Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2648465rdb; Wed, 15 Nov 2023 06:57:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEw1p5ycinVIiM9CTFPtFWmHPMaJLzMEQZBSlvrkTd/Q3BgZ2aGp5GogA5/BcDt72Z01sSO X-Received: by 2002:a05:6a00:6c94:b0:6be:2dce:cf5a with SMTP id jc20-20020a056a006c9400b006be2dcecf5amr13256875pfb.26.1700060267993; Wed, 15 Nov 2023 06:57:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700060267; cv=none; d=google.com; s=arc-20160816; b=qD8vM3BFlYK/U6nBrnxMZgv3joSIp9nOKT3waGBHPDZIwU/lBXvQq1sdNzS4lA5cdy ixFENp6HogI7hzh28zLQnDpAwd3WcBV8Ii0abj1l03ggjKkKockFPbwpk2LCYvKQlCpE //04eRceDz8Tp5HRlliHXx6YshnZyva2tkS75x9PgLtjRBaUiWztuXA3TYAeZPM36JKL eJluZNCpnhyO5sz9XuaxyMsicUmm45gi3xvV8MYolb/32oqgA2Cd1o6K2tUcz9sY8Um6 gp+l0MpbAIq2x31oVER3YWOuLNvB4alCn2xT3CR7h19CLMw85bC062SaWWm2Xb4IdSkA 9qGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NU47uCHOCQo/Ai4D7JyNeeKPgQuQbJ2YjRyK4TagipY=; fh=nDYK0jER3/5rY4lFsoCAdXuf4pyu4bHffvW176Fr6To=; b=pRvsf484gqymwdbTnfzDw4rSg3G0P56fkvombRF1PN/NSSheV6usxUJd+DtAJ2tzEO DD7a6lboH4g1X5Zbh4aArttlHzZEc88WbIUahrKbSCCFoAl8lCuoYKJuUlLX2/2otqFk zDAD0SPqZPpErMbbvHxWqiROuSeZqp7WLu3XRc+RDRjDRay43kQPKDzsAh/O7KUdN5jM nGN1/xzPSkVeW92+MnMKgpvl8zSWXMRFSkUKqeIbWRO0KpYJbOwtQl1cVKwq8Qilhi6y grASLD4odnvj5UYj8Sti/5aWxcxHfPyVtA2/B5yPrHQr1/jCfUN/8Q4HTeUoMHjvitAQ Kyag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c12-20020aa7880c000000b006c0db523732si10005084pfo.136.2023.11.15.06.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:57:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 84F5C81CC860; Wed, 15 Nov 2023 06:57:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344288AbjKOO5q (ORCPT + 99 others); Wed, 15 Nov 2023 09:57:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344066AbjKOO5p (ORCPT ); Wed, 15 Nov 2023 09:57:45 -0500 Received: from mail.bugwerft.de (mail.bugwerft.de [IPv6:2a03:6000:1011::59]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A55DCA6; Wed, 15 Nov 2023 06:57:40 -0800 (PST) Received: from [192.168.178.97] (pd95ef485.dip0.t-ipconnect.de [217.94.244.133]) by mail.bugwerft.de (Postfix) with ESMTPSA id A9C40281578; Wed, 15 Nov 2023 14:57:38 +0000 (UTC) Message-ID: <549319d4-5da9-4eb0-abeb-6e63b3e26e3f@zonque.org> Date: Wed, 15 Nov 2023 15:57:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] serial: sc16is7xx: address RX timeout interrupt errata Content-Language: en-US To: Hugo Villeneuve Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, lech.perczak@camlingroup.com, u.kleine-koenig@pengutronix.de, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Maxim Popov , stable@vger.kernel.org References: <20231114074904.239458-1-daniel@zonque.org> <20231114102025.d48c0a6ec6c413f274b7680b@hugovil.com> <140280a6-1948-4630-b10c-8e6a2afec2de@zonque.org> <20231115094717.7541b01ec0c8a7f4006fcae6@hugovil.com> From: Daniel Mack In-Reply-To: <20231115094717.7541b01ec0c8a7f4006fcae6@hugovil.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:57:46 -0800 (PST) On 11/15/23 15:47, Hugo Villeneuve wrote: > On Tue, 14 Nov 2023 16:55:33 +0100 > Daniel Mack wrote: > >> Hi Hugo, >> >> On 11/14/23 16:20, Hugo Villeneuve wrote: >>> On Tue, 14 Nov 2023 08:49:04 +0100 >>> Daniel Mack wrote: >>>> This devices has a silicon bug that makes it report a timeout interrupt >>>> but no data in FIFO. >>>> >>>> The datasheet states the following in the errata section 18.1.4: >>>> >>>> "If the host reads the receive FIFO at the at the same time as a >>>> time-out interrupt condition happens, the host might read 0xCC >>>> (time-out) in the Interrupt Indication Register (IIR), but bit 0 >>>> of the Line Status Register (LSR) is not set (means there is not >>>> data in the receive FIFO)." >>>> >>>> When this happens, the loop in sc16is7xx_irq() will run forever, >>>> which effectively blocks the i2c bus and breaks the functionality >>>> of the UART. >>>> >>>> From the information above, it is assumed that when the bug is >>>> triggered, the FIFO does in fact have payload in its buffer, but the >>>> fill level reporting is off-by-one. Hence this patch fixes the issue >>>> by reading one byte from the FIFO when that condition is detected. >>> >>> From what I understand from the errata, when the problem occurs, it >>> affects bit 0 of the LSR register. I see no mention that it >>> also affects the RX FIFO level register (SC16IS7XX_RXLVL_REG)? >> >> True, the errata doesn't explicitly mention that, but tests have shown >> that the RXLVL register is equally affected. > > Hi Daniel, > ok, now it makes more sense if RXLVL is affected. > > Have you contacted NXP about this? If not, I suggest you do open a > support case and let them know about your findings, because it is very > strange that it is not mentioned in the errata. And doing so may led to > an updated and better documentation on their side about this errata. The errata is also wrong in other regards - the IIR register cannot yield 0xcc according to their own documentation. It also makes no suggestion on how to recover from that situation, which is common practice usually. We'll let them know through our FAE channels, but the latest datasheet for this chip was released over a decade ago, and I don't expect any update to the errata wording. > And incorporate this new info into your commit log for an eventual > patch V2. It makes no sense IMO to have all users of this chip suffer from an issue that was clearly identified to be present and which has an evident fix. Why would we do that? Thanks, Daniel