From patchwork Wed Oct 24 10:58:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinya Kuribayashi X-Patchwork-Id: 1637571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 23B0E3FD4E for ; Wed, 24 Oct 2012 11:00:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQyfY-0005Lf-Ij; Wed, 24 Oct 2012 10:58:41 +0000 Received: from relmlor1.renesas.com ([210.160.252.171]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQyfS-0005H7-11 for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 10:58:35 +0000 Received: from relmlir4.idc.renesas.com ([10.200.68.154]) by relmlor1.idc.renesas.com ( SJSMS) with ESMTP id <0MCE0056695JYJ20@relmlor1.idc.renesas.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 19:58:31 +0900 (JST) Received: from relmlac1.idc.renesas.com ([10.200.69.21]) by relmlir4.idc.renesas.com ( SJSMS) with ESMTP id <0MCE00BH595JDPA0@relmlir4.idc.renesas.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 19:58:31 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 3CD4E80193; Wed, 24 Oct 2012 19:58:31 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 377D680177; Wed, 24 Oct 2012 19:58:31 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id VAH14819; Wed, 24 Oct 2012 19:58:31 +0900 X-IronPort-AV: E=Sophos; i="4.80,639,1344178800"; d="scan'208"; a="103296596" Received: from unknown (HELO [10.161.64.55]) ([10.161.64.55]) by relmlii1.idc.renesas.com with ESMTP; Wed, 24 Oct 2012 19:58:31 +0900 Message-id: <5087C9D7.1040108@renesas.com> Date: Wed, 24 Oct 2012 19:58:31 +0900 From: Shinya Kuribayashi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-version: 1.0 To: w.sang@pengutronix.de, ben-linux@fluff.org, magnus.damm@gmail.com Subject: [PATCH 5/5] i2c: i2c-sh_mobile: fix spurious transfer request timed out References: <5087C93F.6080601@renesas.com> In-reply-to: <5087C93F.6080601@renesas.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Ensure that any of preceding register write operations to the I2C hardware block reached the module, and the write data is reflected in the registers, before leaving the interrupt handler. Otherwise, we'll suffer from spurious WAIT interrupts that lead to 'Transfer request timed out' message, and the transaction failed. Tracked-down-by: Teppei Kamijou Signed-off-by: Shinya Kuribayashi --- drivers/i2c/busses/i2c-sh_mobile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 4c28358..9411c1b 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -469,6 +469,9 @@ static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) wake_up(&pd->wait); } + /* defeat write posting to avoid spurious WAIT interrupts */ + iic_rd(pd, ICSR); + return IRQ_HANDLED; }