From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A246C31E4B for ; Fri, 14 Jun 2019 10:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21B5B208CA for ; Fri, 14 Jun 2019 10:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbfFNKoP (ORCPT ); Fri, 14 Jun 2019 06:44:15 -0400 Received: from foss.arm.com ([217.140.110.172]:59374 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbfFNKoP (ORCPT ); Fri, 14 Jun 2019 06:44:15 -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 2A7262B; Fri, 14 Jun 2019 03:44:14 -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 D936F3F246; Fri, 14 Jun 2019 03:45:55 -0700 (PDT) Date: Fri, 14 Jun 2019 11:43:59 +0100 From: Lorenzo Pieralisi To: Karthikeyan Mitran 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 Subject: Re: [PATCHv5 10/20] PCI: mobiveil: Fix the INTx process errors Message-ID: <20190614104351.GA29955@e121166-lin.cambridge.arm.com> References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> <20190612150819.GD15747@redmoon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Jun 14, 2019 at 12:38:51PM +0530, Karthikeyan Mitran wrote: > 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 You are the maintainer for this driver, so if there is something to be changed you must post a patch to that extent, I do not understand what the above means, write the code to fix it, I won't do it. I am getting a bit annoyed with this Mobiveil driver so either you guys sort this out or I will have to remove it from the kernel. > Acked-by: Karthikeyan Mitran Ok I assume this means you tested it but according to what you say above, are there still issues with this code path ? Should we update the patch ? Moreover: https://kernelnewbies.org/PatchCulture Please read it and never top-post. Thanks, Lorenzo > 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCHv5 10/20] PCI: mobiveil: Fix the INTx process errors Date: Fri, 14 Jun 2019 11:43:59 +0100 Message-ID: <20190614104351.GA29955@e121166-lin.cambridge.arm.com> References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> <20190612150819.GD15747@redmoon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Karthikeyan Mitran 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 List-Id: devicetree@vger.kernel.org On Fri, Jun 14, 2019 at 12:38:51PM +0530, Karthikeyan Mitran wrote: > 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 You are the maintainer for this driver, so if there is something to be changed you must post a patch to that extent, I do not understand what the above means, write the code to fix it, I won't do it. I am getting a bit annoyed with this Mobiveil driver so either you guys sort this out or I will have to remove it from the kernel. > Acked-by: Karthikeyan Mitran Ok I assume this means you tested it but according to what you say above, are there still issues with this code path ? Should we update the patch ? Moreover: https://kernelnewbies.org/PatchCulture Please read it and never top-post. Thanks, Lorenzo > 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55799C31E44 for ; Fri, 14 Jun 2019 10:44:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29F02208CA for ; Fri, 14 Jun 2019 10:44:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h12GoKgM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29F02208CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bc0K20UtE+VwEbI2VGTK5wirTIYRePmOYNH2FkevefU=; b=h12GoKgMBjB4tn JHHy9JhItOsGlhjh+ewPLC4mCO7X1RJfSqkoWsGqxCSUQkuwMyd3g+buyeMSnwQtiU6n5KrDBS3RW NFy+HQq8kLWeg/Rl+d8V0zvx/rI+hqIPM7k0vPezmjNdk5OhGExOd6IhXHNJ1qULfHNpkY5GRNQu6 mPbQy94i+viCz/b2JWXPYKvrdxCWXbPeRXddttSgXdOLoEHGEqj7Kvy9KJtbSOtKtqPt3IMIt1+Mz qeWBTvy2csBEDS3QHRY98s3xaqMvOxg9b6TsOipX42/EXIlUCiR7illr9RNRfnKeuP8p3m4FghBFp sgXnL7Lvzm0KTJOLmitQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbjh8-0001qP-St; Fri, 14 Jun 2019 10:44:30 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbjgt-0001db-57 for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2019 10:44:17 +0000 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 2A7262B; Fri, 14 Jun 2019 03:44:14 -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 D936F3F246; Fri, 14 Jun 2019 03:45:55 -0700 (PDT) Date: Fri, 14 Jun 2019 11:43:59 +0100 From: Lorenzo Pieralisi To: Karthikeyan Mitran Subject: Re: [PATCHv5 10/20] PCI: mobiveil: Fix the INTx process errors Message-ID: <20190614104351.GA29955@e121166-lin.cambridge.arm.com> References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-11-Zhiqiang.Hou@nxp.com> <20190612150819.GD15747@redmoon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190614_034415_341015_8FC82428 X-CRM114-Status: GOOD ( 24.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , Xiaowei Bao , "linux-pci@vger.kernel.org" , "Z.q. Hou" , "l.subrahmanya@mobiveil.co.in" , "will.deacon@arm.com" , "linux-kernel@vger.kernel.org" , Leo Li , "M.h. Lian" , "robh+dt@kernel.org" , Mingkai Hu , "catalin.marinas@arm.com" , "bhelgaas@google.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 14, 2019 at 12:38:51PM +0530, Karthikeyan Mitran wrote: > 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 You are the maintainer for this driver, so if there is something to be changed you must post a patch to that extent, I do not understand what the above means, write the code to fix it, I won't do it. I am getting a bit annoyed with this Mobiveil driver so either you guys sort this out or I will have to remove it from the kernel. > Acked-by: Karthikeyan Mitran Ok I assume this means you tested it but according to what you say above, are there still issues with this code path ? Should we update the patch ? Moreover: https://kernelnewbies.org/PatchCulture Please read it and never top-post. Thanks, Lorenzo > 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel