From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61546ECAAA1 for ; Tue, 6 Sep 2022 13:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbiIFNpw (ORCPT ); Tue, 6 Sep 2022 09:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238784AbiIFNnd (ORCPT ); Tue, 6 Sep 2022 09:43:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B38B855; Tue, 6 Sep 2022 06:37:49 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 6B6D561562; Tue, 6 Sep 2022 13:37:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75355C433D6; Tue, 6 Sep 2022 13:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471467; bh=kd5gKSnZpWtc9wMFoHC7LlZrcjVhmY49Jsn1RVB/Fos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDmrhkKV9Q+QjJdboSvpu1T6C3IADrDp9OupJu1OvSSJOUgqeu/bzLlBbYBIOdjBK 1q5uECjpFQrJ2BG1X6nrnIlF0p+/YvGl5DDFUfEXO8aNBqXjkYnQ8Upw0XyMy6amMU gtgfqo/CQpVHZbiUm99Ve6n1wfaPbYewkUUMC8c8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Sherry Sun Subject: [PATCH 5.15 037/107] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete Date: Tue, 6 Sep 2022 15:30:18 +0200 Message-Id: <20220906132823.361640583@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132821.713989422@linuxfoundation.org> References: <20220906132821.713989422@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sherry Sun commit d5a2e0834364377a5d5a2fff1890a0b3f0bafd1f upstream. When the user initializes the uart port, and waits for the transmit engine to complete in lpuart32_set_termios(), if the UART TX fifo has dirty data and the UARTMODIR enable the flow control, the TX fifo may never be empty. So here we should disable the flow control first to make sure the transmit engin can complete. Fixes: 380c966c093e ("tty: serial: fsl_lpuart: add 32-bit register interface support") Cc: stable Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220821101527.10066-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2203,6 +2203,7 @@ lpuart32_set_termios(struct uart_port *p uart_update_timeout(port, termios->c_cflag, baud); /* wait transmit engin complete */ + lpuart32_write(&sport->port, 0, UARTMODIR); lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC); /* disable transmit and receive */