Skip to content

Commit 87b5d60

Browse files
committed
mmc: tmio: Fixup runtime PM management during remove
Accessing the device when it may be runtime suspended is a bug, which is the case in tmio_mmc_host_remove(). Let's fix the behaviour. Cc: [email protected] Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]>
1 parent aa86f1a commit 87b5d60

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,12 +1274,11 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
12741274
struct platform_device *pdev = host->pdev;
12751275
struct mmc_host *mmc = host->mmc;
12761276

1277+
pm_runtime_get_sync(&pdev->dev);
1278+
12771279
if (host->pdata->flags & TMIO_MMC_SDIO_IRQ)
12781280
sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
12791281

1280-
if (!host->native_hotplug)
1281-
pm_runtime_get_sync(&pdev->dev);
1282-
12831282
dev_pm_qos_hide_latency_limit(&pdev->dev);
12841283

12851284
mmc_remove_host(mmc);
@@ -1288,6 +1287,8 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
12881287
tmio_mmc_release_dma(host);
12891288

12901289
pm_runtime_dont_use_autosuspend(&pdev->dev);
1290+
if (host->native_hotplug)
1291+
pm_runtime_put_noidle(&pdev->dev);
12911292
pm_runtime_put_sync(&pdev->dev);
12921293
pm_runtime_disable(&pdev->dev);
12931294
}

0 commit comments

Comments
 (0)