From patchwork Tue Aug 13 09:11:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 266760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 82A5A2C00F3 for ; Tue, 13 Aug 2013 19:13:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195Ab3HMJNk (ORCPT ); Tue, 13 Aug 2013 05:13:40 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:44828 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756058Ab3HMJNj (ORCPT ); Tue, 13 Aug 2013 05:13:39 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so4614812pdj.3 for ; Tue, 13 Aug 2013 02:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EeQ/QG63fvv2uj5CXg29204CiGsDjQQyCXnEmv632yo=; b=F/eKeSNaHwUJgc6ItcdrD+r1n8Pf29icX/H16OCY7R252x3p/0I0QZlRFOsobZ6dbX afj4lOHGVJHJB1Ch2AfpHhkrAXJj0I4wO5uixH1Fm2d/yDCc/n3R/Z3lq2McbmXsXjLo x3mKdXpYqFrsGwnqGvSr1Nh+nc5aqu1jn8wjUba4sGusDSaK1qDxHDKjtfhS+Pg5s02n fKt4XT3TuV+JdKH1+anKuS5/xdvkooCg7t1X8YgzBnXEELFLd4Pq/+P2mq7/9Ahg1Ebr W/KzV5F1ssN+8dU/aANE0fUwDqHKCl8qNjagMImElIQnnnjomQ/R+TYHoB4aiLPiuc3o ygXw== X-Received: by 10.66.122.41 with SMTP id lp9mr3521443pab.6.1376385219487; Tue, 13 Aug 2013 02:13:39 -0700 (PDT) Received: from localhost.localdomain ([117.136.8.11]) by mx.google.com with ESMTPSA id mz5sm11805828pbc.18.2013.08.13.02.13.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 02:13:38 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: wsa@the-dreams.de, linux-i2c@vger.kernel.org Cc: workgroup.linux@csr.com, Zhiwu Song , Barry Song Subject: [PATCH 5/5] i2c: sirf: retry 3 times as sometimes we get random noack and timeout Date: Tue, 13 Aug 2013 17:11:31 +0800 Message-Id: <1376385091-30597-6-git-send-email-Baohua.Song@csr.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1376385091-30597-1-git-send-email-Baohua.Song@csr.com> References: <1376385091-30597-1-git-send-email-Baohua.Song@csr.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Zhiwu Song let i2c core retry 3 times as sometimes we get random noack and timeout even when we access an existing i2c client. Signed-off-by: Zhiwu Song Signed-off-by: Barry Song --- drivers/i2c/busses/i2c-sirf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c index d2b7913..90adc2d 100644 --- a/drivers/i2c/busses/i2c-sirf.c +++ b/drivers/i2c/busses/i2c-sirf.c @@ -230,7 +230,7 @@ static int i2c_sirfsoc_xfer_msg(struct sirfsoc_i2c *siic, struct i2c_msg *msg) while (readl(siic->base + SIRFSOC_I2C_CTRL) & SIRFSOC_I2C_RESET) cpu_relax(); } - return siic->err_status ? -EIO : 0; + return siic->err_status ? -EAGAIN : 0; } static u32 i2c_sirfsoc_func(struct i2c_adapter *adap) @@ -334,6 +334,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) adap->algo = &i2c_sirfsoc_algo; adap->algo_data = siic; + adap->retries = 3; adap->dev.of_node = pdev->dev.of_node; adap->dev.parent = &pdev->dev;