While mmc0 enter suspend state, we need halt CQE to send legacy cmd(flush
cache) and disable cqe, for resume back, we enable CQE and not clear HALT
state.
In this case MediaTek mmc host controller will keep the value for HALT
state after CQE disable/enable flow, so the next CQE transfer after resume
will be timeout due to CQE is in HALT state, the log as below:
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: timeout for tag 2
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: ============ CQHCI REGISTER DUMP ===========
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Caps: 0x100020b6 | Version: 0x00000510
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Config: 0x00001103 | Control: 0x00000001
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Int stat: 0x00000000 | Int enab: 0x00000006
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Int sig: 0x00000006 | Int Coal: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: TDL base: 0xfd05f000 | TDL up32: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Doorbell: 0x8000203c | TCN: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Dev queue: 0x00000000 | Dev Pend: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Task clr: 0x00000000 | SSC1: 0x00001000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: SSC2: 0x00000001 | DCMD rsp: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: Resp idx: 0x00000000 | Resp arg: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: CRNQP: 0x00000000 | CRNQDUN: 0x00000000
<4>.(4)[318:kworker/4:1H]mmc0: cqhci: CRNQIS: 0x00000000 | CRNQIE: 0x00000000
This change check HALT state after CQE enable, if CQE is in HALT state, we
will clear it.
Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host")
Signed-off-by: Wenbin Mei <wenbin.mei(a)mediatek.com>
Acked-by: Adrian Hunter <adrian.hunter(a)intel.com>
Cc: stable(a)vger.kernel.org
---
drivers/mmc/host/cqhci-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
index ca8329d55f43..b0d30c35c390 100644
--- a/drivers/mmc/host/cqhci-core.c
+++ b/drivers/mmc/host/cqhci-core.c
@@ -282,6 +282,9 @@ static void __cqhci_enable(struct cqhci_host *cq_host)
cqhci_writel(cq_host, cqcfg, CQHCI_CFG);
+ if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT)
+ cqhci_writel(cq_host, 0, CQHCI_CTL);
+
mmc->cqe_on = true;
if (cq_host->ops->enable)
--
2.25.1
This is the start of the stable review cycle for the 4.19.214 release.
There are 37 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 27 Oct 2021 19:07:44 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.214-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.214-rc1
Nick Desaulniers <ndesaulniers(a)google.com>
ARM: 9122/1: select HAVE_FUTEX_CMPXCHG
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Have all levels of checks prevent recursion
Yanfei Xu <yanfei.xu(a)windriver.com>
net: mdiobus: Fix memory leak in __mdiobus_register
Oliver Neukum <oneukum(a)suse.com>
usbnet: sanity check for maxpacket
Dexuan Cui <decui(a)microsoft.com>
scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()
Kai Vehmanen <kai.vehmanen(a)linux.intel.com>
ALSA: hda: avoid write to STATESTS if controller is in reset
Prashant Malani <pmalani(a)chromium.org>
platform/x86: intel_scu_ipc: Update timeout value in comment
Zheyu Ma <zheyuma97(a)gmail.com>
isdn: mISDN: Fix sleeping function called from invalid context
Herve Codina <herve.codina(a)bootlin.com>
ARM: dts: spear3xx: Fix gmac node
Herve Codina <herve.codina(a)bootlin.com>
net: stmmac: add support for dwmac 3.40a
Filipe Manana <fdmanana(a)suse.com>
btrfs: deal with errors when checking if a dir entry exists during log replay
Brendan Higgins <brendanhiggins(a)google.com>
gcc-plugins/structleak: add makefile var for disabling structleak
Vegard Nossum <vegard.nossum(a)gmail.com>
netfilter: Kconfig: use 'default y' instead of 'm' for bool config option
Xiaolong Huang <butterflyhuangxx(a)gmail.com>
isdn: cpai: check ctr->cnr to avoid array index out of bound
Lin Ma <linma(a)zju.edu.cn>
nfc: nci: fix the UAF of rf_conn_info object
Miaohe Lin <linmiaohe(a)huawei.com>
mm, slub: fix mismatch between reconstructed freelist depth and cnt
Takashi Iwai <tiwai(a)suse.de>
ASoC: DAPM: Fix missing kctl change notifications
Steven Clarkson <sc(a)lambdal.com>
ALSA: hda/realtek: Add quirk for Clevo PC50HS
Brendan Grieve <brendan(a)grieve.com.au>
ALSA: usb-audio: Provide quirk for Sennheiser GSP670 Headset
Matthew Wilcox (Oracle) <willy(a)infradead.org>
vfs: check fd has read access in kernel_read_file_from_fd()
Lukas Bulwahn <lukas.bulwahn(a)gmail.com>
elfcore: correct reference to CONFIG_UML
Valentin Vidic <vvidic(a)valentin-vidic.from.hr>
ocfs2: mount fails with buffer overflow in strlen
Jan Kara <jack(a)suse.cz>
ocfs2: fix data corruption after conversion from inline format
Zheyu Ma <zheyuma97(a)gmail.com>
can: peak_pci: peak_pci_remove(): fix UAF
Stephane Grosjean <s.grosjean(a)peak-system.com>
can: peak_usb: pcan_usb_fd_decode_status(): fix back to ERROR_ACTIVE state notification
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
can: rcar_can: fix suspend/resume
Peng Li <lipeng321(a)huawei.com>
net: hns3: disable sriov before unload hclge layer
Guangbin Huang <huangguangbin2(a)huawei.com>
net: hns3: add limit ets dwrr bandwidth cannot be 0
Randy Dunlap <rdunlap(a)infradead.org>
NIOS2: irqflags: rename a redefined register name
Vegard Nossum <vegard.nossum(a)oracle.com>
lan78xx: select CRC32
Antoine Tenart <atenart(a)kernel.org>
netfilter: ipvs: make global sysctl readonly in non-init netns
Shengjiu Wang <shengjiu.wang(a)nxp.com>
ASoC: wm8960: Fix clock configuration on slave mode
Gerald Schaefer <gerald.schaefer(a)linux.ibm.com>
dma-debug: fix sg checks in debug_dma_map_sg()
Benjamin Coddington <bcodding(a)redhat.com>
NFSD: Keep existing listeners on portlist error
Guenter Roeck <linux(a)roeck-us.net>
xtensa: xtfpga: Try software restart before simulating CPU reset
Max Filippov <jcmvbkbc(a)gmail.com>
xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF
Eugen Hristev <eugen.hristev(a)microchip.com>
ARM: dts: at91: sama5d2_som1_ek: disable ISC node by default
-------------
Diffstat:
Makefile | 4 +-
arch/arm/Kconfig | 1 +
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 -
arch/arm/boot/dts/spear3xx.dtsi | 2 +-
arch/nios2/include/asm/irqflags.h | 4 +-
arch/nios2/include/asm/registers.h | 2 +-
arch/xtensa/platforms/xtfpga/setup.c | 12 ++--
drivers/isdn/capi/kcapi.c | 5 ++
drivers/isdn/hardware/mISDN/netjet.c | 2 +-
drivers/net/can/rcar/rcar_can.c | 20 ++++---
drivers/net/can/sja1000/peak_pci.c | 9 ++-
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 5 +-
drivers/net/ethernet/hisilicon/hns3/hnae3.c | 21 +++++++
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 +
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 9 +++
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 +
.../net/ethernet/stmicro/stmmac/dwmac-generic.c | 1 +
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 +++
drivers/net/phy/mdio_bus.c | 1 +
drivers/net/usb/Kconfig | 1 +
drivers/net/usb/usbnet.c | 4 ++
drivers/platform/x86/intel_scu_ipc.c | 2 +-
drivers/scsi/hosts.c | 3 +-
fs/btrfs/tree-log.c | 47 ++++++++++------
fs/exec.c | 2 +-
fs/nfsd/nfsctl.c | 5 +-
fs/ocfs2/alloc.c | 46 ++++------------
fs/ocfs2/super.c | 14 +++--
include/linux/elfcore.h | 2 +-
kernel/dma/debug.c | 12 ++--
kernel/trace/ftrace.c | 4 +-
kernel/trace/trace.h | 64 +++++++---------------
kernel/trace/trace_functions.c | 2 +-
mm/slub.c | 11 +++-
net/netfilter/Kconfig | 2 +-
net/netfilter/ipvs/ip_vs_ctl.c | 5 ++
net/nfc/nci/rsp.c | 2 +
scripts/Makefile.gcc-plugins | 4 ++
sound/hda/hdac_controller.c | 5 +-
sound/pci/hda/patch_realtek.c | 1 +
sound/soc/codecs/wm8960.c | 13 ++++-
sound/soc/soc-dapm.c | 13 +++--
sound/usb/quirks-table.h | 32 +++++++++++
43 files changed, 250 insertions(+), 155 deletions(-)