linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Saravana Kannan <saravanak@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	John Stultz <john.stultz@linaro.org>,
	kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v1] irqchip: Add IRQCHIP_MODULE_BEGIN/END helper macros
Date: Sat, 11 Apr 2020 10:14:47 +0100	[thread overview]
Message-ID: <86sghas7so.wl-maz@kernel.org> (raw)
In-Reply-To: <20200411045918.179455-1-saravanak@google.com>

Hi Saravana,

On Sat, 11 Apr 2020 05:59:18 +0100,
Saravana Kannan <saravanak@google.com> 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 <john.stultz@linaro.org>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> 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.

  reply	other threads:[~2020-04-11  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  4:59 [RFC PATCH v1] irqchip: Add IRQCHIP_MODULE_BEGIN/END helper macros Saravana Kannan
2020-04-11  9:14 ` Marc Zyngier [this message]
2020-04-13 22:13   ` John Stultz
2020-04-13 22:43     ` Saravana Kannan
2020-04-29  9:28       ` Marc Zyngier
2020-04-29 19:04         ` Saravana Kannan
2020-05-01  8:48           ` Marc Zyngier
2020-05-01 20:23             ` Saravana Kannan
2020-06-03  1:59               ` Saravana Kannan
2020-06-03 10:12               ` Marc Zyngier
2020-07-17  2:55                 ` Saravana Kannan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86sghas7so.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saravanak@google.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).