Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4467377rwb; Tue, 6 Sep 2022 07:59:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/CfhbXJ+xX+2hD9F6I8WkUcEVdx+X9zw71EI1q5g5dB4uWLsjhnveVfoKJygSclvoqXZX X-Received: by 2002:a17:907:94ca:b0:76f:93a2:999a with SMTP id dn10-20020a17090794ca00b0076f93a2999amr1584588ejc.529.1662476346377; Tue, 06 Sep 2022 07:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476346; cv=none; d=google.com; s=arc-20160816; b=mDfe1/v95QSQUnztfcqnr7vgJZbqbrSjePeF4tBX9VwKTDz37G7pfsxkJYwSl1L4M5 PMkUhXnSZ5SE9W8sx6+xas8+YbvWqia8t9G942Po3tT5yfBsPsvuk1XxIJzjS7YM8C3f Oj92ze5ufd+Bvz7Y+DDTfkwLc+xxTdFwsFUwufyjuE36BumvGdSEs+RCATkb+ZqLR3VM y2fhcvNe7YrugTKq3SzdQczB1AJInRRJzJqlQrbQRle1sdTfDqVryVUAOp54l7X7/+Fy uXn+gkdqe7r4QzJHVdAY5xdRout9Fco7g7gLVQ5mAHlG61iLMwtZb/InoreW6ej8iEcU T9hg== 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=2yx2s+EP36kst10wrGk8vwXV+6M2nKiAvofYH0rcXzQ=; b=WFwpLuZTWGswsxZbgljalEOHWrI9zWeDYTTYjF3L8gQByuFbW/PnJQ2bIqFcFL7V5L jyVGYUTAxMSyucMA8wjKLxBNtk+P5cVgeybbiKvAkULaov4L6rlvT89a3Kk0E0qPSrtM s3xrYv4t34A4SDzs03yBuYCP2bRJOcInSmytB2iUZPJl/kR5dEAiPVlP2ZHnY1lSzbP5 uX9lEuu2/aony9hoakdVLe+lw7Yq+/9E47Spv0KEIJck2W6/moTOEj84OCBn/P5F7SMf lO1RvCIiG7meT+tF63Q4Sc/nr7vm9M2aqeRF5GF+ONgmcOLKB+vdyvQuvi83/hjJozF2 ustg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E2tcU643; 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 q24-20020a170906145800b007306064f323si8763885ejc.531.2022.09.06.07.58.41; Tue, 06 Sep 2022 07:59:06 -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=E2tcU643; 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 S241817AbiIFOQf (ORCPT + 99 others); Tue, 6 Sep 2022 10:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241327AbiIFOMZ (ORCPT ); Tue, 6 Sep 2022 10:12:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA01C86FC2; Tue, 6 Sep 2022 06:47:38 -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 338F961540; Tue, 6 Sep 2022 13:46:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C5DC433C1; Tue, 6 Sep 2022 13:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471982; bh=d3KO6J4JH2Ikto3JSUb8HPcLA69we/6vu/tdj+4a8jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2tcU6433+EX+tWxXC6mWvZX0aCKcANl+no2ysZUvsthgnj0XPe1zMnA52BHQRUF+ SprdzLyFoYaOgi1PlWS3vpCHKFSmYb4xLfhtTdfQZWeauGzx4gESjM3cINRCPsd9K0 1nbRVQfIGBaasW7gV2QcaeuNDHjKQVWsp6WEAhyc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Sherry Sun Subject: [PATCH 5.19 066/155] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete Date: Tue, 6 Sep 2022 15:30:14 +0200 Message-Id: <20220906132832.233182809@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@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 @@ -2182,6 +2182,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 */