Commit 1c4c5e25 authored by Linus Torvalds's avatar Linus Torvalds

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"
parents 592b8d87 87b5d602
...@@ -597,7 +597,7 @@ static void bcm2835_finish_request(struct bcm2835_host *host) ...@@ -597,7 +597,7 @@ static void bcm2835_finish_request(struct bcm2835_host *host)
struct dma_chan *terminate_chan = NULL; struct dma_chan *terminate_chan = NULL;
struct mmc_request *mrq; struct mmc_request *mrq;
cancel_delayed_work_sync(&host->timeout_work); cancel_delayed_work(&host->timeout_work);
mrq = host->mrq; mrq = host->mrq;
......
...@@ -774,8 +774,6 @@ int renesas_sdhi_probe(struct platform_device *pdev, ...@@ -774,8 +774,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
/* All SDHI have SDIO status bits which must be 1 */ /* All SDHI have SDIO status bits which must be 1 */
mmc_data->flags |= TMIO_MMC_SDIO_STATUS_SETBITS; mmc_data->flags |= TMIO_MMC_SDIO_STATUS_SETBITS;
pm_runtime_enable(&pdev->dev);
ret = renesas_sdhi_clk_enable(host); ret = renesas_sdhi_clk_enable(host);
if (ret) if (ret)
goto efree; goto efree;
...@@ -856,8 +854,6 @@ int renesas_sdhi_probe(struct platform_device *pdev, ...@@ -856,8 +854,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
efree: efree:
tmio_mmc_host_free(host); tmio_mmc_host_free(host);
pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(renesas_sdhi_probe); EXPORT_SYMBOL_GPL(renesas_sdhi_probe);
...@@ -869,8 +865,6 @@ int renesas_sdhi_remove(struct platform_device *pdev) ...@@ -869,8 +865,6 @@ int renesas_sdhi_remove(struct platform_device *pdev)
tmio_mmc_host_remove(host); tmio_mmc_host_remove(host);
renesas_sdhi_clk_disable(host); renesas_sdhi_clk_disable(host);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(renesas_sdhi_remove); EXPORT_SYMBOL_GPL(renesas_sdhi_remove);
......
...@@ -432,7 +432,6 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot) ...@@ -432,7 +432,6 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)
mmc_hostname(host->mmc)); mmc_hostname(host->mmc));
host->flags &= ~SDHCI_SIGNALING_330; host->flags &= ~SDHCI_SIGNALING_330;
host->flags |= SDHCI_SIGNALING_180; host->flags |= SDHCI_SIGNALING_180;
host->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
host->mmc->caps2 |= MMC_CAP2_NO_SD; host->mmc->caps2 |= MMC_CAP2_NO_SD;
host->mmc->caps2 |= MMC_CAP2_NO_SDIO; host->mmc->caps2 |= MMC_CAP2_NO_SDIO;
pci_write_config_dword(chip->pdev, pci_write_config_dword(chip->pdev,
...@@ -682,6 +681,7 @@ static const struct sdhci_ops sdhci_pci_o2_ops = { ...@@ -682,6 +681,7 @@ static const struct sdhci_ops sdhci_pci_o2_ops = {
const struct sdhci_pci_fixes sdhci_o2 = { const struct sdhci_pci_fixes sdhci_o2 = {
.probe = sdhci_pci_o2_probe, .probe = sdhci_pci_o2_probe,
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.quirks2 = SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD,
.probe_slot = sdhci_pci_o2_probe_slot, .probe_slot = sdhci_pci_o2_probe_slot,
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.resume = sdhci_pci_o2_resume, .resume = sdhci_pci_o2_resume,
......
...@@ -172,8 +172,6 @@ static int tmio_mmc_probe(struct platform_device *pdev) ...@@ -172,8 +172,6 @@ static int tmio_mmc_probe(struct platform_device *pdev)
host->mmc->f_max = pdata->hclk; host->mmc->f_max = pdata->hclk;
host->mmc->f_min = pdata->hclk / 512; host->mmc->f_min = pdata->hclk / 512;
pm_runtime_enable(&pdev->dev);
ret = tmio_mmc_host_probe(host); ret = tmio_mmc_host_probe(host);
if (ret) if (ret)
goto host_free; goto host_free;
...@@ -193,7 +191,6 @@ static int tmio_mmc_probe(struct platform_device *pdev) ...@@ -193,7 +191,6 @@ static int tmio_mmc_probe(struct platform_device *pdev)
tmio_mmc_host_remove(host); tmio_mmc_host_remove(host);
host_free: host_free:
tmio_mmc_host_free(host); tmio_mmc_host_free(host);
pm_runtime_disable(&pdev->dev);
cell_disable: cell_disable:
if (cell->disable) if (cell->disable)
cell->disable(pdev); cell->disable(pdev);
...@@ -210,8 +207,6 @@ static int tmio_mmc_remove(struct platform_device *pdev) ...@@ -210,8 +207,6 @@ static int tmio_mmc_remove(struct platform_device *pdev)
if (cell->disable) if (cell->disable)
cell->disable(pdev); cell->disable(pdev);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
......
...@@ -163,6 +163,7 @@ struct tmio_mmc_host { ...@@ -163,6 +163,7 @@ struct tmio_mmc_host {
unsigned long last_req_ts; unsigned long last_req_ts;
struct mutex ios_lock; /* protect set_ios() context */ struct mutex ios_lock; /* protect set_ios() context */
bool native_hotplug; bool native_hotplug;
bool runtime_synced;
bool sdio_irq_enabled; bool sdio_irq_enabled;
/* Mandatory callback */ /* Mandatory callback */
......
...@@ -1153,15 +1153,6 @@ void tmio_mmc_host_free(struct tmio_mmc_host *host) ...@@ -1153,15 +1153,6 @@ void tmio_mmc_host_free(struct tmio_mmc_host *host)
} }
EXPORT_SYMBOL_GPL(tmio_mmc_host_free); EXPORT_SYMBOL_GPL(tmio_mmc_host_free);
/**
* tmio_mmc_host_probe() - Common probe for all implementations
* @_host: Host to probe
*
* Perform tasks common to all implementations probe functions.
*
* The caller should have called pm_runtime_enable() prior to calling
* the common probe function.
*/
int tmio_mmc_host_probe(struct tmio_mmc_host *_host) int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
{ {
struct platform_device *pdev = _host->pdev; struct platform_device *pdev = _host->pdev;
...@@ -1257,19 +1248,22 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host) ...@@ -1257,19 +1248,22 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
/* See if we also get DMA */ /* See if we also get DMA */
tmio_mmc_request_dma(_host, pdata); tmio_mmc_request_dma(_host, pdata);
pm_runtime_set_active(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, 50); pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
ret = mmc_add_host(mmc); ret = mmc_add_host(mmc);
if (ret) if (ret)
goto remove_host; goto remove_host;
dev_pm_qos_expose_latency_limit(&pdev->dev, 100); dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
pm_runtime_put(&pdev->dev);
return 0; return 0;
remove_host: remove_host:
pm_runtime_put_noidle(&pdev->dev);
tmio_mmc_host_remove(_host); tmio_mmc_host_remove(_host);
return ret; return ret;
} }
...@@ -1280,12 +1274,11 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host) ...@@ -1280,12 +1274,11 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
struct platform_device *pdev = host->pdev; struct platform_device *pdev = host->pdev;
struct mmc_host *mmc = host->mmc; struct mmc_host *mmc = host->mmc;
pm_runtime_get_sync(&pdev->dev);
if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) if (host->pdata->flags & TMIO_MMC_SDIO_IRQ)
sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000); sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
if (!host->native_hotplug)
pm_runtime_get_sync(&pdev->dev);
dev_pm_qos_hide_latency_limit(&pdev->dev); dev_pm_qos_hide_latency_limit(&pdev->dev);
mmc_remove_host(mmc); mmc_remove_host(mmc);
...@@ -1294,7 +1287,10 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host) ...@@ -1294,7 +1287,10 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
tmio_mmc_release_dma(host); tmio_mmc_release_dma(host);
pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev);
if (host->native_hotplug)
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
} }
EXPORT_SYMBOL_GPL(tmio_mmc_host_remove); EXPORT_SYMBOL_GPL(tmio_mmc_host_remove);
...@@ -1337,6 +1333,11 @@ int tmio_mmc_host_runtime_resume(struct device *dev) ...@@ -1337,6 +1333,11 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
{ {
struct tmio_mmc_host *host = dev_get_drvdata(dev); struct tmio_mmc_host *host = dev_get_drvdata(dev);
if (!host->runtime_synced) {
host->runtime_synced = true;
return 0;
}
tmio_mmc_clk_enable(host); tmio_mmc_clk_enable(host);
tmio_mmc_hw_reset(host->mmc); tmio_mmc_hw_reset(host->mmc);
......
...@@ -631,7 +631,6 @@ static int uniphier_sd_probe(struct platform_device *pdev) ...@@ -631,7 +631,6 @@ static int uniphier_sd_probe(struct platform_device *pdev)
host->clk_disable = uniphier_sd_clk_disable; host->clk_disable = uniphier_sd_clk_disable;
host->set_clock = uniphier_sd_set_clock; host->set_clock = uniphier_sd_set_clock;
pm_runtime_enable(&pdev->dev);
ret = uniphier_sd_clk_enable(host); ret = uniphier_sd_clk_enable(host);
if (ret) if (ret)
goto free_host; goto free_host;
...@@ -653,7 +652,6 @@ static int uniphier_sd_probe(struct platform_device *pdev) ...@@ -653,7 +652,6 @@ static int uniphier_sd_probe(struct platform_device *pdev)
free_host: free_host:
tmio_mmc_host_free(host); tmio_mmc_host_free(host);
pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
...@@ -664,7 +662,6 @@ static int uniphier_sd_remove(struct platform_device *pdev) ...@@ -664,7 +662,6 @@ static int uniphier_sd_remove(struct platform_device *pdev)
tmio_mmc_host_remove(host); tmio_mmc_host_remove(host);
uniphier_sd_clk_disable(host); uniphier_sd_clk_disable(host);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment