Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4160047rwi; Mon, 17 Oct 2022 02:17:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UD4xwrgPrl9DMAcuTr9mH6R/fz2hBgllTz0BQE3/RV5fFhe+F1F+yaE6S9r6lB437B87x X-Received: by 2002:a05:6a00:b54:b0:566:917:e57e with SMTP id p20-20020a056a000b5400b005660917e57emr11595820pfo.26.1665998229718; Mon, 17 Oct 2022 02:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665998229; cv=none; d=google.com; s=arc-20160816; b=rqlTa/yx5R/3nzxorVFTWqcOSIQYwurI9XiRqMxL3b7l1XATgUyDbpo/VD5xxe3da4 Tba3kurf78SShSC7OguSDlUrFqqcSDI9nyTcuBAY7MuOeZ1UIQGMsxKdQD9lFPXVO1TD 3cSj0CE7jw0Ss+p+w9oFlk7Aqenh+EWR2l72bWhDaYWIpPdB8wUAHYsFMSPxwOqDT1+O EeDphClVbj+i4F+owYgCK7a5Vjk785B2QOlNnZAIGLU8Nkt7rMBF5SGl9rad4f4cIYLL +63ExtEq9rfYX5Butex61ref8jqaDNmJ5Ec/1pSHhRL88qXbjxNg39Hoj+JfI26jEOy2 IYgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=e3cvKWVDDXmSC/pi5fBn4+ZGRH5VYnyrxLgb7Uzgxnw=; b=Wbry6Qk+OCFh6ifk1sELtKKu+ald2EnWCjXLPsczZy3UpiQKPSLsE+kkRakLoUx8Cc bPPqzxenaQm3FaJ6lj2B0A4I8yG6zI2qKpIKzGjsQ3jaoAYmS3emm+y8ZBysHoU8Doai m55E8+/O5piEnVdWQYKRNg1ys3FbwspSyhhjrR9ysd8Yq884X50FyXjnbl75eGlUjxZt lO7OYajLtX1gzwGhqhVKy6PhYLdVkPteQ/n21PdOkuQzaKYcu0kSMWg2BM8D0E1NmzGb aI8G81f5QEd7/iNmol8YuLIO2cotE+38U7dytpXfFWbWxqArRfUaXTytK0NMGL2fvcGm wmQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nf2GJcpJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Yr3px8mY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a170902e85200b0017f77922b11si13584685plg.84.2022.10.17.02.16.57; Mon, 17 Oct 2022 02:17:09 -0700 (PDT) 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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nf2GJcpJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Yr3px8mY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbiJQJI4 (ORCPT + 99 others); Mon, 17 Oct 2022 05:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbiJQJIp (ORCPT ); Mon, 17 Oct 2022 05:08:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5217DCC8; Mon, 17 Oct 2022 02:08:44 -0700 (PDT) Date: Mon, 17 Oct 2022 11:08:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1665997722; 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=e3cvKWVDDXmSC/pi5fBn4+ZGRH5VYnyrxLgb7Uzgxnw=; b=nf2GJcpJytL/HFwfwuN82XbcEzOosVAqnmQbT+Ti4SBMWOLv89ns9xs5skIC8ffgnkNwTW XWJEnJkzFU6di9yby4JjM8SC4NAl9HveO149uSp+8Zwk5Kf/78x32SMPoizA6eem4tMP7u 9sd9i5WklPNxXGaAhQLSA1dHXyk/G1/xUfqMc70l6M9ZxjgcBEo9oqIZjRxgbTjnH89G1A v0L+azazxFRfX+NZ9AGh/bNL4AwLSOHiyEKTmJzIFPjBDwEqI5cPeOZQme/JwvC7qqm1+R zjMwAjknyBX/JXMy9jP1qvrHkwtB+xAPXJAOYlTtWpy1/XsccYZOOwaA+pzIWg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1665997722; 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=e3cvKWVDDXmSC/pi5fBn4+ZGRH5VYnyrxLgb7Uzgxnw=; b=Yr3px8mYGxJLV1EKNFbqUB2b3sGLhUz+mXR7RE3LdlJEq1bIDVrI2qmGis6BspKYYa9vMd yxzw1E8yz7q20cCQ== From: Sebastian Andrzej Siewior To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Matthias Schiffer , Greg Kroah-Hartman , Jiri Slaby , Tony Lindgren , Peter Hurley , linux-serial , LKML Subject: Re: [PATCH] serial: 8250_omap: remove wait loop from Errata i202 workaround Message-ID: References: <20221013112339.2540767-1-matthias.schiffer@ew.tq-group.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 2022-10-17 11:12:41 [+0300], Ilpo J=C3=A4rvinen wrote: > On Thu, 13 Oct 2022, Matthias Schiffer wrote: >=20 > > We were occasionally seeing the "Errata i202: timedout" on an AM335x > > board when repeatedly opening and closing a UART connected to an active > > sender. As new input may arrive at any time, it is possible to miss the > > "RX FIFO empty" condition, forcing the loop to wait until it times out. >=20 > I can see this problem could occur and why your patch fixes it. >=20 > > Nothing in the i202 Advisory states that such a wait is even necessary; > > other FIFO clear functions like serial8250_clear_fifos() do not wait > > either. For this reason, it seems safe to remove the wait, fixing the > > mentioned issue. >=20 > Checking the commit that added this driver and the loop along with it,=20 > there was no information why it would be needed there either. I don't remember all the details but I do remember that I never hit it. The idea back then was to document what appears the problem and then once there is a reproducer address it _or_ when there is another problem check if it aligns with the output here (so that _this_ problem's origin could be this). This was part of address all known chip erratas and copied from omap-serial at the time so that the 8250 does not miss anything. Looking closer, this is still part of the omap-serial driver and it was introduced in commit 0003450964357 ("omap2/3/4: serial: errata i202: fix for MDR1 access") If someone found a way to trigger this output which is unrelated to the expected cause then this is clearly not helping nor intended. I would prefer to keep the loop and replace the disturbing output with a comment describing _why_ the FIFO might remain non-empty after a flush. In worst cases that loop causes a delay of less than 0.5ms while setting a baud rate so I doubt that this is causing a real problem. Either way I would like to see Tony's ACK before this is getting removed as suggested in this patch. > Reviewed-by: Ilpo J=C3=A4rvinen >=20 > Thanks. Sebastian