Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1100287rdb; Fri, 20 Oct 2023 08:25:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHKvk6AwHFRqYHF1r/v+/U5Af35gPFOQ5tLTNu3mb4rTKeq1vtuvZxFyxdeoVq00jo2WgA X-Received: by 2002:a05:6a20:748e:b0:171:c88a:891e with SMTP id p14-20020a056a20748e00b00171c88a891emr2197341pzd.55.1697815540086; Fri, 20 Oct 2023 08:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697815540; cv=none; d=google.com; s=arc-20160816; b=tUlG2qnH+zuS4rO82+uSTBd77TFI9n3k1m3xsLCQRftIZwWzeRsJ9Yi5jQ372uOgrn wnR1pPINrPHT9L17t5MotQ7UjixnRd3yX3ZPrHrn4KCA7wtuwZwNr1VqZwRKLm6B57v9 6RkKu/Lxe7Z67m7fSLbI7VyOew58LkqCXzHVbAJAW7uMUp8t9f+ZBiZ2Cfrs9Q+9sC+A GlpgdkuFRhvBp1egqszr/1Oi2KBFS8N6MDmPV5CzQZs7voH+28IZDpL0aJyzmjSBv+O6 oX2pe+2x7ICG5AyO551sy7hCAanusDGn66MJ4E7X9w16d4+oQy5yYeglNN4jQsSuYcdY xk7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=vwbCNNZfs9RqfccAPlfkHKG0MKObWZhmJcj/5vJiL7Q=; fh=vmwpRCMd/vD6zsuGfLRTbF+XquoH9u4y8mF/Y/1+7KA=; b=gAWw8zZ0ev2EZWm0iGEIRyR9ycTnHvRNTyWFfCDTumlabeqv1VC54ibCowit87zpV4 qo5EH3OsKaLX7jRqFZjhvoZNmhKFOa6Iq/GJjF9wmyILIxmfHr6mLIo2lBNXPT5TGtjD PlgF+z4eoDfXQrIPGiWcDRWs8uqHdJh7NPYq/NPmSSFE2Mzclc0Srr8rhoZk5XD5ZFgY +rIoOXdGlLa0/6Y2S0InW7CemkiSBRnmq4e6Fcu9HCIhcMXAmkMkYm19uDhkqap6faOZ gGxaUiRgmq1rPxXzhQl5hYkuJwpQ4lhCv/4pJifXHJmN2F2Yd0UdWlMbk7s54pYTEGg8 KDsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TTHfJ/qw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id m129-20020a633f87000000b005859c3a51c0si2163968pga.421.2023.10.20.08.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 08:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TTHfJ/qw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 96756815C212; Fri, 20 Oct 2023 08:25:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377719AbjJTPZY (ORCPT + 99 others); Fri, 20 Oct 2023 11:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377721AbjJTPZW (ORCPT ); Fri, 20 Oct 2023 11:25:22 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23FC9D6A for ; Fri, 20 Oct 2023 08:25:16 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7408CFF80F; Fri, 20 Oct 2023 15:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697815514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vwbCNNZfs9RqfccAPlfkHKG0MKObWZhmJcj/5vJiL7Q=; b=TTHfJ/qwdJ0lc3+wOs0FQq0fHTPf0Gd2F+wMsOfyOY1nN1M+Uax9U1j5PgHftEzIY/0jn4 tQXKWHoWNMHBSgfTmG+qkWWO9TVCpul5N7GliVRWDPl/bOEeqDaD0+H9yUQHQkTdgcytEk HHHF6XyPs4s47mRNvDIL1BL74XHh+peqRmD6zdb9UXQWrPNtsycISvsrx1zUE4RkBQi2zK F7iITjJ5O18dzpn+q4Cjazfd8W9Cg4+RgXR+9e+xlRB69dzI3CReMpm1f8w2J7ZGwqouAF HWlOhzkZvKocViyLGsPLRwf298Xcut7AN+4ctCjk1cDBT/nmkLkhowPryWJyZA== Date: Fri, 20 Oct 2023 17:25:13 +0200 From: Miquel Raynal To: Frank Li Cc: alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 Resent 6/6] i3c: master: svc: fix random hot join failure since timeout error Message-ID: <20231020172513.43a99144@xps-13> In-Reply-To: References: <20231018155926.3305476-1-Frank.Li@nxp.com> <20231018155926.3305476-7-Frank.Li@nxp.com> <20231019084452.11fd0645@xps-13> <20231020160645.67e678ee@xps-13> <20231020163525.66485920@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=1.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SORTED_RECIPS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 08:25:37 -0700 (PDT) X-Spam-Level: * Hi Frank, Frank.li@nxp.com wrote on Fri, 20 Oct 2023 11:17:17 -0400: > On Fri, Oct 20, 2023 at 10:47:52AM -0400, Frank Li wrote: > > On Fri, Oct 20, 2023 at 04:35:25PM +0200, Miquel Raynal wrote: =20 > > > Hi Frank, > > >=20 > > > Frank.li@nxp.com wrote on Fri, 20 Oct 2023 10:18:55 -0400: > > > =20 > > > > On Fri, Oct 20, 2023 at 04:06:45PM +0200, Miquel Raynal wrote: =20 > > > > > Hi Frank, > > > > >=20 > > > > > Frank.li@nxp.com wrote on Thu, 19 Oct 2023 11:39:42 -0400: > > > > > =20 > > > > > > On Thu, Oct 19, 2023 at 08:44:52AM +0200, Miquel Raynal wrote: = =20 > > > > > > > Hi Frank, > > > > > > >=20 > > > > > > > Frank.Li@nxp.com wrote on Wed, 18 Oct 2023 11:59:26 -0400: > > > > > > > =20 > > > > > > > > master side report: > > > > > > > > silvaco-i3c-master 44330000.i3c-master: Error condition: = MSTATUS 0x020090c7, MERRWARN 0x00100000 > > > > > > > >=20 > > > > > > > > BIT 20: TIMEOUT error > > > > > > > > The module has stalled too long in a frame. This happens = when: > > > > > > > > - The TX FIFO or RX FIFO is not handled and the bus is st= uck in the > > > > > > > > middle of a message, > > > > > > > > - No STOP was issued and between messages, > > > > > > > > - IBI manual is used and no decision was made. =20 > > > > > > >=20 > > > > > > > I am still not convinced this should be ignored in all cases. > > > > > > >=20 > > > > > > > Case 1 is a problem because the hardware failed somehow. = =20 > > > > > >=20 > > > > > > But so far, no action to handle this case in current code. =20 > > > > >=20 > > > > > Yes, but if you detect an issue and ignore it, it's not better th= an > > > > > reporting it without handling it. Instead of totally ignoring thi= s I > > > > > would at least write a debug message (identical to what's below) = before > > > > > returning false, even though I am not convinced unconditionally > > > > > returning false here is wise. If you fail a hardware sequence bec= ause > > > > > you added a printk, it's a problem. Maybe you consider this line = as > > > > > noise, but I believe it's still an error condition. Maybe, howeve= r, > > > > > this bit gets set after the whole sequence, and this is just a "b= us > > > > > is idle" condition. If that's the case, then you need some > > > > > additional heuristics to properly ignore the bit? > > > > > =20 > > > >=20 > > > > dev_err(master->dev, = =20 > > > > "Error condition: MSTATUS 0x%08x, MERRWARN = 0x%08x\n", > > > > mstatus, merrwarn); > > > > + > > > > + /* ignore timeout error */ > > > > + if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) > > > > + return false; > > > > + > > > >=20 > > > > Is it okay move SVC_I3C_MERRWARN_TIMEOUT after dev_err? =20 > > >=20 > > > I think you mentioned earlier that the problem was not the printk but > > > the return value. So perhaps there is a way to know if the timeout > > > happened after a transaction and was legitimate or not? =20 > >=20 > > Error message just annoise user, don't impact function. But return false > > let IBI thread running to avoid dead lock. =20 >=20 > I forget mention one thing. Any error message here will make SDA low for > longer. Before emit stop, SDA is low. >=20 > I have not checked I3C spec yet about how long SDA will be allowed. it wi= ll > worser if message go through uart port. The bus will be locked longer. >=20 > It's better to print error message after emit_stop to reduce SDA low time. That's fine I guess. Thanks, Miqu=C3=A8l