Skip to content

Commit 1c4c5e2

Browse files
committed
Merge tag 'mmc-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: - tmio: Fixup runtime PM management during probe and remove - sdhci-pci-o2micro: Fix eMMC initialization for an AMD SoC - bcm2835: Prevent lockups when terminating work * tag 'mmc-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: tmio: Fixup runtime PM management during remove mmc: tmio: Fixup runtime PM management during probe Revert "mmc: tmio: move runtime PM enablement to the driver implementations" Revert "mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host controller" Revert "mmc: bcm2835: Terminate timeout work synchronously"
2 parents 592b8d8 + 87b5d60 commit 1c4c5e2

File tree

7 files changed

+17
-29
lines changed

7 files changed

+17
-29
lines changed

drivers/mmc/host/bcm2835.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static void bcm2835_finish_request(struct bcm2835_host *host)
597597
struct dma_chan *terminate_chan = NULL;
598598
struct mmc_request *mrq;
599599

600-
cancel_delayed_work_sync(&host->timeout_work);
600+
cancel_delayed_work(&host->timeout_work);
601601

602602
mrq = host->mrq;
603603

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/sdhci-pci-o2micro.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)
432432
mmc_hostname(host->mmc));
433433
host->flags &= ~SDHCI_SIGNALING_330;
434434
host->flags |= SDHCI_SIGNALING_180;
435-
host->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
436435
host->mmc->caps2 |= MMC_CAP2_NO_SD;
437436
host->mmc->caps2 |= MMC_CAP2_NO_SDIO;
438437
pci_write_config_dword(chip->pdev,
@@ -682,6 +681,7 @@ static const struct sdhci_ops sdhci_pci_o2_ops = {
682681
const struct sdhci_pci_fixes sdhci_o2 = {
683682
.probe = sdhci_pci_o2_probe,
684683
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
684+
.quirks2 = SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD,
685685
.probe_slot = sdhci_pci_o2_probe_slot,
686686
#ifdef CONFIG_PM_SLEEP
687687
.resume = sdhci_pci_o2_resume,

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.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ struct tmio_mmc_host {
163163
unsigned long last_req_ts;
164164
struct mutex ios_lock; /* protect set_ios() context */
165165
bool native_hotplug;
166+
bool runtime_synced;
166167
bool sdio_irq_enabled;
167168

168169
/* Mandatory callback */

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 14 additions & 13 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;
@@ -1257,19 +1248,22 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
12571248
/* See if we also get DMA */
12581249
tmio_mmc_request_dma(_host, pdata);
12591250

1260-
pm_runtime_set_active(&pdev->dev);
12611251
pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
12621252
pm_runtime_use_autosuspend(&pdev->dev);
1253+
pm_runtime_enable(&pdev->dev);
1254+
pm_runtime_get_sync(&pdev->dev);
12631255

12641256
ret = mmc_add_host(mmc);
12651257
if (ret)
12661258
goto remove_host;
12671259

12681260
dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
1261+
pm_runtime_put(&pdev->dev);
12691262

12701263
return 0;
12711264

12721265
remove_host:
1266+
pm_runtime_put_noidle(&pdev->dev);
12731267
tmio_mmc_host_remove(_host);
12741268
return ret;
12751269
}
@@ -1280,12 +1274,11 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
12801274
struct platform_device *pdev = host->pdev;
12811275
struct mmc_host *mmc = host->mmc;
12821276

1277+
pm_runtime_get_sync(&pdev->dev);
1278+
12831279
if (host->pdata->flags & TMIO_MMC_SDIO_IRQ)
12841280
sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
12851281

1286-
if (!host->native_hotplug)
1287-
pm_runtime_get_sync(&pdev->dev);
1288-
12891282
dev_pm_qos_hide_latency_limit(&pdev->dev);
12901283

12911284
mmc_remove_host(mmc);
@@ -1294,7 +1287,10 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
12941287
tmio_mmc_release_dma(host);
12951288

12961289
pm_runtime_dont_use_autosuspend(&pdev->dev);
1290+
if (host->native_hotplug)
1291+
pm_runtime_put_noidle(&pdev->dev);
12971292
pm_runtime_put_sync(&pdev->dev);
1293+
pm_runtime_disable(&pdev->dev);
12981294
}
12991295
EXPORT_SYMBOL_GPL(tmio_mmc_host_remove);
13001296

@@ -1337,6 +1333,11 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
13371333
{
13381334
struct tmio_mmc_host *host = dev_get_drvdata(dev);
13391335

1336+
if (!host->runtime_synced) {
1337+
host->runtime_synced = true;
1338+
return 0;
1339+
}
1340+
13401341
tmio_mmc_clk_enable(host);
13411342
tmio_mmc_hw_reset(host->mmc);
13421343

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)