diff options
author | Doug Anderson <dianders@chromium.org> | 2015-01-26 19:24:03 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-01-30 12:38:36 +0300 |
commit | 5ae0c7ad06f4386d253ff2120ea769f01292f37b (patch) | |
tree | bbd75539fef28d39c935a56d3a30478e3daa7da5 /block | |
parent | b6afdbe8e841e20297a38e2af0a053d8eb26c19b (diff) | |
download | linux-5ae0c7ad06f4386d253ff2120ea769f01292f37b.tar.xz |
pinctrl: rockchip: Only mask interrupts; never disable
The Rockchip GPIO interrupt controller totally throws away all status
about an interrupt when you "disable" the interrupt. That has
unfortunate consequences in the following situation:
1. An edge-triggered interrupt is enabled and should wake the system.
2. System suspend happens: interrupt is disabled and marked for wake.
3. rockchip_irq_suspend() reenables the interrupt so we can wake.
4. Interrupt happens when asleep.
5. rockchip_irq_resume() redisables the interrupt.
6. Disabling the interrupt throws away all status about it.
7. Normal system resume happens and we enable the interrupt again,
since we threw away status about the interrupt we don't know it
fired while suspended. Even worse: if we need both edges of the
interrupt the logic to swap edges never runs.
Note: even if we somehow can post the status about wakeup interrupts
in rockchip_irq_resume() we would still have a window of losing any
edges that came in while interrupts were disabled.
If we use mask only then we don't need to worry. The GPIO Interrupt
controller keeps track of pending interrupts that are enabled and just
masked.
There was no real strong reason to support the enable/disable
functionality (other than that it seemed right), so let's go back to
just supporting mask/unmask but actually map it to the real
mask/unmask. This ends up with slightly different (and more correct)
behavior than before (f2dd028 pinctrl: rockchip: Fix
enable/disable/mask/unmask).
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions