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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C3266C433F5 for ; Tue, 8 Feb 2022 15:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=v8XgTNPupzooIm6y8wPge/P65swYrX9EbRtsbP3VV9A=; b=PEmVGeVbdS1nVp qexyQ1d16uHUNfsZZzpc9AllNgzgJyqAzbeBvBW8bl+T9c/YyBDVsX0q1Sw+v3vpUTBcrehLVk+sG BHZfuwJCM9omiyp9AoFDbSaYgmumuzj7U5ciW5Lno9BsMqKG3qYL9v/SAiCCoNP1+7BHOoKyAIAVL 2F2cMbBS2seJxALB/rpJeEaLJu7fWOmqC1BQmkIPrillgBmsIK2SJ5wrpxDc43n05pI2NB9lwtSuE P+gpbp8pXcoLJqXwSad3oyCv+9ILovVmr+7ECWZnDj7ABEytw9NI01ceJihmByE6KBzkRoCP1fT59 OZ9gV/gRRM8cygaqkbRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHSTN-00EVK7-QW; Tue, 08 Feb 2022 15:32:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHSTH-00EVId-PA for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 15:32:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 47B8B615B4; Tue, 8 Feb 2022 15:31:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F8F2C340E9; Tue, 8 Feb 2022 15:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644334318; bh=L0p/sE9csIRwSUuble/l//7GDvjyfHoLqprBqHetPSc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ouw1+av2qOU9Y88Pio/kOxI/2jxsqngUdvYjkPsq0DGvW0wvZjBPSv7J43exny63Z 2Jq+TXc8J1EkXvbcfVnIPVggcz7rWd5ZmWfpfroAQfch+SXB/HnBePi5diiAYy+9ek 7Gi0QplCwPQIJA0pDJ/3psDaRXngU3NfjL7Y5I72ZBGiQd/i2NBFluOMvphmC4GJM8 svFHDDl/lx9IXUlgnp1hYa2IhId0BlUdVN2URhNtxlM1rSqPpQp62ngDxc/9RxRK29 HZ/ZgxNO42Hc8oXVE30B8DzAdv+ZtLzZJO+sbsWdWz8y4yHID7z3kS0HG0P4+oh8UA mThwvlwoh0fEA== Date: Tue, 8 Feb 2022 15:31:52 +0000 From: Will Deacon To: Robin Murphy Cc: Lad Prabhakar , Joerg Roedel , Rob Clark , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Xin Tan , Sai Prakash Ranjan , "Isaac J. Manjarres" , Rob Herring , linux-kernel@vger.kernel.org, Prabhakar Subject: Re: [PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count Message-ID: <20220208153152.GC1802@willie-the-truck> References: <20211223130046.9365-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211223130046.9365-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220208151932.GB1802@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_073159_922092_46C7BBFC X-CRM114-Status: GOOD ( 38.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 08, 2022 at 03:28:50PM +0000, Robin Murphy wrote: > On 2022-02-08 15:19, Will Deacon wrote: > > On Thu, Dec 23, 2021 at 02:14:35PM +0000, Robin Murphy wrote: > > > On 2021-12-23 13:00, Lad Prabhakar wrote: > > > > platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static > > > > allocation of IRQ resources in DT core code, this causes an issue > > > > when using hierarchical interrupt domains using "interrupts" property > > > > in the node as this bypasses the hierarchical setup and messes up the > > > > irq chaining. > > > > > > > > In preparation for removal of static setup of IRQ resource from DT core > > > > code use platform_get_irq_count(). > > > > > > Nit: platform_irq_count() > > > > > > > Signed-off-by: Lad Prabhakar > > > > --- > > > > drivers/iommu/arm/arm-smmu/arm-smmu.c | 12 ++++++------ > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c > > > > index 4bc75c4ce402..4844cd075644 100644 > > > > --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c > > > > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c > > > > @@ -2105,12 +2105,12 @@ static int arm_smmu_device_probe(struct platform_device *pdev) > > > > if (IS_ERR(smmu)) > > > > return PTR_ERR(smmu); > > > > - num_irqs = 0; > > > > - while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, num_irqs))) { > > > > - num_irqs++; > > > > - if (num_irqs > smmu->num_global_irqs) > > > > - smmu->num_context_irqs++; > > > > - } > > > > + num_irqs = platform_irq_count(pdev); > > > > + if (num_irqs < 0) > > > > + return num_irqs; > > > > + > > > > + if (num_irqs > smmu->num_global_irqs) > > > > + smmu->num_context_irqs += (num_irqs - smmu->num_global_irqs); > > > > > > This seems a bit overcomplicated. I reckon: > > > > > > smmu->num_context_irqs = num_irqs - smmu->num_global_irqs; > > > if (num_irqs <= smmu->num_global_irqs) { > > > dev_err(... > > > > > > should do it. > > > > > > However, FYI I have some patches refactoring most of the IRQ stuff here that > > > I plan to post next cycle (didn't quite have time to get them done for 5.17 > > > as I'd hoped...), so unless this needs to go in right now as an urgent fix, > > > I'm happy to take care of removing platform_get_resource() as part of that > > > if it's easier. > > > > Did you get anywhere with this? December 23rd is long forgotten by now ;) > > Yup: https://gitlab.arm.com/linux-arm/linux-rm/-/commit/b2a40caaf1622eb35c555074a0d72f4f0513cff9 > > I'm still cleaning up the PMU driver that justifies the whole thing, but I > can send that patch now if you reckon it's not complete nonsense out of > context. Otherwise, I'll aim to get the whole lot out next week. Next week is fine, no rush. I was just trying to work out what to do with Lad's patches in this thread and it sounds like I should ignore them and wait for your series instead. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel