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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDEF9C433F5 for ; Tue, 28 Sep 2021 08:10:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC11E61159 for ; Tue, 28 Sep 2021 08:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239330AbhI1IMS (ORCPT ); Tue, 28 Sep 2021 04:12:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:40418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239043AbhI1IMR (ORCPT ); Tue, 28 Sep 2021 04:12:17 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD42560F9B; Tue, 28 Sep 2021 08:10:37 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mV8CB-00DRl2-M2; Tue, 28 Sep 2021 09:10:35 +0100 Date: Tue, 28 Sep 2021 09:10:34 +0100 Message-ID: <87pmstt91h.wl-maz@kernel.org> From: Marc Zyngier To: Florian Fainelli Cc: Rob Herring , "linux-kernel@vger.kernel.org" , Russell King , Ray Jui , Scott Branden , "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." , Catalin Marinas , Will Deacon , Yoshinori Sato , Rich Felker , Thomas Gleixner , Frank Rowand , Ard Biesheuvel , Mike Rapoport , Linus Walleij , Andrew Morton , Geert Uytterhoeven , Arnd Bergmann , Guenter Roeck , Kefeng Wang , Mark Rutland , Andrey Konovalov , Anshuman Khandual , Valentin Schneider , Ingo Molnar , Peter Zijlstra , "moderated list:ARM PORT" , "open list:SUPERH" , "open list:BROADCOM BMIPS MIPS ARCHITECTURE" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Subject: Re: [PATCH 07/11] of/irq: Export of_irq_count to drivers In-Reply-To: References: <20210924170546.805663-1-f.fainelli@gmail.com> <20210924170546.805663-8-f.fainelli@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: f.fainelli@gmail.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, catalin.marinas@arm.com, will@kernel.org, ysato@users.sourceforge.jp, dalias@libc.org, tglx@linutronix.de, frowand.list@gmail.com, ardb@kernel.org, rppt@kernel.org, linus.walleij@linaro.org, akpm@linux-foundation.org, geert+renesas@glider.be, arnd@arndb.de, linux@roeck-us.net, wangkefeng.wang@huawei.com, mark.rutland@arm.com, andreyknvl@gmail.com, anshuman.khandual@arm.com, valentin.schneider@arm.com, mingo@kernel.org, peterz@infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Mon, 27 Sep 2021 20:49:46 +0100, Florian Fainelli wrote: > > On 9/27/21 12:43 PM, Rob Herring wrote: > > On Mon, Sep 27, 2021 at 2:28 PM Florian Fainelli wrote: > >> > >> On 9/27/21 12:08 PM, Rob Herring wrote: > >>> On Fri, Sep 24, 2021 at 12:07 PM Florian Fainelli wrote: > >>>> > >>>> In order to build drivers/irqchip/irq-bcm7120-l2.c as a module, we will > >>>> need to have of_irq_count() exported to modules. > >>>> > >>>> Signed-off-by: Florian Fainelli > >>>> --- > >>>> drivers/of/irq.c | 1 + > >>>> 1 file changed, 1 insertion(+) > >>>> > >>>> diff --git a/drivers/of/irq.c b/drivers/of/irq.c > >>>> index 352e14b007e7..949b9d1f8729 100644 > >>>> --- a/drivers/of/irq.c > >>>> +++ b/drivers/of/irq.c > >>>> @@ -440,6 +440,7 @@ int of_irq_count(struct device_node *dev) > >>>> > >>>> return nr; > >>>> } > >>>> +EXPORT_SYMBOL_GPL(of_irq_count); > >>> > >>> Please convert to use platform_irq_count() instead. > >> > >> That requires a platform_device to be passed to platform_irq_count(), > >> will that work even when the drivers remain built into the kernel and > >> get initialized early on? > > > > No, does your irqchip using this do both? Looks to me like it is > > always a platform_device. > > On ARM/ARM64 not using GKI as well as MIPS, we would want the module to > be built into the kernel image, however when using GKI that driver would > become a module. How do you suggest reconciling both usages? I don't see what GKI has to do with anything. Either the driver can be built as a module (and it is in this case a platform device at all times, built-in or not), or it cannot, and it falls into the IRQCHIP_DECLARE() category (and there is no export problem). Pick your poison! Thanks, M. -- Without deviation from the norm, progress is not possible.