Skip to content

Commit 0dcaa24

Browse files
Daniel Drakecjb
authored andcommitted
sdhci-pxav3: Fix runtime PM initialization
Commit bb691ae 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>
1 parent 5a36d6b commit 0dcaa24

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/mmc/host/sdhci-pxav3.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,15 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
287287
}
288288
}
289289

290-
pm_runtime_set_active(&pdev->dev);
291290
pm_runtime_enable(&pdev->dev);
291+
pm_runtime_get_sync(&pdev->dev);
292292
pm_runtime_set_autosuspend_delay(&pdev->dev, PXAV3_RPM_DELAY_MS);
293293
pm_runtime_use_autosuspend(&pdev->dev);
294294
pm_suspend_ignore_children(&pdev->dev, 1);
295-
pm_runtime_get_noresume(&pdev->dev);
296295

297296
ret = sdhci_add_host(host);
298297
if (ret) {
299298
dev_err(&pdev->dev, "failed to add host\n");
300-
pm_runtime_forbid(&pdev->dev);
301-
pm_runtime_disable(&pdev->dev);
302299
goto err_add_host;
303300
}
304301

@@ -318,6 +315,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
318315
err_of_parse:
319316
err_cd_req:
320317
err_add_host:
318+
pm_runtime_put_sync(&pdev->dev);
319+
pm_runtime_disable(&pdev->dev);
321320
clk_disable_unprepare(clk);
322321
clk_put(clk);
323322
err_clk_get:

0 commit comments

Comments
 (0)