Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1965383imm; Thu, 24 May 2018 03:42:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrJ9NmnrG2odKzHMNf+walUECHY9utwfqYfCLO+I4Acqp4wMjKYSPVdu+laU8Wvw0vzyDBz X-Received: by 2002:a63:2647:: with SMTP id m68-v6mr5455009pgm.56.1527158574376; Thu, 24 May 2018 03:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158574; cv=none; d=google.com; s=arc-20160816; b=OldeHPS52TGMal7s+LXR0989Np0cEnIlOIe32MNU0KQ+CR4FWOugxEYDyRhJ5jA0Ig lbhtYjgz5rKKGY0hBdmifHOBGtDjyOFygCXaEXOKeGQzz5N4cYd4UgiLDGKDc0j+P12v DFUqFE2JpKs+WrZJyFFmdYdTNVHtlLP7A/M5uTgvkm+MhzvTVIPwIojty5+bP9Xy3juU 7CIv5R1qOSFNW1A/uMqMJ3aSisc4a1DLPpmVEagpDrla9Vf1Fg0JaEwsl5FUExFUujKN w1FXujDfB9Y9B5BcUeGyY0IyHd0iJt6xSynv9bbZfaBdQ7jfTOkyyADbj+uHnn3Mp9Ge Yg9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=1Iz/Ysao93zHJVcUlins3fLHblCnAcrgp9ceBCNbZYg=; b=LCJMQ5xcxjG98kHb2SqZl/jSVFja/d2n4Z5ip93xXOrJnWFDLTRj9QqstTdXPZEm+l 9mUkqHs8iOzYVpS0+RO1zp8IIrkw+9Pvbu53bzB5D+yUNZIK7VnBMq2pcs84ZbWQjOKK vUqIbEsH+VUpAheSUlcZiQrD/vMt0so6zcqofwihVdncmIJUnDPiiIe5rx5JLUJpOq98 RuH31DDSpAsqJafcAOqh+BsLQ21AURgQ3LwNxwciNp6WhD3UwyK9+MCRRkPtr/bLmgau Qo6nLP2UVU+eATYUWdmdjz6acaoR8/zmI2RhNsBASmkCGSQOBrRAdD7JzZjG3a+/Zh2g hYxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FFZYOrXd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26-v6si22912149pfl.209.2018.05.24.03.42.39; Thu, 24 May 2018 03:42:54 -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=@kernel.org header.s=default header.b=FFZYOrXd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032224AbeEXKk7 (ORCPT + 99 others); Thu, 24 May 2018 06:40:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030681AbeEXJ6z (ORCPT ); Thu, 24 May 2018 05:58:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 E682A2089F; Thu, 24 May 2018 09:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155935; bh=tLuxwv9Ov4H0AoamvFqeBYF3q/o00tgLXO5GaMA48q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FFZYOrXd8kx07TWgMFCM413/IEpNdsHDdFV7HBv79MXKxvovgnwoFyiBkXL8r4cHA OTQ27Fqvl3sbpSRTlqAOrDHENsPYkMruV9BqvoOFI6+nbZsMOxbMeUnXIz9UhMn9db xnD54gI2EMVYkqCEZjSYNHfb+WzkOiySS1Gxh+AE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vignesh R , Sasha Levin Subject: [PATCH 4.14 157/165] serial: 8250: Dont service RX FIFO if interrupts are disabled Date: Thu, 24 May 2018 11:39:23 +0200 Message-Id: <20180524093628.429607262@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vignesh R [ Upstream commit 2e9fe539108320820016f78ca7704a7342788380 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1874,7 +1874,8 @@ int serial8250_handle_irq(struct uart_po 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); }