diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-06-14 15:41:49 +0100 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-07-24 08:51:52 +0100 |
commit | 111509294b9efafe0353423c8180e03db810bdb5 (patch) | |
tree | 9767725b131f6e6cc950b71cd12a7db02294de40 /lib/memory-notifier-error-inject.c | |
parent | bc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff) |
mfd: arizona: Fix race between runtime suspend and IRQs
The function arizona_irq_thread (the threaded handler for the arizona
IRQs) calls pm_runtime_get_sync at the start to ensure that the chip is
active as we handle the IRQ. If the chip is part way through a runtime
suspend when an IRQ arrives the PM core will wait for the suspend to
complete, before resuming. However, since commit 4f0216409f7c
("mfd: arizona: Add better support for system suspend") the runtime
suspend function may call disable_irq, if the chip is going to fully
power off, which will try to wait for any outstanding IRQs to complete.
This results in deadlock as the IRQ thread is waiting for the PM
operation to complete and the PM thread is waiting for the IRQ to
complete.
To avoid this situation we use disable_irq_nosync, which allows the
suspending thread to finish the suspend without waiting for the IRQ to
complete. This is safe because if an IRQ is being processed it can only
be blocked at the pm_runtime_get_sync at the start of the handler
otherwise it wouldn't be possible to suspend.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions