Skip to content

Commit 8861474

Browse files
committed
Revert "mmc: tmio: move runtime PM enablement to the driver implementations"
This reverts commit 7ff2131. It turns out that the above commit introduces other problems. For example, calling pm_runtime_set_active() must not be done prior calling pm_runtime_enable() as that makes it fail. This leads to additional problems, such as clock enables being wrongly balanced. Rather than fixing the problem on top, let's start over by doing a revert. Fixes: 7ff2131 ("mmc: tmio: move runtime PM enablement to the driver implementations") Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]>
1 parent 49baa01 commit 8861474

File tree

4 files changed

+2
-23
lines changed

4 files changed

+2
-23
lines changed

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
774774
/* All SDHI have SDIO status bits which must be 1 */
775775
mmc_data->flags |= TMIO_MMC_SDIO_STATUS_SETBITS;
776776

777-
pm_runtime_enable(&pdev->dev);
778-
779777
ret = renesas_sdhi_clk_enable(host);
780778
if (ret)
781779
goto efree;
@@ -856,8 +854,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
856854
efree:
857855
tmio_mmc_host_free(host);
858856

859-
pm_runtime_disable(&pdev->dev);
860-
861857
return ret;
862858
}
863859
EXPORT_SYMBOL_GPL(renesas_sdhi_probe);
@@ -869,8 +865,6 @@ int renesas_sdhi_remove(struct platform_device *pdev)
869865
tmio_mmc_host_remove(host);
870866
renesas_sdhi_clk_disable(host);
871867

872-
pm_runtime_disable(&pdev->dev);
873-
874868
return 0;
875869
}
876870
EXPORT_SYMBOL_GPL(renesas_sdhi_remove);

drivers/mmc/host/tmio_mmc.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ static int tmio_mmc_probe(struct platform_device *pdev)
172172
host->mmc->f_max = pdata->hclk;
173173
host->mmc->f_min = pdata->hclk / 512;
174174

175-
pm_runtime_enable(&pdev->dev);
176-
177175
ret = tmio_mmc_host_probe(host);
178176
if (ret)
179177
goto host_free;
@@ -193,7 +191,6 @@ static int tmio_mmc_probe(struct platform_device *pdev)
193191
tmio_mmc_host_remove(host);
194192
host_free:
195193
tmio_mmc_host_free(host);
196-
pm_runtime_disable(&pdev->dev);
197194
cell_disable:
198195
if (cell->disable)
199196
cell->disable(pdev);
@@ -210,8 +207,6 @@ static int tmio_mmc_remove(struct platform_device *pdev)
210207
if (cell->disable)
211208
cell->disable(pdev);
212209

213-
pm_runtime_disable(&pdev->dev);
214-
215210
return 0;
216211
}
217212

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,15 +1153,6 @@ void tmio_mmc_host_free(struct tmio_mmc_host *host)
11531153
}
11541154
EXPORT_SYMBOL_GPL(tmio_mmc_host_free);
11551155

1156-
/**
1157-
* tmio_mmc_host_probe() - Common probe for all implementations
1158-
* @_host: Host to probe
1159-
*
1160-
* Perform tasks common to all implementations probe functions.
1161-
*
1162-
* The caller should have called pm_runtime_enable() prior to calling
1163-
* the common probe function.
1164-
*/
11651156
int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
11661157
{
11671158
struct platform_device *pdev = _host->pdev;
@@ -1260,6 +1251,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
12601251
pm_runtime_set_active(&pdev->dev);
12611252
pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
12621253
pm_runtime_use_autosuspend(&pdev->dev);
1254+
pm_runtime_enable(&pdev->dev);
12631255

12641256
ret = mmc_add_host(mmc);
12651257
if (ret)
@@ -1295,6 +1287,7 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
12951287

12961288
pm_runtime_dont_use_autosuspend(&pdev->dev);
12971289
pm_runtime_put_sync(&pdev->dev);
1290+
pm_runtime_disable(&pdev->dev);
12981291
}
12991292
EXPORT_SYMBOL_GPL(tmio_mmc_host_remove);
13001293

drivers/mmc/host/uniphier-sd.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ static int uniphier_sd_probe(struct platform_device *pdev)
631631
host->clk_disable = uniphier_sd_clk_disable;
632632
host->set_clock = uniphier_sd_set_clock;
633633

634-
pm_runtime_enable(&pdev->dev);
635634
ret = uniphier_sd_clk_enable(host);
636635
if (ret)
637636
goto free_host;
@@ -653,7 +652,6 @@ static int uniphier_sd_probe(struct platform_device *pdev)
653652

654653
free_host:
655654
tmio_mmc_host_free(host);
656-
pm_runtime_disable(&pdev->dev);
657655

658656
return ret;
659657
}
@@ -664,7 +662,6 @@ static int uniphier_sd_remove(struct platform_device *pdev)
664662

665663
tmio_mmc_host_remove(host);
666664
uniphier_sd_clk_disable(host);
667-
pm_runtime_disable(&pdev->dev);
668665

669666
return 0;
670667
}

0 commit comments

Comments
 (0)