]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
spi/pxa2xx: check status register as well to determine if the device is off
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 4 Sep 2013 10:37:43 +0000 (13:37 +0300)
committerMark Brown <broonie@linaro.org>
Wed, 4 Sep 2013 19:14:29 +0000 (20:14 +0100)
commit269e4a4122685d0739f0e8e53b440111bf8a03f9
tree2cabd3fdf9bc05024920749386ed54b9e541d595
parent578739259875a93b1869d25cdf4a8bd963b7d0a7
spi/pxa2xx: check status register as well to determine if the device is off

The current interrupt handler calls pm_runtime_suspended() to check if the
device is suspended or not. However, runtime PM status of the device is
only set to suspended once all PM runtime suspend hooks have executed.

In case of Intel Lynxpoint we have the device bound to the ACPI power
domain and its runtime suspend hook will put the device to D3hot (or D3cold
if possible). This means that the device is powered off before its state is
set to runtime suspended. While in this state the device might get an
interrupt that is meant for another device (as the interrupt line is
shared), and because the device is powered off accessing its registers will
return 0xffffffff that the driver misinterprets as an invalid state.

When this happens user will see messages like below on the console:

  pxa2xx-spi INT33C0:00: bad message state in interrupt handler

Fix this by checking the status register for ~0 and returning IRQ_NONE in
that case.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-pxa2xx.c