Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1716727pxj; Wed, 19 May 2021 12:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhgEbnX7iRdqzfL/l/jPSgmE2W85ciCozX0nP32nzrd3En+Pqv5LLHcfGvsOBI72qT4Jwv X-Received: by 2002:a02:9109:: with SMTP id a9mr610841jag.93.1621451557773; Wed, 19 May 2021 12:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451557; cv=none; d=google.com; s=arc-20160816; b=b7XpXEN8Fc/3OH/7st4uMeFZftzFXmRWJxugjJ0a1j38M8McuVxo4ND1E5x/2LrpXB CxJiEK4Gga83ryGYroNOJn4+gwq1lnkrSfkB9dyfNkklgGE9ldm/HcQQ4Eu/6QglhJe4 3BKz1osvEnIbCsGQf6TS3QDHBp6LFWxiGLk+vzNnwxlCUHcP8nBvTR33JN154Kf168Tw qQQxi2FWr5BDd30mePOY03rzxOt4Zj2ZNSB0nWbZT/TUfjB6hm4Q9cZJyK0OWISjlPcu eWMLhCb2h17FrB7pLM3B7Q+psI6jJClMvYijgzthHKTJRiX+BvwjYq9+TPw325iqqhQR YY4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=GEQi439rDfvTRkSJD56IhBuyWrsjBmHL/9eSU1ieZ5o=; b=x1avF3Jl06MK7+AgEFPVh3R9DkzoVndgLeN6MwZ0ugjjhImwJIDwl9FNlNqdzmxwG/ TyddxR3U18xKhJYDD45IVO/4WPBgDevxSnPTcgwK31wyozMjv4kBcWDtUE6yzvIaELrn F5YavxH6KRLEeV/g2ZaEiH57ixVrlKYXgBYVN1xFf0JlUfy2kCmKX2AAH3MOTju6PCAV YyEzMSQ+uyK4i3ZFhFfhOUaVI5rnNb/NwwxanXaJCXUGouRc66nhnhEBmgO8ymTC7mRX GD60+cD1MKi6R3SIQGuRrBrJ/MVMmUxj5CpxArZMIMbYQWfFVBbtxALJ+2V1eWpHXx+q zh6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=Gv2lFV9F; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MINiyE8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si66970jat.37.2021.05.19.12.12.22; Wed, 19 May 2021 12:12:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=Gv2lFV9F; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=MINiyE8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240907AbhESFAK (ORCPT + 99 others); Wed, 19 May 2021 01:00:10 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:34145 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241074AbhESFAJ (ORCPT ); Wed, 19 May 2021 01:00:09 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id F11B4580C43; Wed, 19 May 2021 00:58:49 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Wed, 19 May 2021 00:58:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=GEQi439rDfvTRkSJD56IhBuyWrsjBmH L/9eSU1ieZ5o=; b=Gv2lFV9Fn605qLRPC+zpp9WChhhrT9AxRaG3TMDpGHCAtMR jwhZ18nyIJIDw2zL3PV7GHtryhrBkuJr2Bk8+iDbkh0YiR2LZuhUWrRlkN+tr0xO ag/CDfIs42cgW2JoNzmgqPEPwdNCk8Jjfs8qOt2PR2Be27kjmY0u3KQb4klAJBcM dvdK3qzQcTS73rvhjOtuCo1ugyYkYDv7XB7yXxiFV0zWioWZ82AjCzweZ2n5k5iB B/TKViQv6MX5N5coiKo2ptBxsbqNCaSlMvoOco/ItqUQgAuzG3VaVd2xTbJrXyuR n/CUABA4xc3xQSH5CxbuejPCu5qK6S3vvxFRLrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=GEQi43 9rDfvTRkSJD56IhBuyWrsjBmHL/9eSU1ieZ5o=; b=MINiyE8y5zv0bN1unA3Fb9 DBIGslbZgOkYTl0jzeHItc5j0owO+c4Fe6QvGHig3Vj8yDIM8JT3D9F10FrEQPL9 LGhRsYam0qfs+ZLJNVcZ+JYNB9JKhQFQuc0qz5BgrMwmLjWXZSnbedfjJw1r6H5F TygU6HrXbdCcjaySOYw2nH8jjL3lu0Qw0UTxBCQTXv9AHhrmxZltOJppdKLmBKFp a1/YckF1f98/Xcoxmg+UJCwa5IK2Z1IelrgczYEa4AL+SYz4UbAkNS6WSTZVXhjO M9jFnbqOKX0tSyRjDH+2HYonEipTHI0ZMQoSq0navs+ZF6CFrmnZZ4G6z7lvs0OQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeikedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecuggftrf grthhtvghrnhepffehuedvhefhgeekhfeigffftedtffefvedtueffteevfedttdetuedv hfffleegnecuffhomhgrihhnpehpohhrthdruggvvhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9368DA00079; Wed, 19 May 2021 00:58:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-Id: <66904cc2-a4ef-42db-a1c9-b12ceecb52c1@www.fastmail.com> In-Reply-To: References: <20210519000704.3661773-1-andrew@aj.id.au> <20210519000704.3661773-2-andrew@aj.id.au> Date: Wed, 19 May 2021 14:28:18 +0930 From: "Andrew Jeffery" To: "Joel Stanley" Cc: linux-serial@vger.kernel.org, "Greg Kroah-Hartman" , "Jiri Slaby" , "Linux Kernel Mailing List" , "Linux ARM" , linux-aspeed , "OpenBMC Maillist" , "Jenmin Yuan" , "Ryan Chen" , "Milton Miller II" , "Chia-Wei, Wang" Subject: =?UTF-8?Q?Re:_[PATCH_v2_1/2]_serial:_8250:_Add_UART=5FBUG=5FTXRACE_worka?= =?UTF-8?Q?round_for_Aspeed_VUART?= Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 May 2021, at 10:28, Joel Stanley wrote: > On Wed, 19 May 2021 at 00:07, Andrew Jeffery wrote: > > > > Aspeed Virtual UARTs directly bridge e.g. the system console UART on the > > LPC bus to the UART interface on the BMC's internal APB. As such there's > > no RS-232 signalling involved - the UART interfaces on each bus are > > directly connected as the producers and consumers of the one set of > > FIFOs. > > > > The APB in the AST2600 generally runs at 100MHz while the LPC bus peaks > > at 33MHz. The difference in clock speeds exposes a race in the VUART > > design where a Tx data burst on the APB interface can result in a byte > > lost on the LPC interface. The symptom is LSR[DR] remains clear on the > > LPC interface despite data being present in its Rx FIFO, while LSR[THRE] > > remains clear on the APB interface as the host has not consumed the data > > the BMC has transmitted. In this state, the UART has stalled and no > > further data can be transmitted without manual intervention (e.g. > > resetting the FIFOs, resulting in loss of data). > > > > The recommended work-around is to insert a read cycle on the APB > > interface between writes to THR. > > > > Cc: ChiaWei Wang > > Signed-off-by: Andrew Jeffery > > Reviewed-by: Joel Stanley > > > --- > > drivers/tty/serial/8250/8250.h | 1 + > > drivers/tty/serial/8250/8250_aspeed_vuart.c | 1 + > > drivers/tty/serial/8250/8250_port.c | 10 ++++++++++ > > 3 files changed, 12 insertions(+) > > > > diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h > > index 52bb21205bb6..34aa2714f3c9 100644 > > --- a/drivers/tty/serial/8250/8250.h > > +++ b/drivers/tty/serial/8250/8250.h > > @@ -88,6 +88,7 @@ struct serial8250_config { > > #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ > > #define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */ > > #define UART_BUG_PARITY (1 << 4) /* UART mishandles parity if FIFO enabled */ > > +#define UART_BUG_TXRACE (1 << 5) /* UART Tx fails to set remote DR */ > > > > > > #ifdef CONFIG_SERIAL_8250_SHARE_IRQ > > diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c > > index a28a394ba32a..4caab8714e2c 100644 > > --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c > > +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c > > @@ -440,6 +440,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev) > > port.port.status = UPSTAT_SYNC_FIFO; > > port.port.dev = &pdev->dev; > > port.port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); > > + port.bugs |= UART_BUG_TXRACE; > > A future enhancement would be to have this depend on the ast2600 > compatible string, so we don't enable the feature for ast2400/ast2500. > > That would also mean adding a compatible string for the ast2600. Yep, I'll sort out some cleanups in that regard in a separate series. Andrew