Linux Kernels

mmc: sh-mmcif: fix I/O errors

This change “mmc: sh-mmcif: fix I/O errors” (commit b31d637) in Linux kernel is authored by Guennadi Liakhovetski <g.liakhovetski [at]> on Wed Dec 12 15:38:17 2012 +0100.

Description of "mmc: sh-mmcif: fix I/O errors"

The change “mmc: sh-mmcif: fix I/O errors” introduces changes as follows.

mmc: sh-mmcif: fix I/O errors

The INT_BUFWEN IRQ often arrives with other bits set too. If they are not
cleared, an additional IRQ can be triggered, sometimes also after the MMC
request has already been completed. This leads to block I/O errors. Earlier
Teppei Kamijou also observed these additional interrupts and proposed to
explicitly wait for them. This patch chooses an alternative approach of
clearing all active bits immediately, when processing the main interrupt.

Reported-by: Teppei Kamijou <>
Signed-off-by: Guennadi Liakhovetski <>
Signed-off-by: Chris Ball <>

Linux kernel releases containing commit b31d637

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "mmc: sh-mmcif: fix I/O errors"

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/mmc/host/sh_mmcif.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 1c37854c0f33..e6a6d2363a4d 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1238,7 +1238,9 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
 		sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~INT_BUFREN);
 		sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MBUFREN);
 	} else if (state & INT_BUFWEN) {
-		sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~INT_BUFWEN);
+		sh_mmcif_writel(host->addr, MMCIF_CE_INT,
+				  INT_CMD12RBE | INT_CMD12CRE));
 		sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN);
 	} else if (state & INT_CMD12DRE) {
 		sh_mmcif_writel(host->addr, MMCIF_CE_INT,

The commit for this change in Linux stable tree is b31d637 (patch).

Last modified: 2020/01/11 06:42