Loading drivers/mmc/core/bus.c +1 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ static int mmc_bus_resume(struct device *dev) struct mmc_host *host = card->host; int ret; if (host->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME) { if (mmc_bus_manual_resume(host)) { host->bus_resume_flags |= MMC_BUSRESUME_NEEDS_RESUME; goto skip_full_resume; } Loading drivers/mmc/core/core.c +14 −0 Original line number Diff line number Diff line Loading @@ -2764,11 +2764,17 @@ static inline void mmc_bus_put(struct mmc_host *host) int mmc_resume_bus(struct mmc_host *host) { unsigned long flags; if (!mmc_bus_needs_resume(host)) return -EINVAL; pr_debug("%s: Starting deferred resume\n", mmc_hostname(host)); spin_lock_irqsave(&host->lock, flags); host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME; host->rescan_disable = 0; spin_unlock_irqrestore(&host->lock, flags); mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->card) { mmc_power_up(host, host->card->ocr); Loading Loading @@ -3990,6 +3996,10 @@ int mmc_pm_notify(struct notifier_block *notify_block, case PM_SUSPEND_PREPARE: case PM_RESTORE_PREPARE: spin_lock_irqsave(&host->lock, flags); if (mmc_bus_needs_resume(host)) { spin_unlock_irqrestore(&host->lock, flags); break; } host->rescan_disable = 1; spin_unlock_irqrestore(&host->lock, flags); cancel_delayed_work_sync(&host->detect); Loading Loading @@ -4018,6 +4028,10 @@ int mmc_pm_notify(struct notifier_block *notify_block, spin_lock_irqsave(&host->lock, flags); host->rescan_disable = 0; if (mmc_bus_manual_resume(host)) { spin_unlock_irqrestore(&host->lock, flags); break; } spin_unlock_irqrestore(&host->lock, flags); _mmc_detect_change(host, 0, false); Loading include/linux/mmc/host.h +2 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,8 @@ static inline void *mmc_cmdq_private(struct mmc_host *host) #define mmc_hostname(x) (dev_name(&(x)->class_dev)) #define mmc_bus_needs_resume(host) ((host)->bus_resume_flags & \ MMC_BUSRESUME_NEEDS_RESUME) #define mmc_bus_manual_resume(host) ((host)->bus_resume_flags & \ MMC_BUSRESUME_MANUAL_RESUME) static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) { Loading Loading
drivers/mmc/core/bus.c +1 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ static int mmc_bus_resume(struct device *dev) struct mmc_host *host = card->host; int ret; if (host->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME) { if (mmc_bus_manual_resume(host)) { host->bus_resume_flags |= MMC_BUSRESUME_NEEDS_RESUME; goto skip_full_resume; } Loading
drivers/mmc/core/core.c +14 −0 Original line number Diff line number Diff line Loading @@ -2764,11 +2764,17 @@ static inline void mmc_bus_put(struct mmc_host *host) int mmc_resume_bus(struct mmc_host *host) { unsigned long flags; if (!mmc_bus_needs_resume(host)) return -EINVAL; pr_debug("%s: Starting deferred resume\n", mmc_hostname(host)); spin_lock_irqsave(&host->lock, flags); host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME; host->rescan_disable = 0; spin_unlock_irqrestore(&host->lock, flags); mmc_bus_get(host); if (host->bus_ops && !host->bus_dead && host->card) { mmc_power_up(host, host->card->ocr); Loading Loading @@ -3990,6 +3996,10 @@ int mmc_pm_notify(struct notifier_block *notify_block, case PM_SUSPEND_PREPARE: case PM_RESTORE_PREPARE: spin_lock_irqsave(&host->lock, flags); if (mmc_bus_needs_resume(host)) { spin_unlock_irqrestore(&host->lock, flags); break; } host->rescan_disable = 1; spin_unlock_irqrestore(&host->lock, flags); cancel_delayed_work_sync(&host->detect); Loading Loading @@ -4018,6 +4028,10 @@ int mmc_pm_notify(struct notifier_block *notify_block, spin_lock_irqsave(&host->lock, flags); host->rescan_disable = 0; if (mmc_bus_manual_resume(host)) { spin_unlock_irqrestore(&host->lock, flags); break; } spin_unlock_irqrestore(&host->lock, flags); _mmc_detect_change(host, 0, false); Loading
include/linux/mmc/host.h +2 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,8 @@ static inline void *mmc_cmdq_private(struct mmc_host *host) #define mmc_hostname(x) (dev_name(&(x)->class_dev)) #define mmc_bus_needs_resume(host) ((host)->bus_resume_flags & \ MMC_BUSRESUME_NEEDS_RESUME) #define mmc_bus_manual_resume(host) ((host)->bus_resume_flags & \ MMC_BUSRESUME_MANUAL_RESUME) static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) { Loading