Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1097435rdb; Fri, 20 Oct 2023 08:21:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjM7qebzJtlina4tlgwxAvJx0XAvMPVOOWmQacmVufgtHtaFgnF2RsFFpB9tJ3PGTmN/S3 X-Received: by 2002:a05:6870:818f:b0:1e9:b0be:d004 with SMTP id k15-20020a056870818f00b001e9b0bed004mr2802086oae.47.1697815274180; Fri, 20 Oct 2023 08:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697815274; cv=none; d=google.com; s=arc-20160816; b=cFTFkcZrwL2ZV7Gr5vX7bK/WO+8YJs7T1T9XDavo/CME2Yv4/v80rcOsdUevpk19Zn x/zPK3mOt8al3te0ux5BfS5EZi1ArJi1ORoxAsypEdXzL3Qb431PvlRBIprVLUFxD/mw SaaOrGTZdh7wyYe2/UackZ14o1dlqMq0upA/Z/WovD/A2Xb8XA6mbTRCLo3uE45x4/Rm WgSsDYLaPITYRll5kKMAnl2sU8i8JR5kqx64NrEQYOebAZPJXXkSsNGDtIwlacFA0No5 K2xCP7yzjCKqG+NamCAeJB4e2HZkumu0KpSuq5jBCJPw6aMdAt1CR4z1UESEqamqjx6Q knvA== 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=oaHjuPcslWN24KOkrEWK0l5r712keu9E2N1sB5NoPOs=; fh=vmwpRCMd/vD6zsuGfLRTbF+XquoH9u4y8mF/Y/1+7KA=; b=eh4AH9XQDE0JIddHkCm700jAHHLaMKGdA3z96dLhjjn1vvjA+tpTX5VVjPik92y+QZ LMCBnoCMWH4iRhpV5NGco2fEHT3GA40cnL13AX++Q5/nKiyitaWfB1zfdjkjAsmTKm0a MESNPnSkCXkBctRSlTsTRsduMOY2hI06Y3YVuAMPStve326VCCnUtvKzicrZ73gUW6UW rV7IkdxzAQU5XtMEEQzgKHXjtllyB1O48EBR7plWcl2YrSOHmlEA0erW9PI6VPkuA/hs giakCBRBTexPiQQH5QooLiXB9DbV5brPGJIsWECDRA4IeoKegDcj/hC4gkEZO7ZV7+am egIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Fe+FfZGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s12-20020a63f04c000000b005824bad8f83si1984641pgj.846.2023.10.20.08.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 08:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Fe+FfZGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id CE923808E547; Fri, 20 Oct 2023 08:20:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377669AbjJTPUO (ORCPT + 99 others); Fri, 20 Oct 2023 11:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377620AbjJTPUL (ORCPT ); Fri, 20 Oct 2023 11:20:11 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F9E1A3 for ; Fri, 20 Oct 2023 08:20:09 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8A0F0E0009; Fri, 20 Oct 2023 15:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697815207; 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=oaHjuPcslWN24KOkrEWK0l5r712keu9E2N1sB5NoPOs=; b=Fe+FfZGaDRfcO7OxSpnI7HBHq7pQthX5q1wmELp/2TZ6CBB/BSEsazaWzWmcdM+MsLXzbb tpnZ6nvC76Bz/OIBqfIaIfRJd8qI1EE+dx2Kk5mY9KZ9qpBoWbNQzSoTuXIFPfjp3DiUJp r1VMfnXib18izsQDF4BpRubDCSQYlDe9WiUdZ2r0/gbpHt8g8SbGtdy8o4RuNvtsMgpTq5 373/zLtnSo+Caz8d3a+Yx058Mf59Lj7KVWms57EglSS1+nBkvqL5nE7cnEL4kWFhMOHOav wVsfU1yaDInUxUJYJ2vR3lZVX5ZlAGBHzCPihp906pKce+SidNAM/DLo3ysA1g== Date: Fri, 20 Oct 2023 17:20:06 +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: <20231020172006.5de0998b@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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 08:20:24 -0700 (PDT) X-Spam-Level: * Hi Frank, Frank.li@nxp.com wrote on Fri, 20 Oct 2023 10:47:52 -0400: > On Fri, Oct 20, 2023 at 04:35:25PM +0200, Miquel Raynal wrote: > > 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: MS= TATUS 0x020090c7, MERRWARN 0x00100000 > > > > > > >=20 > > > > > > > BIT 20: TIMEOUT error > > > > > > > The module has stalled too long in a frame. This happens wh= en: > > > > > > > - The TX FIFO or RX FIFO is not handled and the bus is stuc= k 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 than > > > > reporting it without handling it. Instead of totally ignoring this I > > > > would at least write a debug message (identical to what's below) be= fore > > > > returning false, even though I am not convinced unconditionally > > > > returning false here is wise. If you fail a hardware sequence becau= se > > > > 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, however, > > > > this bit gets set after the whole sequence, and this is just a "bus > > > > 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 > >=20 > > In any case we should probably lower the log level for this error. =20 >=20 > Only SVC_I3C_MERRWARN_TIMEOUT is warning >=20 > Maybe below logic is better >=20 > if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) { > dev_dbg(master->dev,=20 > "Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x= \n", > mstatus, merrwarn); > return false; > }=20 > =09 > dev_err(master->dev, =20 > "Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", > mstatus, merrwarn);=20 > .... >=20 Yes, this looks better but I wonder if we should add an additional condition to just return false in this case; something saying "this timeout is legitimate and has no impact". Thanks, Miqu=C3=A8l