Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/irq: Cleanup the arch_*_msi_irqs() leftovers

Get rid of all the gunk and remove the 'select PCI_MSI_ARCH_FALLBACK' from
the x86 Kconfig so the weak functions in the PCI core are replaced by stubs
which emit a warning, which ensures that any fail to set the irq domain
pointer results in a warning when the device is used.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20200826112334.086003720@linutronix.de

-60
-1
arch/x86/Kconfig
··· 225 225 select NEED_SG_DMA_LENGTH 226 226 select PCI_DOMAINS if PCI 227 227 select PCI_LOCKLESS_CONFIG if PCI 228 - select PCI_MSI_ARCH_FALLBACKS 229 228 select PERF_EVENTS 230 229 select RTC_LIB 231 230 select RTC_MC146818_LIB
-11
arch/x86/include/asm/pci.h
··· 105 105 106 106 extern void pci_iommu_alloc(void); 107 107 108 - #ifdef CONFIG_PCI_MSI 109 - /* implemented in arch/x86/kernel/apic/io_apic. */ 110 - struct msi_desc; 111 - int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); 112 - void native_teardown_msi_irq(unsigned int irq); 113 - void native_restore_msi_irqs(struct pci_dev *dev); 114 - #else 115 - #define native_setup_msi_irqs NULL 116 - #define native_teardown_msi_irq NULL 117 - #endif 118 - 119 108 /* generic pci stuff */ 120 109 #include <asm-generic/pci.h> 121 110
-1
arch/x86/include/asm/x86_init.h
··· 277 277 278 278 struct x86_msi_ops { 279 279 int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type); 280 - void (*teardown_msi_irq)(unsigned int irq); 281 280 void (*teardown_msi_irqs)(struct pci_dev *dev); 282 281 void (*restore_msi_irqs)(struct pci_dev *dev); 283 282 };
-22
arch/x86/kernel/apic/msi.c
··· 181 181 .flags = IRQCHIP_SKIP_SET_WAKE, 182 182 }; 183 183 184 - int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 185 - { 186 - struct irq_domain *domain; 187 - struct irq_alloc_info info; 188 - 189 - init_irq_alloc_info(&info, NULL); 190 - info.type = X86_IRQ_ALLOC_TYPE_PCI_MSI; 191 - 192 - domain = irq_remapping_get_irq_domain(&info); 193 - if (domain == NULL) 194 - domain = x86_pci_msi_default_domain; 195 - if (domain == NULL) 196 - return -ENOSYS; 197 - 198 - return msi_domain_alloc_irqs(domain, &dev->dev, nvec); 199 - } 200 - 201 - void native_teardown_msi_irq(unsigned int irq) 202 - { 203 - irq_domain_free_irqs(irq, 1); 204 - } 205 - 206 184 int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec, 207 185 msi_alloc_info_t *arg) 208 186 {
-18
arch/x86/kernel/x86_init.c
··· 146 146 147 147 #if defined(CONFIG_PCI_MSI) 148 148 struct x86_msi_ops x86_msi __ro_after_init = { 149 - .setup_msi_irqs = native_setup_msi_irqs, 150 - .teardown_msi_irq = native_teardown_msi_irq, 151 - .teardown_msi_irqs = default_teardown_msi_irqs, 152 149 .restore_msi_irqs = default_restore_msi_irqs, 153 150 }; 154 151 155 152 /* MSI arch specific hooks */ 156 - int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 157 - { 158 - return x86_msi.setup_msi_irqs(dev, nvec, type); 159 - } 160 - 161 - void arch_teardown_msi_irqs(struct pci_dev *dev) 162 - { 163 - x86_msi.teardown_msi_irqs(dev); 164 - } 165 - 166 - void arch_teardown_msi_irq(unsigned int irq) 167 - { 168 - x86_msi.teardown_msi_irq(irq); 169 - } 170 - 171 153 void arch_restore_msi_irqs(struct pci_dev *dev) 172 154 { 173 155 x86_msi.restore_msi_irqs(dev);
-7
arch/x86/pci/xen.c
··· 402 402 xen_teardown_msi_irqs(dev); 403 403 } 404 404 405 - static void xen_teardown_msi_irq(unsigned int irq) 406 - { 407 - WARN_ON_ONCE(1); 408 - } 409 - 410 405 static int xen_msi_domain_alloc_irqs(struct irq_domain *domain, 411 406 struct device *dev, int nvec) 412 407 { ··· 477 482 WARN_ON_ONCE(1); 478 483 return; 479 484 } 480 - 481 - x86_msi.teardown_msi_irq = xen_teardown_msi_irq; 482 485 483 486 /* 484 487 * Override the PCI/MSI irq domain init function. No point