Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp658986lqs; Fri, 14 Jun 2024 01:28:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcsofy0aoRtQ3c7LucPBTV3h5vy7PJugE2rkkENWlBTdOzMXdQ3AwzNniDxbujx1A+a/BNXmEK+T9K8QH9pFH5f1F7rLtnGyUdCAy96A== X-Google-Smtp-Source: AGHT+IHgIArlwmRwbP1jZU+0dhP6T6krAESIglTro1UC9pharQciqQt4yPPE8tp6ixRTgN0QJfi3 X-Received: by 2002:a05:622a:11:b0:441:5612:21d5 with SMTP id d75a77b69052e-44216b1c996mr25886951cf.49.1718353721890; Fri, 14 Jun 2024 01:28:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718353721; cv=pass; d=google.com; s=arc-20160816; b=Bel8npxOcc8sLBDAAPKt+UF5r18m4ICekHrEa2DNC2a3PBVE2YN74KVdWmfR47qSTt AL8tttExGhS5JiUSb2yA2I4yOiwZBG/2UEZ55Oq1s3oiMcpfK1VdrBgdh2VvTwuY3FUw aStU0OhYmLfo8Grl4Hc5RehvnD7xF8OflqRtXscd8fvdeLJdhxMhzYxcMKiUcRO4UGK4 BwYK/PFGleHnK7AuEWmXmK1pi1TwBUzzzKCMY6uLJZCLtTEZ0VI+329Dnp6q2M8KAIx/ NM0H/YTpQ9lybXH6it95OwVjDqd70XbKV66dUKcSWaRcwFYgWu4G2GO1fXGIQ8p5BvQc 8z5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=SJ6FLWtrRAC0dkyiD9OW5DxELWRn8m2MGLWUw6jaQ/A=; fh=xmbyM3vzhukPMMqLDLr2mVX1h4gQ6OyYHYpKzTvz67o=; b=CS2Qt7OFfc7xGf9IBPLY6Xh+EDHKGOkOczWCnLqubWcasN5aHDO3G80IDg5Hs8lSUU zf89+YWrmcHIsuI0fGQxaiLYN3y7JlYkzriv6nfU3QzKsCV3Jy020GaDmvnTaWTEvXJR TDM2QMpqTny3hnFPntnA6iifAcH2370uuLf47Mi4qBoVBVPcBBY1d9WBc3F0/x6psHPO RDitWk1XkGa2+Ap5fbGv+SzeCEA4+BL7PLPMi18SvcluML3Ef8cWu2tcC3+R66LmoAQc fgwB7PhT99hnXjbU9BY3VFFFwBsPkh/Eze2lD5fjRTLyscb2t84l3facrveoHz4jPNmU SV0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jlXE9xfI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-441f2ea8e62si33812221cf.246.2024.06.14.01.28.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 01:28:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jlXE9xfI; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214551-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214551-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D14C71C20C3C for ; Fri, 14 Jun 2024 08:28:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FD4D18FC60; Fri, 14 Jun 2024 08:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jlXE9xfI" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 47CF21836DE; Fri, 14 Jun 2024 08:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718353713; cv=none; b=RD+EhWUoj5pDu0vZng+JPruKf8HSno/KYH9nBNrBHo6fsjhXQWm6sSuNfPPvF0ckdmI8MXboEaYzme28BnHOqrfy6Gwdf9j+MHqT3RuHCqdiZESCizE26GsIbTioOr41o9q556ZEcObgbiI2MSbCAa/BpZTHQ3uYaqnFMxXUuOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718353713; c=relaxed/simple; bh=3Wg/Po2Loo+reS1EmZmVGQq87fLm9QQsUXRnohnMAbo=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ZXS2K92ynMYmiey/nENXOAQ7i0z9+AkX698sEdqEfSWkcZpzg2b0y1YiuzFMDU0fWZIaQDj9lKAkOpH/8iHvndQzRyjTlqcGBS4BOOugYaxpUTm6JjBVnAU79+w0yEW5vzP04zG/TQup9QM4CpGwQw6rEWcj8Af1UsOldUdk1B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jlXE9xfI; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718353712; x=1749889712; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=3Wg/Po2Loo+reS1EmZmVGQq87fLm9QQsUXRnohnMAbo=; b=jlXE9xfIFYXggu501qbNu34pWBW9nmrLB12eHOLmLu6iE6Ao7Den987P uCKpNqnR0w+CI6EJKW+USZ7zgv70dXULhRDZ52sFLskhVKz77WVRYJNxE T+UYRYEhYkQXJIeNMATmIrFCiqNTwy/C8HV/l5pP8deUUgYzSoU2ZBNho J4aBst3ZTjfYHCL6eZ9MF3wwzxrQr0ZADnDw0fBrOnrDIy2qWR0bR9ELt pXZS41NMdZ9Fepl4AzD8ApLVg8cKJglaJc98NpkQRNapvEHomcrIIOvfa fWOPagzgjwBK1V3JDUuDk7dY6F5l+rVZdhkRXPa5L4T6oISLvERxKxYus g==; X-CSE-ConnectionGUID: J+2u2QbuS1SxhHTH0nmkRg== X-CSE-MsgGUID: 6750PwdgReOa7FkhwacaxQ== X-IronPort-AV: E=McAfee;i="6700,10204,11102"; a="15389740" X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="15389740" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 01:28:31 -0700 X-CSE-ConnectionGUID: lKJeMOyDStGEerfMw5hvrQ== X-CSE-MsgGUID: jcZo1bZjRxak9W8kutW/DA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="40398062" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.222]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 01:28:27 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 14 Jun 2024 11:28:23 +0300 (EEST) To: Udit Kumar cc: vigneshr@ti.com, nm@ti.com, Tony Lindgren , Greg Kroah-Hartman , Jiri Slaby , u.kleine-koenig@pengutronix.de, ronald.wahl@raritan.com, thomas.richard@bootlin.com, tglx@linutronix.de, LKML , linux-serial Subject: Re: [PATCH] serial: 8250_omap: Implementation of Errata i2310 In-Reply-To: <20240614061314.290840-1-u-kumar1@ti.com> Message-ID: <9ed7e96a-c538-aac1-5b52-b7b1d72bb6a0@linux.intel.com> References: <20240614061314.290840-1-u-kumar1@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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). > + 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); -- i.