diff mbox series

[07/11] mmc: core: WARN if SDIO IRQs are enabled for non-powered card in suspend

Message ID 20190903142207.5825-8-ulf.hansson@linaro.org (mailing list archive)
State New, archived
Headers show
Series mmc: core: PM fixes/improvements for SDIO IRQs | expand

Commit Message

Ulf Hansson Sept. 3, 2019, 2:22 p.m. UTC
To make sure SDIO func drivers behaves correctly during system
suspend/resume, let add a WARN_ON in case the condition is a non-powered
SDIO card and there are some SDIO IRQs still being claimed.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/core/sdio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Matthias Kaehlcke Sept. 5, 2019, 5:38 p.m. UTC | #1
On Tue, Sep 03, 2019 at 04:22:03PM +0200, Ulf Hansson wrote:
> To make sure SDIO func drivers behaves correctly during system
> suspend/resume, let add a WARN_ON in case the condition is a non-powered
> SDIO card and there are some SDIO IRQs still being claimed.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  drivers/mmc/core/sdio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index 8dd8fc32ecca..c557f1519b77 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -951,6 +951,8 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host)
>   */
>  static int mmc_sdio_suspend(struct mmc_host *host)
>  {
> +	WARN_ON(host->sdio_irqs && !mmc_card_keep_power(host));
> +
>  	/* Prevent processing of SDIO IRQs in suspended state. */
>  	mmc_card_set_suspended(host->card);
>  	cancel_delayed_work_sync(&host->sdio_irq_work);

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
diff mbox series

Patch

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 8dd8fc32ecca..c557f1519b77 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -951,6 +951,8 @@  static int mmc_sdio_pre_suspend(struct mmc_host *host)
  */
 static int mmc_sdio_suspend(struct mmc_host *host)
 {
+	WARN_ON(host->sdio_irqs && !mmc_card_keep_power(host));
+
 	/* Prevent processing of SDIO IRQs in suspended state. */
 	mmc_card_set_suspended(host->card);
 	cancel_delayed_work_sync(&host->sdio_irq_work);