mmc: dw_mmc: Prevent runtime PM suspend when SDIO IRQs are enabled
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 18 Apr 2017 11:37:32 +0000 (13:37 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jun 2017 08:30:12 +0000 (10:30 +0200)
commitca8971ca5753e95da978e7941f0228120b6bbb96
treee914a0033170ac5faad2c7fbd2784cd58a3dd3fa
parent32dba73772f8bf156bb3bd002b3334178a43032f
mmc: dw_mmc: Prevent runtime PM suspend when SDIO IRQs are enabled

To be able to handle SDIO IRQs the dw_mmc device needs to be powered and
providing clock to the SDIO card. Therefore, we must not allow the device
to be runtime PM suspended while SDIO IRQs are enabled.

To fix this, let's increase the runtime PM usage count while the mmc core
enables SDIO IRQs. Later when the mmc core tells dw_mmc to disable SDIO
IRQs, we drop the usage count to again allow runtime PM suspend.

This now becomes the default behaviour for dw_mmc. In cases where SDIO IRQs
can be re-routed as GPIO wake-ups during runtime PM suspend, one could
potentially allow runtime PM suspend. However, that will have to be
addressed as a separate change on top of this one.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
drivers/mmc/host/dw_mmc.c