Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4468298rwb; Tue, 6 Sep 2022 07:59:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OxcMzJflfRFT62S7Vsc66Cch0ESuB0JWNaZkUZAfBz+ujwAf95/CknmsWCydOMpygdsmV X-Received: by 2002:a62:d446:0:b0:53e:2781:6bd3 with SMTP id u6-20020a62d446000000b0053e27816bd3mr3469744pfl.30.1662476391457; Tue, 06 Sep 2022 07:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476391; cv=none; d=google.com; s=arc-20160816; b=j5s/WOhXe7GyBMptEFDyVi4kp/dl1shsD1VfrfrDLXiMME2CiSl5aQMTJXTguhcZfH BCnMstqMafMCBIpNQCGRSV/11eTp5De+MOXrV3+wQshGy6RzxgipFptQ2GRHFM6t7GOX H/rMc6P73Lfdk/13NpsPLvQ7NIre1nqfp0hzcP3pvQWLB7ru0Xxvd2+g3rotA0ZgvhrU kEL2an+mgZXQf4r4cHkbh3sclzRkYdAxg+fdPYkz8RsK0qdR9b5IWgMqb0r6Ha319Oa6 0rd69Dspk8U1vY1hxjQFVpOXU7sBnBZgy3OAXY6UXnJsrDbVLdRMHUKdx14rLjbn00yT myxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x4hI3tARYUYy/v7VgvbAwLrSHTAmDdZKhksJjIje1ek=; b=UIjTC3Bdf6Ff1bsnXL3ma4g4eB9kZWeufbCkMKnRutrRXLPlAAnkP62HXZGAVRlwcC +YavBKTODnlX/otCJsjGFQuludaPwy8LZa1cE5g3KmAq13KBI93kDLtG6SA9JhvZ36EQ y0bPmLsMmceInyrt16Q6gk1eOq3tev0G3OqU6yDVuv6QYyCD9kYMV6ZYQd6wNgDlHytc Kwz1RCfzITmTCtH1Ao9GT106Ozjz+KnTWx1Z3IvtoKme0Ajnh3EKvRpEIz50MIKW3hac IxF8y1L2WsI3qw9PoFRrl3ysVL+RNkpk6ceglDJZQ0+xaLzndVAmUPJn1vxIJAUX5Jb9 7oaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z9MRoMQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a631f4a000000b0041b2f37c570si13753476pgm.752.2022.09.06.07.59.25; Tue, 06 Sep 2022 07:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z9MRoMQm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233314AbiIFNj6 (ORCPT + 99 others); Tue, 6 Sep 2022 09:39:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239545AbiIFNih (ORCPT ); Tue, 6 Sep 2022 09:38:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C5D4760E2; Tue, 6 Sep 2022 06:35:17 -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 57BBE61539; Tue, 6 Sep 2022 13:34:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60532C433D6; Tue, 6 Sep 2022 13:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471283; bh=PtmjzioE0RxWi/++TL3Rx8G/wtAkhld+qImlPxdFUVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z9MRoMQmsPv6y8NGkDAlyn28Nkdk+05+QxMqfDOIzQ+N8gIsdGFZLBBzibxtojSh8 K+i6KzMzKbvV0lQv/583sj7i8MPRQwgQzMhgWQK143NAY5XKtsZ4bbDzuUv2MogT3F N1JRDb59D2Ds9lR/hHgjxxanQ8NVELABP3Ps2tE4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Sherry Sun Subject: [PATCH 5.10 25/80] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete Date: Tue, 6 Sep 2022 15:30:22 +0200 Message-Id: <20220906132817.980506849@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 @@ -2138,6 +2138,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 */