aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2013-06-27 11:46:29 -0400
committerChris Ball <cjb@laptop.org>2013-06-27 12:39:23 -0400
commit0dcaa2499b7d111bd70da5b0976c34210c850fb3 (patch)
tree7a3f394ef96c6c82660c2c41218cd614e9671b96
parent5a36d6bcdf23e408da1d0cbb5d5ad2a26089e9ca (diff)
sdhci-pxav3: Fix runtime PM initialization
Commit bb691ae464b77d30e74c66480e98d74e88d6b194 breaks boot on OLPC XO-4, it hangs somewhere inside sdhci_add_host. When pm_runtime_set_autosuspend_delay() was being called, the device's usage counter was 0, causing the PM layer to runtime-suspend the device. We then went on to call sdhci_add_host() on a suspended device, which hung. Fix this by making the driver consistent with the omap_hsmmc driver, both in terms of runtime PM initialization and error handling. Now the device is not runtime-suspended until we exit the probe routine. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sdhci-pxav3.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index d29f81097334..bf99359a3a90 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -287,18 +287,15 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
287 } 287 }
288 } 288 }
289 289
290 pm_runtime_set_active(&pdev->dev);
291 pm_runtime_enable(&pdev->dev); 290 pm_runtime_enable(&pdev->dev);
291 pm_runtime_get_sync(&pdev->dev);
292 pm_runtime_set_autosuspend_delay(&pdev->dev, PXAV3_RPM_DELAY_MS); 292 pm_runtime_set_autosuspend_delay(&pdev->dev, PXAV3_RPM_DELAY_MS);
293 pm_runtime_use_autosuspend(&pdev->dev); 293 pm_runtime_use_autosuspend(&pdev->dev);
294 pm_suspend_ignore_children(&pdev->dev, 1); 294 pm_suspend_ignore_children(&pdev->dev, 1);
295 pm_runtime_get_noresume(&pdev->dev);
296 295
297 ret = sdhci_add_host(host); 296 ret = sdhci_add_host(host);
298 if (ret) { 297 if (ret) {
299 dev_err(&pdev->dev, "failed to add host\n"); 298 dev_err(&pdev->dev, "failed to add host\n");
300 pm_runtime_forbid(&pdev->dev);
301 pm_runtime_disable(&pdev->dev);
302 goto err_add_host; 299 goto err_add_host;
303 } 300 }
304 301
@@ -318,6 +315,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
318err_of_parse: 315err_of_parse:
319err_cd_req: 316err_cd_req:
320err_add_host: 317err_add_host:
318 pm_runtime_put_sync(&pdev->dev);
319 pm_runtime_disable(&pdev->dev);
321 clk_disable_unprepare(clk); 320 clk_disable_unprepare(clk);
322 clk_put(clk); 321 clk_put(clk);
323err_clk_get: 322err_clk_get: