From patchwork Thu Feb 21 15:31:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 2171861 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 DD497DF215 for ; Thu, 21 Feb 2013 15:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848Ab3BUPgw (ORCPT ); Thu, 21 Feb 2013 10:36:52 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:44589 "EHLO relmlor2.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553Ab3BUPgv (ORCPT ); Thu, 21 Feb 2013 10:36:51 -0500 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Thu, 21 Feb 2013 10:36:51 EST Received: from relmlir2.idc.renesas.com ([10.200.68.152]) by relmlor2.idc.renesas.com ( SJSMS) with ESMTP id <0MIK00315TT104B0@relmlor2.idc.renesas.com>; Fri, 22 Feb 2013 00:31:49 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir2.idc.renesas.com ( SJSMS) with ESMTP id <0MIK00HYNTT1IXE0@relmlir2.idc.renesas.com>; Fri, 22 Feb 2013 00:31:49 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 119A7480A4; Fri, 22 Feb 2013 00:31:49 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 0CADA480A0; Fri, 22 Feb 2013 00:31:49 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id AAB04594; Fri, 22 Feb 2013 00:31:49 +0900 X-IronPort-AV: E=Sophos; i="4.84,709,1355065200"; d="scan'208"; a="117887408" Received: from unknown (HELO relay51.aps.necel.com) ([10.29.19.60]) by relmlii1.idc.renesas.com with ESMTP; Fri, 22 Feb 2013 00:31:48 +0900 Received: from julia (du2com5.eu.necel.com [172.29.24.35] (may be forged)) by relay51.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id r1LFVj48012334; Fri, 22 Feb 2013 00:31:45 +0900 (JST) Received: by julia (Postfix, from userid 2) id 219614E97D; Thu, 21 Feb 2013 16:31:45 +0100 (CET) Received: from du0smtp.eu.necel.com (unknown [172.29.24.86]) by julia (Postfix) with ESMTP id 1646E4E987; Thu, 21 Feb 2013 16:31:45 +0100 (CET) Received: from duacsls.ad.ree.renesas.com ([172.29.43.47]) by du0smtp.eu.necel.com (Lotus Domino Release 8.5.3 HF466) with ESMTP id 2013022116314329-122868 ; Thu, 21 Feb 2013 16:31:43 +0100 From: Phil Edworthy To: linux-mmc@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus , Simon , Guennadi Liakhovetski , Phil Edworthy Subject: [PATCH] mc: sh-mmcif: handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ again X-Mailer: git-send-email 1.7.5.4 X-TNEFEvaluated: 1 Message-id: <1361460678-9429-1-git-send-email-phil.edworthy@renesas.com> Date: Thu, 21 Feb 2013 15:31:18 +0000 X-MIMETrack: Itemize by SMTP Server on DU0SMTP/EE/NECEE(Release 8.5.3 HF466|March 09, 2012) at 21.02.2013 16:31:43, Serialize by Router on DU0SMTP/EE/NECEE(Release 8.5.3 HF466|March 09, 2012) at 21.02.2013 16:31:45, Serialize complete at 21.02.2013 16:31:45 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Upon completion of a MMC_WRITE_MULTIPLE_BLOCK command MMCIF issues an IRQ with the BUFREN or BUFWEN bits set and often with one or several of CMD12 bits set. If those interrupts are not acknowledged, an additional interrupt can be produced and will be delivered later, possibly when the transaction has already been completed. To prevent this from happening, CMD12 completion interrupt sources have to be cleared too upon reception of a BUFREN or BUFWEN IRQ. This is similar to commit 7a7eb328; this change adds the same handling for BUFREN and BUFWEN interrupts. Signed-off-by: Phil Edworthy --- Tested on Renesas Hurricane board with r8a7779 device, eMMC with DMA. drivers/mmc/host/sh_mmcif.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 9a4c151..59fa44e 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1199,10 +1199,14 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id) sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~INT_CRSPE); sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MCRSPE); } else if (state & INT_BUFREN) { - sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~INT_BUFREN); + sh_mmcif_writel(host->addr, MMCIF_CE_INT, + ~(INT_CMD12DRE | INT_CMD12RBE | + INT_CMD12CRE | 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_CMD12DRE | INT_CMD12RBE | + INT_CMD12CRE | INT_BUFWEN)); sh_mmcif_bitclr(host, MMCIF_CE_INT_MASK, MASK_MBUFWEN); } else if (state & INT_CMD12DRE) { sh_mmcif_writel(host->addr, MMCIF_CE_INT,