From patchwork Fri Sep 23 08:02:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12986274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D71ABC6FA82 for ; Fri, 23 Sep 2022 08:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:From:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1lsGQC7IPxplAX560MgWc/x2Rm7bMbLc+mTdt29VU20=; b=wfmIQflDyvwYEg sXxji9gxWe2Hq+f3C3sd6VRT4VGzLRdTjDAzNLyP8P+DAEQ55GDim36mETgKAau1tvhFy12B5BfEm S9uRhdGo10NMq5WZqkjcmwQFWuMJQgcLMDJ41DjaO+LDIV/rcAfui9XvplP89yFh4/kTPWZTSsLz5 D86bVbqrV68uzBSSMWj89/c2KKXryMnBd/4gX3IeJQAJmBeSxDJm3FCgEixRtigQAy/PjRcJVNhuT fVE8dey4yi0aedMcLodALy4C3hKGDepaY4moyXNQ/2jx/WGc4YeTsk/ACgs8FrEDkVDIbRxe1HCOn pyTHonqgSVrm+aHGYUFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obdf1-002piu-Te; Fri, 23 Sep 2022 08:03:48 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obdey-002phb-Gz for linux-arm-kernel@lists.infradead.org; Fri, 23 Sep 2022 08:03:46 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4F26B82435; Fri, 23 Sep 2022 08:03:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B803C433D6; Fri, 23 Sep 2022 08:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663920221; bh=8reDmTtazqjwQti3PluLpTUxEXsgbG2y1AZ26kuw8go=; h=Subject:To:From:Date:From; b=rLrFMuZOByVOHw+NqV1mROWGf0NZbwCNpQtVjosnV52nAQYKLN6cWi03CTRuPch6E fE/1Dhvetx8TCbL6kZClWBBBy13hJPIXrnRLick8hfukqBgaThrY7P50Fd9K0eyguc M/o9pJJI7OGedUtIccIMDDdpDUXqcL2O3vtD8fyk= Subject: patch "tty: serial: extract tx_ready() from __serial_lpc32xx_tx()" added to tty-next To: jslaby@suse.cz,gregkh@linuxfoundation.org,ilpo.jarvinen@linux.intel.com,linux-arm-kernel@lists.infradead.org,vz@mleia.com From: Date: Fri, 23 Sep 2022 10:02:41 +0200 Message-ID: <166392016020428@kroah.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220923_010344_733566_0EF14781 X-CRM114-Status: GOOD ( 17.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a note to let you know that I've just added the patch titled tty: serial: extract tx_ready() from __serial_lpc32xx_tx() to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. From 2a4be3a55cd2970aa8c45f6cd1cd9dce09061093 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 20 Sep 2022 07:20:45 +0200 Subject: tty: serial: extract tx_ready() from __serial_lpc32xx_tx() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The condition in __serial_lpc32xx_tx()'s loop is barely readable. Extract it to a separate function. This will make the cleanup in the next patches easier too. Cc: Vladimir Zapolskiy Cc: Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220920052049.20507-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/lpc32xx_hs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index 0d5ef7df27d0..ed47f4768338 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -278,6 +278,13 @@ static void __serial_lpc32xx_rx(struct uart_port *port) static void serial_lpc32xx_stop_tx(struct uart_port *port); +static bool serial_lpc32xx_tx_ready(struct uart_port *port) +{ + u32 level = readl(LPC32XX_HSUART_LEVEL(port->membase)); + + return LPC32XX_HSU_TX_LEV(level) < 64; +} + static void __serial_lpc32xx_tx(struct uart_port *port) { struct circ_buf *xmit = &port->state->xmit; @@ -293,8 +300,7 @@ static void __serial_lpc32xx_tx(struct uart_port *port) goto exit_tx; /* Transfer data */ - while (LPC32XX_HSU_TX_LEV(readl( - LPC32XX_HSUART_LEVEL(port->membase))) < 64) { + while (serial_lpc32xx_tx_ready(port)) { writel((u32) xmit->buf[xmit->tail], LPC32XX_HSUART_FIFO(port->membase)); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);