Loading drivers/mmc/core/core.c +2 −1 Original line number Diff line number Diff line Loading @@ -485,7 +485,8 @@ int mmc_clk_update_freq(struct mmc_host *host, else pr_err("%s: %s: failed (%d) at freq=%lu\n", mmc_hostname(host), __func__, err, freq); mmc_log_string(host, "clock scale state %d freq %lu done with err %d\n", state, freq, err); /* * CQE would be enabled as part of CQE issueing path * So no need to unhalt it explicitly Loading drivers/mmc/core/mmc.c +9 −3 Original line number Diff line number Diff line Loading @@ -2311,6 +2311,8 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_suspended(host->card)) goto out; Loading Loading @@ -2342,6 +2344,7 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) mmc_card_set_suspended(host->card); } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); if (err) mmc_resume_clk_scaling(host); Loading Loading @@ -2379,10 +2382,12 @@ static int _mmc_resume(struct mmc_host *host) goto out; } mmc_log_string(host, "Enter\n"); mmc_power_up(host, host->card->ocr); err = mmc_init_card(host, host->card->ocr, host->card); mmc_card_clr_suspended(host->card); mmc_log_string(host, "Exit err %d\n", err); mmc_release_host(host); err = mmc_resume_clk_scaling(host); Loading Loading @@ -2417,7 +2422,7 @@ static int mmc_shutdown(struct mmc_host *host) if (!err) err = _mmc_suspend(host, false); mmc_log_string(host, "done err %d\n", err); return err; } Loading @@ -2427,6 +2432,7 @@ static int mmc_shutdown(struct mmc_host *host) static int mmc_resume(struct mmc_host *host) { pm_runtime_enable(&host->card->dev); mmc_log_string(host, "Done\n"); return 0; } Loading @@ -2444,7 +2450,7 @@ static int mmc_runtime_suspend(struct mmc_host *host) if (err) pr_err("%s: error %d doing aggressive suspend\n", mmc_hostname(host), err); mmc_log_string(host, "done err %d\n", err); return err; } Loading @@ -2459,7 +2465,7 @@ static int mmc_runtime_resume(struct mmc_host *host) if (err && err != -ENOMEDIUM) pr_err("%s: error %d doing runtime resume\n", mmc_hostname(host), err); mmc_log_string(host, "done err %d\n", err); return 0; } Loading drivers/mmc/core/sd.c +6 −0 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,7 @@ static int _mmc_sd_suspend(struct mmc_host *host) } mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_suspended(host->card)) goto out; Loading @@ -1249,6 +1250,7 @@ static int _mmc_sd_suspend(struct mmc_host *host) } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); return err; } Loading Loading @@ -1278,6 +1280,7 @@ static int _mmc_sd_resume(struct mmc_host *host) int err = 0; mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (!mmc_card_suspended(host->card)) goto out; Loading @@ -1293,6 +1296,7 @@ static int _mmc_sd_resume(struct mmc_host *host) goto out; } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); return err; } Loading @@ -1303,6 +1307,8 @@ static int _mmc_sd_resume(struct mmc_host *host) static int mmc_sd_resume(struct mmc_host *host) { pm_runtime_enable(&host->card->dev); mmc_log_string(host, "done\n"); return 0; } Loading drivers/mmc/core/sdio.c +4 −0 Original line number Diff line number Diff line Loading @@ -936,6 +936,7 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host) static int mmc_sdio_suspend(struct mmc_host *host) { mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) sdio_disable_wide(host->card); Loading @@ -947,6 +948,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) mmc_retune_needed(host); } mmc_log_string(host, "Exit\n"); mmc_release_host(host); return 0; Loading @@ -958,6 +960,7 @@ static int mmc_sdio_resume(struct mmc_host *host) /* Basic card reinitialization. */ mmc_claim_host(host); mmc_log_string(host, "Enter\n"); /* Restore power if needed */ if (!mmc_card_keep_power(host)) { Loading Loading @@ -990,6 +993,7 @@ static int mmc_sdio_resume(struct mmc_host *host) host->ops->enable_sdio_irq(host, 1); } mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); host->pm_flags &= ~MMC_PM_KEEP_POWER; Loading drivers/mmc/host/cqhci.c +17 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,15 @@ static void cqhci_dumpregs(struct cqhci_host *cq_host) { struct mmc_host *mmc = cq_host->mmc; mmc_log_string(mmc, "CQHCI_CTL=0x%08x CQHCI_IS=0x%08x CQHCI_ISTE=0x%08x CQHCI_ISGE=0x%08x CQHCI_TDBR=0x%08x CQHCI_TCN=0x%08x CQHCI_DQS=0x%08x CQHCI_DPT=0x%08x CQHCI_TERRI=0x%08x CQHCI_CRI=0x%08x CQHCI_CRA=0x%08x CQHCI_CRDCT=0x%08x\n", cqhci_readl(cq_host, CQHCI_CTL), cqhci_readl(cq_host, CQHCI_IS), cqhci_readl(cq_host, CQHCI_ISTE), cqhci_readl(cq_host, CQHCI_ISGE), cqhci_readl(cq_host, CQHCI_TDBR), cqhci_readl(cq_host, CQHCI_TCN), cqhci_readl(cq_host, CQHCI_DQS), cqhci_readl(cq_host, CQHCI_DPT), cqhci_readl(cq_host, CQHCI_TERRI), cqhci_readl(cq_host, CQHCI_CRI), cqhci_readl(cq_host, CQHCI_CRA), cqhci_readl(cq_host, CQHCI_CRDCT)); CQHCI_DUMP("============ CQHCI REGISTER DUMP ===========\n"); CQHCI_DUMP("Caps: 0x%08x | Version: 0x%08x\n", Loading Loading @@ -297,6 +306,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host) cqhci_set_irqs(cq_host, CQHCI_IS_MASK); cq_host->activated = true; mmc_log_string(mmc, "CQ enabled\n"); } static void __cqhci_disable(struct cqhci_host *cq_host) Loading @@ -310,6 +320,7 @@ static void __cqhci_disable(struct cqhci_host *cq_host) cq_host->mmc->cqe_on = false; cq_host->activated = false; mmc_log_string(cq_host->mmc, "CQ disabled\n"); } int cqhci_suspend(struct mmc_host *mmc) Loading Loading @@ -684,6 +695,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq) cq_host->qcnt += 1; mmc_log_string(mmc, "tag: %d\n", tag); cqhci_writel(cq_host, 1 << tag, CQHCI_TDBR); if (!(cqhci_readl(cq_host, CQHCI_TDBR) & (1 << tag))) pr_debug("%s: cqhci: doorbell not set for tag %d\n", Loading Loading @@ -844,6 +856,8 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error, cqhci_writel(cq_host, status, CQHCI_IS); pr_debug("%s: cqhci: IRQ status: 0x%08x\n", mmc_hostname(mmc), status); mmc_log_string(mmc, "CQIS: 0x%x cmd_error : %d data_err: %d\n", status, cmd_error, data_error); if ((status & CQHCI_IS_RED) || cmd_error || data_error) cqhci_error_irq(mmc, status, cmd_error, data_error); Loading @@ -861,6 +875,7 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error, /* complete the corresponding mrq */ pr_debug("%s: cqhci: completing tag %lu\n", mmc_hostname(mmc), tag); mmc_log_string(mmc, "completing tag -> %lu\n", tag); cqhci_finish_mrq(mmc, tag); } Loading Loading @@ -994,6 +1009,7 @@ static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout) if (!ret) pr_debug("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); mmc_log_string(mmc, "halt done with ret %d\n", ret); return ret; } Loading Loading @@ -1132,6 +1148,7 @@ static void cqhci_recovery_finish(struct mmc_host *mmc) cqhci_set_irqs(cq_host, CQHCI_IS_MASK); pr_debug("%s: cqhci: recovery done\n", mmc_hostname(mmc)); mmc_log_string(mmc, "recovery done\n"); } static const struct mmc_cqe_ops cqhci_cqe_ops = { Loading Loading
drivers/mmc/core/core.c +2 −1 Original line number Diff line number Diff line Loading @@ -485,7 +485,8 @@ int mmc_clk_update_freq(struct mmc_host *host, else pr_err("%s: %s: failed (%d) at freq=%lu\n", mmc_hostname(host), __func__, err, freq); mmc_log_string(host, "clock scale state %d freq %lu done with err %d\n", state, freq, err); /* * CQE would be enabled as part of CQE issueing path * So no need to unhalt it explicitly Loading
drivers/mmc/core/mmc.c +9 −3 Original line number Diff line number Diff line Loading @@ -2311,6 +2311,8 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_suspended(host->card)) goto out; Loading Loading @@ -2342,6 +2344,7 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) mmc_card_set_suspended(host->card); } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); if (err) mmc_resume_clk_scaling(host); Loading Loading @@ -2379,10 +2382,12 @@ static int _mmc_resume(struct mmc_host *host) goto out; } mmc_log_string(host, "Enter\n"); mmc_power_up(host, host->card->ocr); err = mmc_init_card(host, host->card->ocr, host->card); mmc_card_clr_suspended(host->card); mmc_log_string(host, "Exit err %d\n", err); mmc_release_host(host); err = mmc_resume_clk_scaling(host); Loading Loading @@ -2417,7 +2422,7 @@ static int mmc_shutdown(struct mmc_host *host) if (!err) err = _mmc_suspend(host, false); mmc_log_string(host, "done err %d\n", err); return err; } Loading @@ -2427,6 +2432,7 @@ static int mmc_shutdown(struct mmc_host *host) static int mmc_resume(struct mmc_host *host) { pm_runtime_enable(&host->card->dev); mmc_log_string(host, "Done\n"); return 0; } Loading @@ -2444,7 +2450,7 @@ static int mmc_runtime_suspend(struct mmc_host *host) if (err) pr_err("%s: error %d doing aggressive suspend\n", mmc_hostname(host), err); mmc_log_string(host, "done err %d\n", err); return err; } Loading @@ -2459,7 +2465,7 @@ static int mmc_runtime_resume(struct mmc_host *host) if (err && err != -ENOMEDIUM) pr_err("%s: error %d doing runtime resume\n", mmc_hostname(host), err); mmc_log_string(host, "done err %d\n", err); return 0; } Loading
drivers/mmc/core/sd.c +6 −0 Original line number Diff line number Diff line Loading @@ -1236,6 +1236,7 @@ static int _mmc_sd_suspend(struct mmc_host *host) } mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_suspended(host->card)) goto out; Loading @@ -1249,6 +1250,7 @@ static int _mmc_sd_suspend(struct mmc_host *host) } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); return err; } Loading Loading @@ -1278,6 +1280,7 @@ static int _mmc_sd_resume(struct mmc_host *host) int err = 0; mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (!mmc_card_suspended(host->card)) goto out; Loading @@ -1293,6 +1296,7 @@ static int _mmc_sd_resume(struct mmc_host *host) goto out; } out: mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); return err; } Loading @@ -1303,6 +1307,8 @@ static int _mmc_sd_resume(struct mmc_host *host) static int mmc_sd_resume(struct mmc_host *host) { pm_runtime_enable(&host->card->dev); mmc_log_string(host, "done\n"); return 0; } Loading
drivers/mmc/core/sdio.c +4 −0 Original line number Diff line number Diff line Loading @@ -936,6 +936,7 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host) static int mmc_sdio_suspend(struct mmc_host *host) { mmc_claim_host(host); mmc_log_string(host, "Enter\n"); if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) sdio_disable_wide(host->card); Loading @@ -947,6 +948,7 @@ static int mmc_sdio_suspend(struct mmc_host *host) mmc_retune_needed(host); } mmc_log_string(host, "Exit\n"); mmc_release_host(host); return 0; Loading @@ -958,6 +960,7 @@ static int mmc_sdio_resume(struct mmc_host *host) /* Basic card reinitialization. */ mmc_claim_host(host); mmc_log_string(host, "Enter\n"); /* Restore power if needed */ if (!mmc_card_keep_power(host)) { Loading Loading @@ -990,6 +993,7 @@ static int mmc_sdio_resume(struct mmc_host *host) host->ops->enable_sdio_irq(host, 1); } mmc_log_string(host, "Exit err: %d\n", err); mmc_release_host(host); host->pm_flags &= ~MMC_PM_KEEP_POWER; Loading
drivers/mmc/host/cqhci.c +17 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,15 @@ static void cqhci_dumpregs(struct cqhci_host *cq_host) { struct mmc_host *mmc = cq_host->mmc; mmc_log_string(mmc, "CQHCI_CTL=0x%08x CQHCI_IS=0x%08x CQHCI_ISTE=0x%08x CQHCI_ISGE=0x%08x CQHCI_TDBR=0x%08x CQHCI_TCN=0x%08x CQHCI_DQS=0x%08x CQHCI_DPT=0x%08x CQHCI_TERRI=0x%08x CQHCI_CRI=0x%08x CQHCI_CRA=0x%08x CQHCI_CRDCT=0x%08x\n", cqhci_readl(cq_host, CQHCI_CTL), cqhci_readl(cq_host, CQHCI_IS), cqhci_readl(cq_host, CQHCI_ISTE), cqhci_readl(cq_host, CQHCI_ISGE), cqhci_readl(cq_host, CQHCI_TDBR), cqhci_readl(cq_host, CQHCI_TCN), cqhci_readl(cq_host, CQHCI_DQS), cqhci_readl(cq_host, CQHCI_DPT), cqhci_readl(cq_host, CQHCI_TERRI), cqhci_readl(cq_host, CQHCI_CRI), cqhci_readl(cq_host, CQHCI_CRA), cqhci_readl(cq_host, CQHCI_CRDCT)); CQHCI_DUMP("============ CQHCI REGISTER DUMP ===========\n"); CQHCI_DUMP("Caps: 0x%08x | Version: 0x%08x\n", Loading Loading @@ -297,6 +306,7 @@ static void __cqhci_enable(struct cqhci_host *cq_host) cqhci_set_irqs(cq_host, CQHCI_IS_MASK); cq_host->activated = true; mmc_log_string(mmc, "CQ enabled\n"); } static void __cqhci_disable(struct cqhci_host *cq_host) Loading @@ -310,6 +320,7 @@ static void __cqhci_disable(struct cqhci_host *cq_host) cq_host->mmc->cqe_on = false; cq_host->activated = false; mmc_log_string(cq_host->mmc, "CQ disabled\n"); } int cqhci_suspend(struct mmc_host *mmc) Loading Loading @@ -684,6 +695,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq) cq_host->qcnt += 1; mmc_log_string(mmc, "tag: %d\n", tag); cqhci_writel(cq_host, 1 << tag, CQHCI_TDBR); if (!(cqhci_readl(cq_host, CQHCI_TDBR) & (1 << tag))) pr_debug("%s: cqhci: doorbell not set for tag %d\n", Loading Loading @@ -844,6 +856,8 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error, cqhci_writel(cq_host, status, CQHCI_IS); pr_debug("%s: cqhci: IRQ status: 0x%08x\n", mmc_hostname(mmc), status); mmc_log_string(mmc, "CQIS: 0x%x cmd_error : %d data_err: %d\n", status, cmd_error, data_error); if ((status & CQHCI_IS_RED) || cmd_error || data_error) cqhci_error_irq(mmc, status, cmd_error, data_error); Loading @@ -861,6 +875,7 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error, /* complete the corresponding mrq */ pr_debug("%s: cqhci: completing tag %lu\n", mmc_hostname(mmc), tag); mmc_log_string(mmc, "completing tag -> %lu\n", tag); cqhci_finish_mrq(mmc, tag); } Loading Loading @@ -994,6 +1009,7 @@ static bool cqhci_halt(struct mmc_host *mmc, unsigned int timeout) if (!ret) pr_debug("%s: cqhci: Failed to halt\n", mmc_hostname(mmc)); mmc_log_string(mmc, "halt done with ret %d\n", ret); return ret; } Loading Loading @@ -1132,6 +1148,7 @@ static void cqhci_recovery_finish(struct mmc_host *mmc) cqhci_set_irqs(cq_host, CQHCI_IS_MASK); pr_debug("%s: cqhci: recovery done\n", mmc_hostname(mmc)); mmc_log_string(mmc, "recovery done\n"); } static const struct mmc_cqe_ops cqhci_cqe_ops = { Loading