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: 1637521 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D2BE63FD4E for ; Wed, 24 Oct 2012 10:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758122Ab2JXK6l (ORCPT ); Wed, 24 Oct 2012 06:58:41 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:36341 "EHLO relmlor4.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932939Ab2JXK6k (ORCPT ); Wed, 24 Oct 2012 06:58:40 -0400 Received: from relmlir4.idc.renesas.com ([10.200.68.154]) by relmlor4.idc.renesas.com ( SJSMS) with ESMTP id <0MCE006EC95JPU10@relmlor4.idc.renesas.com>; 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>; 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 Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org 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> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.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; }