]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commit
ARM: zynq: Fix suspend code for Thumb kernels
authorSoren Brinkmann <soren.brinkmann@xilinx.com>
Wed, 21 Sep 2016 14:00:31 +0000 (07:00 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 13 Oct 2016 12:09:01 +0000 (14:09 +0200)
commitffc9e7f5b5040ba625d965330ffbb01b0ffd332b
tree79ab5bd37ab0d8e1cdc3d23487b4f2bf911c9dc3
parentafe7309b58279cf6ef149d5af3e8e2d6a26d3027
ARM: zynq: Fix suspend code for Thumb kernels

When the kernel is compiled in Thumb mode (CONFIG_THUMB2_KERNEL)
copying and jumping/returning to/from the suspend code in OCM failed due
to misinterpreting or ignoring bit 0 of function addresses - which
indicates the execution state at the jump destination - , resulting
with the kernel crashing on an undefined instruction.

In detail, the suspend code was copied with an erroneous, additional
offset of 1 due to the LSB in the address of zynq_sys_suspend being set.
And jumping to the code failed as
 1. the additional offset wasn't taken into account when jumping
 2. the jump switched to ARM state even though the destination contains
    Thumb code

Fixed by using the 'fncpy' macro to do the copying and obtaining the
function pointer to call.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/mach-zynq/pm.c
arch/arm/mach-zynq/suspend.S