Skip to contentSkip to conversation

IRQF_ONESHOT clean up

PATCH Applied Sebastian Andrzej Siewior 23 participants 75 messages Jan 23 – Feb 8

Subsystems (50)

v1 of 2 Applied 1/21 Latest is v2 →

lore
Share & tools
lore

Sebastian Andrzej Siewior

author maintainer
#0 lore raw

cover IRQF_ONESHOT clean up

There was a bug report about setting IRQF_ONESHOT where it should have not been set. I looked around for other mistakes in that area. There are the following categories:

- Using custom primary irq handler doing exactly what irq_default_primary_handler() does

- Not using IRQF_ONESHOT but it looks like it is needed

- Using IRQF_ONESHOT but it looks like it should not have been used

- Using IRQF_ONESHOT but IRQF_NO_THREAD should be used

The outcome varies from harmless to problematic. Some examples:
- Missing IRQF_ONESHOT for a threaded interrupt.
For level-typed interrupts it is essential to disable the interrupt while the thread is running in order to make progress. Missing it means the interrupt remains active and the thread has little chance to make progress.
The irq-core will reject such request_irq() invocations but only if the primary handler is NULL, not if it is a copy of the default handler.

- Using IRQF_ONESHOT for a non-threaded interrupt.
This makes no sense since the threaded handler is missing. It can lead to errors in forced-threaded environments such as PREEMPT_RT especially if the handler uses functions which can sleep only on PREEMPT_RT.

This series is touching multiple subsystems. Instead of sending many single patches I decided to make one series. It would be nice if the individual subsystems could apply the changes individually, there are no dependencies as far as I can tell (except for int0002 but this is a different story).

Sebastian Andrzej Siewior (21):
genirq: Set IRQF_COND_ONESHOT in devm_request_irq(). platform/x86: int0002: Remove IRQF_ONESHOT from request_irq() iommu/amd: Use core's primary handler and set IRQF_ONESHOT
mailbox: bcm-ferxrm-mailbox: Use default primary handler
bus: fsl-mc: Use default primary handler
Bluetooth: btintel_pcie: Use IRQF_ONESHOT and default primary handler
scsi: efct: Use IRQF_ONESHOT and default primary handler
ARM: versatile: Remove IRQF_ONESHOT
char: tpm: cr50: Remove IRQF_ONESHOT
EDAC/altera: Remove IRQF_ONESHOT
i2c: spacemit: Remove IRQF_ONESHOT
ASoC: codecs: rt56*: Remove IRQF_ONESHOT
usb: typec: fusb302: Remove IRQF_ONESHOT
rtc: amlogic-a4: Remove IRQF_ONESHOT
thermal/qcom/lmh: Replace IRQF_ONESHOT with IRQF_NO_THREAD perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD
mfd: wm8350-core: Use IRQF_ONESHOT
iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD
iio: Use IRQF_NO_THREAD
iio: magnetometer: Remove IRQF_ONESHOT
media: pci: mg4b: Use IRQF_NO_THREAD

 arch/arm/mach-versatile/spc.c              |  4 ++--
 drivers/bluetooth/btintel_pcie.c           |  9 ++-------
 drivers/bus/fsl-mc/dprc-driver.c           | 13 +------------
 drivers/char/tpm/tpm_tis_i2c_cr50.c        |  3 +--
 drivers/char/tpm/tpm_tis_spi_cr50.c        |  2 +-
 drivers/edac/altera_edac.c                 | 11 ++++-------
 drivers/i2c/busses/i2c-k1.c                |  2 +-
 drivers/iio/accel/adxl355_core.c           |  3 ++-
 drivers/iio/accel/adxl372.c                |  9 ++++-----
 drivers/iio/accel/bma180.c                 |  5 +++--
 drivers/iio/accel/mxc4005.c                | 11 ++++-------
 drivers/iio/accel/stk8ba50.c               | 11 ++++-------
 drivers/iio/adc/ad4170-4.c                 |  2 +-
 drivers/iio/adc/ad7766.c                   | 10 ++--------
 drivers/iio/adc/ad7768-1.c                 |  5 ++---
 drivers/iio/adc/ad7779.c                   |  2 +-
 drivers/iio/adc/mcp3911.c                  |  2 +-
 drivers/iio/adc/ti-ads131e08.c             |  2 +-
 drivers/iio/chemical/ens160_core.c         |  9 +++------
 drivers/iio/gyro/adxrs290.c                |  2 +-
 drivers/iio/gyro/itg3200_buffer.c          |  2 +-
 drivers/iio/health/afe4403.c               |  9 ++++-----
 drivers/iio/health/afe4404.c               |  9 ++++-----
 drivers/iio/light/si1145.c                 |  2 +-
 drivers/iio/magnetometer/ak8975.c          |  2 +-
 drivers/iio/magnetometer/bmc150_magn.c     |  9 +++------
 drivers/iio/pressure/dlhl60d.c             |  6 +++---
 drivers/iio/temperature/tmp006.c           | 10 ++++------
 drivers/iommu/amd/amd_iommu.h              |  1 -
 drivers/iommu/amd/init.c                   | 12 ++++--------
 drivers/iommu/amd/iommu.c                  |  5 -----
 drivers/mailbox/bcm-flexrm-mailbox.c       | 14 ++------------
 drivers/media/pci/mgb4/mgb4_trigger.c      |  2 +-
 drivers/perf/cxl_pmu.c                     |  2 +-
 drivers/platform/x86/intel/int0002_vgpio.c |  4 ++--
 drivers/rtc/rtc-amlogic-a4.c               |  2 +-
 drivers/scsi/elx/efct/efct_driver.c        |  8 +-------
 drivers/thermal/qcom/lmh.c                 |  2 +-
 drivers/usb/typec/tcpm/fusb302.c           |  3 +--
 include/linux/interrupt.h                  |  2 +-
 include/linux/mfd/wm8350/core.h            |  2 +-
 sound/soc/codecs/rt5640.c                  |  4 ++--
 sound/soc/codecs/rt5651.c                  |  2 +-
 sound/soc/codecs/rt5663.c                  |  4 ++--
 44 files changed, 83 insertions(+), 152 deletions(-)
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH 1/21 genirq: Set IRQF_COND_ONESHOT in devm_request_irq().

The flag IRQF_COND_ONESHOT was already force-added to request_irq() because the ACPI SCI interrupt handler is using the ONESHOT and it breaks all shared handler.
devm_request_irq() needs the same change since some users, such as int0002_vgpio, are using this function instead.

Add IRQF_COND_ONESHOT to flags passed to devm_request_irq().

Fixes c37927a203fa2 ("genirq: Set IRQF_COND_ONESHOT in request_irq()")
---
 include/linux/interrupt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/interrupt.h +1 -1
index 266f2b39213a0..b2bb878abd113 100644
@@ -228,7 +228,7 @@ static inline int __must_check
 devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
 		 unsigned long irqflags, const char *devname, void *dev_id)
 {
-	return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags,
+	return devm_request_threaded_irq(dev, irq, handler, NULL, irqflags | IRQF_COND_ONESHOT,
 					 devname, dev_id);
 }
 
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 2/21 platform/x86: int0002: Remove IRQF_ONESHOT from request_irq()

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The flag was added to match the flag on the shared handler which uses a threaded handler and therefore IRQF_ONESHOT. This is no longer needed because devm_request_irq() now passes IRQF_COND_ONESHOT for this case.

Revert adding IRQF_ONESHOT to irqflags.

Cc Hans de Goede <[email protected]>
Cc "Ilpo Järvinen" <[email protected]>
Fixes 8f812373d1958 ("platform/x86: intel: int0002_vgpio: Pass IRQF_ONESHOT to request_irq()")
---
 drivers/platform/x86/intel/int0002_vgpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/intel/int0002_vgpio.c +2 -2
index 6f5629dc3f8db..562e880256436 100644
@@ -206,8 +206,8 @@ static int int0002_probe(struct platform_device *pdev)
 	 * FIXME: augment this if we managed to pull handling of shared
 	 * IRQs into gpiolib.
 	 */
-	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_ONESHOT | IRQF_SHARED, "INT0002", chip);
+	ret = devm_request_irq(dev, irq, int0002_irq, IRQF_SHARED, "INT0002",
+			       chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;
Signature · 1 line
2.51.0
author maintainer
#3 lore raw

Re: [PATCH 02/21] platform/x86: int0002: Remove IRQF_ONESHOT from request_irq()

Quoted 7 lines · On 2026-01-23 12:36:48 [+0100], To [email protected] wrote:

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Quoted 5 lines

The flag was added to match the flag on the shared handler which uses a threaded handler and therefore IRQF_ONESHOT. This is no longer needed because devm_request_irq() now passes IRQF_COND_ONESHOT for this case.

Revert adding IRQF_ONESHOT to irqflags.

This one should probably go hand in hand with the previous one. It might be easier to route both via tip/irq.

Sebastian

maintainer Acked-by
#4 lore raw

Re: [PATCH 02/21] platform/x86: int0002: Remove IRQF_ONESHOT from request_irq()

Quoted 8 lines · Sebastian Andrzej Siewior
Quoted 7 lines · On 2026-01-23 12:36:48 [+0100], To [email protected] wrote:

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Quoted 8 lines
Quoted 5 lines

The flag was added to match the flag on the shared handler which uses a threaded handler and therefore IRQF_ONESHOT. This is no longer needed because devm_request_irq() now passes IRQF_COND_ONESHOT for this case.

Revert adding IRQF_ONESHOT to irqflags.

This one should probably go hand in hand with the previous one. It might be easier to route both via tip/irq.

For that,

Signature · 1 line
 i.
maintainer Reviewed-by on v1 2/21
#5 lore raw

Re: [PATCH 02/21] platform/x86: int0002: Remove IRQF_ONESHOT from request_irq()

In reply to Sebastian Andrzej Siewior

Hi,

Quoted 13 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The flag was added to match the flag on the shared handler which uses a threaded handler and therefore IRQF_ONESHOT. This is no longer needed because devm_request_irq() now passes IRQF_COND_ONESHOT for this case.

Revert adding IRQF_ONESHOT to irqflags.

Quoted 7 lines
Cc Hans de Goede <[email protected]>
Cc "Ilpo Järvinen" <[email protected]>
Fixes 8f812373d1958 ("platform/x86: intel: int0002_vgpio: Pass IRQF_ONESHOT to request_irq()")

Thanks, patch looks good to me:

Regards,

Hans

Quoted 19 lines
---
 drivers/platform/x86/intel/int0002_vgpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/intel/int0002_vgpio.c +2 -2
index 6f5629dc3f8db..562e880256436 100644
@@ -206,8 +206,8 @@ static int int0002_probe(struct platform_device *pdev)
 	 * FIXME: augment this if we managed to pull handling of shared
 	 * IRQs into gpiolib.
 	 */
-	ret = devm_request_irq(dev, irq, int0002_irq,
-			       IRQF_ONESHOT | IRQF_SHARED, "INT0002", chip);
+	ret = devm_request_irq(dev, irq, int0002_irq, IRQF_SHARED, "INT0002",
+			       chip);
 	if (ret) {
 		dev_err(dev, "Error requesting IRQ %d: %d\n", irq, ret);
 		return ret;
author maintainer
#6 lore raw

PATCH 3/21 iommu/amd: Use core's primary handler and set IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

request_threaded_irq() is invoked with a primary and a secondary handler and no flags are passed. The primary handler is the same as irq_default_primary_handler() so there is no need to have an identical copy.
The lack of the IRQF_ONESHOT can be dangerous because the interrupt source is not masked while the threaded handler is active. This means, especially on LEVEL typed interrupt lines, the interrupt can fire again before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Cc Joerg Roedel <[email protected]>
Cc Suravee Suthikulpanit <[email protected]>
Fixes 72fe00f01f9a3 ("x86/amd-iommu: Use threaded interupt handler")
---
 drivers/iommu/amd/amd_iommu.h |  1 -
 drivers/iommu/amd/init.c      | 12 ++++--------
 drivers/iommu/amd/iommu.c     |  5 -----
 3 files changed, 4 insertions(+), 14 deletions(-)
drivers/iommu/amd/amd_iommu.h +0 -1
index b742ef1adb352..df1c238dc8885 100644
@@ -15,7 +15,6 @@ irqreturn_t amd_iommu_int_thread(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_evtlog(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_pprlog(int irq, void *data);
 irqreturn_t amd_iommu_int_thread_galog(int irq, void *data);
-irqreturn_t amd_iommu_int_handler(int irq, void *data);
 void amd_iommu_restart_log(struct amd_iommu *iommu, const char *evt_type,
 			   u8 cntrl_intr, u8 cntrl_log,
 			   u32 status_run_mask, u32 status_overflow_mask);
drivers/iommu/amd/init.c +4 -8
index 384c90b4f90a0..62a7a718acf8f 100644
@@ -2356,12 +2356,8 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
 	if (r)
 		return r;
 
-	r = request_threaded_irq(iommu->dev->irq,
-				 amd_iommu_int_handler,
-				 amd_iommu_int_thread,
-				 0, "AMD-Vi",
-				 iommu);
-
+	r = request_threaded_irq(iommu->dev->irq, NULL, amd_iommu_int_thread,
+				 IRQF_ONESHOT, "AMD-Vi", iommu);
 	if (r) {
 		pci_disable_msi(iommu->dev);
 		return r;
@@ -2535,8 +2531,8 @@ static int __iommu_setup_intcapxt(struct amd_iommu *iommu, const char *devname,
 		return irq;
 	}
 
-	ret = request_threaded_irq(irq, amd_iommu_int_handler,
-				   thread_fn, 0, devname, iommu);
+	ret = request_threaded_irq(irq, NULL, thread_fn, IRQF_ONESHOT, devname,
+				   iommu);
 	if (ret) {
 		irq_domain_free_irqs(irq, 1);
 		irq_domain_remove(domain);
drivers/iommu/amd/iommu.c +0 -5
index 5d45795c367a6..bd577852618b7 100644
@@ -1151,11 +1151,6 @@ irqreturn_t amd_iommu_int_thread(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-irqreturn_t amd_iommu_int_handler(int irq, void *data)
-{
-	return IRQ_WAKE_THREAD;
-}
-
 /****************************************************************************
  *
  * IOMMU command queuing functions
Signature · 1 line
2.51.0
author maintainer
#7 lore raw

PATCH 4/21 mailbox: bcm-ferxrm-mailbox: Use default primary handler

In reply to Sebastian Andrzej Siewior

request_threaded_irq() is invoked with a primary and a secondary handler and no flags are passed. The primary handler is the same as irq_default_primary_handler() so there is no need to have an identical copy.
The lack of the IRQF_ONESHOT can be dangerous because the interrupt source is not masked while the threaded handler is active. This means, especially on LEVEL typed interrupt lines, the interrupt can fire again before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

---

Has this by any chance been done as micro optimisation to avoid setting IRQF_ONESHOT which disables the IRQ-line and could be avoided for MSI typed interrupts? But since it IRQ-core requires this flag one could get away with it by using a different primary handler.

 drivers/mailbox/bcm-flexrm-mailbox.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/mailbox/bcm-flexrm-mailbox.c +2 -12
index 41f79e51d9e5a..4255fefc3a5a0 100644
@@ -1173,14 +1173,6 @@ static int flexrm_debugfs_stats_show(struct seq_file *file, void *offset)
 
 /* ====== FlexRM interrupt handler ===== */
 
-static irqreturn_t flexrm_irq_event(int irq, void *dev_id)
-{
-	/* We only have MSI for completions so just wakeup IRQ thread */
-	/* Ring related errors will be informed via completion descriptors */
-
-	return IRQ_WAKE_THREAD;
-}
-
 static irqreturn_t flexrm_irq_thread(int irq, void *dev_id)
 {
 	flexrm_process_completions(dev_id);
@@ -1271,10 +1263,8 @@ static int flexrm_startup(struct mbox_chan *chan)
 		ret = -ENODEV;
 		goto fail_free_cmpl_memory;
 	}
-	ret = request_threaded_irq(ring->irq,
-				   flexrm_irq_event,
-				   flexrm_irq_thread,
-				   0, dev_name(ring->mbox->dev), ring);
+	ret = request_threaded_irq(ring->irq, NULL, flexrm_irq_thread,
+				   IRQF_ONESHOT, dev_name(ring->mbox->dev), ring);
 	if (ret) {
 		dev_err(ring->mbox->dev,
 			"failed to request ring%d IRQ\n", ring->num);
Signature · 1 line
2.51.0
author maintainer
#8 lore raw

PATCH 5/21 bus: fsl-mc: Use default primary handler

In reply to Sebastian Andrzej Siewior

There is no added value in dprc_irq0_handler() compared to irq_default_primary_handler().

Use the default primary interrupt handler by specifying NULL.

---
 drivers/bus/fsl-mc/dprc-driver.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/bus/fsl-mc/dprc-driver.c +1 -12
index c63a7e688db6a..db67442addad2 100644
@@ -380,17 +380,6 @@ int dprc_scan_container(struct fsl_mc_device *mc_bus_dev,
 }
 EXPORT_SYMBOL_GPL(dprc_scan_container);
 
-/**
- * dprc_irq0_handler - Regular ISR for DPRC interrupt 0
- *
- * @irq_num: IRQ number of the interrupt being handled
- * @arg: Pointer to device structure
- */
-static irqreturn_t dprc_irq0_handler(int irq_num, void *arg)
-{
-	return IRQ_WAKE_THREAD;
-}
-
 /**
  * dprc_irq0_handler_thread - Handler thread function for DPRC interrupt 0
  *
@@ -527,7 +516,7 @@ static int register_dprc_irq_handler(struct fsl_mc_device *mc_dev)
 	 */
 	error = devm_request_threaded_irq(&mc_dev->dev,
 					  irq->virq,
-					  dprc_irq0_handler,
+					  NULL,
 					  dprc_irq0_handler_thread,
 					  IRQF_NO_SUSPEND | IRQF_ONESHOT,
 					  dev_name(&mc_dev->dev),
Signature · 1 line
2.51.0
author maintainer
#10 lore raw

PATCH 6/21 Bluetooth: btintel_pcie: Use IRQF_ONESHOT and default primary handler

In reply to Sebastian Andrzej Siewior

There is no added value in btintel_pcie_msix_isr() compared to irq_default_primary_handler().
Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Cc Marcel Holtmann <[email protected]>
Cc Luiz Augusto von Dentz <[email protected]>
Fixes c2b636b3f788d ("Bluetooth: btintel_pcie: Add support for PCIe transport")
---
 drivers/bluetooth/btintel_pcie.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/bluetooth/btintel_pcie.c +2 -7
index 2936b535479f2..704767b334b98 100644
@@ -1431,11 +1431,6 @@ static void btintel_pcie_msix_rx_handle(struct btintel_pcie_data *data)
 	}
 }
 
-static irqreturn_t btintel_pcie_msix_isr(int irq, void *data)
-{
-	return IRQ_WAKE_THREAD;
-}
-
 static inline bool btintel_pcie_is_rxq_empty(struct btintel_pcie_data *data)
 {
 	return data->ia.cr_hia[BTINTEL_PCIE_RXQ_NUM] == data->ia.cr_tia[BTINTEL_PCIE_RXQ_NUM];
@@ -1537,9 +1532,9 @@ static int btintel_pcie_setup_irq(struct btintel_pcie_data *data)
 
 		err = devm_request_threaded_irq(&data->pdev->dev,
 						msix_entry->vector,
-						btintel_pcie_msix_isr,
+						NULL,
 						btintel_pcie_irq_msix_handler,
-						IRQF_SHARED,
+						IRQF_ONESHOT | IRQF_SHARED,
 						KBUILD_MODNAME,
 						msix_entry);
 		if (err) {
Signature · 1 line
2.51.0
author maintainer
#11 lore raw

PATCH 7/21 scsi: efct: Use IRQF_ONESHOT and default primary handler

In reply to Sebastian Andrzej Siewior

There is no added value in efct_intr_msix() compared to irq_default_primary_handler().

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Use the default primary interrupt handler by specifying NULL and set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Cc Ram Vegesna <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
Fixes 4df84e8466242 ("scsi: elx: efct: Driver initialization routines")
---
 drivers/scsi/elx/efct/efct_driver.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/scsi/elx/efct/efct_driver.c +1 -7
index 1bd42f7db1773..528399f725d42 100644
@@ -415,12 +415,6 @@ efct_intr_thread(int irq, void *handle)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t
-efct_intr_msix(int irq, void *handle)
-{
-	return IRQ_WAKE_THREAD;
-}
-
 static int
 efct_setup_msix(struct efct *efct, u32 num_intrs)
 {
@@ -450,7 +444,7 @@ efct_setup_msix(struct efct *efct, u32 num_intrs)
 		intr_ctx->index = i;
 
 		rc = request_threaded_irq(pci_irq_vector(efct->pci, i),
-					  efct_intr_msix, efct_intr_thread, 0,
+					  NULL, efct_intr_thread, IRQF_ONESHOT,
 					  EFCT_DRIVER_NAME, intr_ctx);
 		if (rc) {
 			dev_err(&efct->pci->dev,
Signature · 1 line
2.51.0
#12 lore raw

Re: [PATCH 07/21] scsi: efct: Use IRQF_ONESHOT and default primary handler

Sebastian,

Quoted 7 lines

There is no added value in efct_intr_msix() compared to irq_default_primary_handler().

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Applied to 6.20/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
author maintainer
#13 lore raw

PATCH 8/21 ARM: versatile: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.

Revert adding IRQF_ONESHOT to irqflags.

Cc Linus Walleij <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Sudeep Holla <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>
---
 arch/arm/mach-versatile/spc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-versatile/spc.c +2 -2
index 812db32448fcd..2d27777a00d33 100644
@@ -459,8 +459,8 @@ int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
 
 	readl_relaxed(info->baseaddr + PWC_STATUS);
 
-	ret = request_irq(irq, ve_spc_irq_handler, IRQF_TRIGGER_HIGH
-				| IRQF_ONESHOT, "vexpress-spc", info);
+	ret = request_irq(irq, ve_spc_irq_handler, IRQF_TRIGGER_HIGH,
+			  "vexpress-spc", info);
 	if (ret) {
 		pr_err(SPCLOG "IRQ %d request failed\n", irq);
 		kfree(info);
Signature · 1 line
2.51.0
Acked-by on v1 8/21
#14 lore raw

Re: [PATCH 08/21] ARM: versatile: Remove IRQF_ONESHOT

Quoted 10 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.

Revert adding IRQF_ONESHOT to irqflags.

Cc Linus Walleij <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Sudeep Holla <[email protected]>
Signature · 2 lines
Regards,
Sudeep
maintainer Acked-by on v1 8/21
#15 lore raw

Re: [PATCH 08/21] ARM: versatile: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior
Quoted 5 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.

Quoted 8 lines

Revert adding IRQF_ONESHOT to irqflags.

Cc Linus Walleij <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Sudeep Holla <[email protected]>
Cc Lorenzo Pieralisi <[email protected]>

Yours,
Linus Walleij

author maintainer
#16 lore raw

PATCH 9/21 char: tpm: cr50: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

---
 drivers/char/tpm/tpm_tis_i2c_cr50.c | 3 +--
 drivers/char/tpm/tpm_tis_spi_cr50.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm_tis_i2c_cr50.c +1 -2
index fc6891a0b6936..b48cacacc0664 100644
@@ -749,8 +749,7 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
 
 	if (client->irq > 0) {
 		rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
-				      IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
-				      IRQF_NO_AUTOEN,
+				      IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
 				      dev->driver->name, chip);
 		if (rc < 0) {
 			dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
drivers/char/tpm/tpm_tis_spi_cr50.c +1 -1
index f4937280e9406..32920b4cecfb4 100644
@@ -287,7 +287,7 @@ int cr50_spi_probe(struct spi_device *spi)
 	if (spi->irq > 0) {
 		ret = devm_request_irq(&spi->dev, spi->irq,
 				       cr50_spi_irq_handler,
-				       IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				       IRQF_TRIGGER_RISING,
 				       "cr50_spi", cr50_phy);
 		if (ret < 0) {
 			if (ret == -EPROBE_DEFER)
Signature · 1 line
2.51.0
maintainer Reviewed-by on v1 9/21
#17 lore raw

Re: [PATCH 09/21] char: tpm: cr50: Remove IRQF_ONESHOT

Quoted 49 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

---
 drivers/char/tpm/tpm_tis_i2c_cr50.c | 3 +--
 drivers/char/tpm/tpm_tis_spi_cr50.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm_tis_i2c_cr50.c +1 -2
index fc6891a0b6936..b48cacacc0664 100644
@@ -749,8 +749,7 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
 
 	if (client->irq > 0) {
 		rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
-				      IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
-				      IRQF_NO_AUTOEN,
+				      IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
 				      dev->driver->name, chip);
 		if (rc < 0) {
 			dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
drivers/char/tpm/tpm_tis_spi_cr50.c +1 -1
index f4937280e9406..32920b4cecfb4 100644
@@ -287,7 +287,7 @@ int cr50_spi_probe(struct spi_device *spi)
 	if (spi->irq > 0) {
 		ret = devm_request_irq(&spi->dev, spi->irq,
 				       cr50_spi_irq_handler,
-				       IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				       IRQF_TRIGGER_RISING,
 				       "cr50_spi", cr50_phy);
 		if (ret < 0) {
 			if (ret == -EPROBE_DEFER)
Signature · 1 line
2.51.0

Shoud I pick this? I did apply it to my master branch (not next).

BR, Jarkko

author maintainer
#18 lore raw

Re: [PATCH 09/21] char: tpm: cr50: Remove IRQF_ONESHOT

Quoted 3 lines · Jarkko Sakkinen

Shoud I pick this? I did apply it to my master branch (not next).

I am about to prepare a v2 and if you take it I am going to drop it. Shouldn't you apply it, then I hope to route leftovers via the genirq tree.

Quoted 1 line

BR, Jarkko

Sebastian

maintainer
#19 lore raw

Re: [PATCH 09/21] char: tpm: cr50: Remove IRQF_ONESHOT

Quoted 8 lines · Sebastian Andrzej Siewior
Quoted 3 lines · Jarkko Sakkinen

Shoud I pick this? I did apply it to my master branch (not next).

I am about to prepare a v2 and if you take it I am going to drop it. Shouldn't you apply it, then I hope to route leftovers via the genirq tree.

Please route through genirq tree.

Quoted 4 lines
Quoted 2 lines

BR, Jarkko

Sebastian

BR, Jarkko

author maintainer
#20 lore raw

PATCH 10/21 EDAC/altera: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Dinh Nguyen <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Tony Luck <[email protected]>
Fixes a29d64a45eed1 ("EDAC, altera: Add IRQ Flags to disable IRQ while handling")
---
 drivers/edac/altera_edac.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/edac/altera_edac.c +4 -7
index 0c5b94e64ea15..4edd2088c2db6 100644
@@ -1563,8 +1563,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 		goto err_release_group_1;
 	}
 	rc = devm_request_irq(&altdev->ddev, altdev->sb_irq,
-			      prv->ecc_irq_handler,
-			      IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
+			      prv->ecc_irq_handler, IRQF_TRIGGER_HIGH,
 			      ecc_name, altdev);
 	if (rc) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "PortB SBERR IRQ error\n");
@@ -1587,8 +1586,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
 		goto err_release_group_1;
 	}
 	rc = devm_request_irq(&altdev->ddev, altdev->db_irq,
-			      prv->ecc_irq_handler,
-			      IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
+			      prv->ecc_irq_handler, IRQF_TRIGGER_HIGH,
 			      ecc_name, altdev);
 	if (rc) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "PortB DBERR IRQ error\n");
@@ -1970,8 +1968,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac,
 		goto err_release_group1;
 	}
 	rc = devm_request_irq(edac->dev, altdev->sb_irq, prv->ecc_irq_handler,
-			      IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
-			      ecc_name, altdev);
+			      IRQF_TRIGGER_HIGH, ecc_name, altdev);
 	if (rc) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "No SBERR IRQ resource\n");
 		goto err_release_group1;
@@ -1993,7 +1990,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac,
 		goto err_release_group1;
 	}
 	rc = devm_request_irq(edac->dev, altdev->db_irq, prv->ecc_irq_handler,
-			      IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
+			      IRQF_TRIGGER_HIGH,
 			      ecc_name, altdev);
 	if (rc) {
 		edac_printk(KERN_ERR, EDAC_DEVICE, "No DBERR IRQ resource\n");
Signature · 1 line
2.51.0
author maintainer
#21 lore raw

PATCH 11/21 i2c: spacemit: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

---
 drivers/i2c/busses/i2c-k1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-k1.c +1 -1
index d42c03ef5db59..8ef6d5d1927b7 100644
@@ -566,7 +566,7 @@ static int spacemit_i2c_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, i2c->irq, "failed to get irq resource");
 
 	ret = devm_request_irq(i2c->dev, i2c->irq, spacemit_i2c_irq_handler,
-			       IRQF_NO_SUSPEND | IRQF_ONESHOT, dev_name(i2c->dev), i2c);
+			       IRQF_NO_SUSPEND, dev_name(i2c->dev), i2c);
 	if (ret)
 		return dev_err_probe(dev, ret, "failed to request irq");
 
Signature · 1 line
2.51.0
#22 lore raw

Re: [PATCH 11/21] i2c: spacemit: Remove IRQF_ONESHOT

Hi Sebastian,

Quoted 9 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

I've sent out a similar patch which already accepted and queued, see
https://lore.kernel.org/r/[email protected]

Quoted 26 lines
---
 drivers/i2c/busses/i2c-k1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-k1.c +1 -1
index d42c03ef5db59..8ef6d5d1927b7 100644
@@ -566,7 +566,7 @@ static int spacemit_i2c_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, i2c->irq, "failed to get irq resource");
 
 	ret = devm_request_irq(i2c->dev, i2c->irq, spacemit_i2c_irq_handler,
-			       IRQF_NO_SUSPEND | IRQF_ONESHOT, dev_name(i2c->dev), i2c);
+			       IRQF_NO_SUSPEND, dev_name(i2c->dev), i2c);
 	if (ret)
 		return dev_err_probe(dev, ret, "failed to request irq");
 
Signature · 1 line
2.51.0
Signature · 1 line
Yixun Lan (dlan)
#23 lore raw

Re: [PATCH 11/21] i2c: spacemit: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior
This patch was applied to riscv/linux.git (fixes) by Andi Shyti <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (fixes)
by Andi Shyti <[email protected]>:

Quoted 8 lines · On Fri, 23 Jan 2026 12:36:57 +0100 you wrote:

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

[...]

Here is the summary with links:
- [11/21] i2c: spacemit: Remove IRQF_ONESHOT

    https://git.kernel.org/riscv/c/e351836a54e3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
author maintainer
#24 lore raw

PATCH 12/21 ASoC: codecs: rt56*: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Oder Chiou <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Mark Brown <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
---
 sound/soc/codecs/rt5640.c | 4 ++--
 sound/soc/codecs/rt5651.c | 2 +-
 sound/soc/codecs/rt5663.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/codecs/rt5640.c +2 -2
index 4c08c274f50e2..db2222e6f2e75 100644
@@ -2564,7 +2564,7 @@ static void rt5640_enable_jack_detect(struct snd_soc_component *component,
 		rt5640->use_platform_clock = jack_data->use_platform_clock;
 
 	ret = request_irq(rt5640->irq, rt5640_irq,
-			  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+			  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 			  "rt5640", rt5640);
 	if (ret) {
 		dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret);
@@ -2618,7 +2618,7 @@ static void rt5640_enable_hda_jack_detect(
 	rt5640->jack = jack;
 
 	ret = request_irq(rt5640->irq, rt5640_irq,
-			  IRQF_TRIGGER_RISING | IRQF_ONESHOT, "rt5640", rt5640);
+			  IRQF_TRIGGER_RISING, "rt5640", rt5640);
 	if (ret) {
 		dev_warn(component->dev, "Failed to request IRQ %d: %d\n", rt5640->irq, ret);
 		rt5640->jack = NULL;
sound/soc/codecs/rt5651.c +1 -1
index 9af65a38f0ee6..23c4bf3da2982 100644
@@ -2262,7 +2262,7 @@ static int rt5651_i2c_probe(struct i2c_client *i2c)
 
 	ret = devm_request_irq(&i2c->dev, rt5651->irq, rt5651_irq,
 			       IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
-			       | IRQF_ONESHOT | IRQF_NO_AUTOEN, "rt5651", rt5651);
+			       | IRQF_NO_AUTOEN, "rt5651", rt5651);
 	if (ret) {
 		dev_warn(&i2c->dev, "Failed to request IRQ %d: %d\n",
 			 rt5651->irq, ret);
sound/soc/codecs/rt5663.c +2 -2
index e4d8785e64c10..eee1c98cc4aa6 100644
@@ -3689,8 +3689,8 @@ static int rt5663_i2c_probe(struct i2c_client *i2c)
 
 	if (i2c->irq) {
 		ret = request_irq(i2c->irq, rt5663_irq,
-			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
-			| IRQF_ONESHOT, "rt5663", rt5663);
+			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+			"rt5663", rt5663);
 		if (ret) {
 			dev_err(&i2c->dev, "%s Failed to request IRQ: %d\n",
 				__func__, ret);
Signature · 1 line
2.51.0
author maintainer
#25 lore raw

PATCH 13/21 usb: typec: fusb302: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Heikki Krogerus <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes 309b6341d5570 ("usb: typec: fusb302: Revert incorrect threaded irq fix")
---
 drivers/usb/typec/tcpm/fusb302.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/typec/tcpm/fusb302.c +1 -2
index 870a71f953f6c..19ff8217818e7 100644
@@ -1756,8 +1756,7 @@ static int fusb302_probe(struct i2c_client *client)
 	}
 
 	ret = request_irq(chip->gpio_int_n_irq, fusb302_irq_intn,
-			  IRQF_ONESHOT | IRQF_TRIGGER_LOW,
-			  "fsc_interrupt_int_n", chip);
+			  IRQF_TRIGGER_LOW, "fsc_interrupt_int_n", chip);
 	if (ret < 0) {
 		dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", ret);
 		goto tcpm_unregister_port;
Signature · 1 line
2.51.0
maintainer Acked-by on v1 13/21
#26 lore raw

Re: [PATCH 13/21] usb: typec: fusb302: Remove IRQF_ONESHOT

Quoted 35 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Heikki Krogerus <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes 309b6341d5570 ("usb: typec: fusb302: Revert incorrect threaded irq fix")
---
 drivers/usb/typec/tcpm/fusb302.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/typec/tcpm/fusb302.c +1 -2
index 870a71f953f6c..19ff8217818e7 100644
@@ -1756,8 +1756,7 @@ static int fusb302_probe(struct i2c_client *client)
 	}
 
 	ret = request_irq(chip->gpio_int_n_irq, fusb302_irq_intn,
-			  IRQF_ONESHOT | IRQF_TRIGGER_LOW,
-			  "fsc_interrupt_int_n", chip);
+			  IRQF_TRIGGER_LOW, "fsc_interrupt_int_n", chip);
 	if (ret < 0) {
 		dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", ret);
 		goto tcpm_unregister_port;
Signature · 1 line
2.51.0
maintainer Acked-by on v1 13/21
#27 lore raw

Re: [PATCH 13/21] usb: typec: fusb302: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Fri, Jan 23, 2026 at 12:36:59PM +0100, Sebastian Andrzej Siewior kirjoitti:

Quoted 7 lines

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Quoted 7 lines

Remove IRQF_ONESHOT from irqflags.

Cc Heikki Krogerus <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Fixes 309b6341d5570 ("usb: typec: fusb302: Revert incorrect threaded irq fix")
Quoted 20 lines
---
 drivers/usb/typec/tcpm/fusb302.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/typec/tcpm/fusb302.c +1 -2
index 870a71f953f6c..19ff8217818e7 100644
@@ -1756,8 +1756,7 @@ static int fusb302_probe(struct i2c_client *client)
 	}
 
 	ret = request_irq(chip->gpio_int_n_irq, fusb302_irq_intn,
-			  IRQF_ONESHOT | IRQF_TRIGGER_LOW,
-			  "fsc_interrupt_int_n", chip);
+			  IRQF_TRIGGER_LOW, "fsc_interrupt_int_n", chip);
 	if (ret < 0) {
 		dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", ret);
 		goto tcpm_unregister_port;
Signature · 1 line
2.51.0
Signature · 1 line
heikki
author maintainer
#28 lore raw

PATCH 14/21 rtc: amlogic-a4: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Yiting Deng <[email protected]>
Cc Xianwei Zhao <[email protected]>
Cc Alexandre Belloni <[email protected]>
Fixes c89ac9182ee29 ("rtc: support for the Amlogic on-chip RTC")
---
 drivers/rtc/rtc-amlogic-a4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-amlogic-a4.c +1 -1
index 123fb372fc9fe..50938c35af36a 100644
@@ -369,7 +369,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
 		return PTR_ERR(rtc->rtc_dev);
 
 	ret = devm_request_irq(dev, rtc->irq, aml_rtc_handler,
-			       IRQF_ONESHOT, "aml-rtc alarm", rtc);
+			       0, "aml-rtc alarm", rtc);
 	if (ret) {
 		dev_err_probe(dev, ret, "IRQ%d request failed, ret = %d\n",
 			      rtc->irq, ret);
Signature · 1 line
2.51.0
maintainer Reviewed-by on v1 14/21
#29 lore raw

Re: [PATCH 14/21] rtc: amlogic-a4: Remove IRQF_ONESHOT

Quoted 38 lines · Sebastian Andrzej Siewior

[ EXTERNAL EMAIL ]

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Remove IRQF_ONESHOT from irqflags.

Cc Yiting Deng <[email protected]>
Cc Xianwei Zhao <[email protected]>
Cc Alexandre Belloni <[email protected]>
Fixes c89ac9182ee29 ("rtc: support for the Amlogic on-chip RTC")
---
  drivers/rtc/rtc-amlogic-a4.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-amlogic-a4.c +1 -2
index 123fb372fc9fe..50938c35af36a 100644
@@ -369,7 +369,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
                 return PTR_ERR(rtc->rtc_dev);
 
         ret = devm_request_irq(dev, rtc->irq, aml_rtc_handler,
-                              IRQF_ONESHOT, "aml-rtc alarm", rtc);
+                              0, "aml-rtc alarm", rtc);
         if (ret) {
                 dev_err_probe(dev, ret, "IRQ%d request failed, ret = %d\n",
                               rtc->irq, ret);
--

2.51.0

author maintainer
#30 lore raw

PATCH 15/21 thermal/qcom/lmh: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Cc Amit Kucheria <[email protected]>
Cc Thara Gopinath <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Lukasz Luba <[email protected]>
---
 drivers/thermal/qcom/lmh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/qcom/lmh.c +1 -1
index ddadcfada5136..3d072b7a4a6dd 100644
@@ -220,7 +220,7 @@ static int lmh_probe(struct platform_device *pdev)
 	/* Disable the irq and let cpufreq enable it when ready to handle the interrupt */
 	irq_set_status_flags(lmh_data->irq, IRQ_NOAUTOEN);
 	ret = devm_request_irq(dev, lmh_data->irq, lmh_handle_irq,
-			       IRQF_ONESHOT | IRQF_NO_SUSPEND,
+			       IRQF_NO_THREAD | IRQF_NO_SUSPEND,
 			       "lmh-irq", lmh_data);
 	if (ret) {
 		dev_err(dev, "Error %d registering irq %x\n", ret, lmh_data->irq);
Signature · 1 line
2.51.0
author maintainer
#31 lore raw

PATCH 16/21 perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

---
 drivers/perf/cxl_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/cxl_pmu.c +1 -1
index d094030220bf2..68a54d97d2a8a 100644
@@ -877,7 +877,7 @@ static int cxl_pmu_probe(struct device *dev)
 	if (!irq_name)
 		return -ENOMEM;
 
-	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_ONESHOT,
+	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_NO_THREAD,
 			      irq_name, info);
 	if (rc)
 		return rc;
Signature · 1 line
2.51.0
Reviewed-by on v1 16/21
#32 lore raw

Re: [PATCH 16/21] perf/cxlpmu: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 11 lines · On Fri, 23 Jan 2026 12:37:02 +0100 Sebastian Andrzej Siewior…

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

I don't think we are that likely to see force-threading on CXL systems (I could be wrong!), but still good to correct this.

Quoted 23 lines
---
 drivers/perf/cxl_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/cxl_pmu.c +1 -1
index d094030220bf2..68a54d97d2a8a 100644
@@ -877,7 +877,7 @@ static int cxl_pmu_probe(struct device *dev)
 	if (!irq_name)
 		return -ENOMEM;
 
-	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_ONESHOT,
+	rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_NO_THREAD,
 			      irq_name, info);
 	if (rc)
 		return rc;
author maintainer
#33 lore raw

PATCH 17/21 mfd: wm8350-core: Use IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Mark explained that this should not happen with this hardware since it a slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will refuse to accept such a handler.

Set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>
Fixes 1c6c69525b40e ("genirq: Reject bogus threaded irq requests")
---
 include/linux/mfd/wm8350/core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mfd/wm8350/core.h +1 -1
index 5f70d3b5d1b1a..097ef4dfcdac8 100644
@@ -667,7 +667,7 @@ static inline int wm8350_register_irq(struct wm8350 *wm8350, int irq,
 		return -ENODEV;
 
 	return request_threaded_irq(irq + wm8350->irq_base, NULL,
-				    handler, flags, name, data);
+				    handler, flags | IRQF_ONESHOT, name, data);
 }
 
 static inline void wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data)
Signature · 1 line
2.51.0
#34 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 6 lines · Sebastian Andrzej Siewior

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Mark explained that this should not happen with this hardware since it a

"it is a" ?

Quoted 5 lines

slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will refuse to accept such a handler.

Set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

...

Quoted 4 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>

Cc list can be moved out from the commit message.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#35 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Sebastian Andrzej Siewior

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Mark explained that this should not happen with this hardware since it a

"it is a" ?

yes.

Quoted 6 lines
Quoted 5 lines

slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will refuse to accept such a handler.

Set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Quoted 8 lines

...

Quoted 4 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>

Cc list can be moved out from the commit message.

If I move it out, the list won't be CCed.

Sebastian

#36 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 2 lines · Sebastian Andrzej Siewior
Quoted 1 line · Andy Shevchenko

On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:

...

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>

Cc list can be moved out from the commit message.

If I move it out, the list won't be CCed.

Please. elaborate. It works for me. I use git send-email ...

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#37 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 11 lines · Andy Shevchenko
Quoted 2 lines · Sebastian Andrzej Siewior
Quoted 1 line · Andy Shevchenko

On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:

...

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Cc list can be moved out from the commit message.

If I move it out, the list won't be CCed.

Please. elaborate. It works for me. I use git send-email ...

Yes that works. But I have to move it every single patch and I have 20 and the number of Cc:es varies. Once I move it there, it won't be there on the next git-format-patch or will be imported via git-am. If you continue to nitpick here, I could do it for the next iio submission assuming it will be picked-up by iio maintainers. But doing it just for the single mfd patch looks like too much work.

Sebastian

#38 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 4 lines · Sebastian Andrzej Siewior
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Sebastian Andrzej Siewior
Quoted 1 line · Andy Shevchenko

On Fri, Jan 23, 2026 at 12:37:03PM +0100, Sebastian Andrzej Siewior wrote:

...

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>

Cc list can be moved out from the commit message.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

If I move it out, the list won't be CCed.

Please. elaborate. It works for me. I use git send-email ...

Yes that works. But I have to move it every single patch and I have 20 and the number of Cc:es varies. Once I move it there, it won't be there on the next git-format-patch

git format-patch uses the commit message verbatim.

Quoted 1 line

or will be imported via git-am.

Yes, that's the idea. git am will strip them out. But why would you need to apply via git am locally? You can pull from the tree.

Quoted 3 lines

If you continue to nitpick here, I could do it for the next iio submission assuming it will be picked-up by iio maintainers. But doing it just for the single mfd patch looks like too much work.

I'm thinking of all the patches.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#39 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 4 lines · Andy Shevchenko
Quoted 1 line

or will be imported via git-am.

Yes, that's the idea. git am will strip them out. But why would you need to apply via git am locally? You can pull from the tree.

I fetch from the list to pick up the tags, fix some of them up as the iio but most of them remain the same. Then I post the v2. Where do I get the Cc from? So I add them manually again?

Quoted 6 lines
Quoted 3 lines

If you continue to nitpick here, I could do it for the next iio submission assuming it will be picked-up by iio maintainers. But doing it just for the single mfd patch looks like too much work.

I'm thinking of all the patches.

Sebastian

Reviewed-by Alyssa Rosenzweig Reviewed-by Linus Walleij
#40 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 9 lines · Sebastian Andrzej Siewior
Quoted 4 lines · Andy Shevchenko
Quoted 1 line

or will be imported via git-am.

Yes, that's the idea. git am will strip them out. But why would you need to apply via git am locally? You can pull from the tree.

I fetch from the list to pick up the tags, fix some of them up as the iio but most of them remain the same. Then I post the v2. Where do I get the Cc from? So I add them manually again?

Nope, I just checked how b4 trailers -u ... works. It does the correct thing. What did I miss?

So, for the matter of test I took this one:
[email protected]
(as a *single* change).

In my tree I corrected it to look like this at the end of the commit message:

---
Cc: Janne Grunau <[email protected]>
Cc: Alyssa Rosenzweig <[email protected]>
Cc: Neal Gompa <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Then I ran

$ b4 trailers -u [email protected]
Finding code-review trailers for 1 commits...
---
  + Reviewed-by: Alyssa Rosenzweig <[email protected]>
    https://lore.kernel.org/all/aB3_Kw6WDaDAY6Ub@blossom
  + Reviewed-by: Linus Walleij <[email protected]>
    https://lore.kernel.org/all/CACRpkdbCfUEZd06yeZTNecGFPwBgJkpMH3hqkvJw4J%2BiSENG%[email protected]
---
Press Enter to apply these trailers or Ctrl-C to abort
  dt-bindings: gpio: Add Apple Mac SMC GPIO block
    + Reviewed-by: Alyssa Rosenzweig <[email protected]> (✓ DKIM/rosenzweig.io)
    + Reviewed-by: Linus Walleij <[email protected]> (✗ DKIM/linaro.org)
---
Invoking git-filter-repo to update trailers.
New history written in 0.08 seconds...
Completely finished after 0.38 seconds.
Trailers updated.

Then I looked at git show again:

---
Cc: Janne Grunau <[email protected]>
Cc: Alyssa Rosenzweig <[email protected]>
Cc: Neal Gompa <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

P.S. git am is for maintainers, not flexible for the contributors.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

If you continue to nitpick here, I could do it for the next iio submission assuming it will be picked-up by iio maintainers. But doing it just for the single mfd patch looks like too much work.

I'm thinking of all the patches.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by Alyssa Rosenzweig Reviewed-by Linus Walleij
#41 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Sebastian Andrzej Siewior

On 2026-01-26 12:05:13 [+0200], Andy Shevchenko wrote:

...

Quoted 77 lines
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

or will be imported via git-am.

Yes, that's the idea. git am will strip them out. But why would you need to apply via git am locally? You can pull from the tree.

I fetch from the list to pick up the tags, fix some of them up as the iio but most of them remain the same. Then I post the v2. Where do I get the Cc from? So I add them manually again?

Nope, I just checked how b4 trailers -u ... works. It does the correct thing. What did I miss?

So, for the matter of test I took this one:
[email protected]
(as a *single* change).

In my tree I corrected it to look like this at the end of the commit message:

---
Cc: Janne Grunau <[email protected]>
Cc: Alyssa Rosenzweig <[email protected]>
Cc: Neal Gompa <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Then I ran

$ b4 trailers -u [email protected]
Finding code-review trailers for 1 commits...
---
  + Reviewed-by: Alyssa Rosenzweig <[email protected]>
    https://lore.kernel.org/all/aB3_Kw6WDaDAY6Ub@blossom
  + Reviewed-by: Linus Walleij <[email protected]>
    https://lore.kernel.org/all/CACRpkdbCfUEZd06yeZTNecGFPwBgJkpMH3hqkvJw4J%2BiSENG%[email protected]
---
Press Enter to apply these trailers or Ctrl-C to abort
  dt-bindings: gpio: Add Apple Mac SMC GPIO block
    + Reviewed-by: Alyssa Rosenzweig <[email protected]> (✓ DKIM/rosenzweig.io)
    + Reviewed-by: Linus Walleij <[email protected]> (✗ DKIM/linaro.org)
---
Invoking git-filter-repo to update trailers.
New history written in 0.08 seconds...
Completely finished after 0.38 seconds.
Trailers updated.

Then I looked at git show again:

---
Cc: Janne Grunau <[email protected]>
Cc: Alyssa Rosenzweig <[email protected]>
Cc: Neal Gompa <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Sebastian Reichel <[email protected]>

Quoted 8 lines

Cc: Lee Jones <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

FWIW, I ran git format-patch and reapplied locally to test how maintainer will see it:

Add the DT binding for the Apple Mac System Management Controller GPIOs.

Documentation/devicetree/bindings/gpio/apple,smc-gpio.yaml +0 -0

So, everything works as intended.

Quoted 7 lines

P.S. git am is for maintainers, not flexible for the contributors.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

If you continue to nitpick here, I could do it for the next iio submission assuming it will be picked-up by iio maintainers. But doing it just for the single mfd patch looks like too much work.

I'm thinking of all the patches.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on v1 17/21
#42 lore raw

Re: [PATCH 17/21] mfd: wm8350-core: Use IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior
Quoted 12 lines · Sebastian Andrzej Siewior

Using a threaded interrupt without a dedicated primary handler mandates the IRQF_ONESHOT flag to mask the interrupt source while the threaded handler is active. Otherwise the interrupt can fire again before the threaded handler had a chance to run.

Mark explained that this should not happen with this hardware since it a slow irqchip which is behind an I2C/ SPI bus but the IRQ-core will refuse to accept such a handler.

Set IRQF_ONESHOT so the interrupt source is masked until the secondary handler is done.

Quoted 7 lines
Cc Lee Jones <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Mark Brown <[email protected]>
Fixes 1c6c69525b40e ("genirq: Reject bogus threaded irq requests")

---

Thanks,
Charles

author maintainer
#43 lore raw

PATCH 18/21 iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading for handlers such as iio_trigger_generic_data_rdy_poll() will intends to invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>
---
 drivers/iio/accel/adxl355_core.c       |  3 ++-
 drivers/iio/accel/adxl372.c            |  9 ++++-----
 drivers/iio/accel/mxc4005.c            | 11 ++++-------
 drivers/iio/accel/stk8ba50.c           | 11 ++++-------
 drivers/iio/adc/ad4170-4.c             |  2 +-
 drivers/iio/adc/ad7768-1.c             |  5 ++---
 drivers/iio/adc/ad7779.c               |  2 +-
 drivers/iio/adc/mcp3911.c              |  2 +-
 drivers/iio/adc/ti-ads131e08.c         |  2 +-
 drivers/iio/chemical/ens160_core.c     |  9 +++------
 drivers/iio/gyro/adxrs290.c            |  2 +-
 drivers/iio/health/afe4403.c           |  9 ++++-----
 drivers/iio/health/afe4404.c           |  9 ++++-----
 drivers/iio/magnetometer/bmc150_magn.c |  9 +++------
 drivers/iio/pressure/dlhl60d.c         |  6 +++---
 drivers/iio/temperature/tmp006.c       | 10 ++++------
 16 files changed, 42 insertions(+), 59 deletions(-)
drivers/iio/accel/adxl355_core.c +2 -1
index 5fc7f814b9077..04caa493176d3 100644
@@ -770,7 +770,8 @@ static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq)
 
 	ret = devm_request_irq(data->dev, irq,
 			       &iio_trigger_generic_data_rdy_poll,
-			       IRQF_ONESHOT, "adxl355_irq", data->dready_trig);
+			       IRQF_NO_THREAD,
+			       "adxl355_irq", data->dready_trig);
 	if (ret)
 		return dev_err_probe(data->dev, ret, "request irq %d failed\n",
 				     irq);
drivers/iio/accel/adxl372.c +4 -5
index 46d518a2a0291..2f6aa52aeba51 100644
@@ -1247,11 +1247,10 @@ int adxl372_probe(struct device *dev, struct regmap *regmap,
 
 		indio_dev->trig = iio_trigger_get(st->dready_trig);
 
-		ret = devm_request_threaded_irq(dev, st->irq,
-					iio_trigger_generic_data_rdy_poll,
-					NULL,
-					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-					indio_dev->name, st->dready_trig);
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;
 	}
drivers/iio/accel/mxc4005.c +4 -7
index ac973d871c8bb..a2c3cf13d0981 100644
@@ -486,13 +486,10 @@ static int mxc4005_probe(struct i2c_client *client)
 		if (!data->dready_trig)
 			return -ENOMEM;
 
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL,
-						IRQF_TRIGGER_FALLING |
-						IRQF_ONESHOT,
-						"mxc4005_event",
-						data->dready_trig);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_FALLING | IRQF_NO_THREAD,
+				       "mxc4005_event", data->dready_trig);
 		if (ret) {
 			dev_err(&client->dev,
 				"failed to init threaded irq\n");
drivers/iio/accel/stk8ba50.c +4 -7
index 384f1fbcbcb37..a9ff2a273fe1c 100644
@@ -428,13 +428,10 @@ static int stk8ba50_probe(struct i2c_client *client)
 	}
 
 	if (client->irq > 0) {
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						stk8ba50_data_rdy_trig_poll,
-						NULL,
-						IRQF_TRIGGER_RISING |
-						IRQF_ONESHOT,
-						"stk8ba50_event",
-						indio_dev);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       stk8ba50_data_rdy_trig_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       "stk8ba50_event", indio_dev);
 		if (ret < 0) {
 			dev_err(&client->dev, "request irq %d failed\n",
 				client->irq);
drivers/iio/adc/ad4170-4.c +1 -1
index efaed92191f1b..82205bfae531e 100644
@@ -2973,7 +2973,7 @@ static int ad4170_probe(struct spi_device *spi)
 
 	if (spi->irq) {
 		ret = devm_request_irq(dev, spi->irq, &ad4170_irq_handler,
-				       IRQF_ONESHOT, indio_dev->name, indio_dev);
+				       IRQF_NO_THREAD, indio_dev->name, indio_dev);
 		if (ret)
 			return ret;
 
drivers/iio/adc/ad7768-1.c +2 -3
index d96802b7847a6..84ce23c8e5782 100644
@@ -1394,9 +1394,8 @@ static int ad7768_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	ret = devm_request_irq(&spi->dev, spi->irq,
-			       &ad7768_interrupt,
-			       IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+	ret = devm_request_irq(&spi->dev, spi->irq, &ad7768_interrupt,
+			       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
 			       indio_dev->name, indio_dev);
 	if (ret)
 		return ret;
drivers/iio/adc/ad7779.c +1 -1
index aac5049c9a07b..695cc79e78da5 100644
@@ -840,7 +840,7 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct iio_dev
 	iio_trigger_set_drvdata(st->trig, st);
 
 	ret = devm_request_irq(dev, st->spi->irq, iio_trigger_generic_data_rdy_poll,
-			       IRQF_ONESHOT | IRQF_NO_AUTOEN, indio_dev->name,
+			       IRQF_NO_THREAD | IRQF_NO_AUTOEN, indio_dev->name,
 			       st->trig);
 	if (ret)
 		return dev_err_probe(dev, ret, "request IRQ %d failed\n",
drivers/iio/adc/mcp3911.c +1 -1
index a6f21791c6859..ddc3721f3f688 100644
@@ -815,7 +815,7 @@ static int mcp3911_probe(struct spi_device *spi)
 		 * don't enable the interrupt to avoid extra load on the system.
 		 */
 		ret = devm_request_irq(dev, spi->irq, &iio_trigger_generic_data_rdy_poll,
-				       IRQF_NO_AUTOEN | IRQF_ONESHOT,
+				       IRQF_NO_AUTOEN | IRQF_NO_THREAD,
 				       indio_dev->name, adc->trig);
 		if (ret)
 			return ret;
drivers/iio/adc/ti-ads131e08.c +1 -1
index c9a20024d6b11..a585621b0bc30 100644
@@ -827,7 +827,7 @@ static int ads131e08_probe(struct spi_device *spi)
 	if (spi->irq) {
 		ret = devm_request_irq(&spi->dev, spi->irq,
 			ads131e08_interrupt,
-			IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+			IRQF_TRIGGER_FALLING | IRQF_NO_THREAD,
 			spi->dev.driver->name, indio_dev);
 		if (ret)
 			return dev_err_probe(&spi->dev, ret,
drivers/iio/chemical/ens160_core.c +3 -6
index 86bde4a91bf7e..bbc96c4c62838 100644
@@ -316,12 +316,9 @@ static int ens160_setup_trigger(struct iio_dev *indio_dev, int irq)
 
 	indio_dev->trig = iio_trigger_get(trig);
 
-	ret = devm_request_threaded_irq(dev, irq,
-					iio_trigger_generic_data_rdy_poll,
-					NULL,
-					IRQF_ONESHOT,
-					indio_dev->name,
-					indio_dev->trig);
+	ret = devm_request_irq(dev, irq, iio_trigger_generic_data_rdy_poll,
+			       IRQF_NO_THREAD, indio_dev->name,
+			       indio_dev->trig);
 	if (ret)
 		return dev_err_probe(dev, ret, "failed to request irq\n");
 
drivers/iio/gyro/adxrs290.c +1 -1
index 8fcb41f45baac..3efe385ebedc4 100644
@@ -597,7 +597,7 @@ static int adxrs290_probe_trigger(struct iio_dev *indio_dev)
 
 	ret = devm_request_irq(&st->spi->dev, st->spi->irq,
 			       &iio_trigger_generic_data_rdy_poll,
-			       IRQF_ONESHOT, "adxrs290_irq", st->dready_trig);
+			       IRQF_NO_THREAD, "adxrs290_irq", st->dready_trig);
 	if (ret < 0)
 		return dev_err_probe(&st->spi->dev, ret,
 				     "request irq %d failed\n", st->spi->irq);
drivers/iio/health/afe4403.c +4 -5
index 0e5a512e3bb8f..d358f4d5e5da8 100644
@@ -540,11 +540,10 @@ static int afe4403_probe(struct spi_device *spi)
 			return ret;
 		}
 
-		ret = devm_request_threaded_irq(dev, afe->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL, IRQF_ONESHOT,
-						AFE4403_DRIVER_NAME,
-						afe->trig);
+		ret = devm_request_irq(dev, afe->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, AFE4403_DRIVER_NAME,
+				       afe->trig);
 		if (ret) {
 			dev_err(dev, "Unable to request IRQ\n");
 			return ret;
drivers/iio/health/afe4404.c +4 -5
index 768d794e574b9..032da52a96d0e 100644
@@ -547,11 +547,10 @@ static int afe4404_probe(struct i2c_client *client)
 			return ret;
 		}
 
-		ret = devm_request_threaded_irq(dev, afe->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL, IRQF_ONESHOT,
-						AFE4404_DRIVER_NAME,
-						afe->trig);
+		ret = devm_request_irq(dev, afe->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, AFE4404_DRIVER_NAME,
+				       afe->trig);
 		if (ret) {
 			dev_err(dev, "Unable to request IRQ\n");
 			return ret;
drivers/iio/magnetometer/bmc150_magn.c +3 -6
index 6a73f6e2f1f06..a022e1805dff7 100644
@@ -906,12 +906,9 @@ int bmc150_magn_probe(struct device *dev, struct regmap *regmap,
 			goto err_poweroff;
 		}
 
-		ret = request_threaded_irq(irq,
-					   iio_trigger_generic_data_rdy_poll,
-					   NULL,
-					   IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-					   "bmc150_magn_event",
-					   data->dready_trig);
+		ret = request_irq(irq, iio_trigger_generic_data_rdy_poll,
+				  IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				  "bmc150_magn_event", data->dready_trig);
 		if (ret < 0) {
 			dev_err(dev, "request irq %d failed\n", irq);
 			goto err_trigger_unregister;
drivers/iio/pressure/dlhl60d.c +3 -3
index 8bad7162fec64..e975b733ce0a1 100644
@@ -306,9 +306,9 @@ static int dlh_probe(struct i2c_client *client)
 	indio_dev->num_channels = ARRAY_SIZE(dlh_channels);
 
 	if (client->irq > 0) {
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-			dlh_interrupt, NULL,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+		ret = devm_request_irq(&client->dev, client->irq,
+				       dlh_interrupt,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
 			st->info->name, indio_dev);
 		if (ret) {
 			dev_err(&client->dev, "failed to allocate threaded irq");
drivers/iio/temperature/tmp006.c +4 -6
index 10bd3f221929d..d8d8c8936d177 100644
@@ -356,12 +356,10 @@ static int tmp006_probe(struct i2c_client *client)
 
 		indio_dev->trig = iio_trigger_get(data->drdy_trig);
 
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL,
-						IRQF_ONESHOT,
-						"tmp006_irq",
-						data->drdy_trig);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, "tmp006_irq",
+				       data->drdy_trig);
 		if (ret < 0)
 			return ret;
 	}
Signature · 1 line
2.51.0
Reviewed-by on v1 18/21
#44 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 7 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Quoted 5 lines

The intention here was probably not allowing forced-threading for handlers such as iio_trigger_generic_data_rdy_poll() will intends to invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Code wise LGTM,

There is a few nit-picks regarding style below.

...

Quoted 5 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Quoted 8 lines
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>

Move these...

Quoted 2 lines

---

...to be here. This will drastically reduce the unneeded noise in the commit message. The email will have (if using git format-patch and git send-email) them.

...

drivers/iio/accel/adxl355_core.c static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq) · line 774

Quoted 9 lines
drivers/iio/accel/adxl355_core.c +2 -1
@@ -770,7 +770,8 @@ static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq)
 
 	ret = devm_request_irq(data->dev, irq,
 			       &iio_trigger_generic_data_rdy_poll,
-			       IRQF_ONESHOT, "adxl355_irq", data->dready_trig);
+			       IRQF_NO_THREAD,
+			       "adxl355_irq", data->dready_trig);

Leave it on a single line. It's only 81 characters and it's fine to be like this.

Quoted 3 lines
drivers/iio/accel/adxl355_core.c +0 -0
 	if (ret)
 		return dev_err_probe(data->dev, ret, "request irq %d failed\n",
 				     irq);

...

drivers/iio/accel/adxl355_core.c

Quoted 8 lines

+++ b/drivers/iio/accel/adxl372.c

drivers/iio/accel/adxl355_core.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

...

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 310

Quoted 11 lines
drivers/iio/pressure/dlhl60d.c +2 -3
@@ -306,9 +306,9 @@ static int dlh_probe(struct i2c_client *client)
 	indio_dev->num_channels = ARRAY_SIZE(dlh_channels);
 
 	if (client->irq > 0) {
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-			dlh_interrupt, NULL,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+		ret = devm_request_irq(&client->dev, client->irq,
+				       dlh_interrupt,

Joined to the previous line it gives exactly 80 characters, which is allowed.

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 312

Quoted 2 lines
drivers/iio/pressure/dlhl60d.c +1 -0
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
 			st->info->name, indio_dev);

Forgot to indent.

...

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client)

Quoted 6 lines
drivers/iio/pressure/dlhl60d.c +4 -0
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, "tmp006_irq",
+				       data->drdy_trig);
 		if (ret < 0)
 			return ret;

Jonathan et al., this seems to me like a duplication from one to another driver. Can't we do like a helper for it, so we don't change it each time the IRQ core or other things got changed?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#45 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 14 lines

drivers/iio/accel/adxl372.c int adxl372_probe(struct device *dev, struct regmap *regmap, · line 1255

Quoted 9 lines

+++ b/drivers/iio/accel/adxl372.c

drivers/iio/accel/adxl372.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;  

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

It's indeed a bug but one of those historic ones we can't fix without high risk of regressions :(

Quoted 23 lines

...

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 310

Quoted 11 lines
drivers/iio/pressure/dlhl60d.c +2 -3
@@ -306,9 +306,9 @@ static int dlh_probe(struct i2c_client *client)
 	indio_dev->num_channels = ARRAY_SIZE(dlh_channels);
 
 	if (client->irq > 0) {
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-			dlh_interrupt, NULL,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+		ret = devm_request_irq(&client->dev, client->irq,
+				       dlh_interrupt,  

Joined to the previous line it gives exactly 80 characters, which is allowed.

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 312

Quoted 2 lines
drivers/iio/pressure/dlhl60d.c +1 -0
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
 			st->info->name, indio_dev);  

Forgot to indent.

...

Quoted 10 lines

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client)

Quoted 6 lines
drivers/iio/pressure/dlhl60d.c +4 -0
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, "tmp006_irq",
+				       data->drdy_trig);
 		if (ret < 0)
 			return ret;  

Jonathan et al., this seems to me like a duplication from one to another driver. Can't we do like a helper for it, so we don't change it each time the IRQ core or other things got changed?

I'm not sure what the helper would include that would shorten things much:
could hide two params, but need a longer name and that's going to be hard to find. So maybe...

J

Quoted 1 line
reviewer
#46 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 15 lines · Jonathan Cameron
Quoted 14 lines

drivers/iio/accel/adxl372.c int adxl372_probe(struct device *dev, struct regmap *regmap, · line 1255

Quoted 9 lines

+++ b/drivers/iio/accel/adxl372.c

drivers/iio/accel/adxl372.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;  

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

Quoted 4 lines

It's indeed a bug but one of those historic ones we can't fix without high risk of regressions :(

Sounds like we should add a "don't copy this because ..." comment while we are touching this.

author maintainer
#47 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Andy Shevchenko
Quoted 35 lines · Andy Shevchenko
Quoted 7 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

Quoted 5 lines

The intention here was probably not allowing forced-threading for handlers such as iio_trigger_generic_data_rdy_poll() will intends to invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Code wise LGTM,

There is a few nit-picks regarding style below.

...

Quoted 5 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Quoted 8 lines
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>
Quoted 8 lines

Move these...

Quoted 2 lines

---

...to be here. This will drastically reduce the unneeded noise in the commit message. The email will have (if using git format-patch and git send-email) them.

Yeah but if I have to send v2 then they are gone, aren't they? So I have to move them for each submission. Or is there something I am not aware of?

Quoted 23 lines

...

drivers/iio/accel/adxl355_core.c static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq) · line 774

Quoted 9 lines
drivers/iio/accel/adxl355_core.c +2 -1
@@ -770,7 +770,8 @@ static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq)
 
 	ret = devm_request_irq(data->dev, irq,
 			       &iio_trigger_generic_data_rdy_poll,
-			       IRQF_ONESHOT, "adxl355_irq", data->dready_trig);
+			       IRQF_NO_THREAD,
+			       "adxl355_irq", data->dready_trig);

Leave it on a single line. It's only 81 characters and it's fine to be like this.

Quoted 3 lines
drivers/iio/accel/adxl355_core.c +0 -0
 	if (ret)
 		return dev_err_probe(data->dev, ret, "request irq %d failed\n",
 				     irq);

...

Quoted 1 line

+++ b/drivers/iio/accel/adxl372.c

Quoted 10 lines

drivers/iio/accel/adxl355_core.c

Quoted 6 lines
drivers/iio/accel/adxl355_core.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

If the irq-chip is level or unknown mode on boot up/ default and the device can only operate as an edge-rising then I don't see why this should be a bug.

Quoted 16 lines

...

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 310

Quoted 11 lines
drivers/iio/pressure/dlhl60d.c +2 -3
@@ -306,9 +306,9 @@ static int dlh_probe(struct i2c_client *client)
 	indio_dev->num_channels = ARRAY_SIZE(dlh_channels);
 
 	if (client->irq > 0) {
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-			dlh_interrupt, NULL,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+		ret = devm_request_irq(&client->dev, client->irq,
+				       dlh_interrupt,

Joined to the previous line it gives exactly 80 characters, which is allowed.

Quoted 4 lines

drivers/iio/pressure/dlhl60d.c static int dlh_probe(struct i2c_client *client) · line 312

Quoted 2 lines
drivers/iio/pressure/dlhl60d.c +1 -0
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
 			st->info->name, indio_dev);

Forgot to indent.

Okay, let me fix this up.

Quoted 14 lines

...

drivers/iio/pressure/dlhl60d.c

Quoted 6 lines
drivers/iio/pressure/dlhl60d.c +4 -0
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, "tmp006_irq",
+				       data->drdy_trig);
 		if (ret < 0)
 			return ret;

Jonathan et al., this seems to me like a duplication from one to another driver. Can't we do like a helper for it, so we don't change it each time the IRQ core or other things got changed?

Sebastian

#48 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 2 lines · Sebastian Andrzej Siewior
Quoted 1 line · Andy Shevchenko

On Fri, Jan 23, 2026 at 12:37:04PM +0100, Sebastian Andrzej Siewior wrote:

...

Quoted 16 lines
Quoted 16 lines
Quoted 5 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Quoted 8 lines
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>

Move these...

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

---

...to be here. This will drastically reduce the unneeded noise in the commit message. The email will have (if using git format-patch and git send-email) them.

Yeah but if I have to send v2 then they are gone, aren't they?

I didn't follow. How? What tools do you use?

Quoted 2 lines

So I have to move them for each submission. Or is there something I am not aware of?

Make them in the tail of commit messages locally with a delimiter, they will always be present as long as they are in your tree.

I dunno if b4 manages the Cc lists separately. At least I see no-one using b4 *and* putting the Cc noise into the commit messages, so I assume it behaves nicely.

...

Quoted 11 lines
Quoted 10 lines

drivers/iio/accel/adxl372.c int adxl372_probe(struct device *dev, struct regmap *regmap, · line 1255

Quoted 6 lines
drivers/iio/accel/adxl372.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

Quoted 3 lines

If the irq-chip is level or unknown mode on boot up/ default and the device can only operate as an edge-rising then I don't see why this should be a bug.

But if FW says use "level", wouldn't this setting override it?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#49 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 14 lines · Andy Shevchenko
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>

…

Quoted 1 line

I didn't follow. How? What tools do you use?

b4/ git.

Quoted 9 lines
Quoted 2 lines

So I have to move them for each submission. Or is there something I am not aware of?

Make them in the tail of commit messages locally with a delimiter, they will always be present as long as they are in your tree.

I dunno if b4 manages the Cc lists separately. At least I see no-one using b4 *and* putting the Cc noise into the commit messages, so I assume it behaves nicely.

I point is if I move them for one submission, I lose it on the next if I update patches in tree and re-export them.

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

drivers/iio/accel/adxl372.c int adxl372_probe(struct device *dev, struct regmap *regmap, · line 1255

Quoted 6 lines
drivers/iio/accel/adxl372.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

Quoted 5 lines
Quoted 3 lines

If the irq-chip is level or unknown mode on boot up/ default and the device can only operate as an edge-rising then I don't see why this should be a bug.

But if FW says use "level", wouldn't this setting override it?

Yes, it will. It was common to use it pre-device-tree time where this information was not configured automatically before ->probe. Now it might be missing/wrong in the dt for some of the old devices. It might be a left-over which continued to grow and spread.

Sebastian

#50 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 23 lines · Sebastian Andrzej Siewior
Quoted 14 lines · Andy Shevchenko
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>

…

Quoted 1 line

I didn't follow. How? What tools do you use?

b4/ git.

Quoted 3 lines
Quoted 2 lines

So I have to move them for each submission. Or is there something I am not aware of?

Quoted 8 lines
Quoted 6 lines

Make them in the tail of commit messages locally with a delimiter, they will always be present as long as they are in your tree.

I dunno if b4 manages the Cc lists separately. At least I see no-one using b4 *and* putting the Cc noise into the commit messages, so I assume it behaves nicely.

I point is if I move them for one submission,

It will be in your Git tree as a part of the commit message.

What I mean is that your commit message will be like

$PREFIX: $SUMMARY
...blank line...
$COMMIT_MESSAGE
...blank line...
$TAG
Signed-off-by: ...
---
Cc: person 1
Cc: person 2

Just don't reimport them via git am.

Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

...

Hmm... The https://b4.docs.kernel.org/en/latest/contributor/prep.html
doesn't clearly tell me if there is a carry-on procedure for the Cc list between versions.

...

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 10 lines

drivers/iio/accel/adxl372.c int adxl372_probe(struct device *dev, struct regmap *regmap, · line 1255

Quoted 6 lines
drivers/iio/accel/adxl372.c +4 -0
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);
 		if (ret < 0)
 			return ret;

Interestingly that this driver ignores the flags from firmware... Seems to me like a bug (not in your patch, obviously). Ditto for other drivers doing similar things.

If the irq-chip is level or unknown mode on boot up/ default and the device can only operate as an edge-rising then I don't see why this should be a bug.

Quoted 6 lines
Quoted 1 line

But if FW says use "level", wouldn't this setting override it?

Yes, it will. It was common to use it pre-device-tree time where this information was not configured automatically before ->probe. Now it might be missing/wrong in the dt for some of the old devices. It might be a left-over which continued to grow and spread.

It may be considered as a bug, especially in the cases when the driver works only on DT/ACPI platforms.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#51 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 6 lines · Andy Shevchenko
Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

That's not the intended workflow -- the series is kept as a branch in your local tree and any updates happen to that branch, so any entries in a commit falling under "---" will persist across revisions.

Quoted 3 lines

Hmm... The https://b4.docs.kernel.org/en/latest/contributor/prep.html
doesn't clearly tell me if there is a carry-on procedure for the Cc list between versions.

There isn't any special procedure. ¯\_(ツ)_/¯

-K

#52 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 11 lines · Konstantin Ryabitsev
Quoted 6 lines · Andy Shevchenko
Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

That's not the intended workflow -- the series is kept as a branch in your local tree and any updates happen to that branch, so any entries in a commit falling under "---" will persist across revisions.

Right. I found b4 trailers do a really good job to inject collected trailers into the Git repo without need of any git reset; b4 am; git am dances.

Quoted 5 lines
Quoted 3 lines

Hmm... The https://b4.docs.kernel.org/en/latest/contributor/prep.html
doesn't clearly tell me if there is a carry-on procedure for the Cc list between versions.

There isn't any special procedure. ¯\_(ツ)_/¯

What I have i mind is rather the scenario when I see already sent (by somebody else) patch in the mailing list and I want develop a followup with the same To/Cc list. So I want b4 ... --use/restore-to-cc-from-the-mailing-list / lore type of functionality.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#53 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 4 lines · Andy Shevchenko

What I have i mind is rather the scenario when I see already sent (by somebody else) patch in the mailing list and I want develop a followup with the same To/Cc list. So I want b4 ... --use/restore-to-cc-from-the-mailing-list / lore type of functionality.

To understand it better -- you want to send a new revision to a patch sent by someone else? If so, you should be able to "b4 prep --from-thread <msgid>", but it's actually a good question if that will do the right thing with content under "---" or not, as I'm not sure this part was ever properly tested.

-K

#54 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 8 lines · Konstantin Ryabitsev
Quoted 4 lines · Andy Shevchenko

What I have i mind is rather the scenario when I see already sent (by somebody else) patch in the mailing list and I want develop a followup with the same To/Cc list. So I want b4 ... --use/restore-to-cc-from-the-mailing-list / lore type of functionality.

To understand it better -- you want to send a new revision to a patch sent by someone else?

Like this or when I want to send another patch on top of what has been sent to the same people.

Quoted 3 lines

If so, you should be able to "b4 prep --from-thread <msgid>",
but it's actually a good question if that will do the right thing with content under "---" or not, as I'm not sure this part was ever properly tested.

But that's not needed, as it's assumed to be in the *email* Cc and To already, so that's it then. I will try the suggested command, thanks!

More complex case is to preserve that locally, but it might be not needed after all.

Thanks for the suggestions and nice tool!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#55 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Konstantin Ryabitsev
Quoted 12 lines · Konstantin Ryabitsev
Quoted 6 lines · Andy Shevchenko
Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

That's not the intended workflow -- the series is kept as a branch in your local tree and any updates happen to that branch, so any entries in a commit falling under "---" will persist across revisions.

Hi Konstantin,

Since I have you here, I might ask about something that I'm not sure how to handle. Might be dumb but here it goes. One problem is when I send v1 based on a branch and when I'm starting to work on v2 that branch was force-updated and I want to base my v2 on it. Is there any good way to handle this?

What I currently do is more or less:

git cat-file -p $COVER_SHA
git reset --hard origin/branch
git commit --allow-empty (and past all the cover with b4 metadata) // apply my series patches.

Thx!
- Nuno Sá

Quoted 1 line
#56 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 5 lines · Nuno Sá

Since I have you here, I might ask about something that I'm not sure how to handle. Might be dumb but here it goes. One problem is when I send v1 based on a branch and when I'm starting to work on v2 that branch was force-updated and I want to base my v2 on it. Is there any good way to handle this?

You should be able to just rebase the b4 branch.

git switch b4/your-branch
git rebase tracking-branch

You can do this at any point, not necessarily between revisions. Since we have the tracking empty commit, we'll always know the base-commit automatically.

-K

author maintainer
#57 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

---
Cc: person 1
Cc: person 2

Quoted 8 lines

Just don't reimport them via git am.

Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

So doing this and switching to b4 trailers to grab the tags actually help. Then I have been playing with prep. So thank you.

Then I stumbled upon --auto-to-cc which picked up all addresses and added it to the cover letter which was fine. But then `send' used those for every patch in the series which I did not want. So for that part I probably stick with git-send-mail since this not in everyone's workflow (sending a series across multiple subsystems and avoiding flooding everyone).

Anyway. This seems to have turned out nice.

Sebastian

#58 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Quoted 9 lines · Sebastian Andrzej Siewior
Quoted 8 lines · Andy Shevchenko

---
Cc: person 1
Cc: person 2

Just don't reimport them via git am.

Quoted 1 line

I lose it on the next if I update patches in tree and re-export them.

Quoted 7 lines
Quoted 4 lines

I don't understand this, sorry. Can you provide a step-by-step example? Do you mean that you are taking previous version from the list and reapplying it via git am? But shouldn't b4 take care of that as long as it knows the Change-ID and it matches?

So doing this and switching to b4 trailers to grab the tags actually help. Then I have been playing with prep. So thank you.

You're welcome!

Quoted 6 lines

Then I stumbled upon --auto-to-cc which picked up all addresses and added it to the cover letter which was fine. But then `send' used those for every patch in the series which I did not want. So for that part I probably stick with git-send-mail since this not in everyone's workflow (sending a series across multiple subsystems and avoiding flooding everyone).

I'm not an (advanced) user of b4 yet. I have my own script to send based on some heuristics [1].

Quoted 1 line

Anyway. This seems to have turned out nice.

Good!

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Reviewed-by on v1 18/21
#59 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior
Quoted 28 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading for handlers such as iio_trigger_generic_data_rdy_poll() will intends to invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>

---

[...]

Quoted 1 line
 drivers/iio/adc/mcp3911.c              |  2 +-

Best regards,
Marcus Folkesson

Reviewed-by on v1 18/21
#60 lore raw

Re: [PATCH 18/21] iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior
Quoted 27 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.

The intention here was probably not allowing forced-threading for handlers such as iio_trigger_generic_data_rdy_poll() will intends to invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
Cc Puranjay Mohan <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Marcelo Schmitt <[email protected]>
Cc Marcus Folkesson <[email protected]>
Cc Kent Gustavsson <[email protected]>
Cc Gustavo Silva <[email protected]>
Cc Nishant Malpani <[email protected]>
Quoted 1 line

---

LGTM,

Quoted 296 lines

 drivers/iio/accel/adxl355_core.c       |  3 ++- drivers/iio/accel/adxl372.c            |  9 ++++----- drivers/iio/accel/mxc4005.c            | 11 ++++------- drivers/iio/accel/stk8ba50.c           | 11 ++++------- drivers/iio/adc/ad4170-4.c             |  2 +- drivers/iio/adc/ad7768-1.c             |  5 ++--- drivers/iio/adc/ad7779.c               |  2 +- drivers/iio/adc/mcp3911.c              |  2 +- drivers/iio/adc/ti-ads131e08.c         |  2 +- drivers/iio/chemical/ens160_core.c     |  9 +++------ drivers/iio/gyro/adxrs290.c            |  2 +- drivers/iio/health/afe4403.c           |  9 ++++----- drivers/iio/health/afe4404.c           |  9 ++++----- drivers/iio/magnetometer/bmc150_magn.c |  9 +++------ drivers/iio/pressure/dlhl60d.c         |  6 +++--- drivers/iio/temperature/tmp006.c       | 10 ++++------

 16 files changed, 42 insertions(+), 59 deletions(-)
drivers/iio/accel/adxl355_core.c +0 -0
index 5fc7f814b9077..04caa493176d3 100644
@@ -770,7 +770,8 @@ static int adxl355_probe_trigger(struct iio_dev *indio_dev, int irq)


  ret = devm_request_irq(data->dev, irq, &iio_trigger_generic_data_rdy_poll,

drivers/iio/accel/adxl355_core.c +2 -1
-			       IRQF_ONESHOT, "adxl355_irq", data->dready_trig);
+			       IRQF_NO_THREAD,
+			       "adxl355_irq", data->dready_trig);

  if (ret)
  return dev_err_probe(data->dev, ret, "request irq %d failed\n", irq);

drivers/iio/accel/adxl372.c +0 -0
index 46d518a2a0291..2f6aa52aeba51 100644
@@ -1247,11 +1247,10 @@ int adxl372_probe(struct device *dev, struct regmap *regmap,


  indio_dev->trig = iio_trigger_get(st->dready_trig);

drivers/iio/accel/adxl372.c +4 -5
-		ret = devm_request_threaded_irq(dev, st->irq,
-					iio_trigger_generic_data_rdy_poll,
-					NULL,
-					IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-					indio_dev->name, st->dready_trig);
+		ret = devm_request_irq(dev, st->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       indio_dev->name, st->dready_trig);

  if (ret < 0)
  return ret;
  }

drivers/iio/accel/mxc4005.c +0 -0
index ac973d871c8bb..a2c3cf13d0981 100644
@@ -486,13 +486,10 @@ static int mxc4005_probe(struct i2c_client *client)
  		if (!data->dready_trig)
  			return -ENOMEM;

drivers/iio/accel/mxc4005.c +4 -7
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL,
-						IRQF_TRIGGER_FALLING |
-						IRQF_ONESHOT,
-						"mxc4005_event",
-						data->dready_trig);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_FALLING | IRQF_NO_THREAD,
+				       "mxc4005_event", data->dready_trig);

  if (ret) {
  dev_err(&client->dev,
  "failed to init threaded irq\n");

drivers/iio/accel/stk8ba50.c +0 -0
index 384f1fbcbcb37..a9ff2a273fe1c 100644
@@ -428,13 +428,10 @@ static int stk8ba50_probe(struct i2c_client *client)
  	}


  if (client->irq > 0) {

drivers/iio/accel/stk8ba50.c +4 -7
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						stk8ba50_data_rdy_trig_poll,
-						NULL,
-						IRQF_TRIGGER_RISING |
-						IRQF_ONESHOT,
-						"stk8ba50_event",
-						indio_dev);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       stk8ba50_data_rdy_trig_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       "stk8ba50_event", indio_dev);

  if (ret < 0) {
  dev_err(&client->dev, "request irq %d failed\n", client->irq);

drivers/iio/adc/ad4170-4.c +0 -0
index efaed92191f1b..82205bfae531e 100644
@@ -2973,7 +2973,7 @@ static int ad4170_probe(struct spi_device *spi)


  if (spi->irq) {
  ret = devm_request_irq(dev, spi->irq, &ad4170_irq_handler,

drivers/iio/adc/ad4170-4.c +1 -1
-				       IRQF_ONESHOT, indio_dev->name, indio_dev);
+				       IRQF_NO_THREAD, indio_dev->name, indio_dev);

  if (ret)
  return ret;

drivers/iio/adc/ad7768-1.c +0 -0
index d96802b7847a6..84ce23c8e5782 100644
@@ -1394,9 +1394,8 @@ static int ad7768_probe(struct spi_device *spi)
  	if (ret)
  		return ret;

drivers/iio/adc/ad7768-1.c +2 -3
-	ret = devm_request_irq(&spi->dev, spi->irq,
-			       &ad7768_interrupt,
-			       IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+	ret = devm_request_irq(&spi->dev, spi->irq, &ad7768_interrupt,
+			       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,

         indio_dev->name, indio_dev); if (ret)
  return ret;

drivers/iio/adc/ad7779.c +0 -0
index aac5049c9a07b..695cc79e78da5 100644
@@ -840,7 +840,7 @@ static int ad7779_setup_without_backend(struct ad7779_state *st, struct

iio_dev
  iio_trigger_set_drvdata(st->trig, st);

  ret = devm_request_irq(dev, st->spi->irq, iio_trigger_generic_data_rdy_poll,

drivers/iio/adc/ad7779.c +1 -1
-			       IRQF_ONESHOT | IRQF_NO_AUTOEN, indio_dev->name,
+			       IRQF_NO_THREAD | IRQF_NO_AUTOEN, indio_dev->name,

         st->trig);
  if (ret)
  return dev_err_probe(dev, ret, "request IRQ %d failed\n",

drivers/iio/adc/mcp3911.c +1 -1
index a6f21791c6859..ddc3721f3f688 100644
@@ -815,7 +815,7 @@ static int mcp3911_probe(struct spi_device *spi)
  		 * don't enable the interrupt to avoid extra load on the system.
  		 */
  		ret = devm_request_irq(dev, spi->irq, &iio_trigger_generic_data_rdy_poll,
-				       IRQF_NO_AUTOEN | IRQF_ONESHOT,
+				       IRQF_NO_AUTOEN | IRQF_NO_THREAD,
  				       indio_dev->name, adc->trig);
  		if (ret)
  			return ret;
drivers/iio/adc/ti-ads131e08.c +1 -1
index c9a20024d6b11..a585621b0bc30 100644
@@ -827,7 +827,7 @@ static int ads131e08_probe(struct spi_device *spi)
  	if (spi->irq) {
  		ret = devm_request_irq(&spi->dev, spi->irq,
  			ads131e08_interrupt,
-			IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+			IRQF_TRIGGER_FALLING | IRQF_NO_THREAD,
  			spi->dev.driver->name, indio_dev);
  		if (ret)
  			return dev_err_probe(&spi->dev, ret,
drivers/iio/chemical/ens160_core.c +0 -0
index 86bde4a91bf7e..bbc96c4c62838 100644
@@ -316,12 +316,9 @@ static int ens160_setup_trigger(struct iio_dev *indio_dev, int irq)


  indio_dev->trig = iio_trigger_get(trig);

drivers/iio/chemical/ens160_core.c +3 -6
-	ret = devm_request_threaded_irq(dev, irq,
-					iio_trigger_generic_data_rdy_poll,
-					NULL,
-					IRQF_ONESHOT,
-					indio_dev->name,
-					indio_dev->trig);
+	ret = devm_request_irq(dev, irq, iio_trigger_generic_data_rdy_poll,
+			       IRQF_NO_THREAD, indio_dev->name,
+			       indio_dev->trig);

  if (ret)
  return dev_err_probe(dev, ret, "failed to request irq\n");

drivers/iio/gyro/adxrs290.c +0 -0
index 8fcb41f45baac..3efe385ebedc4 100644
@@ -597,7 +597,7 @@ static int adxrs290_probe_trigger(struct iio_dev *indio_dev)


  ret = devm_request_irq(&st->spi->dev, st->spi->irq, &iio_trigger_generic_data_rdy_poll,

drivers/iio/gyro/adxrs290.c +1 -1
-			       IRQF_ONESHOT, "adxrs290_irq", st->dready_trig);
+			       IRQF_NO_THREAD, "adxrs290_irq", st->dready_trig);

  if (ret < 0)
  return dev_err_probe(&st->spi->dev, ret,
       "request irq %d failed\n", st->spi->irq);

drivers/iio/health/afe4403.c +0 -0
index 0e5a512e3bb8f..d358f4d5e5da8 100644
@@ -540,11 +540,10 @@ static int afe4403_probe(struct spi_device *spi)
  			return ret;
  		}

drivers/iio/health/afe4403.c +4 -5
-		ret = devm_request_threaded_irq(dev, afe->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL, IRQF_ONESHOT,
-						AFE4403_DRIVER_NAME,
-						afe->trig);
+		ret = devm_request_irq(dev, afe->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, AFE4403_DRIVER_NAME,
+				       afe->trig);

  if (ret) {
  dev_err(dev, "Unable to request IRQ\n"); return ret;

drivers/iio/health/afe4404.c +0 -0
index 768d794e574b9..032da52a96d0e 100644
@@ -547,11 +547,10 @@ static int afe4404_probe(struct i2c_client *client)
  			return ret;
  		}

drivers/iio/health/afe4404.c +4 -5
-		ret = devm_request_threaded_irq(dev, afe->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL, IRQF_ONESHOT,
-						AFE4404_DRIVER_NAME,
-						afe->trig);
+		ret = devm_request_irq(dev, afe->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, AFE4404_DRIVER_NAME,
+				       afe->trig);

  if (ret) {
  dev_err(dev, "Unable to request IRQ\n"); return ret;

drivers/iio/magnetometer/bmc150_magn.c +0 -0
index 6a73f6e2f1f06..a022e1805dff7 100644
@@ -906,12 +906,9 @@ int bmc150_magn_probe(struct device *dev, struct regmap *regmap,
  			goto err_poweroff;
  		}

drivers/iio/magnetometer/bmc150_magn.c +3 -6
-		ret = request_threaded_irq(irq,
-					   iio_trigger_generic_data_rdy_poll,
-					   NULL,
-					   IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-					   "bmc150_magn_event",
-					   data->dready_trig);
+		ret = request_irq(irq, iio_trigger_generic_data_rdy_poll,
+				  IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				  "bmc150_magn_event", data->dready_trig);

  if (ret < 0) {
  dev_err(dev, "request irq %d failed\n", irq); goto err_trigger_unregister;

drivers/iio/pressure/dlhl60d.c +0 -0
index 8bad7162fec64..e975b733ce0a1 100644
@@ -306,9 +306,9 @@ static int dlh_probe(struct i2c_client *client)
  	indio_dev->num_channels = ARRAY_SIZE(dlh_channels);


  if (client->irq > 0) {

drivers/iio/pressure/dlhl60d.c +3 -3
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-			dlh_interrupt, NULL,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+		ret = devm_request_irq(&client->dev, client->irq,
+				       dlh_interrupt,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,

  st->info->name, indio_dev);
  if (ret) {
  dev_err(&client->dev, "failed to allocate threaded irq");

drivers/iio/temperature/tmp006.c +0 -0
index 10bd3f221929d..d8d8c8936d177 100644
@@ -356,12 +356,10 @@ static int tmp006_probe(struct i2c_client *client)


  indio_dev->trig = iio_trigger_get(data->drdy_trig);

drivers/iio/temperature/tmp006.c +4 -6
-		ret = devm_request_threaded_irq(&client->dev, client->irq,
-						iio_trigger_generic_data_rdy_poll,
-						NULL,
-						IRQF_ONESHOT,
-						"tmp006_irq",
-						data->drdy_trig);
+		ret = devm_request_irq(&client->dev, client->irq,
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_NO_THREAD, "tmp006_irq",
+				       data->drdy_trig);

  if (ret < 0)
  return ret;
  }

author maintainer
#61 lore raw

PATCH 19/21 iio: Use IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior

The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke other interrupt handler and this supposed to happen from within the hardirq.

Use IRQF_NO_THREAD to forbid forced-threading.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>
---
 drivers/iio/accel/bma180.c        |  5 +++--
 drivers/iio/adc/ad7766.c          | 10 ++--------
 drivers/iio/gyro/itg3200_buffer.c |  2 +-
 drivers/iio/light/si1145.c        |  2 +-
 4 files changed, 7 insertions(+), 12 deletions(-)
drivers/iio/accel/bma180.c +3 -2
index 8925f5279e627..7bc6761f51354 100644
@@ -986,8 +986,9 @@ static int bma180_probe(struct i2c_client *client)
 		}
 
 		ret = devm_request_irq(dev, client->irq,
-			iio_trigger_generic_data_rdy_poll, IRQF_TRIGGER_RISING,
-			"bma180_event", data->trig);
+				       iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
+				       "bma180_event", data->trig);
 		if (ret) {
 			dev_err(dev, "unable to request IRQ\n");
 			goto err_trigger_free;
drivers/iio/adc/ad7766.c +2 -8
index 4d570383ef025..9e4a66477d2d0 100644
@@ -184,12 +184,6 @@ static const struct iio_info ad7766_info = {
 	.read_raw = &ad7766_read_raw,
 };
 
-static irqreturn_t ad7766_irq(int irq, void *private)
-{
-	iio_trigger_poll(private);
-	return IRQ_HANDLED;
-}
-
 static int ad7766_set_trigger_state(struct iio_trigger *trig, bool enable)
 {
 	struct ad7766 *ad7766 = iio_trigger_get_drvdata(trig);
@@ -260,8 +254,8 @@ static int ad7766_probe(struct spi_device *spi)
 		 * Some platforms might not allow the option to power it down so
 		 * don't enable the interrupt to avoid extra load on the system
 		 */
-		ret = devm_request_irq(&spi->dev, spi->irq, ad7766_irq,
-				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
+		ret = devm_request_irq(&spi->dev, spi->irq, iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN | IRQF_NO_THREAD,
 				       dev_name(&spi->dev),
 				       ad7766->trig);
 		if (ret < 0)
drivers/iio/gyro/itg3200_buffer.c +1 -1
index a624400a239cb..767b87b7feea7 100644
@@ -120,7 +120,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev)
 
 	ret = request_irq(st->i2c->irq,
 			  &iio_trigger_generic_data_rdy_poll,
-			  IRQF_TRIGGER_RISING,
+			  IRQF_NO_THREAD | IRQF_TRIGGER_RISING,
 			  "itg3200_data_rdy",
 			  st->trig);
 	if (ret)
drivers/iio/light/si1145.c +1 -1
index f8eb251eca8dc..ef0abc4499b74 100644
@@ -1248,7 +1248,7 @@ static int si1145_probe_trigger(struct iio_dev *indio_dev)
 
 	ret = devm_request_irq(&client->dev, client->irq,
 			  iio_trigger_generic_data_rdy_poll,
-			  IRQF_TRIGGER_FALLING,
+			  IRQF_TRIGGER_FALLING | IRQF_NO_THREAD,
 			  "si1145_irq",
 			  trig);
 	if (ret < 0) {
Signature · 1 line
2.51.0
#62 lore raw

Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

Quoted 5 lines · Sebastian Andrzej Siewior

The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke other interrupt handler and this supposed to happen from within the hardirq.

Use IRQF_NO_THREAD to forbid forced-threading.

...

Quoted 7 lines
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Michael Hennerich <[email protected]>

Same comment about Cc list.

...

drivers/iio/gyro/itg3200_buffer.c int itg3200_probe_trigger(struct iio_dev *indio_dev) · line 123

Quoted 4 lines
drivers/iio/gyro/itg3200_buffer.c +1 -1
 	ret = request_irq(st->i2c->irq,
 			  &iio_trigger_generic_data_rdy_poll,
-			  IRQF_TRIGGER_RISING,
+			  IRQF_NO_THREAD | IRQF_TRIGGER_RISING,

Maybe swap their positions as it's done everywhere else for the consistency's sake?

Quoted 2 lines
drivers/iio/gyro/itg3200_buffer.c +0 -0
 			  "itg3200_data_rdy",
 			  st->trig);
Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#63 lore raw

Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

Quoted 7 lines · Andy Shevchenko

drivers/iio/gyro/itg3200_buffer.c int itg3200_probe_trigger(struct iio_dev *indio_dev) · line 123

Quoted 4 lines
drivers/iio/gyro/itg3200_buffer.c +1 -1
 	ret = request_irq(st->i2c->irq,
 			  &iio_trigger_generic_data_rdy_poll,
-			  IRQF_TRIGGER_RISING,
+			  IRQF_NO_THREAD | IRQF_TRIGGER_RISING,

Maybe swap their positions as it's done everywhere else for the consistency's sake?

Almost missed this. I swapped the flags, re-ident-ed.
Also updated the commit message that ad7766_irq() is identical to iio_trigger_generic_data_rdy_poll() and can be replaced. Hope that works for everyone.

Quoted 2 lines

drivers/iio/gyro/itg3200_buffer.c int itg3200_probe_trigger(struct iio_dev *indio_dev) · line 125

Quoted 2 lines
drivers/iio/gyro/itg3200_buffer.c +0 -0
 			  "itg3200_data_rdy",
 			  st->trig);

Sebastian

reviewer
#64 lore raw

Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior
Quoted 6 lines · Sebastian Andrzej Siewior

The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke other interrupt handler and this supposed to happen from within the hardirq.

Use IRQF_NO_THREAD to forbid forced-threading.

...

Quoted 5 lines
drivers/iio/adc/ad7766.c +0 -0
index 4d570383ef025..9e4a66477d2d0 100644

drivers/iio/adc/ad7766.c static const struct iio_info ad7766_info = { · line 192

Quoted 9 lines
drivers/iio/adc/ad7766.c +0 -6
@@ -184,12 +184,6 @@ static const struct iio_info ad7766_info = {
 	.read_raw = &ad7766_read_raw,
 };
 
-static irqreturn_t ad7766_irq(int irq, void *private)
-{
-	iio_trigger_poll(private);
-	return IRQ_HANDLED;
-}
-

Replacing this with iio_trigger_generic_data_rdy_poll() seems like a separate improvement that should be in a separate patch.

At a minimum, the commit message should explain this change. But I expect the reason will make it obvious it should be a separate patch.

Quoted 14 lines
drivers/iio/adc/ad7766.c +2 -2
 static int ad7766_set_trigger_state(struct iio_trigger *trig, bool enable)
 {
 	struct ad7766 *ad7766 = iio_trigger_get_drvdata(trig);
@@ -260,8 +254,8 @@ static int ad7766_probe(struct spi_device *spi)
 		 * Some platforms might not allow the option to power it down so
 		 * don't enable the interrupt to avoid extra load on the system
 		 */
-		ret = devm_request_irq(&spi->dev, spi->irq, ad7766_irq,
-				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
+		ret = devm_request_irq(&spi->dev, spi->irq, iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN | IRQF_NO_THREAD,
 				       dev_name(&spi->dev),
 				       ad7766->trig);
 		if (ret < 0)
author maintainer
#65 lore raw

Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

Quoted 10 lines · David Lechner

drivers/iio/adc/ad7766.c static const struct iio_info ad7766_info = { · line 192

Quoted 6 lines
drivers/iio/adc/ad7766.c +0 -6
-static irqreturn_t ad7766_irq(int irq, void *private)
-{
-	iio_trigger_poll(private);
-	return IRQ_HANDLED;
-}
-

Replacing this with iio_trigger_generic_data_rdy_poll() seems like a separate improvement that should be in a separate patch.

Quoted 2 lines

At a minimum, the commit message should explain this change. But I expect the reason will make it obvious it should be a separate patch.

The other use iio_trigger_generic_data_rdy_poll() as the handler except this one. Which uses a wrapper around it. It looked to easier to add this hunk.
What do you want (split or keep)?

Quoted 6 lines
Quoted 6 lines

static int ad7766_set_trigger_state(struct iio_trigger *trig, bool enable) {

drivers/iio/adc/ad7766.c +0 -0
 	struct ad7766 *ad7766 = iio_trigger_get_drvdata(trig);
@@ -260,8 +254,8 @@ static int ad7766_probe(struct spi_device *spi)
 		 * Some platforms might not allow the option to power it down so
 		 * don't enable the interrupt to avoid extra load on the system
Quoted 8 lines

drivers/iio/adc/ad7766.c static int ad7766_probe(struct spi_device *spi) · line 261

Quoted 8 lines
drivers/iio/adc/ad7766.c +2 -2
 		 */
-		ret = devm_request_irq(&spi->dev, spi->irq, ad7766_irq,
-				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN,
+		ret = devm_request_irq(&spi->dev, spi->irq, iio_trigger_generic_data_rdy_poll,
+				       IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN | IRQF_NO_THREAD,
 				       dev_name(&spi->dev),
 				       ad7766->trig);
 		if (ret < 0)

Sebastian

reviewer
#66 lore raw

Re: [PATCH 19/21] iio: Use IRQF_NO_THREAD

Quoted 11 lines · Sebastian Andrzej Siewior
Quoted 10 lines · David Lechner

drivers/iio/adc/ad7766.c static const struct iio_info ad7766_info = { · line 192

Quoted 6 lines
drivers/iio/adc/ad7766.c +0 -6
-static irqreturn_t ad7766_irq(int irq, void *private)
-{
-	iio_trigger_poll(private);
-	return IRQ_HANDLED;
-}
-

Replacing this with iio_trigger_generic_data_rdy_poll() seems like a separate improvement that should be in a separate patch.

Quoted 8 lines
Quoted 2 lines

At a minimum, the commit message should explain this change. But I expect the reason will make it obvious it should be a separate patch.

The other use iio_trigger_generic_data_rdy_poll() as the handler except this one. Which uses a wrapper around it. It looked to easier to add this hunk.
What do you want (split or keep)?

I would still expect a separate patch to replace the duplicate function with iio_trigger_generic_data_rdy_poll(). That change stands on it's own, so deserves a separate patch.

author maintainer
#67 lore raw

PATCH 20/21 iio: magnetometer: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.
The force-threading functionality is required on PREEMPT_RT because the handler is using locks with can sleep on PREEMPT_RT.

Remove IRQF_ONESHOT from irqflags.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
---
 drivers/iio/magnetometer/ak8975.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +1 -1
index 3fd0171e5d69b..d30315ad85ded 100644
@@ -581,7 +581,7 @@ static int ak8975_setup_irq(struct ak8975_data *data)
 		irq = gpiod_to_irq(data->eoc_gpiod);
 
 	rc = devm_request_irq(&client->dev, irq, ak8975_irq_handler,
-			      IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+			      IRQF_TRIGGER_RISING,
 			      dev_name(&client->dev), data);
 	if (rc < 0) {
 		dev_err(&client->dev, "irq %d request failed: %d\n", irq, rc);
Signature · 1 line
2.51.0
#68 lore raw

Re: [PATCH 20/21] iio: magnetometer: Remove IRQF_ONESHOT

Quoted 10 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.
The force-threading functionality is required on PREEMPT_RT because the handler is using locks with can sleep on PREEMPT_RT.

Remove IRQF_ONESHOT from irqflags.

...

Quoted 5 lines
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>

Same comment on the location of Cc list.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Tested-by on v1 20/21
#69 lore raw

Re: [PATCH 20/21] iio: magnetometer: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior

Hi Sebastian,

Quoted 9 lines

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.
The force-threading functionality is required on PREEMPT_RT because the handler is using locks with can sleep on PREEMPT_RT.

Quoted 8 lines

Remove IRQF_ONESHOT from irqflags.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>

Thanks for your patch!

This fixes the

    WARNING: kernel/irq/manage.c:1491 at __setup_irq+0xb0/0x79c, CPU#0: swapper/0/1

I was seeing on the KZM-A9-GT board since commit aef30c8d569c0f31 ("genirq: Warn about using IRQF_ONESHOT without a threaded handler") in irqchip/irq/core.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Reviewed-by on v1 20/21
#70 lore raw

Re: [PATCH 20/21] iio: magnetometer: Remove IRQF_ONESHOT

In reply to Sebastian Andrzej Siewior
Quoted 11 lines · Sebastian Andrzej Siewior

Passing IRQF_ONESHOT ensures that the interrupt source is masked until the secondary (threaded) handler is done. If only a primary handler is used then the flag makes no sense because the interrupt can not fire (again) while its handler is running.
The flag also disallows force-threading of the primary handler and the irq-core will warn about this.
The force-threading functionality is required on PREEMPT_RT because the handler is using locks with can sleep on PREEMPT_RT.

Remove IRQF_ONESHOT from irqflags.

Quoted 7 lines
Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>

---

Quoted 16 lines

 drivers/iio/magnetometer/ak8975.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +0 -0
index 3fd0171e5d69b..d30315ad85ded 100644
@@ -581,7 +581,7 @@ static int ak8975_setup_irq(struct ak8975_data *data)
  		irq = gpiod_to_irq(data->eoc_gpiod);


  rc = devm_request_irq(&client->dev, irq, ak8975_irq_handler,

drivers/iio/magnetometer/ak8975.c +1 -1
-			      IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+			      IRQF_TRIGGER_RISING,

        dev_name(&client->dev), data);
  if (rc < 0) {
  dev_err(&client->dev, "irq %d request failed: %d\n", irq, rc);

#71 lore raw

Re: [PATCH 20/21] iio: magnetometer: Remove IRQF_ONESHOT

Quoted 3 lines · Nuno Sá

On Fri, 2026-01-23 at 12:37 +0100, Sebastian Andrzej Siewior wrote:

There is the v2 available.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#72 lore raw

PATCH 21/21 media: pci: mg4b: Use IRQF_NO_THREAD

In reply to Sebastian Andrzej Siewior

The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke other interrupt handler and this supposed to happen from within the hardirq.

Use IRQF_NO_THREAD to forbid forced-threading.

Cc Martin Tuma <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Fixes 0ab13674a9bd1 ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
---
 drivers/media/pci/mgb4/mgb4_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/mgb4/mgb4_trigger.c +1 -1
index 4f9a35904b418..70cad324df608 100644
@@ -115,7 +115,7 @@ static int probe_trigger(struct iio_dev *indio_dev, int irq)
 	if (!st->trig)
 		return -ENOMEM;
 
-	ret = request_irq(irq, &iio_trigger_generic_data_rdy_poll, 0,
+	ret = request_irq(irq, &iio_trigger_generic_data_rdy_poll, IRQF_NO_THREAD,
 			  "mgb4-trigger", st->trig);
 	if (ret)
 		goto error_free_trig;
Signature · 1 line
2.51.0
maintainer
#73 lore raw

Re: (subset) [PATCH 00/21] IRQF_ONESHOT clean up

In reply to Sebastian Andrzej Siewior
Quoted 8 lines · Sebastian Andrzej Siewior

There was a bug report about setting IRQF_ONESHOT where it should have not been set. I looked around for other mistakes in that area. There are the following categories:

- Using custom primary irq handler doing exactly what irq_default_primary_handler() does

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[12/21] ASoC: codecs: rt56*: Remove IRQF_ONESHOT

        commit: 4a393958b6a1f8e476201437dbad2580d9b8700e

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

#74 lore raw

Re: (subset) [PATCH 00/21] IRQF_ONESHOT clean up

In reply to Sebastian Andrzej Siewior
Quoted 8 lines · Sebastian Andrzej Siewior

There was a bug report about setting IRQF_ONESHOT where it should have not been set. I looked around for other mistakes in that area. There are the following categories:

- Using custom primary irq handler doing exactly what irq_default_primary_handler() does

[...]

Applied to 6.20/scsi-queue, thanks!

[07/21] scsi: efct: Use IRQF_ONESHOT and default primary handler

        https://git.kernel.org/mkp/scsi/c/1508301d4a47
Signature · 1 line
Martin K. Petersen