From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Bert Karwatzki <spasswolf@web.de>
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
Jiri Kosina <jikos@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Thomas Gleixner <tglx@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [tip: irq/core] genirq: Warn about using IRQF_ONESHOT without a threaded handler
Date: Tue, 3 Feb 2026 09:38:26 +0100 [thread overview]
Message-ID: <20260203083826.1gOzxrwt@linutronix.de> (raw)
In-Reply-To: <20260202232741.13380-1-spasswolf@web.de>
On 2026-02-03 00:27:40 [+0100], Bert Karwatzki wrote:
>
> The warning appears because iio_triggered_buffer_setup_ext() (in
> drivers/iio/buffer/industrialio-triggered-buffer.c) is called with thread = NULL
> during the probe of the iio device and calls iio_alloc_pollfunc()
> (in drivers/iio/industrialio-trigger.c) with thread = NULL and type = IRQF_ONESHOT.
>
> A simple fix could be this:
>
> diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
> index 9bf75dee7ff8..40eea3a44724 100644
> --- a/drivers/iio/buffer/industrialio-triggered-buffer.c
> +++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
> @@ -64,7 +64,7 @@ int iio_triggered_buffer_setup_ext(struct iio_dev *indio_dev,
>
> indio_dev->pollfunc = iio_alloc_pollfunc(h,
> thread,
> - IRQF_ONESHOT,
> + thread ? IRQF_ONESHOT : 0,
> indio_dev,
> "%s_consumer%d",
> indio_dev->name,
>
>
> Are there any problems with this?
Urgh. Haven't seen those.
Looking at all the users of of *iio_triggered_buffer_setup*() the
primary handler is either NULL or iio_pollfunc_store_time().
So IRQF_ONESHOST should work all the time.
Then there is
- drivers/iio/adc/vf610_adc.c
- drivers/iio/common/hid-sensors/hid-sensor-trigger.c
They use iio_pollfunc_store_time() as primary and have no secondary.
This would trigger the warning but not having a secondary handler while
returning IRQF_WAKE_THREAD should create a warning of its own.
What did I miss?
> Bert Karwatzki
Sebastian
next prev parent reply other threads:[~2026-02-03 8:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260113120541.YVf2vRA3@linutronix.de>
2026-02-02 23:27 ` [tip: irq/core] genirq: Warn about using IRQF_ONESHOT without a threaded handler Bert Karwatzki
2026-02-03 8:38 ` Sebastian Andrzej Siewior [this message]
2026-02-03 10:43 ` Bert Karwatzki
2026-02-03 14:58 ` Sebastian Andrzej Siewior
2026-02-07 15:46 ` Jonathan Cameron
2026-02-09 2:00 ` srinivas pandruvada
2026-02-14 15:00 ` Jonathan Cameron
2026-02-14 15:08 ` Jonathan Cameron
2026-02-03 17:29 ` srinivas pandruvada
2026-02-07 15:42 ` Jonathan Cameron
2026-03-01 23:17 ` David Lechner
2026-03-01 23:57 ` David Lechner
2026-03-01 22:45 ` David Lechner
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=20260203083826.1gOzxrwt@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=spasswolf@web.de \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tglx@kernel.org \
/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