[PATCH 00/21] IRQF_ONESHOT clean up

Sebastian Andrzej Siewior posted 21 patches 2 weeks ago
There is a newer version of this series
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(-)
[PATCH 00/21] IRQF_ONESHOT clean up
Posted by Sebastian Andrzej Siewior 2 weeks ago
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(-)

-- 
2.51.0
Re: (subset) [PATCH 00/21] IRQF_ONESHOT clean up
Posted by Mark Brown 1 week, 4 days ago
On Fri, 23 Jan 2026 12:36:46 +0100, Sebastian Andrzej Siewior wrote:
> 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