Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2538941rwb; Fri, 16 Dec 2022 03:32:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4oQHefQtvRYI7YTV2yZim0fg68Gq34e8qNcYL7DEf6pgKpm6g3kyzd758pEX51RoxjthvJ X-Received: by 2002:a17:903:2412:b0:188:82fc:e277 with SMTP id e18-20020a170903241200b0018882fce277mr34844107plo.12.1671190352859; Fri, 16 Dec 2022 03:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671190352; cv=none; d=google.com; s=arc-20160816; b=yoe4LbrUQZRbD35RCDzaULmAuOPOs2DKvwieMjF4qSS8Zl9asQRthMqEzSPdUVc8RB k5glasmkuLdzVRZuNxDtcjH9RXoccQuNAD7YqaJXOGLZjWzjex9aXktCgJLGfq8gVViG 3SMe7XIwY7h55ARxJ51f5SBLocoG3uBprgof691xTOjz3V78lAQtzDxZEbQO7xCdntYo UJL76nCZ2g2blPDMfCT+Whfy1VsrYhzTPhadP7EJ8T9x4p+Qj+Rp+25PSspwQey39ss/ LntEGMm6Q0v91tv4Xxd+wXTUeXXH/1sScESyXcp+o66tnD2LTBrfbCcPZW6db3r7j4k1 HwTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YiU78x0FzmcnNTf8Kb8EN1IT6tZx3rC57JdvYdF+MHk=; b=CVgeqbjUOV+aLvEFCShWcVIVb12MaemAR+YPxaP/8r/IL8zi9ZqB6ZVPKn3FxXeoEE AHBIYTuYQWmA75Ppu114Y6u9L0LUG+DF0mcb9roeb+D8YqodGm6whEn8eQY+fDi+mLiE n4T7mZJuaW0sBkXereYhJ/t5FWOnw5xLssIKYErqy1QeZ+uZFb0kKuxSmmGGnsILTU7f 5TILJMUt/BNwlLtpjPgJLU8JWn7AybwUw9mtcpA0dZSzN8G0ht5RFkVNNpN7+541oBN+ w/jnR1TAnlj2ra4/KUlFvsOH/cMsPdFI8qQGpwV7w2cLXHYBtSuwVLZDJ1zKOUOR7j9M e/cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709027e8200b00186a3bb7ae3si2225039pla.213.2022.12.16.03.32.23; Fri, 16 Dec 2022 03:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbiLPLCs (ORCPT + 68 others); Fri, 16 Dec 2022 06:02:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbiLPLCp (ORCPT ); Fri, 16 Dec 2022 06:02:45 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E9522BD2 for ; Fri, 16 Dec 2022 03:02:44 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p68U0-0001Mb-Uw; Fri, 16 Dec 2022 12:02:28 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1p68Tz-0003Yt-O1; Fri, 16 Dec 2022 12:02:27 +0100 Date: Fri, 16 Dec 2022 12:02:27 +0100 From: Oleksij Rempel To: Primoz Fiser Cc: Marco Felsch , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, upstream@lists.phytec.de Subject: Re: [PATCH] i2c: imx: increase retries on arbitration loss Message-ID: <20221216110227.GA12327@pengutronix.de> References: <20221216084511.2576786-1-primoz.fiser@norik.com> <20221216094518.bevkg5buzu7iybfh@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 16, 2022 at 11:41:08AM +0100, Primoz Fiser wrote: > Hi Marco, > > On 16. 12. 22 10:45, Marco Felsch wrote: > > Hi Primoz, > > > > On 22-12-16, Primoz Fiser wrote: > > > By default, retries value is set to 0 (no retries). Set retries to more > > > sensible value of 3 to allow i2c core to re-attempt transfer in case of > > > i2c arbitration loss (i2c-imx returns -EAGAIN errno is such case). > > > > apart the fact that the number of retries vary a lot and so the client > > driver behaviour can vary a lot which is not good IMHO, why do you think > > that 3 is a sufficient number? > > IMHO it is better than leaving it at 0 (no retries)? > > Setting it to sensible value like 3 will at least attempt to make transfer > in case arbitration-loss occurs. > > > > > If an arbitration loss happen, why do you think that retrying it 3 times > > changes that? > > I our case, setting retries to non-zero value solves issues with PMIC > shutdown on phyboard-mira which in some rare cases fails with "Failed to > shutdown (err = -11)" (-EAGAIN). > > To me it makes common sense retries is set to non-zero value especially for > such rare conditions/situations. https://lore.kernel.org/all/Ys1bw9zuIwWS+bqw@shikoro/ -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |