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=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no 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 F2210C2BA2B for ; Sat, 11 Apr 2020 09:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4998212CC for ; Sat, 11 Apr 2020 09:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586596496; bh=g1HjFwokJM0rFuNqMG5LZDp7KeYa1z5o4NuTUY9Hwa8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=WjJEBIrfjNMjt5XOQJEZWWcxWaveiOxnD4+0UO28kyqDx88HdXzJRrnPjAaOuQJZ+ VfREjKogQ/Pnu599dFJvuF8+And8TXeZavMQ1j6fZhiIlNPILHlHYGnibcLP5bTOy+ kCa9KtG29doT1LXVB2MJCeRUg9M3X4AyZIkYsNxM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbgDKJOz (ORCPT ); Sat, 11 Apr 2020 05:14:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:54932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgDKJOy (ORCPT ); Sat, 11 Apr 2020 05:14:54 -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 A576A20857; Sat, 11 Apr 2020 09:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586596494; bh=g1HjFwokJM0rFuNqMG5LZDp7KeYa1z5o4NuTUY9Hwa8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SX9E2VAkwORVsD8PNwYS5LTsZdL+ud7uJnHzSt+ESHgyV2qIZK0MMZvCEJZNToc4V 8ZsP+hJrwyDihd4T2aQ8kGSYnJa6pU35HQXzG6bWyfAGdxHZj09/C4xqlWcx2/gDeq t7ZZ/Wgh5LroRGJEaDnIt1HCUvtWF3yfoRLO/c2E= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=big-swifty.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNCE0-002Lcs-UO; Sat, 11 Apr 2020 10:14:53 +0100 Date: Sat, 11 Apr 2020 10:14:47 +0100 Message-ID: <86sghas7so.wl-maz@kernel.org> From: Marc Zyngier To: Saravana Kannan Cc: Thomas Gleixner , Jason Cooper , John Stultz , kernel-team@android.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1] irqchip: Add IRQCHIP_MODULE_BEGIN/END helper macros In-Reply-To: <20200411045918.179455-1-saravanak@google.com> References: <20200411045918.179455-1-saravanak@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-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: 62.31.163.78 X-SA-Exim-Rcpt-To: saravanak@google.com, tglx@linutronix.de, jason@lakedaemon.net, john.stultz@linaro.org, kernel-team@android.com, linux-kernel@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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Sat, 11 Apr 2020 05:59:18 +0100, Saravana Kannan wrote: > > Add helper macros IRQCHIP_MODULE_BEGIN and IRQCHIP_MODULE_END that add > the boilerplate code to be able to compile an irqchip driver as a > module. > > The driver developer just needs to do add IRQCHIP_MODULE_BEGIN and > IRQCHIP_MODULE_END(driver_name) around the IRQCHIP_DECLARE macros, like > so: > > IRQCHIP_MODULE_BEGIN > IRQCHIP_DECLARE(foo, "acme,foo", acme_foo_init) > IRQCHIP_DECLARE(bar, "acme,bar", acme_bar_init) > IRQCHIP_MODULE_END(acme_irq) > > Cc: John Stultz > Signed-off-by: Saravana Kannan > --- > I don't expect this patch to be perfect or the final version. But I'd > like to introduce macros like this that don't need the driver developer > to copy/paste or repeat the same thing (compat string, function name, > etc) in multiple places for the driver to work as a module. If the exact > style of my macros aren't appealing, I'm open to other suggestions. > > There are some checkpatch warning about the > 80 columns that my patch > doesn't add. There are also checkpatch warnings about the trailing ; in > a macro, but I need those for IRQCHIP_DECLARE to work when the driver is > builtin. I think you are looking at the problem from the wrong end, and adding syntactic sugar should be the least of your worries. The reason for not allowing irqchip drivers to be modular is that there is no refcounting in place to prevent drivers from being removed whilst the IRQ stack still has irq_desc, irq_data and various other objects indirectly referencing the driver. I'm all for addressing these issues, though it begs the question of *why* you want to do this. We have been perfectly happy with built-in irqchips so far (they are pretty small, and there aren't millions of them), so what changed? Thanks, M. -- Jazz is not dead, it just smells funny.