Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp690974lqs; Fri, 14 Jun 2024 02:50:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQl/iCg0EKDY1j786V4ZmqY6JL72COag9dnSxDVpzvxFCM58i0wH2PNyH9fOd+K5RgDetKgdCson0WY8ynw9pf1CNNuPhoLcs6KGau1A== X-Google-Smtp-Source: AGHT+IGefkF6hukH3Qp0oJcXBegfEHRFcXcy4lFlY1MXJ8/wzXKW4Ln7LdquN0TiYCXEVUY2m9yx X-Received: by 2002:a05:6512:3a6:b0:52c:8f4e:b1c9 with SMTP id 2adb3069b0e04-52ca6e6712dmr1493647e87.15.1718358613722; Fri, 14 Jun 2024 02:50:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718358613; cv=pass; d=google.com; s=arc-20160816; b=M6jOoa+tcyBgkhvJClSdIb6f4T+XRPWUEF4U5B4jxKzY64C8zb8EZiWekAQoFqiRVK MkBy1KtbkM6SoepCoeVefXGjiT7/b5iXMkguh53kU5EYbT2QFjnj5DEnLYpmDF0/BKzh O+82wWUTNcWPc1B04VB/mC2WxdG75KWCklPAJC0VDB2164RUu7EUP5bMMaDHH1p86IOC j2xrp52r2mJozwAXyYIiuviMZSIUAxVmQCSljSY0oHwgUkwgaP7yJUb/BLxBH4M7njOx FRDwEiSLfAQKir8uYypInlH75iTWIEE5hBHnBausKmoYvVWzKVktlIT98bI7Y3S7F1mx //zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=+NFx58AC1+71lCRJDZfMbX16MlBwFV95gQE5TWMIO4Q=; fh=7VrH2AzEvwOJej8qTnHFMN/RtvBwfVch6hwv+Vvs2IU=; b=0OO357PI5zgeG22bs3ige2/FCWnusvKmxH8eQyWmm4Q3QGoM+FEor0LkmWlguntYdI Gut1jmOEKMUFeWC3S9qsrXeMF3E5NddbYqZWeQhrp920SSKeD+iEteKBwscBGSdnS77c FggQZc7I7ewGf61TuGXaupPbDexPjIHIULa+vvbvpSSqql+9q5KmhoYgp2Pgu8N+M56k mR/WRGg4T2QaQtGZOYL/vXLTl/9TeHfN9QFG/jKsox/Vz/5IoFGH73PnthDUjQKJ8jvf nWU74kdYqwW+vit9KtS6AqsMr5EzOfeWtQyPWZPL3BGeN1iO6GLg0VAL5XHn5ikubknq HweA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PFpSLKrJ; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-214649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e2636csi151895366b.726.2024.06.14.02.50.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 02:50:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PFpSLKrJ; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-214649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C4DE21F24148 for ; Fri, 14 Jun 2024 09:38:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ED19192B62; Fri, 14 Jun 2024 09:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="PFpSLKrJ" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73075146D60; Fri, 14 Jun 2024 09:38:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718357930; cv=none; b=CARVsPWt0iXfv7Ux+EY/sonJg6+K+r9OS7MuhKVHuFajCymaf5xmzGYTxYDp+tbdq5g6H8h2THbiEsSLoh8DLSkp2Va1uLYeywv4TSsWtNj2H2ujrszqn1kot4XjISMYRVB72wMPD1Tg1PQ2C3cmRvGIZ3fKyjDiKeysw5GiHiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718357930; c=relaxed/simple; bh=kW+SCAQawYl8bZMtdCDZoUjYRzo1vwUwV0SeNPSeCSM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ZN5ESiE72h9Iq7jdkXgwLcR/Tohq3EjULAj0992bwU5d0r+xpf6/EMX1r/Guh9FYFNL+DpTv+KjYMeU1fZ5VYea6NaUgGueVNwcX0FpgFbAT15Fmv41fzUja+CKFXk1mLsDQSPoSEPM5gqKUMS4DXzyXgs3uaiICgs/n7fPBjgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=PFpSLKrJ; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45E9cGDA028195; Fri, 14 Jun 2024 04:38:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718357896; bh=+NFx58AC1+71lCRJDZfMbX16MlBwFV95gQE5TWMIO4Q=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=PFpSLKrJELc6ngh9c31BMZPkzItAmQU/yGRdFI0BrL9B5R52McQnNTkKvICmf2lTY NVWFOjRShlhjanbrzF+WWOO37xHRBu7LEzhl/fb2MoSG1td2KqXaIkmT4QixJm8M6S c4JOQSBztuqwXcupkcaIda2IKNlUZlhiLPGcqyvw= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45E9cGfa019267 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Jun 2024 04:38:16 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 14 Jun 2024 04:38:15 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 14 Jun 2024 04:38:15 -0500 Received: from [172.24.18.200] (lt5cd2489kgj.dhcp.ti.com [172.24.18.200]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45E9cCJh106972; Fri, 14 Jun 2024 04:38:12 -0500 Message-ID: Date: Fri, 14 Jun 2024 15:08:11 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] serial: 8250_omap: Implementation of Errata i2310 To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= CC: , , Tony Lindgren , Greg Kroah-Hartman , Jiri Slaby , , , , LKML , linux-serial References: <20240614061314.290840-1-u-kumar1@ti.com> <9ed7e96a-c538-aac1-5b52-b7b1d72bb6a0@linux.intel.com> Content-Language: en-US From: "Kumar, Udit" In-Reply-To: <9ed7e96a-c538-aac1-5b52-b7b1d72bb6a0@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 6/14/2024 1:58 PM, Ilpo Järvinen wrote: > On Fri, 14 Jun 2024, Udit Kumar wrote: > >> As per Errata i2310[0], Erroneous timeout can be triggered, >> if this Erroneous interrupt is not cleared then it may leads >> to strom of interrupts, therefore apply Errata i2310 solution. >> >> [0] https://www.ti.com/lit/pdf/sprz536 page 23 >> >> Signed-off-by: Udit Kumar >> --- >> drivers/tty/serial/8250/8250_omap.c | 25 ++++++++++++++++++++----- >> 1 file changed, 20 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c >> index 170639d12b2a..38eb639f78d3 100644 >> --- a/drivers/tty/serial/8250/8250_omap.c >> +++ b/drivers/tty/serial/8250/8250_omap.c >> @@ -115,6 +115,10 @@ >> /* RX FIFO occupancy indicator */ >> #define UART_OMAP_RX_LVL 0x19 >> >> +/* Timeout Low and High */ >> +#define UART_OMAP_TO_L 0x26 >> +#define UART_OMAP_TO_H 0x27 >> + >> /* >> * Copy of the genpd flags for the console. >> * Only used if console suspend is disabled >> @@ -663,13 +667,24 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) >> >> /* >> * On K3 SoCs, it is observed that RX TIMEOUT is signalled after >> - * FIFO has been drained, in which case a dummy read of RX FIFO >> - * is required to clear RX TIMEOUT condition. >> + * FIFO has been drained or erroneously. >> + * So apply solution of Errata i2310 as mentioned in >> + * https://www.ti.com/lit/pdf/sprz536 >> */ >> if (priv->habit & UART_RX_TIMEOUT_QUIRK && >> - (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT && >> - serial_port_in(port, UART_OMAP_RX_LVL) == 0) { >> - serial_port_in(port, UART_RX); >> + (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT) { >> + unsigned char efr2, timeout_h, timeout_l; >> + >> + efr2 = serial_in(up, UART_OMAP_EFR2); >> + timeout_h = serial_in(up, UART_OMAP_TO_H); >> + timeout_l = serial_in(up, UART_OMAP_TO_L); >> + serial_out(up, UART_OMAP_TO_H, 0xFF); >> + serial_out(up, UART_OMAP_TO_L, 0xFF); >> + serial_out(up, UART_OMAP_EFR2, 0x1); > Eh, this doesn't match the workaround in the errata??? > > Also, don't use literals but name the bits with defines (for the correct > bit there's probably a pre-existing define but it's not named as good as > it could be, I'd say it should be named as > UART_OMAP_EFR2_TIMEOUT_PERIODIC). Thanks, will address in v2. > >> + serial_in(up, UART_IIR); >> + serial_out(up, UART_OMAP_EFR2, efr2); >> + serial_out(up, UART_OMAP_TO_H, timeout_h); >> + serial_out(up, UART_OMAP_TO_L, timeout_l);