Skip to content

Commit 90935eb

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: tmio: reenable card irqs after the reset callback
The reset callback may clear the internal card detect interrupts, so make sure to reenable them if needed. Fixes: b4d86f3 ("mmc: renesas_sdhi: do hard reset if possible") Reported-by: Biju Das <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent e8a1ff6 commit 90935eb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
195195
sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, host->sdcard_irq_mask_all);
196196
host->sdcard_irq_mask = host->sdcard_irq_mask_all;
197197

198+
if (host->native_hotplug)
199+
tmio_mmc_enable_mmc_irqs(host,
200+
TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT);
201+
198202
tmio_mmc_set_bus_width(host, host->mmc->ios.bus_width);
199203

200204
if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) {
@@ -956,8 +960,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
956960
case MMC_POWER_OFF:
957961
tmio_mmc_power_off(host);
958962
/* For R-Car Gen2+, we need to reset SDHI specific SCC */
959-
if (host->pdata->flags & TMIO_MMC_MIN_RCAR2)
963+
if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) {
960964
host->reset(host);
965+
966+
if (host->native_hotplug)
967+
tmio_mmc_enable_mmc_irqs(host,
968+
TMIO_STAT_CARD_REMOVE |
969+
TMIO_STAT_CARD_INSERT);
970+
}
971+
961972
host->set_clock(host, 0);
962973
break;
963974
case MMC_POWER_UP:
@@ -1185,10 +1196,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
11851196
_host->set_clock(_host, 0);
11861197
tmio_mmc_reset(_host);
11871198

1188-
if (_host->native_hotplug)
1189-
tmio_mmc_enable_mmc_irqs(_host,
1190-
TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT);
1191-
11921199
spin_lock_init(&_host->lock);
11931200
mutex_init(&_host->ios_lock);
11941201

0 commit comments

Comments
 (0)