public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Bert Karwatzki <spasswolf@web.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Bert Karwatzki <spasswolf@web.de>,
	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 00:27:40 +0100	[thread overview]
Message-ID: <20260202232741.13380-1-spasswolf@web.de> (raw)
In-Reply-To: <20260113120541.YVf2vRA3@linutronix.de>

Since commit 
aef30c8d569c ("genirq: Warn about using IRQF_ONESHOT without a threaded handler")
has been merged into linux-next the following warning appears when booting my 
MSI Alpha 15 laptop (running linux-next-20260130 with debian stable/trixie):

[    8.436584] [   T1180] ------------[ cut here ]------------
[    8.436811] [   T1180] WARNING: kernel/irq/manage.c:1502 at __setup_irq+0x4fa/0x730, CPU#15: iio-sensor-prox/1180
[    8.436817] [   T1180] Modules linked in: rfcomm bnep nls_ascii nls_cp437 vfat fat snd_hda_codec_generic btusb btrtl snd_hda_codec_atihdmi btintel snd_hda_codec_hdmi btbcm uvcvideo btmtk videobuf2_vmalloc videobuf2_memops snd_hda_intel uvc videobuf2_v4l2 snd_intel_dspcfg snd_hda_codec snd_acp3x_rn snd_soc_dmic snd_acp3x_pdm_dma bluetooth snd_hda_core snd_soc_core snd_hwdep videodev snd_pcm_oss snd_mixer_oss snd_pcm snd_rn_pci_acp3x hid_sensor_magn_3d hid_sensor_prox hid_sensor_accel_3d hid_sensor_als hid_sensor_gyro_3d videobuf2_common snd_acp_config snd_soc_acpi hid_sensor_trigger msi_wmi ecdh_generic ecc mc sparse_keymap wmi_bmof snd_timer k10temp snd snd_pci_acp3x ccp ac soundcore industrialio_triggered_buffer battery kfifo_buf button industrialio amd_pmc hid_sensor_iio_common joydev evdev mt7921e mt7921_common mt792x_lib mt76_connac_lib mt76 mac80211 libarc4 cfg80211 rfkill msr fuse nvme_fabrics efi_pstore configfs efivarfs autofs4 ext4 mbcache jbd2 usbhid amdgpu amdxcp i2c_algo_bit drm_client_lib drm_ttm_helper ttm xhci_pci
[    8.437165] [   T1180]  drm_exec drm_panel_backlight_quirks xhci_hcd gpu_sched drm_suballoc_helper hid_sensor_hub drm_buddy mfd_core hid_multitouch hid_generic drm_display_helper usbcore i2c_hid_acpi psmouse amd_sfh i2c_hid drm_kms_helper nvme hid serio_raw nvme_core r8169 i2c_piix4 cec i2c_smbus usb_common crc16 i2c_designware_platform i2c_designware_core
[    8.437185] [   T1180] CPU: 15 UID: 0 PID: 1180 Comm: iio-sensor-prox Tainted: G        W           6.19.0-rc7-next-20260130-iiodebug-00002-g2875feff2cee #292 PREEMPT(full) 
[    8.437188] [   T1180] Tainted: [W]=WARN
[    8.437189] [   T1180] Hardware name: Micro-Star International Co., Ltd. Alpha 15 B5EEK/MS-158L, BIOS E158LAMS.10F 11/11/2024
[    8.437190] [   T1180] RIP: 0010:__setup_irq+0x4fa/0x730
[    8.437193] [   T1180] Code: e7 e8 ca 6f 00 00 e9 7e fd ff ff b8 01 00 00 00 48 c7 c2 ff ff ff ff f3 48 0f bc d2 c4 e2 e9 f7 c0 48 89 43 48 e9 d8 fd ff ff <0f> 0b 85 c9 0f 85 8c 00 00 00 81 e2 00 00 01 00 0f 85 7d fb ff ff
[    8.437194] [   T1180] RSP: 0018:ffffc3b6c46d7c70 EFLAGS: 00010246
[    8.437196] [   T1180] RAX: 0000000000002000 RBX: ffffa04c05503e80 RCX: 0000000000000000
[    8.437197] [   T1180] RDX: 0000000000000400 RSI: ffffa04c112e0e00 RDI: ffffffffc181cac0
[    8.437198] [   T1180] RBP: 0000000000000077 R08: 0000000000000000 R09: ffffa04c05503e80
[    8.437199] [   T1180] R10: 0000000000000001 R11: 0000000000000003 R12: 0000000000000077
[    8.437200] [   T1180] R13: ffffa04c112e0e00 R14: ffffa04c112e0e00 R15: ffffa04c05503e80
[    8.437201] [   T1180] FS:  00007f447c23f940(0000) GS:ffffa04f2cb1d000(0000) knlGS:0000000000000000
[    8.437203] [   T1180] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    8.437204] [   T1180] CR2: 0000559507dd86d8 CR3: 0000000103b55000 CR4: 0000000000750ef0
[    8.437205] [   T1180] PKRU: 55555554
[    8.437206] [   T1180] Call Trace:
[    8.437207] [   T1180]  <TASK>
[    8.437209] [   T1180]  request_threaded_irq+0xdf/0x170
[    8.437213] [   T1180]  iio_trigger_attach_poll_func.cold+0x3e/0x111 [industrialio]
[    8.437220] [   T1180]  __iio_update_buffers.cold+0x5c/0x70 [industrialio]
[    8.437224] [   T1180]  ? __entry_text_end+0x1021d7/0x1021db
[    8.437227] [   T1180]  ? _dev_info+0x6a/0x84
[    8.437232] [   T1180]  enable_store+0x95/0xe7 [industrialio]
[    8.437236] [   T1180]  kernfs_fop_write_iter+0x14b/0x200
[    8.437240] [   T1180]  vfs_write+0x21d/0x420
[    8.437244] [   T1180]  ksys_write+0x5e/0xd0
[    8.437246] [   T1180]  do_syscall_64+0x66/0x380
[    8.437250] [   T1180]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[    8.437252] [   T1180] RIP: 0033:0x7f447c6459ee
[    8.437254] [   T1180] Code: 08 0f 85 f5 4b ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
[    8.437255] [   T1180] RSP: 002b:00007ffc44efa068 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[    8.437257] [   T1180] RAX: ffffffffffffffda RBX: 00007f447c23f940 RCX: 00007f447c6459ee
[    8.437258] [   T1180] RDX: 0000000000000001 RSI: 00007ffc44efa210 RDI: 0000000000000008
[    8.437259] [   T1180] RBP: 00007ffc44efa210 R08: 0000000000000000 R09: 0000000000000000
[    8.437260] [   T1180] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
[    8.437261] [   T1180] R13: 0000559507d382a0 R14: 00007f447c78fee0 R15: 0000000000000001
[    8.437263] [   T1180]  </TASK>
[    8.437264] [   T1180] ---[ end trace 0000000000000000 ]---

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?

Bert Karwatzki

       reply	other threads:[~2026-02-02 23:28 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 ` Bert Karwatzki [this message]
2026-02-03  8:38   ` [tip: irq/core] genirq: Warn about using IRQF_ONESHOT without a threaded handler Sebastian Andrzej Siewior
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=20260202232741.13380-1-spasswolf@web.de \
    --to=spasswolf@web.de \
    --cc=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=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