Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1916142imm; Thu, 24 May 2018 02:53:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoB+xRjuwwqqVVXRSFsfvxO/ca/23T3sEmVlcnJQtnvII8fPvEVt9sX8R2JjpaoF2/9gk7m X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr2476450plk.256.1527155599596; Thu, 24 May 2018 02:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155599; cv=none; d=google.com; s=arc-20160816; b=as7IRLynl92FGuXABHiHp+MdshygR6Xv7Sq5YClezI0jPr5BCztoYWzB6iiKIt1/Ft gjg2WiunD7BRpq6iZ1KxEApTmCBl7xwosVxZN8QlC+Nun3XEuHYgqH5LMT06cEu5YTeH N+zvfAyXoNM1ekZsjQ1Qm0BxDY4JD9/TUsQUGckjvcZt9GlHZS092v6K8zaQGaN8cBtc skv4NIjH+PLziRekvKyqzu+jJSzZQLARK43dIDkgBEzhKmwj4tO6QGTTUIqvjMFmO/KD 8FzILgdgY4FUN7YOVSbKLWmMpdTwWLfyJySk4Z52s8pNSJJejHuJfirD4t+h0sEl/1qc 96/g== 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=xhdrN90oeXdS2rRUTX7n5xqZZghxTlYxgwemphBSX+0=; b=h1TRPqCtibhoOttBAhgXQ38XLfK9OUZm3RrKmiHPtWmSuCVL1PEQyYjOWtvVJnL3+G QVxrmvQma2/k3Qymy0cq4tZoRtIp7/UxQ55h1ISn5Ck13GFuafTNKY43PvDjoGXZbjbW Ick1Zj1JDTWk+MXb9x8uGidr7lJWBS+bRR30vo8rZtEjdWsaq8lKrVm4NofUGwn2rk9l s1zgz436uh/EQtW38+/bpMNn+Mx7Ha+XP8twaB8SIKInegZ4/jatU71jww9uCw5a3KKJ 0zpbVludWanuil02vmxsEus/NGkasUoaVeyjygGJ89CUTXkS16QsV+QYxRSINRDueqrZ uulw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yM20M6sA; 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 l125-v6si10129300pgl.410.2018.05.24.02.53.04; Thu, 24 May 2018 02:53:19 -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=yM20M6sA; 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 S967651AbeEXJvJ (ORCPT + 99 others); Thu, 24 May 2018 05:51:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967312AbeEXJvD (ORCPT ); Thu, 24 May 2018 05:51:03 -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 2468220891; Thu, 24 May 2018 09:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155462; bh=y4LGHmb1xkpp9w872bGsbouC90hexoa8Hew5yqYgsgo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yM20M6sAMZ4QBTLw9S1r0UNc5txFJ7s6LEgBnDyF8tHDM1FuJla9mFfWqq50iH2EJ rgu6LZfLOaYP1rColepSRs8gy8hE2z8u6sR16ozwRbYGvAri7wjtN8CpcT5dn7C7/S mEPPLvW8Ny8NuOJwHszpBuM+006v6WwvvU85R04c= 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.9 93/96] serial: 8250: Dont service RX FIFO if interrupts are disabled Date: Thu, 24 May 2018 11:39:16 +0200 Message-Id: <20180524093611.223538320@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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 @@ -1815,7 +1815,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); }