Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp575372pxx; Wed, 28 Oct 2020 11:28:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZbMcOU/5zuZtrdf7g2/+H8kawXx8gVw135h2qj9szhvMHSIZvCrdfheysEmZ1qkGb0m8U X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr166143edb.335.1603909727723; Wed, 28 Oct 2020 11:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603909727; cv=none; d=google.com; s=arc-20160816; b=eFHyAYSNlyw+q1eGaDn3dW7mK6WW19lWN0bOwQrPfIMGIxMbingMhGhQNMsHZ+HKpt l2GzA8qKIdTKAF8qh/28syWmCFlL3Vsw1yR4NR++NNhhy2881eoSCPJxNBuwPsN3Nlth lcw8l0MNq3NNC5mj558E9E5nTHAFujC3WF+rpw2RQKBLjA2CXGtk8ysiMs/9mbHCWE1F k9yXMMNQP5pchqrQzICDzZmxfx0XkqbAqslsVjCsNEGhz+HqpO6wD6C0MxH6jJMFUNxF vHndbXRy7yVMKL0wir98KkffFJCNP27FF+Wt5xxMAkHXBg6kgjzc+ROf/4lUt7bXvylQ 8eLQ== 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=eSefNtDyUEZqKlE7q2tTjsOUOsgRBnSYv61a7v8lJV4=; b=E7RrM3QEL7DyvP23pI/4yx0y0v+XoN4rz4c87sJToV/TrM56OLiKJkRsW+gO7P/eYg rjYTIa5Vq3JCaecosEsArvnd8jfl9IMOkfAw16sNGkb9kYc8BxW2mB4BgAkbx0Hame6l GmAo/H/jggq8an1kUfVgw3TKCKoyJ7ar8SzmHUK1Ssogh/BdVJ1x9zhBytrrcOqAaJPG Rt1C4At4rHMuvD9LsGknTWr+/XRqTKJcoIbwJB/AWHRWCARD9KZsrgUDkxiIJyW6dyYt S/BfAc3Wx01cGO9T21ukuw0Fm0fDVHXPVi1qFubAAf/IMnk0Pfaow4R6qi0dk2UKHs/P w5SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UnuIgXFy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si18713edm.295.2020.10.28.11.28.26; Wed, 28 Oct 2020 11:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UnuIgXFy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1825068AbgJ0SIV (ORCPT + 99 others); Tue, 27 Oct 2020 14:08:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:38388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2508860AbgJ0OQW (ORCPT ); Tue, 27 Oct 2020 10:16:22 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 572CF2076A; Tue, 27 Oct 2020 14:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808181; bh=amTksholHYaP6V3+fRmuESgR76MxgK1BjgKQ7sYOYLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UnuIgXFyJC8EqEr/zf68glCU1wG5WFL+qFMSeEecVMHWZaV+e5+thbI0hD06hQFOn wp7yVcdOu8uBSBF2gTlj/0QRvT/d1sJ3zo1EfdkxdGB1X/qBG9kZkDFsteOA7HpeEh uzw9W6wJFYOf/tYAvG/GYMwudUEmGaRnfwWAXXTA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fugang Duan , Peng Fan Subject: [PATCH 4.14 187/191] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char Date: Tue, 27 Oct 2020 14:50:42 +0100 Message-Id: <20201027134918.715220865@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 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: Peng Fan commit 29788ab1d2bf26c130de8f44f9553ee78a27e8d5 upstream. The watermark is set to 1, so we need to input two chars to trigger RDRF using the original logic. With the new logic, we could always get the char when there is data in FIFO. Suggested-by: Fugang Duan Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20200929095509.21680-1-peng.fan@nxp.com Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -567,7 +567,7 @@ static void lpuart32_poll_put_char(struc static int lpuart32_poll_get_char(struct uart_port *port) { - if (!(lpuart32_read(port, UARTSTAT) & UARTSTAT_RDRF)) + if (!(lpuart32_read(port, UARTWATER) >> UARTWATER_RXCNT_OFF)) return NO_POLL_CHAR; return lpuart32_read(port, UARTDATA);