Loading drivers/mmc/core/core.c +25 −3 Original line number Diff line number Diff line Loading @@ -1124,6 +1124,30 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries EXPORT_SYMBOL(mmc_wait_for_cmd); #ifdef CONFIG_PM_RUNTIME static int mmc_get_bkops_status(struct mmc_card *card) { int err = 0; if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && (card->host->parent->power.runtime_status == RPM_SUSPENDING) && mmc_card_is_prog_state(card)) err = -EBUSY; return err; } #else static int mmc_get_bkops_status(struct mmc_card *card) { int err = 0; if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && mmc_card_is_prog_state(card)) err = -EBUSY; return err; } #endif /** * mmc_stop_bkops - stop ongoing BKOPS * @card: MMC card to check BKOPS Loading Loading @@ -1155,9 +1179,7 @@ int mmc_stop_bkops(struct mmc_card *card) * If idle time bkops is running on the card, let's not get into * suspend. */ if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && (card->host->parent->power.runtime_status == RPM_SUSPENDING) && mmc_card_is_prog_state(card)) { if (mmc_get_bkops_status(card)) { err = -EBUSY; goto out; } Loading drivers/mmc/core/host.c +4 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ static void mmc_host_classdev_release(struct device *dev) kfree(host); } #ifdef CONFIG_PM_RUNTIME static int mmc_host_runtime_suspend(struct device *dev) { struct mmc_host *host = cls_dev_to_mmc_host(dev); Loading Loading @@ -76,7 +77,9 @@ static int mmc_host_runtime_resume(struct device *dev) return ret; } #endif #ifdef CONFIG_PM_SLEEP static int mmc_host_suspend(struct device *dev) { struct mmc_host *host = cls_dev_to_mmc_host(dev); Loading Loading @@ -134,6 +137,7 @@ static int mmc_host_resume(struct device *dev) host->dev_status = DEV_RESUMED; return ret; } #endif static const struct dev_pm_ops mmc_host_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mmc_host_suspend, mmc_host_resume) Loading drivers/mmc/host/sdhci-msm.c +3 −1 Original line number Diff line number Diff line Loading @@ -3363,6 +3363,7 @@ static int sdhci_msm_remove(struct platform_device *pdev) return 0; } #ifdef CONFIG_PM_RUNTIME static int sdhci_msm_cfg_sdio_wakeup(struct sdhci_host *host, bool enable) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); Loading Loading @@ -3465,6 +3466,7 @@ skip_enable_host_irq: return 0; } #endif #ifdef CONFIG_PM_SLEEP Loading Loading @@ -3547,7 +3549,7 @@ static const struct dev_pm_ops sdhci_msm_pmops = { #define SDHCI_MSM_PMOPS (&sdhci_msm_pmops) #else #define SDHCI_PM_OPS NULL #define SDHCI_MSM_PMOPS NULL #endif static const struct of_device_id sdhci_msm_dt_match[] = { {.compatible = "qcom,sdhci-msm"}, Loading drivers/mmc/host/sdhci.c +13 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ static bool sdhci_check_state(struct sdhci_host *); #ifdef CONFIG_PM_RUNTIME static int sdhci_runtime_pm_get(struct sdhci_host *host); static int sdhci_runtime_pm_put(struct sdhci_host *host); static void sdhci_dump_rpm_info(struct sdhci_host *host) { struct mmc_host *mmc = host->mmc; pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n", mmc_hostname(mmc), mmc->parent->power.runtime_status, atomic_read(&mmc->parent->power.usage_count), mmc->parent->power.disable_depth); } #else static inline int sdhci_runtime_pm_get(struct sdhci_host *host) { Loading @@ -70,6 +79,9 @@ static inline int sdhci_runtime_pm_put(struct sdhci_host *host) { return 0; } static void sdhci_dump_rpm_info(struct sdhci_host *host) { } #endif static inline int sdhci_get_async_int_status(struct sdhci_host *host) Loading @@ -85,10 +97,7 @@ static void sdhci_dump_state(struct sdhci_host *host) pr_info("%s: clk: %d clk-gated: %d claimer: %s pwr: %d\n", mmc_hostname(mmc), host->clock, mmc->clk_gated, mmc->claimer->comm, host->pwr); pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n", mmc_hostname(mmc), mmc->parent->power.runtime_status, atomic_read(&mmc->parent->power.usage_count), mmc->parent->power.disable_depth); sdhci_dump_rpm_info(host); } static void sdhci_dumpregs(struct sdhci_host *host) Loading Loading
drivers/mmc/core/core.c +25 −3 Original line number Diff line number Diff line Loading @@ -1124,6 +1124,30 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries EXPORT_SYMBOL(mmc_wait_for_cmd); #ifdef CONFIG_PM_RUNTIME static int mmc_get_bkops_status(struct mmc_card *card) { int err = 0; if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && (card->host->parent->power.runtime_status == RPM_SUSPENDING) && mmc_card_is_prog_state(card)) err = -EBUSY; return err; } #else static int mmc_get_bkops_status(struct mmc_card *card) { int err = 0; if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && mmc_card_is_prog_state(card)) err = -EBUSY; return err; } #endif /** * mmc_stop_bkops - stop ongoing BKOPS * @card: MMC card to check BKOPS Loading Loading @@ -1155,9 +1179,7 @@ int mmc_stop_bkops(struct mmc_card *card) * If idle time bkops is running on the card, let's not get into * suspend. */ if (!mmc_use_core_runtime_pm(card->host) && mmc_card_doing_bkops(card) && (card->host->parent->power.runtime_status == RPM_SUSPENDING) && mmc_card_is_prog_state(card)) { if (mmc_get_bkops_status(card)) { err = -EBUSY; goto out; } Loading
drivers/mmc/core/host.c +4 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ static void mmc_host_classdev_release(struct device *dev) kfree(host); } #ifdef CONFIG_PM_RUNTIME static int mmc_host_runtime_suspend(struct device *dev) { struct mmc_host *host = cls_dev_to_mmc_host(dev); Loading Loading @@ -76,7 +77,9 @@ static int mmc_host_runtime_resume(struct device *dev) return ret; } #endif #ifdef CONFIG_PM_SLEEP static int mmc_host_suspend(struct device *dev) { struct mmc_host *host = cls_dev_to_mmc_host(dev); Loading Loading @@ -134,6 +137,7 @@ static int mmc_host_resume(struct device *dev) host->dev_status = DEV_RESUMED; return ret; } #endif static const struct dev_pm_ops mmc_host_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mmc_host_suspend, mmc_host_resume) Loading
drivers/mmc/host/sdhci-msm.c +3 −1 Original line number Diff line number Diff line Loading @@ -3363,6 +3363,7 @@ static int sdhci_msm_remove(struct platform_device *pdev) return 0; } #ifdef CONFIG_PM_RUNTIME static int sdhci_msm_cfg_sdio_wakeup(struct sdhci_host *host, bool enable) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); Loading Loading @@ -3465,6 +3466,7 @@ skip_enable_host_irq: return 0; } #endif #ifdef CONFIG_PM_SLEEP Loading Loading @@ -3547,7 +3549,7 @@ static const struct dev_pm_ops sdhci_msm_pmops = { #define SDHCI_MSM_PMOPS (&sdhci_msm_pmops) #else #define SDHCI_PM_OPS NULL #define SDHCI_MSM_PMOPS NULL #endif static const struct of_device_id sdhci_msm_dt_match[] = { {.compatible = "qcom,sdhci-msm"}, Loading
drivers/mmc/host/sdhci.c +13 −4 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ static bool sdhci_check_state(struct sdhci_host *); #ifdef CONFIG_PM_RUNTIME static int sdhci_runtime_pm_get(struct sdhci_host *host); static int sdhci_runtime_pm_put(struct sdhci_host *host); static void sdhci_dump_rpm_info(struct sdhci_host *host) { struct mmc_host *mmc = host->mmc; pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n", mmc_hostname(mmc), mmc->parent->power.runtime_status, atomic_read(&mmc->parent->power.usage_count), mmc->parent->power.disable_depth); } #else static inline int sdhci_runtime_pm_get(struct sdhci_host *host) { Loading @@ -70,6 +79,9 @@ static inline int sdhci_runtime_pm_put(struct sdhci_host *host) { return 0; } static void sdhci_dump_rpm_info(struct sdhci_host *host) { } #endif static inline int sdhci_get_async_int_status(struct sdhci_host *host) Loading @@ -85,10 +97,7 @@ static void sdhci_dump_state(struct sdhci_host *host) pr_info("%s: clk: %d clk-gated: %d claimer: %s pwr: %d\n", mmc_hostname(mmc), host->clock, mmc->clk_gated, mmc->claimer->comm, host->pwr); pr_info("%s: rpmstatus[pltfm](runtime-suspend:usage_count:disable_depth)(%d:%d:%d)\n", mmc_hostname(mmc), mmc->parent->power.runtime_status, atomic_read(&mmc->parent->power.usage_count), mmc->parent->power.disable_depth); sdhci_dump_rpm_info(host); } static void sdhci_dumpregs(struct sdhci_host *host) Loading