summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorBharat Nihalani <bnihalani@nvidia.com>2014-05-31 11:33:10 +0530
committerMandar Padmawar <mpadmawar@nvidia.com>2014-06-05 01:56:07 -0700
commit6b764a9234a34c9815dcaba880c137791c19163a (patch)
tree5361bb1fa5a79c566b68afeb85f6a39c0eef0467 /arch/arm64
parent0e04f44cafcd0affacd64b640b7f31a2e38d3c38 (diff)
ARM64: kernel: Power off in atomic context
This far the device has been powered off in non-atomic context. This caused unexpected results when the kernel pre-empted the power off sequence and started running some completely unrelated task at the very same time. In addition, IRQs were enabled all time allowing spontaneous interruption of the power off sequence. This patch modifies the power off to happen in atomic context. Original author for same change http://git-master/r/#/c/329636/ done for ARM kernel is Arto Merilainen <amerilainen@nvidia.com> Bug 200007891 Change-Id: I9dfd5523ed838e3c181ef94dcbbb15e3b66419d1 Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-on: http://git-master/r/418215 GVS: Gerrit_Virtual_Submit Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 3e4d03cb086f..6f739d2df19d 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -130,6 +130,10 @@ void machine_halt(void)
void machine_power_off(void)
{
+ /* Disable interrupts and preemption */
+ local_irq_disable();
+ preempt_disable();
+
machine_shutdown();
if (pm_power_off)
pm_power_off();