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: 6610271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6399B9F326 for ; Mon, 15 Jun 2015 15:57:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 987A62060C for ; Mon, 15 Jun 2015 15:57:52 +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 B61632060A for ; Mon, 15 Jun 2015 15:57:50 +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 1Z4WjL-0001sy-1h; Mon, 15 Jun 2015 15:55:23 +0000 Received: from mail-pa0-f45.google.com ([209.85.220.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4Whq-0008Vt-EW for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2015 15:53:51 +0000 Received: by pabqy3 with SMTP id qy3so67901531pab.3 for ; Mon, 15 Jun 2015 08:53:29 -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=cnc9GqmoDhGy5mNf1YuK3NHwU1pPCIcVNge6Qw0Sy5E=; b=KSitIo3vclBXekUOynJaDamVVfGM7ccur0NlbYwr04sxG1h6dsKsvP/x5lgkhmUbIp oCRz/5LzqvKskWtmXMveB6qyHkN3fs76B0w6yZv/h6jNx5hDjCUGppSWIo4GDSEWoKvV eUeFgr+JalPc+qAvidbkRoiac/fFNBPB41YCWwki/1leEtO0GVkpr6SrpZg/KmuOu5g0 CYbpJIwx2ciKMCbpiQhdddoG6MzST3KbyL/kgwRx5ELOzRwz24RAeQjhEZ/ftAzlEJjI JGah4CYAg4Bi9FAiqh8w6FOnpFa6xa0klMtdJ9UQfLKUuG8CfDl+X/N9HJ2v0cvobWqd oLRw== X-Gm-Message-State: ALoCoQkHVn4K3l4VfYARlSBeDvObbdw0vkAzIhQVQTw+psbBdIwIEnYChnqGpnoP2cJl24hM6R+F 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150615_085350_585540_30F62FF8 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: "Jett.Zhou" , robert.jarzmik@free.fr, Vaibhav Hiremath , linux-arm-kernel@lists.infradead.org, wsa@the-dreams.de 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.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 --- 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; }