Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: dw_mmc: exynos: fix to call suspend callback

The dw_mmc-exynos should be RPM_ACTIVE on probe() to call suspend
callback of runtime PM in pm_runtime_force_suspend() during first system
suspend. Also call pm_runtime_get_noresume() on probe() because it
doesn't call suspend/resume callback by runtime PM now.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Joonyoung Shim and committed by
Ulf Hansson
9b93d392 f28ef561

+26 -2
+26 -2
drivers/mmc/host/dw_mmc-exynos.c
··· 516 516 { 517 517 const struct dw_mci_drv_data *drv_data; 518 518 const struct of_device_id *match; 519 + int ret; 519 520 520 521 match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node); 521 522 drv_data = match->data; 522 - return dw_mci_pltfm_register(pdev, drv_data); 523 + 524 + pm_runtime_get_noresume(&pdev->dev); 525 + pm_runtime_set_active(&pdev->dev); 526 + pm_runtime_enable(&pdev->dev); 527 + 528 + ret = dw_mci_pltfm_register(pdev, drv_data); 529 + if (ret) { 530 + pm_runtime_disable(&pdev->dev); 531 + pm_runtime_set_suspended(&pdev->dev); 532 + pm_runtime_put_noidle(&pdev->dev); 533 + 534 + return ret; 535 + } 536 + 537 + return 0; 538 + } 539 + 540 + static int dw_mci_exynos_remove(struct platform_device *pdev) 541 + { 542 + pm_runtime_disable(&pdev->dev); 543 + pm_runtime_set_suspended(&pdev->dev); 544 + pm_runtime_put_noidle(&pdev->dev); 545 + 546 + return dw_mci_pltfm_remove(pdev); 523 547 } 524 548 525 549 static const struct dev_pm_ops dw_mci_exynos_pmops = { ··· 559 535 560 536 static struct platform_driver dw_mci_exynos_pltfm_driver = { 561 537 .probe = dw_mci_exynos_probe, 562 - .remove = dw_mci_pltfm_remove, 538 + .remove = dw_mci_exynos_remove, 563 539 .driver = { 564 540 .name = "dwmmc_exynos", 565 541 .of_match_table = dw_mci_exynos_match,