Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp622338ybi; Fri, 14 Jun 2019 00:09:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmoEFkcsI5GiW0pz66nDKtwxREjFGsCSmukfG/NlS//kwJnKd5Hy8xbrw16xRIACEL7Cpn X-Received: by 2002:a17:90a:5887:: with SMTP id j7mr9414097pji.136.1560496168688; Fri, 14 Jun 2019 00:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560496168; cv=none; d=google.com; s=arc-20160816; b=ir+4LISoN+ZwJkKVqBcyjRuNY+fuCMsrfe0rO/4niE7X0A6Yx0D8eIs48KvGCoNir2 YSUqJe4hlFK/VTQPpddK88E3+betExFk/esKBuJpGRn04z3SdmyDU34k68MWoxZMSfr+ 13gxykiGEg1P6GO1aeeAFCeN29PsjEajU5tr7rwe7DLatL2nA2hwWTO2Cs3zngREWdOX sIHgM+6uHJqKSlDavXgAVcWFlBMpo39PlfeQWZtT52YZ1Do0KcqH54kin7eZFoo9l2Q5 +/uRI8v4XMOjeQGgnTJWj3qnfkX3FgKhvRr2mWE1OJG/L0BeqTuZliubuOUKf66TiqxI RtJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yxfyM6IErwzUuZQc4rX6nb5MYVBMEiaUIJAOhGRqMq4=; b=S0f9IV1WXW+BDS1EKQskHw/VUcjfJ0y9EgpyzZ7ocCGoIbv7epsxbvNNFGceLodKEe BuBRAx3Dvj6jMHizqgNY1lgZx+d07EG5id6kJbz971vTTqXnSPCI1yrqAdsUIJr3e1KS QDMFuk2C34Fd3Pj1miEXD1U/FsP2XyAV/5SuOFtpHCOn4bpcIqDCAOjKizenseHHZux2 csR6splRLtSaDh0t6OePgdHiTz2mzUntDvsEBafyeowAOyb9+8L/cFGN7WighrJglTwV FMm6sx4OUZlNd4xnFWE4guhyhA9869lCfVm8jESpXiVhbE4DQyaOEy1b4z3bIMVk/rJQ d4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mobiveil.co.in header.s=google header.b=BFQ7n7Zx; 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 x13si1728265pgo.149.2019.06.14.00.09.11; Fri, 14 Jun 2019 00:09:28 -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=@mobiveil.co.in header.s=google header.b=BFQ7n7Zx; 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 S1725996AbfFNHJH (ORCPT + 99 others); Fri, 14 Jun 2019 03:09:07 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:32862 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfFNHJG (ORCPT ); Fri, 14 Jun 2019 03:09:06 -0400 Received: by mail-lj1-f196.google.com with SMTP id h10so1296382ljg.0 for ; Fri, 14 Jun 2019 00:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mobiveil.co.in; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yxfyM6IErwzUuZQc4rX6nb5MYVBMEiaUIJAOhGRqMq4=; b=BFQ7n7ZxnDJCfw3InVQV8Lykl7mTzTO/uKjfT68koQImu8DCSUAFvWIamSHmM+uW7E GZVxCsJcMdhXyWOdvsBS8286msfvR4ZWO78pNH0mqpSacM6BftYDWL1xMkdIh7w9MiX3 3tb2/ogsbdl7Lw2YtiCBHiD3UaatAaBTKNvM0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yxfyM6IErwzUuZQc4rX6nb5MYVBMEiaUIJAOhGRqMq4=; b=SeA1hWKtxGEsZnVCNCsOBNvNNBQIBjDiGqDclEa7df29UH0Bfm4kTi/08IFRTHVQun gcSO27BPHiETwLr6PIoL3pF8v0xpJ+w9Ilv7v5rwq3T6WjiprOqkplY47wZlKH5684Qs E3U+GggHD0d1xY0TZYqN8SBebDSwkfggJaqAQrh29OFxOK2r1mWqJk3XRJuQ8e/UtUVW WID2l3YV+T2khMiOXedWfa5ZSBYEnA1V6c1QfP/gpKfPcbBhSRW0XxVBk1SGGg4C1eob 4fz0sGMuiXOIkYYfQwcXo3t4LVbBOipfz/uwSjl63U6g2DGDLvxUshNMv+724oQ5VwgP WUjg== X-Gm-Message-State: APjAAAVJX3PlSEh5MS9YD1m+a2s1eKkxioHKOZhRm/9FtMH5RC3Keyf4 fwyVw14IR5gQaiv4ru/f4jbut6sXW7H25hgDxpohOygEUAPDz+uma41s35knlDx1soNuVGdXaZI soxgTNFksv4Wm4jtF5latURaRPG0sCs0RUg== X-Received: by 2002:a2e:760f:: with SMTP id r15mr34139345ljc.18.1560496143737; Fri, 14 Jun 2019 00:09:03 -0700 (PDT) MIME-Version: 1.0 References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> <20190612150819.GD15747@redmoon> In-Reply-To: <20190612150819.GD15747@redmoon> From: Karthikeyan Mitran Date: Fri, 14 Jun 2019 12:38:51 +0530 Message-ID: Subject: Re: [PATCHv5 10/20] PCI: mobiveil: Fix the INTx process errors To: Lorenzo Pieralisi Cc: "Z.q. Hou" , "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 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 Hi Lorenzo and Hou Zhiqiang PAB_INTP_AMBA_MISC_STAT does have other status in the higher bits, it should have been masked before checking for the status Acked-by: Karthikeyan Mitran On Wed, Jun 12, 2019 at 8:38 PM Lorenzo Pieralisi wrote: > > 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. > > > > Note: Need MV to test this fix. > > This means INTX were never tested and current code handling them is, > AFAICS, an infinite loop which is very very bad. > > This is a gross bug and must be fixed as soon as possible. > > I want Karthikeyan ACK and Tested-by on this patch. > > Lorenzo > > > 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 > > -- Thanks, Regards, Karthikeyan Mitran -- Mobiveil INC., CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain proprietary confidential or privileged information or otherwise be protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender and destroy all copies and the original message.