Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4879775pjb; Mon, 27 Jul 2020 07:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMUDez8ZIoXf94qJr/uxZB5s8A2nsrK1+hVvXYLtnRN3+7bFNcIhxuvl9TgXeIMD0Wykun X-Received: by 2002:a17:906:488:: with SMTP id f8mr12203575eja.215.1595860083023; Mon, 27 Jul 2020 07:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860083; cv=none; d=google.com; s=arc-20160816; b=O/pQDH9TD3pxBopOEMPRDS6DT7O0DBvw1Kul4O5QOSrBREM5Sm32kZIqUwz0Dye6hM z7hiEuF9oX9pvrBRqmmLkWdxVGvO2jlnuazO3qLVoocQ+eFQK1gak2D4lUuQfpJBMpr6 n5fHWnKtpog+CmYp/4t97pq2CDr2qHBxMbW37KrQecY7Q6uG6y720PLAHN7iqqOZEBTi E47JN8T0PIyWPFPBGJoQLHt30huBAeYxv1sG0fCGpCu3Tprx+bpSd2f613sbGn/dy+ot eSS6PKuPnG/ka5Lj8LZztqZg8mO0vQLF2xSUKm8IYOxHJn0JO7di9Keiuq3KUCPer1aG uhjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rrZID0GaBMlN4bV3g19AWqh/Y1hzddRHTO8VDDiiQL0=; b=pkKbMMNxg5y67mKuXTiKnBBjqLPFoXIpmAX/78EZnoeA+2xFsmiLyNUxMUeUeq0TCZ RfxkGFZyR/H/zI1XY/dA+ZYz0bSxYmTD9fFLsTplRaCLH5wJvY/23QPHEf6wYqB2d46w 0ANgtgI0UjmP9uqYP2FDnk0t5i3Yckf84ymYGfWNtY5vz0y6DJ22Y2mTRfpBzH3eGRDZ UeaHLvRZANiQK3r6k3a1t6ZZmr8gHs/EQo9+KKXo6shfxztrpjOBndc8R9sxgeLjYcnA Q0iyR17yESCler9ChMsoFS3ZhZ4ph+OgOTPIK27b4rU/VTdDlYO455qqqou055YGEvBL Xl/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wxHqAKvs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si2997846eja.559.2020.07.27.07.27.40; Mon, 27 Jul 2020 07:28:03 -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=wxHqAKvs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732597AbgG0O0Y (ORCPT + 99 others); Mon, 27 Jul 2020 10:26:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:56540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732552AbgG0O0S (ORCPT ); Mon, 27 Jul 2020 10:26:18 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 58FE1207FC; Mon, 27 Jul 2020 14:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859977; bh=YoCy38iOHeTU55I0Spc40QOQcTYhXBtxt9aDG9lTwgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wxHqAKvsdun/7U2pyE2LJh1OWKQGm0p/eqj3bh37ti2mW6zNwxg9clFXoA7LtaoNW Zgy+NySm1u4RhRSRxX80etkjk3YUqpY5jNrOzupdZXAD3ClwVBL1vZ16BEuBZQ6TnV uVbUKO4XoKEK/PrwbXwVz9GgbSR8IzB/OAOKlRv4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shardar Shariff Md , Krishna Yarlagadda , Johan Hovold , Thierry Reding Subject: [PATCH 5.7 151/179] serial: tegra: fix CREAD handling for PIO Date: Mon, 27 Jul 2020 16:05:26 +0200 Message-Id: <20200727134940.027896061@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit b374c562ee7ab3f3a1daf959c01868bae761571c upstream. Commit 33ae787b74fc ("serial: tegra: add support to ignore read") added support for dropping input in case CREAD isn't set, but for PIO the ignore_status_mask wasn't checked until after the character had been put in the receive buffer. Note that the NULL tty-port test is bogus and will be removed by a follow-on patch. Fixes: 33ae787b74fc ("serial: tegra: add support to ignore read") Cc: stable # 5.4 Cc: Shardar Shariff Md Cc: Krishna Yarlagadda Signed-off-by: Johan Hovold Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20200710135947.2737-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -653,11 +653,14 @@ static void tegra_uart_handle_rx_pio(str ch = (unsigned char) tegra_uart_read(tup, UART_RX); tup->uport.icount.rx++; - if (!uart_handle_sysrq_char(&tup->uport, ch) && tty) - tty_insert_flip_char(tty, ch, flag); + if (uart_handle_sysrq_char(&tup->uport, ch)) + continue; if (tup->uport.ignore_status_mask & UART_LSR_DR) continue; + + if (tty) + tty_insert_flip_char(tty, ch, flag); } while (1); }