From patchwork Thu May 28 13:03:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 6498571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5774AC0020 for ; Thu, 28 May 2015 13:14:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D620205C4 for ; Thu, 28 May 2015 13:14:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21339205D8 for ; Thu, 28 May 2015 13:14:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yxxao-0008WV-8X; Thu, 28 May 2015 13:11:26 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxxWk-00054q-0f for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2015 13:07:17 +0000 Received: by paza2 with SMTP id a2so23313200paz.3 for ; Thu, 28 May 2015 06:06:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zZb6sQevCpXiLvTwr5HcEJQF2G/0DmrpDjw/X5ZPCFQ=; b=Q6Gy5WdIF1T7xp4+XBZqkwcFQIVogpcn+WUGsVuHJ9OiY6mYrek4HD4CxxdKkCQA6w 6025NlHHntLNNiem6G3RJD6uLvPOFFR+FkfxZM5+N0Sv2udIRBikKJXSos4zXHS4wq/i w1aquQ4auHJMSpQ/KQGVIx3/EPm00elFWsD/LRM4Kvmj8lHQGSiOUGvQj3Ix2o4hk4YB /RWB5M8UkZDgfpwAWyqVKlwApGXlI1wXH3v017ydiZGGyowulyV+hSnA7p8Eql63MlPU 3qLUwNX/Rt3e5BfyTtBOxhdcAz9vb4Z+gCP7YhiTK4WF6GgEnSlgBGUaCITsh71jGvto aCxA== X-Gm-Message-State: ALoCoQkQ3WKirYrMYudxaQINE/QRKETrA7xiWNHwppbKv0rFYkf9EEhGV0ky5KashVSp/0LMpzQI X-Received: by 10.68.204.229 with SMTP id lb5mr5285785pbc.139.1432818412231; Thu, 28 May 2015 06:06:52 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id dc5sm2392557pbc.53.2015.05.28.06.06.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 May 2015 06:06:51 -0700 (PDT) From: Vaibhav Hiremath To: linux-i2c@vger.kernel.org Subject: [PATCH 07/12] i2c: pxa: Reset i2c controller on timeout in interrupt and pio mode Date: Thu, 28 May 2015 18:33:39 +0530 Message-Id: <1432818224-17070-8-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150528_060714_151484_A77A04D4 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: "Jett.Zhou" , Vaibhav Hiremath , linux-arm-kernel@lists.infradead.org, Wolfram Sang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case of timeout during msg xfer assert reset to i2c controller for both interrupt and PIO mode of operation. Signed-off-by: Jett.Zhou [vaibhav.hiremath@linaro.org: Split & merge patches into logical changes and update the Changelog] Signed-off-by: Vaibhav Hiremath Signed-off-by: Vaibhav Hiremath --- drivers/i2c/busses/i2c-pxa.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 2777d5c..3c6ebb5 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -197,6 +197,8 @@ struct pxa_i2c { */ #define I2C_PXA_SLAVE_ADDR 0x1 +static void i2c_pxa_reset(struct pxa_i2c *i2c); + #ifdef DEBUG struct bits { @@ -846,6 +848,9 @@ out: ret = I2C_RETRY; } + if (ret < 0) + i2c_pxa_reset(i2c); + return ret; } @@ -912,6 +917,9 @@ static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num) } out: + if (ret < 0) + i2c_pxa_reset(i2c); + return ret; }