From patchwork Wed Dec 12 14:38:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1867261 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 31500DF215 for ; Wed, 12 Dec 2012 14:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607Ab2LLOib (ORCPT ); Wed, 12 Dec 2012 09:38:31 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:60484 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754349Ab2LLOi0 (ORCPT ); Wed, 12 Dec 2012 09:38:26 -0500 Received: from axis700.grange (dslb-146-060-250-080.pools.arcor-ip.net [146.60.250.80]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0Mf6wH-1TTjY10az3-00Oe9V; Wed, 12 Dec 2012 15:38:24 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id E9BF6105FC; Wed, 12 Dec 2012 15:38:21 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1TinRz-0004iS-3j; Wed, 12 Dec 2012 15:38:19 +0100 From: Guennadi Liakhovetski To: linux-mmc@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Chris Ball Subject: [PATCH 13/14] mmc: sh-mmcif: fix I/O errors Date: Wed, 12 Dec 2012 15:38:17 +0100 Message-Id: <1355323098-18061-14-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1355323098-18061-1-git-send-email-g.liakhovetski@gmx.de> References: <1355323098-18061-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:bj3G3IMyZOnK4/+c6hZDGUzYxfsI2JoqQoPAwcm0jXW daAF2VPEfXMPOmn6sgH1Z4aw4lw3tOFPiJ8iRFcWMC0iHoKPW/ PB92GMU/Cxn88PS7HbaDIDFOjdfD7Z68sco0o1rJRcZ3NDOZUm ZhcxYVPGgcOWFLekGrSKVgHGkJZSVOsDXxa1haRHXE4dYgGvwb zIRzWhUt8n5/Qn2tevFLOhgkXIVU/EcLbSxwXEBMasTzVy3YBC 0738masaNA1pwoiKZabMgzkN6KncfQCE4S65XWzpKoSUouGsJn 5OV6+neBEnDLvZWAVgPXRqIwfPW22R62RK9KACAcLKS/BiGZh/ 8P0LcvKFRg2Gkfcbk1jk4OWwblJeYizzaPw4AGV16OLPldG/9q +g6E24r2R9IgHZeapLBB5sm5HJ02gq8wvA= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 --- drivers/mmc/host/sh_mmcif.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 1dd7fc0..36eee8d 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_BUFWEN | INT_DTRANE | INT_CMD12DRE | + 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,