Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3524989ybd; Fri, 28 Jun 2019 10:06:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1xEkmNtMSw3kVZhGnBnpc5ZfnccCl175tEBJlK2/Z9+nQRw/JTc9ddYNWY2YB0WK2bsDT X-Received: by 2002:a17:90a:3086:: with SMTP id h6mr14766745pjb.14.1561741587829; Fri, 28 Jun 2019 10:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561741587; cv=none; d=google.com; s=arc-20160816; b=s++KpU7jJf6smj2D5i0RYSW1gOflKJkDSrcEa1Aw3bjJkHMeb6bYuswTHhKIAv2/lA emwUwXcmHSEfFnRTL9oB/2fEjVNJscl1DTaltTL9K7poymFjQatZXPArhBwCRSN2lYGq 5S5BrFhqbFf8KNMFhoXFRpONlHEDhLh4oSfzHAGR95wHwBIAauJqm0/qISNxekMsqu6w PLbhpdzBUaaHdB6yxQZpJsmDNMcRNLkwh3Zo6WTejvFgdaWYHKPJt4oU1s982y+mfmdL ohL+HjmuUyMHepyY5sUCXibfyc2HoOWAJLLc+td9woX32P6l2zL/iPbf01vjZnYHXTiy f8aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cBVhMh+h+W5w+WtA7BMVhPwsoDicAgRybdXvnr2vh2w=; b=rIfROHn7RywnBIQCgzN+3m1cAMPxeHiEtNGHXGwF/rmmo1SHUe9c+Twt5u+8fezJju JieZpltK2MlUe02hCZgpziwbrQd00bMcADULsU9UY1yxD0S6Zq87S9TIysrKRMl5LaH3 exEoQVVd+7HsTchBCtBYvrN4uL7NffpL4ZdDHxE2c2GJABlU8HR+EUIkNKzzQpXnHvH7 acM5V1MssrITkl1VyZEe2+SP7nJ9wmEHPiHjvwh9XDQBuQj1scLDzrJ1jH8oMQ8D39LI lM1i5h0lIXxmiqGPxtvssqmGIuiruXc61I0s17YXZFAV6I5m8coo5Ord9hbK6V8/sUXp 8upw== 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 v19si2283756pgh.510.2019.06.28.10.06.04; Fri, 28 Jun 2019 10:06:27 -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 S1726688AbfF1RF5 (ORCPT + 99 others); Fri, 28 Jun 2019 13:05:57 -0400 Received: from foss.arm.com ([217.140.110.172]:52080 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfF1RF5 (ORCPT ); Fri, 28 Jun 2019 13:05:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BF6F928; Fri, 28 Jun 2019 10:05:56 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (unknown [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC1AB3F706; Fri, 28 Jun 2019 10:05:54 -0700 (PDT) Date: Fri, 28 Jun 2019 18:05:52 +0100 From: Lorenzo Pieralisi To: "Z.q. Hou" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Subject: Re: [PATCHv5 10/20] PCI: mobiveil: Fix the INTx process errors Message-ID: <20190628170552.GD21829@e121166-lin.cambridge.arm.com> References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 12, 2019 at 08:36:12AM +0000, Z.q. Hou wrote: > From: Hou Zhiqiang > > In the loop block, there is not code to update the loop key, > this patch updates the loop key by re-read the INTx status > register. > > This patch also add the clearing of the handled INTx status. This is two bugs and that requires two patches, each of them fixing a specific issue. So split the patch into two and repost it. Lorenzo > Note: Need MV to test this fix. > > Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > Reviewed-by: Subrahmanya Lingappa > --- > V5: > - Corrected and retouched the subject and changelog. > > drivers/pci/controller/pcie-mobiveil.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c > index 4ba458474e42..78e575e71f4d 100644 > --- a/drivers/pci/controller/pcie-mobiveil.c > +++ b/drivers/pci/controller/pcie-mobiveil.c > @@ -361,6 +361,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) > /* Handle INTx */ > if (intr_status & PAB_INTP_INTX_MASK) { > shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); > + shifted_status &= PAB_INTP_INTX_MASK; > shifted_status >>= PAB_INTX_START; > do { > for_each_set_bit(bit, &shifted_status, PCI_NUM_INTX) { > @@ -372,12 +373,16 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) > dev_err_ratelimited(dev, "unexpected IRQ, INT%d\n", > bit); > > - /* clear interrupt */ > - csr_writel(pcie, > - shifted_status << PAB_INTX_START, > + /* clear interrupt handled */ > + csr_writel(pcie, 1 << (PAB_INTX_START + bit), > PAB_INTP_AMBA_MISC_STAT); > } > - } while ((shifted_status >> PAB_INTX_START) != 0); > + > + shifted_status = csr_readl(pcie, > + PAB_INTP_AMBA_MISC_STAT); > + shifted_status &= PAB_INTP_INTX_MASK; > + shifted_status >>= PAB_INTX_START; > + } while (shifted_status != 0); > } > > /* read extra MSI status register */ > -- > 2.17.1 >