linux/drivers/mmc/host
Wenbin Mei c0a2074ac5 mmc: mediatek: Fix system suspend/resume support for CQHCI
Before we got these errors on MT8192 platform:
[   59.153891] Restarting tasks ...
[   59.154540] done.
[   59.159175] PM: suspend exit
[   59.218724] mtk-msdc 11f60000.mmc: phase: [map:fffffffe] [maxlen:31]
[final:16]
[  119.776083] mmc0: cqhci: timeout for tag 9
[  119.780196] mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
[  119.786709] mmc0: cqhci: Caps:      0x100020b6 | Version:  0x00000510
[  119.793225] mmc0: cqhci: Config:    0x00000101 | Control:  0x00000000
[  119.799706] mmc0: cqhci: Int stat:  0x00000000 | Int enab: 0x00000000
[  119.806177] mmc0: cqhci: Int sig:   0x00000000 | Int Coal: 0x00000000
[  119.812670] mmc0: cqhci: TDL base:  0x00000000 | TDL up32: 0x00000000
[  119.819149] mmc0: cqhci: Doorbell:  0x003ffc00 | TCN:      0x00000200
[  119.825656] mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000
[  119.832155] mmc0: cqhci: Task clr:  0x00000000 | SSC1:     0x00001000
[  119.838627] mmc0: cqhci: SSC2:      0x00000000 | DCMD rsp: 0x00000000
[  119.845174] mmc0: cqhci: RED mask:  0xfdf9a080 | TERRI:    0x0000891c
[  119.851654] mmc0: cqhci: Resp idx:  0x00000000 | Resp arg: 0x00000000
[  119.865773] mmc0: cqhci: : ===========================================
[  119.872358] mmc0: running CQE recovery
From these logs, we found TDL base was back to the default value.

After suspend, the mmc host is powered off by HW, and bring CQE register
to the default value, so we add system suspend/resume interface, then bring
CQE to deactivated state before suspend, it will be enabled by CQE first
request after resume.

Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
Link: https://lore.kernel.org/r/20201118063405.24906-1-wenbin.mei@mediatek.com
Fixes: 88bd652b3c ("mmc: mediatek: command queue support")
Cc: stable@vger.kernel.org
[Ulf: Renamed functions]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2020-11-23 14:42:56 +01:00
..
alcor.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4 2020-09-07 14:24:21 +02:00
android-goldfish.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
atmel-mci.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
au1xmmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
bcm2835.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
cavium-octeon.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
cavium-thunderx.c
cavium.c mmc: host: Drop redundant MMC_CAP_ERASE 2020-05-28 11:22:14 +02:00
cavium.h
cb710-mmc.c mmc: cb710: Inform the mmc core about the maximum busy timeout 2020-05-28 11:22:13 +02:00
cb710-mmc.h
cqhci.c mmc: cqhci: add new cqhci_host_ops pre_enable() and post_disable() 2020-09-07 09:11:31 +02:00
cqhci.h mmc: cqhci: add new cqhci_host_ops pre_enable() and post_disable() 2020-09-07 09:11:31 +02:00
davinci_mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
dw_mmc-bluefield.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.19 2020-09-07 14:24:21 +02:00
dw_mmc-exynos.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
dw_mmc-exynos.h
dw_mmc-hi3798cv200.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.19 2020-09-07 14:24:21 +02:00
dw_mmc-k3.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
dw_mmc-pci.c
dw_mmc-pltfm.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
dw_mmc-pltfm.h
dw_mmc-rockchip.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
dw_mmc-zx.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
dw_mmc-zx.h
dw_mmc.c mmc: dw_mmc: Simplify with dev_err_probe() 2020-09-07 09:15:56 +02:00
dw_mmc.h
jz4740_mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
Kconfig ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
Makefile mmc: sdhci-of-sparx5: Add Sparx5 SoC eMMC driver 2020-09-07 09:11:30 +02:00
meson-gx-mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
meson-mx-sdhc-clkc.c mmc: meson-mx-sdhc: Don't use literal 0 to initialize structs 2020-05-28 11:22:15 +02:00
meson-mx-sdhc-mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer than 5.4 2020-09-07 14:24:21 +02:00
meson-mx-sdhc.h mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host 2020-05-28 11:22:14 +02:00
meson-mx-sdio.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.19 2020-09-07 14:24:21 +02:00
mmc_hsq.c mmc: host: Introduce the request_atomic() for the host 2020-05-28 11:20:59 +02:00
mmc_hsq.h mmc: host: Introduce the request_atomic() for the host 2020-05-28 11:20:59 +02:00
mmc_spi.c Merge branch 'fixes' into next 2020-09-14 11:46:47 +02:00
mmci_qcom_dml.c
mmci_stm32_sdmmc.c mmc: mmci_sdmmc: fix DMA API warning max segment size 2020-05-29 12:38:00 +02:00
mmci.c mmc: mmci: add sdio datactrl mask for sdmmc revisions 2020-07-13 12:18:23 +02:00
mmci.h mmc: mmci_sdmmc: Implement signal voltage callbacks 2020-03-24 14:35:40 +01:00
moxart-mmc.c mmc: moxart: remove unneeded check for drvdata 2020-09-25 13:24:02 +02:00
mtk-sd.c mmc: mediatek: Fix system suspend/resume support for CQHCI 2020-11-23 14:42:56 +01:00
mvsdio.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
mvsdio.h
mxcmmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
mxs-mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
of_mmc_spi.c
omap_hsmmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
omap.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
owl-mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer than 5.4 2020-09-07 14:24:21 +02:00
pxamci.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
pxamci.h
renesas_sdhi_core.c Revert "mmc: renesas_sdhi: workaround a regression when reinserting SD cards" 2020-11-10 13:58:01 +01:00
renesas_sdhi_internal_dmac.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
renesas_sdhi_sys_dmac.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
renesas_sdhi.h mmc: renesas_sdhi: drop local flag for tuning 2020-09-25 13:24:02 +02:00
rtsx_pci_sdmmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
rtsx_usb_sdmmc.c mmc: rtsx_usb_sdmmc: simplify the return expression of sd_change_phase() 2020-09-25 13:24:02 +02:00
s3cmci.c ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
s3cmci.h
sdhci_am654.c mmc: sdhci_am654: Fix module autoload 2020-10-09 08:58:58 +02:00
sdhci_f_sdh30.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci_f_sdh30.h
sdhci-acpi.c mmc: sdhci-acpi: AMDI0040: Set SDHCI_QUIRK2_PRESET_VALUE_BROKEN 2020-10-05 11:13:28 +02:00
sdhci-bcm-kona.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-brcmstb.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.9 2020-09-07 14:24:21 +02:00
sdhci-cadence.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
sdhci-cns3xxx.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-dove.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-esdhc-imx.c mmc: sdhci: fix indentation mistakes 2020-09-25 13:24:02 +02:00
sdhci-esdhc-mcf.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer than 5.4 2020-09-07 14:24:21 +02:00
sdhci-esdhc.h mmc: sdhci-of-esdhc: make sure delay chain locked for HS400 2020-10-28 11:07:01 +01:00
sdhci-iproc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-milbeaut.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer than 5.4 2020-09-07 14:24:21 +02:00
sdhci-msm.c mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table() 2020-09-11 11:43:21 +02:00
sdhci-of-arasan.c mmc: sdhci-of-arasan: Issue DLL reset explicitly 2020-11-17 12:44:44 +01:00
sdhci-of-aspeed.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4 2020-09-07 14:24:21 +02:00
sdhci-of-at91.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-of-dwcmshc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.19 2020-09-07 14:24:21 +02:00
sdhci-of-esdhc.c mmc: sdhci-of-esdhc: Handle pulse width detection erratum for more SoCs 2020-11-10 13:20:37 +01:00
sdhci-of-hlwd.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-of-sparx5.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer than 5.4 2020-09-07 14:24:21 +02:00
sdhci-omap.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.19 2020-09-07 14:24:21 +02:00
sdhci-pci-arasan.c
sdhci-pci-core.c mmc: sdhci-pci: Prefer SDR25 timing for High Speed mode for BYT-based Intel controllers 2020-11-17 12:33:06 +01:00
sdhci-pci-data.c
sdhci-pci-dwc-mshc.c
sdhci-pci-gli.c mmc: sdhci-pci-gli: Add CQHCI Support for GL9763E 2020-10-07 11:25:32 +02:00
sdhci-pci-o2micro.c mmc: sdhci-pci-o2micro: Add HW tuning for SDR104 mode 2020-07-24 12:34:42 +02:00
sdhci-pci.h mmc: sdhci-pci-gli: Add Genesys Logic GL9763E support 2020-05-28 11:22:14 +02:00
sdhci-pic32.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.9 2020-09-07 14:24:21 +02:00
sdhci-pltfm.c
sdhci-pltfm.h mmc: Replace zero-length array with flexible-array member 2020-03-24 14:39:45 +01:00
sdhci-pxav2.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-pxav3.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-s3c.c mmc: sdhci-s3c: hide forward declaration of of_device_id behind CONFIG_OF 2020-09-25 13:30:52 +02:00
sdhci-sirf.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-spear.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-sprd.c mmc: sdhci: fix indentation mistakes 2020-09-25 13:24:02 +02:00
sdhci-st.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-tegra.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sdhci-xenon-phy.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sdhci-xenon.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.14 2020-09-07 14:24:21 +02:00
sdhci-xenon.h
sdhci.c mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true 2020-10-15 12:29:59 +02:00
sdhci.h mmc: sdhci: Allow platform controlled voltage switching 2020-07-13 12:18:24 +02:00
sdricoh_cs.c mmc: sdricoh_cs: Respect the cmd->busy_timeout from the mmc core 2020-05-28 11:22:14 +02:00
sh_mmcif.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
sunxi-mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
tifm_sd.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
tmio_mmc_core.c mmc: tmio: bring tuning HW to a sane state with MMC_POWER_OFF 2020-11-10 13:58:01 +01:00
tmio_mmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
tmio_mmc.h mmc: tmio: add generic hook to fixup after a completed request 2020-09-09 13:09:44 +02:00
toshsd.c
toshsd.h
uniphier-sd.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v5.4 2020-09-07 14:24:21 +02:00
usdhi6rol0.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
ushc.c
via-sdmmc.c mmc: via-sdmmc: Fix data race bug 2020-09-07 09:11:29 +02:00
vub300.c mmc: vub300: Use scnprintf() for avoiding potential buffer overflow 2020-03-24 14:39:52 +01:00
wbsd.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00
wbsd.h
wmt-sdmmc.c mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4 2020-09-07 14:20:17 +02:00