Skip to content

Commit

Permalink
mmc: mtk-sd: Re-store SDIO IRQs mask at system resume
Browse files Browse the repository at this point in the history
In cases when SDIO IRQs have been enabled, runtime suspend is prevented by
the driver. However, this still means msdc_runtime_suspend|resume() gets
called during system suspend/resume, via pm_runtime_force_suspend|resume().

This means during system suspend/resume, the register context of the mtk-sd
device most likely loses its register context, even in cases when SDIO IRQs
have been enabled.

To re-enable the SDIO IRQs during system resume, the mtk-sd driver
currently relies on the mmc core to re-enable the SDIO IRQs when it resumes
the SDIO card, but this isn't the recommended solution. Instead, it's
better to deal with this locally in the mtk-sd driver, so let's do that.

Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
storulf committed Sep 11, 2019
1 parent 7c52660 commit 1c81d69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mmc/host/mtk-sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,9 @@ static void msdc_restore_reg(struct msdc_host *host)
} else {
writel(host->save_para.pad_tune, host->base + tune_reg);
}

if (sdio_irq_claimed(host->mmc))
__msdc_enable_sdio_irq(host, 1);
}

static int msdc_runtime_suspend(struct device *dev)
Expand Down

0 comments on commit 1c81d69

Please sign in to comment.