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
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAl/TM5kXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkAMRAAyiNNj90AUeqeityJTCe6vf9r
 IIhMaW9pNmzY6JDojD9vTiAKc0jevdvHrzLKpXe+eraVAI2H6T62gXFBTWFcLvD+
 DblW2FadK0c4nG/fB2z8uAHbc6SxVNxfIImv1QoEoAWGGyV+hD1xdrDV1IiUJxkt
 kYJRH3pAh5o9aAlzX9nFV94lHa/sYXSje4zVdfXa7u/hh0ZiEaOHhyaq1tueAXeC
 GqptZm0H2xv2fVKEUZnZqxi1FwdnnxYo4Cnzes+lRVXrdrEmLop0PbWSHS5cCpbQ
 PjW+fBHlNmZFqYC8AgE4Xa/VkY7ooF9FSMKzbg0ezHa8BVM0m4on1XTkXVi51sSX
 oR7herbRl3TTRylDO7kN12HtGfet9CrXtWmPmk4Cf3kTIQlyuFrkqxMbX9ZXByL9
 stwbUdbtjj0Niw3LRu/wnX68jIzMrxbHQi16OO57wU+VYk1AYC5RQ0KyYNHbZvCB
 WLVVhengrmuoBVU/RZRZsEiwrq+t0kfWwdfX3FKrBv5pLZEvkFe/be2wQG/cOMUP
 RmPoiTgNX4sRR+F0zqDDg3nDUvnETJHpb/ZBKwfJC619sdb7Ws1+8SO7jxrd9C1t
 freNNaxS6SucadAhuKgiuwdaAe1F1as+M/MKuxEf7GvbOzZJetKcKSC067a1sFd/
 jB3M9EfMMbfoEgJyz/Q=
 =ui1Q
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2020-12-11 14:26:17 -08:00
commit 1de5d12b76
4 changed files with 35 additions and 15 deletions

View File

@ -580,7 +580,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
memcpy(&(idata->ic.response), cmd.resp, sizeof(cmd.resp)); memcpy(&(idata->ic.response), cmd.resp, sizeof(cmd.resp));
if (idata->rpmb || (cmd.flags & MMC_RSP_R1B)) { if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
/* /*
* Ensure RPMB/R1B command has completed by polling CMD13 * Ensure RPMB/R1B command has completed by polling CMD13
* "Send Status". * "Send Status".

View File

@ -446,7 +446,7 @@ struct msdc_host {
static const struct mtk_mmc_compatible mt8135_compat = { static const struct mtk_mmc_compatible mt8135_compat = {
.clk_div_bits = 8, .clk_div_bits = 8,
.recheck_sdio_irq = false, .recheck_sdio_irq = true,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE, .pad_tune_reg = MSDC_PAD_TUNE,
.async_fifo = false, .async_fifo = false,
@ -485,7 +485,7 @@ static const struct mtk_mmc_compatible mt8183_compat = {
static const struct mtk_mmc_compatible mt2701_compat = { static const struct mtk_mmc_compatible mt2701_compat = {
.clk_div_bits = 12, .clk_div_bits = 12,
.recheck_sdio_irq = false, .recheck_sdio_irq = true,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0, .pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true, .async_fifo = true,
@ -511,7 +511,7 @@ static const struct mtk_mmc_compatible mt2712_compat = {
static const struct mtk_mmc_compatible mt7622_compat = { static const struct mtk_mmc_compatible mt7622_compat = {
.clk_div_bits = 12, .clk_div_bits = 12,
.recheck_sdio_irq = false, .recheck_sdio_irq = true,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0, .pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true, .async_fifo = true,
@ -524,7 +524,7 @@ static const struct mtk_mmc_compatible mt7622_compat = {
static const struct mtk_mmc_compatible mt8516_compat = { static const struct mtk_mmc_compatible mt8516_compat = {
.clk_div_bits = 12, .clk_div_bits = 12,
.recheck_sdio_irq = false, .recheck_sdio_irq = true,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0, .pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true, .async_fifo = true,
@ -535,7 +535,7 @@ static const struct mtk_mmc_compatible mt8516_compat = {
static const struct mtk_mmc_compatible mt7620_compat = { static const struct mtk_mmc_compatible mt7620_compat = {
.clk_div_bits = 8, .clk_div_bits = 8,
.recheck_sdio_irq = false, .recheck_sdio_irq = true,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE, .pad_tune_reg = MSDC_PAD_TUNE,
.async_fifo = false, .async_fifo = false,
@ -548,6 +548,7 @@ static const struct mtk_mmc_compatible mt7620_compat = {
static const struct mtk_mmc_compatible mt6779_compat = { static const struct mtk_mmc_compatible mt6779_compat = {
.clk_div_bits = 12, .clk_div_bits = 12,
.recheck_sdio_irq = false,
.hs400_tune = false, .hs400_tune = false,
.pad_tune_reg = MSDC_PAD_TUNE0, .pad_tune_reg = MSDC_PAD_TUNE0,
.async_fifo = true, .async_fifo = true,
@ -2603,7 +2604,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM
static void msdc_save_reg(struct msdc_host *host) static void msdc_save_reg(struct msdc_host *host)
{ {
u32 tune_reg = host->dev_comp->pad_tune_reg; u32 tune_reg = host->dev_comp->pad_tune_reg;
@ -2662,7 +2662,7 @@ static void msdc_restore_reg(struct msdc_host *host)
__msdc_enable_sdio_irq(host, 1); __msdc_enable_sdio_irq(host, 1);
} }
static int msdc_runtime_suspend(struct device *dev) static int __maybe_unused msdc_runtime_suspend(struct device *dev)
{ {
struct mmc_host *mmc = dev_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
struct msdc_host *host = mmc_priv(mmc); struct msdc_host *host = mmc_priv(mmc);
@ -2672,7 +2672,7 @@ static int msdc_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int msdc_runtime_resume(struct device *dev) static int __maybe_unused msdc_runtime_resume(struct device *dev)
{ {
struct mmc_host *mmc = dev_get_drvdata(dev); struct mmc_host *mmc = dev_get_drvdata(dev);
struct msdc_host *host = mmc_priv(mmc); struct msdc_host *host = mmc_priv(mmc);
@ -2681,11 +2681,28 @@ static int msdc_runtime_resume(struct device *dev)
msdc_restore_reg(host); msdc_restore_reg(host);
return 0; return 0;
} }
#endif
static int __maybe_unused msdc_suspend(struct device *dev)
{
struct mmc_host *mmc = dev_get_drvdata(dev);
int ret;
if (mmc->caps2 & MMC_CAP2_CQE) {
ret = cqhci_suspend(mmc);
if (ret)
return ret;
}
return pm_runtime_force_suspend(dev);
}
static int __maybe_unused msdc_resume(struct device *dev)
{
return pm_runtime_force_resume(dev);
}
static const struct dev_pm_ops msdc_dev_pm_ops = { static const struct dev_pm_ops msdc_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume)
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL) SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL)
}; };

View File

@ -1186,16 +1186,19 @@ static struct sdhci_arasan_of_data sdhci_arasan_versal_data = {
static struct sdhci_arasan_of_data intel_keembay_emmc_data = { static struct sdhci_arasan_of_data intel_keembay_emmc_data = {
.soc_ctl_map = &intel_keembay_soc_ctl_map, .soc_ctl_map = &intel_keembay_soc_ctl_map,
.pdata = &sdhci_keembay_emmc_pdata, .pdata = &sdhci_keembay_emmc_pdata,
.clk_ops = &arasan_clk_ops,
}; };
static struct sdhci_arasan_of_data intel_keembay_sd_data = { static struct sdhci_arasan_of_data intel_keembay_sd_data = {
.soc_ctl_map = &intel_keembay_soc_ctl_map, .soc_ctl_map = &intel_keembay_soc_ctl_map,
.pdata = &sdhci_keembay_sd_pdata, .pdata = &sdhci_keembay_sd_pdata,
.clk_ops = &arasan_clk_ops,
}; };
static struct sdhci_arasan_of_data intel_keembay_sdio_data = { static struct sdhci_arasan_of_data intel_keembay_sdio_data = {
.soc_ctl_map = &intel_keembay_soc_ctl_map, .soc_ctl_map = &intel_keembay_soc_ctl_map,
.pdata = &sdhci_keembay_sdio_pdata, .pdata = &sdhci_keembay_sdio_pdata,
.clk_ops = &arasan_clk_ops,
}; };
static const struct of_device_id sdhci_arasan_of_match[] = { static const struct of_device_id sdhci_arasan_of_match[] = {

View File

@ -927,9 +927,9 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
switch (ios->power_mode) { switch (ios->power_mode) {
case MMC_POWER_OFF: case MMC_POWER_OFF:
tmio_mmc_power_off(host); tmio_mmc_power_off(host);
/* Downgrade ensures a sane state for tuning HW (e.g. SCC) */ /* For R-Car Gen2+, we need to reset SDHI specific SCC */
if (host->mmc->ops->hs400_downgrade) if (host->pdata->flags & TMIO_MMC_MIN_RCAR2)
host->mmc->ops->hs400_downgrade(host->mmc); host->reset(host);
host->set_clock(host, 0); host->set_clock(host, 0);
break; break;
case MMC_POWER_UP: case MMC_POWER_UP: