genirq: Treewide hunt for irq descriptor abuse and assorted fixes
Status from this message: The following commit has been merged into the irq/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/30 | genirq: Move irq_has_action() into core codearch/ arch/ include/ +2 more | +21 | 0 replies | |
| 2/30 | genirq: Move status flag checks to coreinclude/ kernel/ | +25 | 2 replies | |
| 3/30 | genirq: Move irq_set_lockdep_class() to coreinclude/ kernel/ | +18 | 4 replies | |
| 4/30 | genirq: Provide irq_get_effective_affinity()include/ | +7 | 0 replies | |
| 5/30 | genirq: Annotate irq stats data raceskernel/ kernel/ | +5 | 0 replies | |
| 6/30 | parisc/irq: Simplify irq count output for /proc/interruptsarch/ | +1 | 0 replies | |
| 7/30 | genirq: Make kstat_irqs() staticinclude/ kernel/ | +6 | 0 replies | |
| 8/30 | genirq: Provide kstat_irqdesc_cpu()include/ kernel/ | +8 | 0 replies | |
| 9/30 | ARM: smp: Use irq_desc_kstat_cpu() in show_ipi_list()arch/ | +1 | 1 reply | |
| 10/30 | arm64/smp: Use irq_desc_kstat_cpu() in arch_show_interrupts()arch/ | +1 | 1 reply | |
| 11/30 | parisc/irq: Use irq_desc_kstat_cpu() in show_interrupts()arch/ | +1 | 0 replies | |
| 12/30 | s390/irq: Use irq_desc_kstat_cpu() in show_msi_interrupt()arch/ | +1 | 1 reply | |
| 13/30 | drm/i915/lpe_audio: Remove pointless irq_to_desc() usagedrivers/ | +0 | 2 replies | |
| 14/30 | drm/i915/pmu: Replace open coded kstat_irqs() copydrivers/ drivers/ drivers/ | +43 | 6 replies | |
| 15/30 | pinctrl: nomadik: Use irq_has_action()drivers/ | +1 | 1 reply | |
| 16/30 | mfd: ab8500-debugfs: Remove the racy fiddling with irq_descdrivers/ | +3 | 3 replies | |
| 17/30 | NTB/msi: Use irq_has_action()drivers/ | +1 | 1 reply | |
| 18/30 | PCI: xilinx-nwl: Use irq_data_get_irq_chip_data()drivers/ | +2 | 1 reply | |
| 19/30 | PCI: mobiveil: Use irq_data_get_irq_chip_data()drivers/ | +2 | 1 reply | |
| 20/30 | net/mlx4: Replace irq_to_desc() abusedrivers/ drivers/ drivers/ | +6 | 1 reply | |
| 21/30 | net/mlx4: Use effective interrupt affinitydrivers/ | +1 | 1 reply | |
| 22/30 | net/mlx5: Replace irq_to_desc() abusedrivers/ drivers/ drivers/ | +3 | 2 replies | |
| 23/30 | net/mlx5: Use effective interrupt affinitydrivers/ | +1 | 2 replies | |
| 24/30 | xen/events: Remove unused bind_evtchn_to_irq_lateeoi()drivers/ | +0 | 2 replies | |
| 25/30 | xen/events: Remove disfunct affinity spreadingdrivers/ drivers/ | +1 | 0 replies | |
| 26/30 | xen/events: Use immediate affinity settingdrivers/ | +9 | 0 replies | |
| 27/30 | xen/events: Only force affinity mask for percpu interruptsdrivers/ | +28 | 11 replies | |
| 28/30 | xen/events: Reduce irq_info::spurious_cnt storage sizedrivers/ | +5 | 0 replies | |
| 29/30 | xen/events: Implement irq distributiondrivers/ | +64 | 0 replies | |
| 30/30 | genirq: Remove export of irq_to_desc()kernel/ | +0 | 0 replies |
Reviews trailers per patch
14 of 30 patches have a Reviewed-by or Acked-by.
| Patch | Ville Syrjälä | Heiko Carstens | Logan Gunthorpe | Rob Herring | Linus Walleij | Jani Nikula | Lee Jones | Marc Zyngier | Tariq Toukan | Saeed Mahameed |
|---|---|---|---|---|---|---|---|---|---|---|
| 1/30 | ||||||||||
| 2/30 | ||||||||||
| 3/30 | ||||||||||
| 4/30 | ||||||||||
| 5/30 | ||||||||||
| 6/30 | ||||||||||
| 7/30 | ||||||||||
| 8/30 | ||||||||||
| 9/30 | A-b | |||||||||
| 10/30 | A-b | |||||||||
| 11/30 | ||||||||||
| 12/30 | A-b | |||||||||
| 13/30 | R-b | A-b | ||||||||
| 14/30 | A-b | |||||||||
| 15/30 | R-b | |||||||||
| 16/30 | R-b | A-b | ||||||||
| 17/30 | R-b | |||||||||
| 18/30 | R-b | |||||||||
| 19/30 | R-b | |||||||||
| 20/30 | R-b | |||||||||
| 21/30 | R-b | |||||||||
| 22/30 | R-b | A-b | ||||||||
| 23/30 | R-b | A-b | ||||||||
| 24/30 | ||||||||||
| 25/30 | ||||||||||
| 26/30 | ||||||||||
| 27/30 | ||||||||||
| 28/30 | ||||||||||
| 29/30 | ||||||||||
| 30/30 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 10 reviewers.
Cover letter [patch 00/30] genirq: Treewide hunt for irq descriptor abuse and assorted fixes
A recent request to export kstat_irqs() pointed to a copy of the same in the i915 code, which made me look for further usage of irq descriptors in drivers.
The usage in drivers ranges from creative to broken in all colours.
irqdesc.h clearly says that this is core functionality and the fact C does not allow full encapsulation is not a justification to fiddle with it just because. It took us a lot of effort to make the core functionality provide what drivers need.
If there is a shortcoming, it's not asked too much to talk to the relevant maintainers instead of going off and fiddling with the guts of interrupt descriptors and often enough without understanding lifetime and locking rules.
As people insist on not respecting boundaries, this series cleans up the (ab)use and at the end removes the export of irq_to_desc() to make it at least harder. All legitimate users of this are built in.
While at it I stumbled over some other oddities related to interrupt counting and cleaned them up as well.
The series applies on top of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
and is also available from git:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git genirq
Thanks,
tglx
--- arch/alpha/kernel/sys_jensen.c | 2 arch/arm/kernel/smp.c | 2 arch/parisc/kernel/irq.c | 7 arch/s390/kernel/irq.c | 2 arch/x86/kernel/topology.c | 1 arch/arm64/kernel/smp.c | 2 drivers/gpu/drm/i915/display/intel_lpe_audio.c | 4 drivers/gpu/drm/i915/i915_irq.c | 34 +++ drivers/gpu/drm/i915/i915_pmu.c | 18 - drivers/gpu/drm/i915/i915_pmu.h | 8 drivers/mfd/ab8500-debugfs.c | 16 - drivers/net/ethernet/mellanox/mlx4/en_cq.c | 8 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 6 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 3 drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 6 drivers/ntb/msi.c | 4 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 8 drivers/pci/controller/pcie-xilinx-nwl.c | 8 drivers/pinctrl/nomadik/pinctrl-nomadik.c | 3 drivers/xen/events/events_base.c | 172 +++++++++++-------- drivers/xen/evtchn.c | 34 --- include/linux/interrupt.h | 1 include/linux/irq.h | 7 include/linux/irqdesc.h | 40 +--- include/linux/kernel_stat.h | 1 kernel/irq/irqdesc.c | 42 ++-- kernel/irq/manage.c | 37 ++++ kernel/irq/proc.c | 5 30 files changed, 263 insertions(+), 222 deletions(-)