From patchwork Thu Sep 22 14:14:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12985223 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 E70E1C6FA82 for ; Thu, 22 Sep 2022 14:15:59 +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=xDSJXfA2NVRl5lsYMOoZUpqnEyE+dumr+wVxIoAKdg8=; b=luEIgqGO5H+IYN NdBd5YVzNBGyCs1RSTi7dSutnN8XOddziZpxxsKeZfStr5ttWRQ41ntqoYx5Pc47q+ypzfAaYHrGX pe56i1zmsaVVkFM8cfANewdGr9gM4YdlaecqmSEkwAyRjYXHyIy6DcCCxyoBBtbtaGoLJ/4B0Xmj1 ZQR2lANLcUDU46yvPEFanlSKsMqGuFH1c5Xv1bpT7KhkKxoq2kL7Twvqk0gHKDCXh3o9K+jZjF+JH TLSQe3Jns7gDcEm/1uxfpSAIKPq1hNPrdV7oB4DhoEiDfr59qED9X5h+XlBs81ZM+BxHC5Pa40+RW +ogMOEMnRI/m2h1/qVbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMyn-00FvUt-3P; Thu, 22 Sep 2022 14:15:05 +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 1obMyk-00FvT9-HY for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 14:15:04 +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 D670FB8376D; Thu, 22 Sep 2022 14:15:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B10AC433C1; Thu, 22 Sep 2022 14:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663856099; bh=kZvGzPBD7hdtvLUzH9CEeWEXPgAbPi0MseesHSPfkig=; h=Subject:To:From:Date:From; b=ZQpR/VEFU+zQiPAsa2Ksd9fviYAQcxCNjAsBvU4KnL+BT2Je4/9H1iX8tmPEfmMRe X2QgPtqsuMviQtA5EJAuyXP/ZDCFTndjc9eqdYS3pDbPUzEFUmexa7cNBJAOZNd+3U g5hgF88LcfYLe3Y3mX0ranZN9wjlhOWenXj7F0gU= Subject: patch "tty: serial: extract tx_ready() from __serial_lpc32xx_tx()" added to tty-testing To: jslaby@suse.cz,gregkh@linuxfoundation.org,ilpo.jarvinen@linux.intel.com,linux-arm-kernel@lists.infradead.org,vz@mleia.com From: Date: Thu, 22 Sep 2022 16:14:44 +0200 Message-ID: <1663856084122239@kroah.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_071502_774550_599A4ED0 X-CRM114-Status: GOOD ( 17.83 ) 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-testing 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 be merged to the tty-next branch sometime soon, after it passes testing, and the merge window is open. 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);