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: 49108 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF53C202A3 for ; Thu, 28 May 2015 13:06:58 +0000 (UTC) Received: by wgez8 with SMTP id z8sf10023475wge.2 for ; Thu, 28 May 2015 06:06:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=0+rH3RWCEVBGRvWDO6kzI2LeEgOF72U+GbapcaLPnuo=; b=O1a50vv+ZAVRwrcUF6VBx096UwZ7TkiWoOA9sOjWseBu8GVQi8GECNpKswGILwtald 87E1DPQXYCcjBgVVOYijqA2nbBRB1rzWFWq0rTGZA7zYD3L7F/BuvEfHd+hSZ5H5KKrE nEqKFnDk86aCgwDVsn1uSzbU3BNU9AyUxn2/G+Sfn3YqgDksfy98/Xcd6kE0wl7sJjB+ hJzz4i8i/fOqE26wMEdC1Ow++EiH845VzP0U4wnC8qavZoydqnB8QmZML78CVIMAZJ82 coJEbwME4xbDjWaFgeOgKp4dUFVk7eA//qFn1nJTXYhL7U9Svu1YISeTUveoKxuuLadE VOcA== X-Gm-Message-State: ALoCoQmlSZm2tLnGIE3fBnnCgcTkpmWOHoiqso4sWLNC2uRfeOoQAWF/4qYoue6u6Y4t+T7YeIer X-Received: by 10.112.29.39 with SMTP id g7mr2656465lbh.1.1432818418194; Thu, 28 May 2015 06:06:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.229 with SMTP id jf5ls175328lac.56.gmail; Thu, 28 May 2015 06:06:58 -0700 (PDT) X-Received: by 10.152.30.4 with SMTP id o4mr2619490lah.74.1432818418047; Thu, 28 May 2015 06:06:58 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id pd4si1922653lbc.40.2015.05.28.06.06.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 06:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by laat2 with SMTP id t2so31242266laa.1 for ; Thu, 28 May 2015 06:06:58 -0700 (PDT) X-Received: by 10.152.29.161 with SMTP id l1mr2692078lah.76.1432818417954; Thu, 28 May 2015 06:06:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1144500lbb; Thu, 28 May 2015 06:06:56 -0700 (PDT) X-Received: by 10.68.178.229 with SMTP id db5mr5400945pbc.17.1432818414667; Thu, 28 May 2015 06:06:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em5si3485083pbb.256.2015.05.28.06.06.53; Thu, 28 May 2015 06:06:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753624AbbE1NGx (ORCPT + 1 other); Thu, 28 May 2015 09:06:53 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:34528 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbbE1NGw (ORCPT ); Thu, 28 May 2015 09:06:52 -0400 Received: by pdbki1 with SMTP id ki1so41548781pdb.1 for ; Thu, 28 May 2015 06:06:52 -0700 (PDT) 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 Cc: Wolfram Sang , linux-arm-kernel@lists.infradead.org, Vaibhav Hiremath , "Jett.Zhou" 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> Sender: linux-i2c-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-i2c@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }