From patchwork Fri Mar 22 15:44:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 160940 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp964448jan; Fri, 22 Mar 2019 08:50:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+xtDrrAwd7wNIrgZgu6AZfR2LuXEDE7KOL3jdZ46me//iSZHeMs79Wx1ZRtR7m4X5bifd X-Received: by 2002:a63:fd10:: with SMTP id d16mr9476112pgh.306.1553269833625; Fri, 22 Mar 2019 08:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269833; cv=none; d=google.com; s=arc-20160816; b=MrCa1ZBj6Sf/xZRi0jdOCCncak8qyjbVyaP/eeGjer3bCdzdiyh29xK8sH8Yzy3eup Qlp9yxd3fWQhw7k45meK0iKCAXWerZfhQfm7UFbCPYpMMrxlJ4Q7+e0xXbhEsd54Ac5k LeAmCnFahtbHe2Fs+lCzuw8CsBnP01rhVQa2rkmK9WDoOkdqWiwjiPqELWnndFaj5QvQ 35KkrUPOY5pUJSSujQD/SBtP85cLdcqwLs7qbQ+vQaBHVCWlGS+/tZfQWsZqdG/tszPy 9C4xXGk2mNSFXoEmv7SxzkUQ4sQGrHHrwIdLgUYV64QqArWB/8uhlBswXUFHKN3DoogO cQoA== 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=vMl1PKYsqfHJcGGUiQKpSybsNBezeOMLRu7ZW0fY0zDS4wABk7OOGXmy8BMynhlcfB Re2Ct33P7kcPn1UNLdZ997lvaoSYhkmBZSqS5+UtPK3lpbpgvX1Gtnbr4//tRKERvQc2 m4c3Kld++Pn+o8yV6kQ3P97Ox+Q1bD9wHf3jsPPbGyUVXwldZOhegDyOKlzfjNlsuFbT FbKYMjyiE/DFAjVBIU/ynHf/ZpjORIFSUMM7TzyaP0AOaDqFy6Q7ciKDBlv0ZMXw6n37 w4B5wS6wleya+u7YX63Dd3rRA4/g5AsE+OMjhZ9eUtRIn8Lkpi5Ssi2EyQt83VAbpq6F 4dIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 138si6130086pfa.199.2019.03.22.08.50.33; Fri, 22 Mar 2019 08:50:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbfCVPuc (ORCPT + 14 others); Fri, 22 Mar 2019 11:50:32 -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 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.20.0 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))