ARM: 8471/1: need to save/restore arm register(r11) when it is corrupted
authorAnson Huang <Anson.Huang@freescale.com>
Mon, 7 Dec 2015 09:09:19 +0000 (10:09 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 15 Dec 2015 11:51:41 +0000 (11:51 +0000)
commitfa0708b320f6da4c1104fe56e01b7abf66fd16ad
tree123a5f2e6e4f52a4292261c7ce63041531976a5c
parentc014953d84ec21a4df9a43be2378861ea6e9246e
ARM: 8471/1: need to save/restore arm register(r11) when it is corrupted

In cpu_v7_do_suspend routine, r11 is used while it is NOT
saved/restored, different compiler may have different usage
of ARM general registers, so it may cause issues during
calling cpu_v7_do_suspend.

We meet kernel fault occurs when using GCC 4.8.3, r11 contains
valid value before calling into cpu_v7_do_suspend, but when returned
from this routine, r11 is corrupted and lead to kernel fault.
Doing save/restore for those corrupted registers is a must in
assemble code.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Cc: <stable@vger.kernel.org> # v3.3+
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/proc-v7.S