Skip to content

Commit 1de5d12

Browse files
committed
Merge tag 'mmc-v5.10-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "A couple of MMC fixes: MMC core: - Fixup condition for CMD13 polling for RPMB requests MMC host: - mtk-sd: Fix system suspend/resume support for CQHCI - mtd-sd: Extend SDIO IRQ fix to more variants - sdhci-of-arasan: Fix clock registration error for Keem Bay SOC - tmio: Bring HW to a sane state after a power off" * tag 'mmc-v5.10-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: mediatek: mark PM functions as __maybe_unused mmc: block: Fixup condition for CMD13 polling for RPMB requests mmc: tmio: improve bringing HW to a sane state with MMC_POWER_OFF mmc: sdhci-of-arasan: Fix clock registration error for Keem Bay SOC mmc: mediatek: Extend recheck_sdio_irq fix to more variants mmc: mediatek: Fix system suspend/resume support for CQHCI
2 parents 782598e + c0d638a commit 1de5d12

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

drivers/mmc/core/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
580580

581581
memcpy(&(idata->ic.response), cmd.resp, sizeof(cmd.resp));
582582

583-
if (idata->rpmb || (cmd.flags & MMC_RSP_R1B)) {
583+
if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
584584
/*
585585
* Ensure RPMB/R1B command has completed by polling CMD13
586586
* "Send Status".

drivers/mmc/host/mtk-sd.c

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ struct msdc_host {
446446

447447
static const struct mtk_mmc_compatible mt8135_compat = {
448448
.clk_div_bits = 8,
449-
.recheck_sdio_irq = false,
449+
.recheck_sdio_irq = true,
450450
.hs400_tune = false,
451451
.pad_tune_reg = MSDC_PAD_TUNE,
452452
.async_fifo = false,
@@ -485,7 +485,7 @@ static const struct mtk_mmc_compatible mt8183_compat = {
485485

486486
static const struct mtk_mmc_compatible mt2701_compat = {
487487
.clk_div_bits = 12,
488-
.recheck_sdio_irq = false,
488+
.recheck_sdio_irq = true,
489489
.hs400_tune = false,
490490
.pad_tune_reg = MSDC_PAD_TUNE0,
491491
.async_fifo = true,
@@ -511,7 +511,7 @@ static const struct mtk_mmc_compatible mt2712_compat = {
511511

512512
static const struct mtk_mmc_compatible mt7622_compat = {
513513
.clk_div_bits = 12,
514-
.recheck_sdio_irq = false,
514+
.recheck_sdio_irq = true,
515515
.hs400_tune = false,
516516
.pad_tune_reg = MSDC_PAD_TUNE0,
517517
.async_fifo = true,
@@ -524,7 +524,7 @@ static const struct mtk_mmc_compatible mt7622_compat = {
524524

525525
static const struct mtk_mmc_compatible mt8516_compat = {
526526
.clk_div_bits = 12,
527-
.recheck_sdio_irq = false,
527+
.recheck_sdio_irq = true,
528528
.hs400_tune = false,
529529
.pad_tune_reg = MSDC_PAD_TUNE0,
530530
.async_fifo = true,
@@ -535,7 +535,7 @@ static const struct mtk_mmc_compatible mt8516_compat = {
535535

536536
static const struct mtk_mmc_compatible mt7620_compat = {
537537
.clk_div_bits = 8,
538-
.recheck_sdio_irq = false,
538+
.recheck_sdio_irq = true,
539539
.hs400_tune = false,
540540
.pad_tune_reg = MSDC_PAD_TUNE,
541541
.async_fifo = false,
@@ -548,6 +548,7 @@ static const struct mtk_mmc_compatible mt7620_compat = {
548548

549549
static const struct mtk_mmc_compatible mt6779_compat = {
550550
.clk_div_bits = 12,
551+
.recheck_sdio_irq = false,
551552
.hs400_tune = false,
552553
.pad_tune_reg = MSDC_PAD_TUNE0,
553554
.async_fifo = true,
@@ -2603,7 +2604,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
26032604
return 0;
26042605
}
26052606

2606-
#ifdef CONFIG_PM
26072607
static void msdc_save_reg(struct msdc_host *host)
26082608
{
26092609
u32 tune_reg = host->dev_comp->pad_tune_reg;
@@ -2662,7 +2662,7 @@ static void msdc_restore_reg(struct msdc_host *host)
26622662
__msdc_enable_sdio_irq(host, 1);
26632663
}
26642664

2665-
static int msdc_runtime_suspend(struct device *dev)
2665+
static int __maybe_unused msdc_runtime_suspend(struct device *dev)
26662666
{
26672667
struct mmc_host *mmc = dev_get_drvdata(dev);
26682668
struct msdc_host *host = mmc_priv(mmc);
@@ -2672,7 +2672,7 @@ static int msdc_runtime_suspend(struct device *dev)
26722672
return 0;
26732673
}
26742674

2675-
static int msdc_runtime_resume(struct device *dev)
2675+
static int __maybe_unused msdc_runtime_resume(struct device *dev)
26762676
{
26772677
struct mmc_host *mmc = dev_get_drvdata(dev);
26782678
struct msdc_host *host = mmc_priv(mmc);
@@ -2681,11 +2681,28 @@ static int msdc_runtime_resume(struct device *dev)
26812681
msdc_restore_reg(host);
26822682
return 0;
26832683
}
2684-
#endif
2684+
2685+
static int __maybe_unused msdc_suspend(struct device *dev)
2686+
{
2687+
struct mmc_host *mmc = dev_get_drvdata(dev);
2688+
int ret;
2689+
2690+
if (mmc->caps2 & MMC_CAP2_CQE) {
2691+
ret = cqhci_suspend(mmc);
2692+
if (ret)
2693+
return ret;
2694+
}
2695+
2696+
return pm_runtime_force_suspend(dev);
2697+
}
2698+
2699+
static int __maybe_unused msdc_resume(struct device *dev)
2700+
{
2701+
return pm_runtime_force_resume(dev);
2702+
}
26852703

26862704
static const struct dev_pm_ops msdc_dev_pm_ops = {
2687-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
2688-
pm_runtime_force_resume)
2705+
SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume)
26892706
SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL)
26902707
};
26912708

drivers/mmc/host/sdhci-of-arasan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,16 +1186,19 @@ static struct sdhci_arasan_of_data sdhci_arasan_versal_data = {
11861186
static struct sdhci_arasan_of_data intel_keembay_emmc_data = {
11871187
.soc_ctl_map = &intel_keembay_soc_ctl_map,
11881188
.pdata = &sdhci_keembay_emmc_pdata,
1189+
.clk_ops = &arasan_clk_ops,
11891190
};
11901191

11911192
static struct sdhci_arasan_of_data intel_keembay_sd_data = {
11921193
.soc_ctl_map = &intel_keembay_soc_ctl_map,
11931194
.pdata = &sdhci_keembay_sd_pdata,
1195+
.clk_ops = &arasan_clk_ops,
11941196
};
11951197

11961198
static struct sdhci_arasan_of_data intel_keembay_sdio_data = {
11971199
.soc_ctl_map = &intel_keembay_soc_ctl_map,
11981200
.pdata = &sdhci_keembay_sdio_pdata,
1201+
.clk_ops = &arasan_clk_ops,
11991202
};
12001203

12011204
static const struct of_device_id sdhci_arasan_of_match[] = {

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,9 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
927927
switch (ios->power_mode) {
928928
case MMC_POWER_OFF:
929929
tmio_mmc_power_off(host);
930-
/* Downgrade ensures a sane state for tuning HW (e.g. SCC) */
931-
if (host->mmc->ops->hs400_downgrade)
932-
host->mmc->ops->hs400_downgrade(host->mmc);
930+
/* For R-Car Gen2+, we need to reset SDHI specific SCC */
931+
if (host->pdata->flags & TMIO_MMC_MIN_RCAR2)
932+
host->reset(host);
933933
host->set_clock(host, 0);
934934
break;
935935
case MMC_POWER_UP:

0 commit comments

Comments
 (0)