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 C1C94C433FE for ; Wed, 20 Oct 2021 15:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BACD6138B for ; Wed, 20 Oct 2021 15:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbhJTPbB (ORCPT ); Wed, 20 Oct 2021 11:31:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbhJTPa7 (ORCPT ); Wed, 20 Oct 2021 11:30:59 -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 5924C61371; Wed, 20 Oct 2021 15:28:45 +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 1mdDWE-000T12-2P; Wed, 20 Oct 2021 16:28:43 +0100 Date: Wed, 20 Oct 2021 16:28:41 +0100 Message-ID: <87zgr3btqu.wl-maz@kernel.org> From: Marc Zyngier To: Florian Fainelli Cc: Rob Herring , "linux-kernel@vger.kernel.org" , Ray Jui , Scott Branden , "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." , Russell King , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , Thomas Gleixner , Frank Rowand , "moderated list:ARM SUB-ARCHITECTURES" , "open list:MIPS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Subject: Re: [PATCH v4 09/14] irqchip: Provide platform_device to of_irq_init_cb_t In-Reply-To: References: <20211009022023.3796472-1-f.fainelli@gmail.com> <20211009022023.3796472-10-f.fainelli@gmail.com> <871r4gvggb.wl-maz@kernel.org> <87tuhcnlwt.wl-maz@kernel.org> 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@kernel.org, linux-kernel@vger.kernel.org, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, tsbogend@alpha.franken.de, tglx@linutronix.de, frowand.list@gmail.com, linux-arm-kernel@lists.infradead.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-kernel@vger.kernel.org On Wed, 20 Oct 2021 16:14:07 +0100, Florian Fainelli wrote: > > > > On 10/20/2021 1:24 AM, Marc Zyngier wrote: > > On Tue, 19 Oct 2021 23:23:52 +0100, > > Rob Herring wrote: > >> > >> On Tue, Oct 19, 2021 at 4:43 PM Marc Zyngier wrote: > >>> > >>> diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h > >>> index ccf32758ea85..146a9d80a6a2 100644 > >>> --- a/include/linux/irqchip.h > >>> +++ b/include/linux/irqchip.h > >>> @@ -33,7 +33,15 @@ extern int platform_irqchip_probe(struct platform_device *pdev); > >>> #define IRQCHIP_PLATFORM_DRIVER_BEGIN(drv_name) \ > >>> static const struct of_device_id drv_name##_irqchip_match_table[] = { > >>> > >>> -#define IRQCHIP_MATCH(compat, fn) { .compatible = compat, .data = fn }, > >>> +/* Undefined on purpose */ > >>> +int typecheck_irq_init_cb(struct device_node *, struct device_node *, > >>> + struct platform_device *); > >>> + > >>> +#define typecheck_irq_init_cb(fn) \ > >>> + __typecheck(typecheck_irq_init_cb, fn) ? fn : fn > >> > >> That's nice! Shouldn't it also be used for IRQCHIP_DECLARE? > > > > Absolutely. And enabling this shows that changing of_irq_init_cb_t > > breaks *all users* of IRQCHIP_DECLARE(). Not an acceptable outcome > > when we're at -rc5. > > > Why can't the relevant drivers use of_find_device_by_node() instead? > > That would allow us to keep the status-quo on of_irq_init_cb_t. > > Rob had suggested several solutions, including using > of_find_device_by_node(), however updating of_irq_init_cb_t was > indicated to be the better way. I had intentionally not updated > IRQCHIP_DECLARE() because it would ignore the 3rd argument we passed > to it (platform_device *) so I thought. In general, conflicting prototype always lead to the compiler legitimately screwing something up, and you are left with a pile of steaming crap to debug. So *no* to that sort of trick. > If I am spinning a v6 using of_find_device_by_node() would that be > acceptable to you? That'd be much better. Thanks, M. -- Without deviation from the norm, progress is not possible. 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 9EF11C433F5 for ; Wed, 20 Oct 2021 15:35:34 +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 6C1286138D for ; Wed, 20 Oct 2021 15:35:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C1286138D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yttJWHjrwdZqbgKowOYkmVssLIZ9j0eHOhJnY9UpwYA=; b=wAH8oDfJHNfCXb DDde1DOP5alkxikGHIbFB178j+9l96yhnuhGDkef2Vf4s/xkAiQ9epp2p8j0M+aSrwRpGTB+iMnXk NSZ2zreLThu8SSAn/UjbDmUdCF3UpnryHJBvsBxihlq4kuPLkLYNqxhHDXucJbCe64JDcbn3eS6e3 5FE3jBkAR/J8wwFmQuq+SGDblbK3f4RKtl5mGtXw2J0Q87FO1MKYgDw+vZQst/mk6uq2Iwl1KRqlL j8fINcoY4TvsEvQ++u/xN6S12z7Tra/t+hhck6mRJvJJVc19Fy55KtP3FMVdl+EobTwW8p/HZezdk qrItnnFU5sCipkr/a8dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdDb2-0053yc-NF; Wed, 20 Oct 2021 15:33:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdDWH-0051iA-Sg for linux-arm-kernel@lists.infradead.org; Wed, 20 Oct 2021 15:28:47 +0000 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 5924C61371; Wed, 20 Oct 2021 15:28:45 +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 1mdDWE-000T12-2P; Wed, 20 Oct 2021 16:28:43 +0100 Date: Wed, 20 Oct 2021 16:28:41 +0100 Message-ID: <87zgr3btqu.wl-maz@kernel.org> From: Marc Zyngier To: Florian Fainelli Cc: Rob Herring , "linux-kernel@vger.kernel.org" , Ray Jui , Scott Branden , "maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE..." , Russell King , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , Thomas Gleixner , Frank Rowand , "moderated list:ARM SUB-ARCHITECTURES" , "open list:MIPS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" Subject: Re: [PATCH v4 09/14] irqchip: Provide platform_device to of_irq_init_cb_t In-Reply-To: References: <20211009022023.3796472-1-f.fainelli@gmail.com> <20211009022023.3796472-10-f.fainelli@gmail.com> <871r4gvggb.wl-maz@kernel.org> <87tuhcnlwt.wl-maz@kernel.org> 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") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: f.fainelli@gmail.com, robh@kernel.org, linux-kernel@vger.kernel.org, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, tsbogend@alpha.franken.de, tglx@linutronix.de, frowand.list@gmail.com, linux-arm-kernel@lists.infradead.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211020_082846_014156_04C8CB42 X-CRM114-Status: GOOD ( 26.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 Wed, 20 Oct 2021 16:14:07 +0100, Florian Fainelli wrote: > > > > On 10/20/2021 1:24 AM, Marc Zyngier wrote: > > On Tue, 19 Oct 2021 23:23:52 +0100, > > Rob Herring wrote: > >> > >> On Tue, Oct 19, 2021 at 4:43 PM Marc Zyngier wrote: > >>> > >>> diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h > >>> index ccf32758ea85..146a9d80a6a2 100644 > >>> --- a/include/linux/irqchip.h > >>> +++ b/include/linux/irqchip.h > >>> @@ -33,7 +33,15 @@ extern int platform_irqchip_probe(struct platform_device *pdev); > >>> #define IRQCHIP_PLATFORM_DRIVER_BEGIN(drv_name) \ > >>> static const struct of_device_id drv_name##_irqchip_match_table[] = { > >>> > >>> -#define IRQCHIP_MATCH(compat, fn) { .compatible = compat, .data = fn }, > >>> +/* Undefined on purpose */ > >>> +int typecheck_irq_init_cb(struct device_node *, struct device_node *, > >>> + struct platform_device *); > >>> + > >>> +#define typecheck_irq_init_cb(fn) \ > >>> + __typecheck(typecheck_irq_init_cb, fn) ? fn : fn > >> > >> That's nice! Shouldn't it also be used for IRQCHIP_DECLARE? > > > > Absolutely. And enabling this shows that changing of_irq_init_cb_t > > breaks *all users* of IRQCHIP_DECLARE(). Not an acceptable outcome > > when we're at -rc5. > > > Why can't the relevant drivers use of_find_device_by_node() instead? > > That would allow us to keep the status-quo on of_irq_init_cb_t. > > Rob had suggested several solutions, including using > of_find_device_by_node(), however updating of_irq_init_cb_t was > indicated to be the better way. I had intentionally not updated > IRQCHIP_DECLARE() because it would ignore the 3rd argument we passed > to it (platform_device *) so I thought. In general, conflicting prototype always lead to the compiler legitimately screwing something up, and you are left with a pile of steaming crap to debug. So *no* to that sort of trick. > If I am spinning a v6 using of_find_device_by_node() would that be > acceptable to you? That'd be much better. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel