]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'irq-msi-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 27 May 2025 15:15:26 +0000 (08:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 27 May 2025 15:15:26 +0000 (08:15 -0700)
Pull MSI updates from Thomas Gleixner:
 "Updates for the MSI subsystem (core code and PCI):

   - Switch the MSI descriptor locking to lock guards

   - Replace a broken and naive implementation of PCI/MSI-X control word
     updates in the PCI/TPH driver with a properly serialized variant in
     the PCI/MSI core code.

   - Remove the MSI descriptor abuse in the SCCI/UFS/QCOM driver by
     replacing the direct access to the MSI descriptors with the proper
     API function calls. People will never understand that APIs exist
     for a reason...

   - Provide core infrastructre for the upcoming PCI endpoint library
     extensions. Currently limited to ARM GICv3+, but in theory
     extensible to other architectures.

   - Provide a MSI domain::teardown() callback, which allows drivers to
     undo the effects of the prepare() callback.

   - Move the MSI domain::prepare() callback invocation to domain
     creation time to avoid redundant (and in case of ARM/GIC-V3-ITS
     confusing) invocations on every allocation.

     In combination with the new teardown callback this removes some
     ugly hacks in the GIC-V3-ITS driver, which pretended to work around
     the short comings of the core code so far. With this update the
     code is correct by design and implementation.

   - Make the irqchip MSI library globally available, provide a MSI
     parent domain creation helper and convert a bunch of (PCI/)MSI
     drivers over to the modern MSI parent mechanism. This is the first
     step to get rid of at least one incarnation of the three PCI/MSI
     management schemes.

   - The usual small cleanups and improvements"

* tag 'irq-msi-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (33 commits)
  PCI/MSI: Use bool for MSI enable state tracking
  PCI: tegra: Convert to MSI parent infrastructure
  PCI: xgene: Convert to MSI parent infrastructure
  PCI: apple: Convert to MSI parent infrastructure
  irqchip/msi-lib: Honour the MSI_FLAG_NO_AFFINITY flag
  irqchip/mvebu: Convert to msi_create_parent_irq_domain() helper
  irqchip/gic: Convert to msi_create_parent_irq_domain() helper
  genirq/msi: Add helper for creating MSI-parent irq domains
  irqchip: Make irq-msi-lib.h globally available
  irqchip/gic-v3-its: Use allocation size from the prepare call
  genirq/msi: Engage the .msi_teardown() callback on domain removal
  genirq/msi: Move prepare() call to per-device allocation
  irqchip/gic-v3-its: Implement .msi_teardown() callback
  genirq/msi: Add .msi_teardown() callback as the reverse of .msi_prepare()
  irqchip/gic-v3-its: Add support for device tree msi-map and msi-mask
  dt-bindings: PCI: pci-ep: Add support for iommu-map and msi-map
  irqchip/gic-v3-its: Set IRQ_DOMAIN_FLAG_MSI_IMMUTABLE for ITS
  irqdomain: Add IRQ_DOMAIN_FLAG_MSI_IMMUTABLE and irq_domain_is_msi_immutable()
  platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all()
  genirq/msi: Rename msi_[un]lock_descs()
  ...

14 files changed:
1  2 
drivers/irqchip/irq-bcm2712-mip.c
drivers/irqchip/irq-gic-v2m.c
drivers/irqchip/irq-gic-v3-its-msi-parent.c
drivers/irqchip/irq-gic-v3-its.c
drivers/irqchip/irq-gic-v3-mbi.c
drivers/irqchip/irq-loongson-pch-msi.c
drivers/irqchip/irq-mvebu-gicp.c
drivers/irqchip/irq-mvebu-odmi.c
drivers/irqchip/irq-sg2042-msi.c
drivers/pci/msi/msi.c
drivers/ufs/host/ufs-qcom.c
include/linux/irqdomain.h
include/linux/pci.h
kernel/irq/msi.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index f7e8429de436b9d91d0034af8737fae9e54e6265,d641f3a5eee9ebb319e853bb2bb97020e45a01be..af16bc5a3c8b566d21e678dc3e36050c8aacc816
  #include <linux/property.h>
  #include <linux/slab.h>
  
- #include "irq-msi-lib.h"
+ #include <linux/irqchip/irq-msi-lib.h>
  
 -#define SG2042_MAX_MSI_VECTOR 32
 +struct sg204x_msi_chip_info {
 +      const struct irq_chip           *irqchip;
 +      const struct msi_parent_ops     *parent_ops;
 +};
 +
 +/**
 + * struct sg204x_msi_chipdata - chip data for the SG204x MSI IRQ controller
 + * @reg_clr:          clear reg, see TRM, 10.1.33, GP_INTR0_CLR
 + * @doorbell_addr:    see TRM, 10.1.32, GP_INTR0_SET
 + * @irq_first:                First vectors number that MSIs starts
 + * @num_irqs:         Number of vectors for MSIs
 + * @msi_map:          mapping for allocated MSI vectors.
 + * @msi_map_lock:     Lock for msi_map
 + * @chip_info:                chip specific infomations
 + */
 +struct sg204x_msi_chipdata {
 +      void __iomem                            *reg_clr;
  
 -struct sg2042_msi_chipdata {
 -      void __iomem    *reg_clr;       // clear reg, see TRM, 10.1.33, GP_INTR0_CLR
 +      phys_addr_t                             doorbell_addr;
  
 -      phys_addr_t     doorbell_addr;  // see TRM, 10.1.32, GP_INTR0_SET
 +      u32                                     irq_first;
 +      u32                                     num_irqs;
  
 -      u32             irq_first;      // The vector number that MSIs starts
 -      u32             num_irqs;       // The number of vectors for MSIs
 +      unsigned long                           *msi_map;
 +      struct mutex                            msi_map_lock;
  
 -      DECLARE_BITMAP(msi_map, SG2042_MAX_MSI_VECTOR);
 -      struct mutex    msi_map_lock;   // lock for msi_map
 +      const struct sg204x_msi_chip_info       *chip_info;
  };
  
 -static int sg2042_msi_allocate_hwirq(struct sg2042_msi_chipdata *data, int num_req)
 +static int sg204x_msi_allocate_hwirq(struct sg204x_msi_chipdata *data, int num_req)
  {
        int first;
  
Simple merge
Simple merge
index 2f6e4c9dd7432f6d37dab9bd0a9ea70ace64f83f,13cbacd1b5dc1e9fef12316c5d3938b802087fed..7387d183029b7b83486698249984b6adbb01a30f
@@@ -627,9 -696,13 +632,13 @@@ static inline bool irq_domain_is_msi_de
        return domain->flags & IRQ_DOMAIN_FLAG_MSI_DEVICE;
  }
  
+ static inline bool irq_domain_is_msi_immutable(struct irq_domain *domain)
+ {
+       return domain->flags & IRQ_DOMAIN_FLAG_MSI_IMMUTABLE;
+ }
  #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */
 -static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
 -                      unsigned int nr_irqs, int node, void *arg)
 +static inline int irq_domain_alloc_irqs(struct irq_domain *domain, unsigned int nr_irqs,
 +                                      int node, void *arg)
  {
        return -1;
  }
Simple merge
Simple merge