Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1935378imm; Thu, 24 May 2018 03:12:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/0FAI7G1VsPuGU7MbZOjwbD3+lOet8+q8Hza1c5zc4q04r6gOMgZ0nHF1ajw5HovpUBHZ X-Received: by 2002:a62:581:: with SMTP id 123-v6mr6643390pff.38.1527156734021; Thu, 24 May 2018 03:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527156733; cv=none; d=google.com; s=arc-20160816; b=hXQQkE2m6YZGXiFmR6ggtVQjr1JOIKJBPF36+YwSgsi1k1UjGfBv184OQdeC5tFEIv sBJ6ndreEeOyBAXRONTe5vooAD+8iiSG6iFaB4SfTaoZS3b2NqUUP+DnfxwH4zlrdeBA jyF8DNavlISMZ1XlSAoFmDzt3oxceMwlyHfcO3YQ1SQngWBR+bbukQ2gjCNLWqfTC5la MO6VfrEhQz0PyImnPlOUsDxM/PXH2h+HWhVlRnERqGt+j1b4+itHmFoECcoBpxYoExmO MdjHJ8k/0H5xcmqRQeBPOXwul9FRFJfk0svwp3wZwoz0SWmfqzVswym5ie4QPKyBIavw WJMQ== 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=zWzLfT54AEQrB4r2ZLxouDCie7JntEWrw5KbV51aii8=; b=eQy8a1f+MAeBSMpXYUpaiwGul6EvMr/MV8/AWfNdq9QCyp29MuaSIlcpEn34d+mxDY BdPWkGMWoj/S67dfrrFX33mDUYvB/R/DfYe1wUtwJiKkKrC5bcYJpdUFA3ciDbCvvrLK 5Q7ceQVdRfhZcOVfrgJ94IiFIbkQuOjAaDh94GhqF/LK3LAMyux21fAk78/X9v9WZELk bUMMFapHgj42JRiczVO6IRvDiauY5QMykYMIRN1u+a0TT07lH9MjfPN2dC2eLCs6bvfX 8sUrihnVdNwgnkhJeC6djXJu/+4mNNdWHlaSzuy4KfSAs65QIfZ2Gr0Cq4nPUAMSiC+z GJMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ykX7RU9m; 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 202-v6si16726523pgg.546.2018.05.24.03.11.59; Thu, 24 May 2018 03:12:13 -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=ykX7RU9m; 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 S1031627AbeEXKFt (ORCPT + 99 others); Thu, 24 May 2018 06:05:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031229AbeEXKFn (ORCPT ); Thu, 24 May 2018 06:05:43 -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 756BF208AD; Thu, 24 May 2018 10:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156343; bh=kJ2LlgfZ+/ZvVJ9wisIhsvAnS8NpW8GWbgVulUYY8is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ykX7RU9mqLRGuurPV4lcJ6d4GT1hmFqAjXx36arTfoyxtVM9L265dGBuwxgJVwmbD v7mgLp5vTPZ/zS+xV2SfTD4vb+xZ8Y0aYR13QdrwkKftf2XnJF/00DITjIRz7zUREU 0WguSQwxKAZpV2dq+rXlhSFYRRIPEaaYcnRIr4CM= 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.16 153/161] serial: 8250: Dont service RX FIFO if interrupts are disabled Date: Thu, 24 May 2018 11:39:38 +0200 Message-Id: <20180524093036.547964383@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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 @@ -1867,7 +1867,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); }