From patchwork Fri Feb 28 12:52:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime COQUELIN X-Patchwork-Id: 25539 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1AC0120567 for ; Fri, 28 Feb 2014 12:53:32 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id v1sf1493968yhn.2 for ; Fri, 28 Feb 2014 04:53:32 -0800 (PST) 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:subject:date :message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=GPk4Qcm4zKhmCeYZ1muMJpNIxN2OXMe6Z8II4w6xxDk=; b=N3PvdkFXALWvMujQ5RUpjcgHvfAuG95orPTCnsumtgZgeerbuLJULPeF6jZWvtF3rr UFJHzU7dP0/ZX4byPTUF53zKgmlzWOqHVK/4gwOd5agpXVyuwpU1RFg16q2RcZDAk9XA PWHFKYIt25n7PrktMfEaq8S9FUizWWWdewTDvfnmw+6WHZ85kfjK7UaIW3Zirpg+0KOw u+ZPMC5TS/jI7EvPUF0YphYjVK7BzBBd76hgBtLZdJhkphypsna46us1RJABrCpKwryC uq02kmiVy7bjvLNh8hvExkgRnyMprtv6KypXCjvOGX4Aqx5zGmGcEQ7s2RUvmOLhVZrI vcGA== X-Gm-Message-State: ALoCoQkvcJXBRPA5pfscfiSFwtsh6WbcEjcAlBdPbJXs+r6S4fS7uDAnyJQ2ZOG26Tfo8ALpZsbD X-Received: by 10.52.187.41 with SMTP id fp9mr7240891vdc.5.1393592012644; Fri, 28 Feb 2014 04:53:32 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.200 with SMTP id k66ls1181134qge.85.gmail; Fri, 28 Feb 2014 04:53:32 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr2476192vco.18.1393592012549; Fri, 28 Feb 2014 04:53:32 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id u5si228850vdo.43.2014.02.28.04.53.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 04:53:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if11so652797vcb.36 for ; Fri, 28 Feb 2014 04:53:32 -0800 (PST) X-Received: by 10.58.49.129 with SMTP id u1mr2529327ven.0.1393592012446; Fri, 28 Feb 2014 04:53:32 -0800 (PST) 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.220.130.193 with SMTP id u1csp51617vcs; Fri, 28 Feb 2014 04:53:32 -0800 (PST) X-Received: by 10.68.241.198 with SMTP id wk6mr3307201pbc.11.1393592011662; Fri, 28 Feb 2014 04:53:31 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wm7si1974370pab.86.2014.02.28.04.53.31; Fri, 28 Feb 2014 04:53:31 -0800 (PST) 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 S1751661AbaB1Mxa (ORCPT + 3 others); Fri, 28 Feb 2014 07:53:30 -0500 Received: from eu1sys200aog117.obsmtp.com ([207.126.144.143]:47139 "EHLO eu1sys200aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbaB1Mx3 (ORCPT ); Fri, 28 Feb 2014 07:53:29 -0500 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKUxCGxr8aScztR/aQwDDZOredF/DX3c+G@postini.com; Fri, 28 Feb 2014 12:53:29 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E363218; Fri, 28 Feb 2014 12:53:12 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 279D215888; Fri, 28 Feb 2014 12:53:12 +0000 (GMT) Received: from lmenx29l.st.com (lmenx29l.lme.st.com [10.201.23.80]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BYI96479 (AUTH lme00137); Fri, 28 Feb 2014 13:52:57 +0100 From: Maxime COQUELIN To: Wolfram Sang , Maxime Coquelin , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, srinivas.kandagatla@st.com, kernel@stlinux.com Subject: [PATCH] drivers: i2c: i2c-st: Fix return in case of arbitration lost Date: Fri, 28 Feb 2014 13:52:56 +0100 Message-Id: <1393591976-10771-1-git-send-email-maxime.coquelin@st.com> X-Mailer: git-send-email 1.9.0 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: maxime.coquelin@st.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , This patch fixes the error returned to the i2c_transfer function to -EAGAIN in case of arbitratin lost, so that the retry mechanism can be used. Signed-off-by: Maxime Coquelin --- drivers/i2c/busses/i2c-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c index 9cf715d..8720161 100644 --- a/drivers/i2c/busses/i2c-st.c +++ b/drivers/i2c/busses/i2c-st.c @@ -574,7 +574,7 @@ static irqreturn_t st_i2c_isr_thread(int irq, void *data) writel_relaxed(it, i2c_dev->base + SSC_IEN); st_i2c_set_bits(i2c_dev->base + SSC_I2C, SSC_I2C_STOPG); - c->result = -EIO; + c->result = -EAGAIN; break; default: