From patchwork Mon Jun 15 15:49:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 49875 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5EB362159B for ; Mon, 15 Jun 2015 15:53:34 +0000 (UTC) Received: by wibdt2 with SMTP id dt2sf22415032wib.3 for ; Mon, 15 Jun 2015 08:53:33 -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=gomR0QP8WAsW/iHng7p6HvwaY+fozAYOMbXR39j15TM=; b=jkggnRAUWLWTdSu0Z2XWXmdWUQxn6I05oUXxELof/mufnXygInpA8FH5BcHL/BBePw igd0d9ryao6N8n5stCU7nq9TguE+71PKITK6ZXrKuOXHMx0BzxqtOqHlDxvycFlhIBZb F+5OBFw5bcDUUZmXQ3fozhe2hXSJrLZ/k0TzTuZ83mnLqn1+to8U+tecdXCRGjE3NoBe l6mkTweif0mXqn6sRlI0csKTpa2YJzjjSmtSVi+b1hyJ34zADjx9z0lne2vO4yzUxdHA 98v81KKtHdUUMjMg8GPE4WjIHeH0BukumT3XCRnMXZamvP6JSBCOKtZnUDVLj2Yykd1U Nn2g== X-Gm-Message-State: ALoCoQmD8VhOKydvIs5AhwnjOkkyXD/+lQSJg/JrpjNDAcEzIyzDQmQ/8dDFPCwaPI65grsCWhbj X-Received: by 10.112.118.162 with SMTP id kn2mr766609lbb.22.1434383613649; Mon, 15 Jun 2015 08:53:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.166 with SMTP id d6ls918163lag.54.gmail; Mon, 15 Jun 2015 08:53:33 -0700 (PDT) X-Received: by 10.112.151.178 with SMTP id ur18mr894225lbb.59.1434383613506; Mon, 15 Jun 2015 08:53:33 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id dz10si10795260lac.88.2015.06.15.08.53.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 08:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbwc1 with SMTP id wc1so4430753lbb.2 for ; Mon, 15 Jun 2015 08:53:33 -0700 (PDT) X-Received: by 10.112.155.197 with SMTP id vy5mr882057lbb.29.1434383613404; Mon, 15 Jun 2015 08:53:33 -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 hn6csp1508805lbb; Mon, 15 Jun 2015 08:53:32 -0700 (PDT) X-Received: by 10.66.141.203 with SMTP id rq11mr14575787pab.131.1434383611713; Mon, 15 Jun 2015 08:53:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si18495084pdr.64.2015.06.15.08.53.30; Mon, 15 Jun 2015 08:53:31 -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 S1755816AbbFOPxa (ORCPT + 1 other); Mon, 15 Jun 2015 11:53:30 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34213 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755812AbbFOPxa (ORCPT ); Mon, 15 Jun 2015 11:53:30 -0400 Received: by pacgb13 with SMTP id gb13so37928823pac.1 for ; Mon, 15 Jun 2015 08:53:29 -0700 (PDT) X-Received: by 10.66.66.166 with SMTP id g6mr50090585pat.157.1434383609520; Mon, 15 Jun 2015 08:53:29 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id fs16sm12662484pdb.12.2015.06.15.08.53.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jun 2015 08:53:28 -0700 (PDT) From: Vaibhav Hiremath To: linux-i2c@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, wsa@the-dreams.de, robert.jarzmik@free.fr, Vaibhav Hiremath , "Jett.Zhou" Subject: [PATCH-V2 04/12] i2c: pxa: Reset i2c controller on timeout in interrupt and pio mode Date: Mon, 15 Jun 2015 21:19:51 +0530 Message-Id: <1434383399-2370-5-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434383399-2370-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1434383399-2370-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.217.170 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 --- 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 632008f..edacfeb3 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -173,6 +173,8 @@ struct pxa_i2c { */ #define I2C_PXA_SLAVE_ADDR 0x1 +static void i2c_pxa_reset(struct pxa_i2c *i2c); + #ifdef DEBUG struct bits { @@ -750,6 +752,9 @@ out: ret = I2C_RETRY; } + if (ret < 0) + i2c_pxa_reset(i2c); + return ret; } @@ -816,6 +821,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; }