From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E8CF5BA34 for ; Tue, 7 Mar 2023 17:32:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FDF7C433EF; Tue, 7 Mar 2023 17:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678210344; bh=QTtX+QJV8MkZW+xXVm/bIgfbp/Fd9nMNuWB+UsWgdF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Swdj6jJneAcGfZ/T7qNT/BozO/8NuBGnmI8qFsZUDmWFNCXGCP5/1DsxqH5i8bosA ocFsOy74dp6FBly6HA/637p7cx3F1Cf0rSBIwSmdSRKgE6MUlEbVUKoQNnSoAK5B9L oh3FPOnX9Q3IcjAAtEkcGmyb5MrxgSAd0RQWazUE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sherry Sun , Sasha Levin Subject: [PATCH 6.2 0511/1001] tty: serial: fsl_lpuart: clear LPUART Status Register in lpuart32_shutdown() Date: Tue, 7 Mar 2023 17:54:43 +0100 Message-Id: <20230307170043.610637097@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Sherry Sun [ Upstream commit 4029dfc034febb54f6dd8ea83568accc943bc088 ] The LPUART Status Register needs to be cleared when closing the uart port to get a clean environment when reopening the uart. Fixes: 380c966c093e ("tty: serial: fsl_lpuart: add 32-bit register interface support") Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20221125101953.18753-4-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/fsl_lpuart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 5d1c28e094bb2..986ec8323c526 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1796,6 +1796,10 @@ static void lpuart32_shutdown(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); + /* clear status */ + temp = lpuart32_read(&sport->port, UARTSTAT); + lpuart32_write(&sport->port, temp, UARTSTAT); + /* disable Rx/Tx DMA */ temp = lpuart32_read(port, UARTBAUD); temp &= ~(UARTBAUD_TDMAE | UARTBAUD_RDMAE); -- 2.39.2