]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: sdhci: tegra: shutdown
authorBitan Biswas <bbiswas@nvidia.com>
Tue, 9 Dec 2014 11:29:37 +0000 (16:59 +0530)
committerBitan Biswas <bbiswas@nvidia.com>
Tue, 30 Dec 2014 05:55:30 +0000 (21:55 -0800)
Introduced shutdown callbacks to prevent sdhci
runtime suspend call during system shutdown

bug 200063319

Change-Id: I1338181f63e33f88454c963c809b772eaff302ec
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: http://git-master/r/663950

drivers/mmc/host/sdhci-tegra.c

index 2768c2bdb84ca1bafbcec24d62ceee34d6279bc6..a670b5b52d9557a3289ae5331634e4b70dbc366f 100644 (file)
@@ -4368,7 +4368,6 @@ static int tegra_sdhci_reboot_notify(struct notifier_block *nb,
        struct sdhci_tegra *tegra_host =
                container_of(nb, struct sdhci_tegra, reboot_notify);
        int err;
-       struct sdhci_host *sdhci = dev_get_drvdata(tegra_host->dev);
 
        switch (event) {
        case SYS_RESTART:
@@ -4379,10 +4378,6 @@ static int tegra_sdhci_reboot_notify(struct notifier_block *nb,
                        pr_err("Disable regulator in reboot notify failed %d\n",
                                err);
 
-               /* disable runtime pm callbacks */
-               pr_debug("%s: %s line=%d\n", mmc_hostname(sdhci->mmc), __func__, __LINE__);
-               __pm_runtime_disable(tegra_host->dev, false);
-
                return NOTIFY_OK;
        }
        return NOTIFY_DONE;
@@ -5497,6 +5492,16 @@ static int sdhci_tegra_remove(struct platform_device *pdev)
        return rc;
 }
 
+static void sdhci_tegra_shutdown(struct platform_device *pdev)
+{
+       struct sdhci_host *host = platform_get_drvdata(pdev);
+       dev_dbg(&pdev->dev, " %s shutting down\n",
+               mmc_hostname(host->mmc));
+#ifdef CONFIG_MMC_RTPM
+       pm_runtime_forbid(&pdev->dev);
+#endif
+}
+
 static struct platform_driver sdhci_tegra_driver = {
        .driver         = {
                .name   = "sdhci-tegra",
@@ -5506,6 +5511,7 @@ static struct platform_driver sdhci_tegra_driver = {
        },
        .probe          = sdhci_tegra_probe,
        .remove         = sdhci_tegra_remove,
+       .shutdown       = sdhci_tegra_shutdown,
 };
 
 module_platform_driver(sdhci_tegra_driver);