linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mark Gross <markgross@kernel.org>, Michael Buesch <m@bues.ch>,
	Rafa?? Mi??ecki <zajec5@gmail.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	linux-gpio@vger.kernel.org, linux-wireless@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [RFC PATCH] genirq: Provide generic_handle_domain_irq_safe().
Date: Mon, 16 May 2022 12:18:14 +0200	[thread overview]
Message-ID: <20220516101814.GA18490@wunner.de> (raw)
In-Reply-To: <YnkfWFzvusFFktSt@linutronix.de>

On Mon, May 09, 2022 at 04:04:08PM +0200, Sebastian Andrzej Siewior wrote:
> The problem with generic_handle_domain_irq() is that with `threadirqs'
> it will trigger "WARN_ON_ONCE(!in_hardirq())".

Now silenced by:
https://git.kernel.org/linus/792ea6a074ae


> +int generic_handle_domain_irq_safe(struct irq_domain *domain, unsigned int hwirq)
> +{
> +	unsigned long flags;
> +	int ret;
> +
> +	local_irq_save(flags);
> +	ret = handle_irq_desc(irq_resolve_mapping(domain, hwirq));
> +	local_irq_restore(flags);
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(generic_handle_domain_irq_safe);

AFAICS you don't need to disable hardirqs at least for the "threadirqs"
case because irq_forced_thread_fn() already does that.


>  drivers/bcma/driver_gpio.c                 |  2 +-
>  drivers/gpio/gpio-mlxbf2.c                 |  6 ++----
>  drivers/pinctrl/pinctrl-amd.c              |  2 +-
>  drivers/platform/x86/intel/int0002_vgpio.c |  3 +--
>  drivers/ssb/driver_gpio.c                  |  6 ++++--

From a quick look, the proper solution for all of those drivers is
probably to just add IRQF_NO_THREAD and be done with it.

Thanks,

Lukas

  reply	other threads:[~2022-05-16 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 14:04 [RFC PATCH] genirq: Provide generic_handle_domain_irq_safe() Sebastian Andrzej Siewior
2022-05-16 10:18 ` Lukas Wunner [this message]
2022-05-16 11:23   ` Sebastian Andrzej Siewior

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=20220516101814.GA18490@wunner.de \
    --to=lukas@wunner.de \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=bigeasy@linutronix.de \
    --cc=brgl@bgdev.pl \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=m@bues.ch \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zajec5@gmail.com \
    /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).