From: Dmitry Shmidt Date: Thu, 7 Oct 2010 21:39:16 +0000 (-0700) Subject: mmc: Add "ignore mmc pm notify" functionality X-Git-Tag: firefly_0821_release~7613^2~704 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c0455a04b73d1de3d885956a182264af3992cdc7;p=firefly-linux-kernel-4.4.55.git mmc: Add "ignore mmc pm notify" functionality Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index b29d3e8fd3a2..84694a9410d9 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -336,7 +336,8 @@ int mmc_add_host(struct mmc_host *host) #endif mmc_start_host(host); - register_pm_notifier(&host->pm_notify); + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) + register_pm_notifier(&host->pm_notify); return 0; } @@ -353,7 +354,9 @@ EXPORT_SYMBOL(mmc_add_host); */ void mmc_remove_host(struct mmc_host *host) { - unregister_pm_notifier(&host->pm_notify); + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) + unregister_pm_notifier(&host->pm_notify); + mmc_stop_host(host); #ifdef CONFIG_DEBUG_FS diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h index d37aac49cf9a..390382367acb 100644 --- a/include/linux/mmc/pm.h +++ b/include/linux/mmc/pm.h @@ -26,5 +26,6 @@ typedef unsigned int mmc_pm_flag_t; #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ +#define MMC_PM_IGNORE_PM_NOTIFY (1 << 2) /* ignore mmc pm notify */ #endif