Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp801300img; Fri, 22 Mar 2019 08:51:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3itSIMNzm4dH5QjaeJJq87pzbTOZOunZpg0sEb0jSmVZqbpUN/nSgTT5mBv3c2fwwcFvL X-Received: by 2002:a17:902:70c9:: with SMTP id l9mr10497007plt.131.1553269898637; Fri, 22 Mar 2019 08:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269898; cv=none; d=google.com; s=arc-20160816; b=neh31C1lBBu+Lgw6bKXBXPPCdyNzDQPygdyW8Rhhh/3vwXQbcJ/FuA6Ff/q3JtOD2D bniEQCp4dBCc69Pfjk0V1RV+Z7L+iVMWBshcqoL8LzZ9CRxWopY1S6Cl8/rxFuOtwMSA 2EPkjZnXY0kkJ6vDxrVWwgTopmLVJ9xoo/CCtct8vzr4yu2pahY4bh/qp+MsfgJrDWyN oP/hnMj4h6ZMk0zej5wpOWluI6RB5QVG7/YbLeKDE3hUd04XD1Ui3iN8uxNnYnimxYva C8qPCVPgrUXkuXS57vWfL0igZo63Jn8+Pkdo6dH3YoUA2sF0N1C9xtw02uOFxPqPsKhN CUlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=o0O2AbXfhR8fCBCqvm5iykY2nR7x5d7hc2OH5PW6Q7g=; b=n5Pupr8fpqYwnM1d7/yUdtBsCFmn7u5AT7dEdah94IAac40JI0/w7WZQbK9g4CipdQ /u3iYGE1w7UIcovejuq8EowHV0TjsrUzZjG/NCElFlsL+bap2OdJmO/lk0b+X0qyG1SJ 2FyhTKFhwBqpdosIYq9K54MDMbV1CSSSaWK6sOynk7c0rzqx8OCQJAFsraPXKFweAXIJ p0EK9SkaQrkVnfOqoKCfktGeM2BvZbGct3FQmL1tEo0t/hDJ+XKW1HAgc0CWbgvkl4AC 6ikGSscoq43AJBswnx7B2tC+bFYVj92jY+/N+5mA1H3T9tNP5j4RSHNwUXdAZTNLtbWn WtpA== ARC-Authentication-Results: i=1; mx.google.com; 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 m10si6956055pgk.386.2019.03.22.08.51.20; Fri, 22 Mar 2019 08:51:38 -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; 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 S1728895AbfCVPud (ORCPT + 99 others); Fri, 22 Mar 2019 11:50:33 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:36815 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbfCVPuc (ORCPT ); Fri, 22 Mar 2019 11:50:32 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mekzb-1gWvHE0xEr-00ajAd; Fri, 22 Mar 2019 16:49:41 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Orson Zhai , Baolin Wang , Chunyan Zhang Cc: Lanqing Liu , Chunyan Zhang , Arnd Bergmann , Lanqing Liu , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 23/25] serial: sprd: clear timeout interrupt only rather than all interrupts Date: Fri, 22 Mar 2019 16:44:14 +0100 Message-Id: <20190322154425.3852517-24-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:PsIPU5iB1xBa5v+WazbuNdzqA4mLLTpIT/uM/wir9xmBeICdEOl UCw4EkoxW5ya6R+rWhfhWa6CrpEV0UXiQ7ozxDNzguNZNFcrZ9IHmtjWiR+X3mChBqXh3sC yEr+wEbKBOpTsK6fFTziPo+iFeeJuFG6n3qDJTjMbOY48FkXw9WY3xKPxmFaSNChy8ONCkV FEGBZd6oxtzWbM5XUlrvQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:UYxcQTad6wk=:G49kiHoDPXJ0UQ2KyQlZlg pIjPzzLMgjXCJbwxZq43V0JrLrHOJ3csPyEAgynOvEa6ujyxBYxECg9K3ywNyJAmRB+86Msdo 3rVYJmQ6H+rqukEri5p+pyTbvBmIZonsxEE46+kmWk2sCZLsKcDBn+3VCoUda7gdqbOWZao/4 gCHj+To9b23s0fXXEym7mj1ufxl0edCObikCWOww8JUQZufQGeI+RVYsLcAej9OIRvAJSEisP d+KVXrpNbw+sw84krKa46QSZqDncqo0q/eaDQNv9ppQjbw0EVxuEX1wp9b7i1du6pCtUIe/2S MinfqZKzM1N4HpZOH7w8zoacAJ/q6QTxH+0epsrk8BKa+GOuqlLQXtj4A9/ZvJ0cWMytpP8OX IH2m+9M8PZzVuLTS9UldI/ZxOtJTZTUIDtQV1TpYZQmfAqizK1pOflm30JnlAJ+AvoaYWpYu5 u7t8hwucKefny0KZYCYXuTBrdEeiK5pf3+o2l0T8WbHLTM89qn9BzosNvjYECoDEi6Ot2lsON U3q5N2Z5q5fNViLRYPD+knySm8te9de/W/FCatnzTbjcNA6SBKZToEqH8aqscstovAL/thoBE n6MCJYmmRG1yCXLSnDmzu/G/csUjpQr7blOlKLSImQkQWp0iL08wDe4r4L+cp2jzs1OLt6So6 riGlPBmBWiR/qrIrurwss4gqsI2Q23ny3c2GDyzxpYgCG54vTAHjbREySL0DSb4tavKPezvAQ 6ru4cLIoC76GiwcZZ7OS0zzAPNU7yLlxy4Sk6Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lanqing Liu On Spreadtrum's serial device, nearly all of interrupts would be cleared by hardware except timeout interrupt. This patch removed the operation of clearing all interrupt in irq handler, instead added an if statement to check if the timeout interrupt is supposed to be cleared. Wrongly clearing timeout interrupt would lead to uart data stay in rx fifo, that means the driver cannot read them out anymore. Signed-off-by: Lanqing Liu Signed-off-by: Chunyan Zhang Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 4350782570b919f254c1e083261a21c19fcaee90) Signed-off-by: Arnd Bergmann --- drivers/tty/serial/sprd_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 176f0a2bf9d9..c894eca57e73 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -63,6 +63,7 @@ /* interrupt clear register */ #define SPRD_ICLR 0x0014 +#define SPRD_ICLR_TIMEOUT BIT(13) /* line control register */ #define SPRD_LCR 0x0018 @@ -298,7 +299,8 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) return IRQ_NONE; } - serial_out(port, SPRD_ICLR, ~0); + if (ims & SPRD_IMSR_TIMEOUT) + serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT); if (ims & (SPRD_IMSR_RX_FIFO_FULL | SPRD_IMSR_BREAK_DETECT | SPRD_IMSR_TIMEOUT)) -- 2.20.0