Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp236749ybe; Tue, 3 Sep 2019 21:44:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWK9GZpMgzuBm7789wPYQO0aED7gZdPe8Q2AFwkJ1jCAkFHMN1pKj8pPbDsRuxUMeFcY5J X-Received: by 2002:a17:902:7147:: with SMTP id u7mr22193566plm.260.1567572266334; Tue, 03 Sep 2019 21:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567572266; cv=none; d=google.com; s=arc-20160816; b=ITGxgLykwdFQZt5EvgWt8jvcK8ocFjsKoIskjlxxKxzA0li2ymSO8EphB+BTSsYlFY 7E9CBaq+jWfmZ2c2Sd5CSeB+k8CfPAeRbpuc2YiWyg8O13jFjc7cksgr0lyNo3ow8Gb2 pG+PIoy+pikTxmbhB3zBT0ARPmr6X6HR+4O/vQ94dVdiyNmknwW+nO2198MAbi4dFUOC lXxSncDjh80Kdy7BUp0LDpOsJSYubHla9MjCLxMAcaJki7EBu99SS8siZ5ii/pC7MHwh eRXQCRyuXL6VACThaK9/S4XRi6kCYs9Fq8C6oBuE6bWzZxeRJMp2Jy7i/LZGzB+Afy+7 Lfyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=rvdELilOlZ/dP5Mxngi1Fe/3ok5haQDWkHnyX1em8eM=; b=kgXeCJ8ixDXoub8eq8mBf7DPt/rupA10zUik2Ye0rhmn1MOs17CZUWwhozwniVYdEP TLmU1np2rT/f8t5pjegAZHSzZDphM9ZfgmBaLYaj0qBdtPOicl/SEXC0+ULVqbLhnNtJ tuZOJSJvgKsnA0Q7apsq7DeEvT1328RJ/T+J5Y2HMd4E94MFMwyMz5O2lltzgjJQAitz qxZxrHJCJUlV0xjzqYue8VEdGHGWuwPY81QKJI3B56hDNpGJhDgDG2OFhlUyLmZenrtQ jye2vDIrFZ02XWqnNWiwPlvVHtqg3Vlau3XZV3d89Ovaf3P7Bhz13B9i3QTCpLZ84Oz0 7viA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=C3QUAcAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j23si18977449pfr.41.2019.09.03.21.44.10; Tue, 03 Sep 2019 21:44:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=C3QUAcAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728320AbfIDEnW (ORCPT + 99 others); Wed, 4 Sep 2019 00:43:22 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7308 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbfIDEnV (ORCPT ); Wed, 4 Sep 2019 00:43:21 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 03 Sep 2019 21:43:23 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 03 Sep 2019 21:43:20 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 03 Sep 2019 21:43:20 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Sep 2019 04:43:20 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 4 Sep 2019 04:43:19 +0000 Received: from kyarlagadda-linux.nvidia.com (Not Verified[10.19.64.169]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 03 Sep 2019 21:43:19 -0700 From: Krishna Yarlagadda To: , , , , , , CC: , , , , Shardar Shariff Md , Krishna Yarlagadda Subject: [PATCH V2 01/12] serial: tegra: add support to ignore read Date: Wed, 4 Sep 2019 10:12:56 +0530 Message-ID: <1567572187-29820-2-git-send-email-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567572187-29820-1-git-send-email-kyarlagadda@nvidia.com> References: <1567572187-29820-1-git-send-email-kyarlagadda@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1567572203; bh=rvdELilOlZ/dP5Mxngi1Fe/3ok5haQDWkHnyX1em8eM=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=C3QUAcAxXjJkCHmckEGVn5XgYuxqCESS9RmToIRuW8x0+mcMdNTqE7ac1/gWa1dor PDV34HxuOI54OrNZ5+gTe1Jujx5CSwciKHwWIXojr2cKfrhw0kNu8pKnnF7tXs0l89 utQxfEE/+G+lC/LD5kGIAQ82W3yvquIuyHDYciqDs8f7uwMuzRPhK9Kw8IuCE9pqf0 /E58tAmLgG/QFlzmyr+lb/ojqpIp00FkMAYMgeQz5UyAM0bfTvlkpZfm1xzTAYaH/+ pCCQeQfFEAXjVUqXz7QKoTvriwQ/glxrgfNuu2s9NjLjQ7TfdUaJHgB5+ukTNBuCeR ht4NT1RY7sIug== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shardar Shariff Md Add support to ignore read characters if CREAD flag is not set. Signed-off-by: Shardar Shariff Md Signed-off-by: Krishna Yarlagadda --- drivers/tty/serial/serial-tegra.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 82a8d51..9c15c87 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -547,6 +547,9 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup, if (!uart_handle_sysrq_char(&tup->uport, ch) && tty) tty_insert_flip_char(tty, ch, flag); + + if (tup->uport.ignore_status_mask & UART_LSR_DR) + continue; } while (1); } @@ -565,6 +568,10 @@ static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup, dev_err(tup->uport.dev, "No tty port\n"); return; } + + if (tup->uport.ignore_status_mask & UART_LSR_DR) + return; + dma_sync_single_for_cpu(tup->uport.dev, tup->rx_dma_buf_phys, TEGRA_UART_RX_DMA_BUFFER_SIZE, DMA_FROM_DEVICE); copied = tty_insert_flip_string(tty, @@ -1193,6 +1200,11 @@ static void tegra_uart_set_termios(struct uart_port *u, tegra_uart_write(tup, tup->ier_shadow, UART_IER); tegra_uart_read(tup, UART_IER); + tup->uport.ignore_status_mask = 0; + /* Ignore all characters if CREAD is not set */ + if ((termios->c_cflag & CREAD) == 0) + tup->uport.ignore_status_mask |= UART_LSR_DR; + spin_unlock_irqrestore(&u->lock, flags); } -- 2.7.4