From patchwork Thu Feb 8 12:55:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 10207101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1381360327 for ; Thu, 8 Feb 2018 12:56:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03443294EA for ; Thu, 8 Feb 2018 12:56:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBC43294F0; Thu, 8 Feb 2018 12:56:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 771C8294EA for ; Thu, 8 Feb 2018 12:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NGdVym/ym5DZtu5ppfCdjKV7lMRdzyckydBChqjhbfY=; b=S/Z03h/SJBy6fd j263bikM04BGvKE4KxveT+HAdIURWvA1pRqTBknrvolWR9YwxKp0xRzAJThD0ejjEedmvX/Sqbzbg SJlm5tY6EMRgOkxAC15fHMr4yTm1MR9C77AwftWNz/8YqRWGTPyi+Lm0PpStJPfkbRtmmUP9Oe5ps RZxkbwmsuNx2C7bXofEZD5nWOw0nkj1W11eN5mwKZ/akpxpNkwVU6JdClfE+J0PWd3yDbyqg7MOKm 6TpSMe095HTwNoEi/MK5m0hLc+54AyY9LpYQTwGZ/FgxvU7vI4sx9ELz4zg38qE/xbwtcWXZRSpQy ZjjBYeaMGhxdV3N4dxzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejlk5-0000zG-RU; Thu, 08 Feb 2018 12:55:57 +0000 Received: from lelnx193.ext.ti.com ([198.47.27.77]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejlja-0000Oy-SC for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2018 12:55:29 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w18Ct9bF013086; Thu, 8 Feb 2018 06:55:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518094509; bh=6Z4qNeVzgBiNhvKSwiwHrV3N8voJQksFod14Vu2C4Gg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UmziayKjYP25TSxp20Q1N0wH26UX+/rMKXbpuU/HYzqTJQNcNp6ciE3hFd6bNhqsF ufayEJe4YKKTvzA1ytUFhh0m/XxSksJts6nrrREKMNxp0b5wYNvFT41f5MX8Ya6Dxt 0LeB1Y4ttbSPXZc/V9SPiN7wu7lA8980sIqoaKoo= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18Ct9a3006483; Thu, 8 Feb 2018 06:55:09 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 8 Feb 2018 06:55:09 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 8 Feb 2018 06:55:09 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18Ct3K0025596; Thu, 8 Feb 2018 06:55:07 -0600 From: Vignesh R To: Greg Kroah-Hartman Subject: [PATCH 1/2] serial: 8250: Don't service RX FIFO if interrupts are disabled Date: Thu, 8 Feb 2018 18:25:41 +0530 Message-ID: <20180208125542.15649-2-vigneshr@ti.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180208125542.15649-1-vigneshr@ti.com> References: <20180208125542.15649-1-vigneshr@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh R , linux-kernel@vger.kernel.org, Andy Shevchenko , linux-serial@vger.kernel.org, Jiri Slaby , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, data in RX FIFO is read based on UART_LSR register state even if RDI and RLSI interrupts are disabled in UART_IER register. This is because when IRQ handler is called due to TX FIFO empty event, RX FIFO is serviced based on UART_LSR register status instead of UART_IIR status. This defeats the purpose of disabling UART RX FIFO interrupts during throttling(see, omap_8250_throttle()) as IRQ handler continues to drain UART RX FIFO resulting in overflow of buffer at tty layer. Fix this by making sure that driver drains UART RX FIFO only when UART_IIR_RDI is set along with UART_LSR_BI or UART_LSR_DR bits. Signed-off-by: Vignesh R --- drivers/tty/serial/8250/8250_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 1328c7e70108..ffbb955d1c06 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1854,7 +1854,8 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) status = serial_port_in(port, UART_LSR); - if (status & (UART_LSR_DR | UART_LSR_BI)) { + if (status & (UART_LSR_DR | UART_LSR_BI) && + iir & UART_IIR_RDI) { if (!up->dma || handle_rx_dma(up, iir)) status = serial8250_rx_chars(up, status); }