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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'irq-core-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq updates from Thomas Gleixner:
"A small set of core changes for the interrupt subsystem:

- Expose the MSI message in the existing debug filesystem dump.
That's useful for validation and debugging.

- Small cleanups"

* tag 'irq-core-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
genirq: Make a few functions static
irqdomain: Remove extern from function declarations
genirq/msi: Expose MSI message data in debugfs

+105 -96
+64 -65
include/linux/irqdomain.h
··· 350 350 irq_hw_number_t first_hwirq, 351 351 const struct irq_domain_ops *ops, 352 352 void *host_data); 353 - extern struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, 354 - enum irq_domain_bus_token bus_token); 355 - extern void irq_set_default_host(struct irq_domain *host); 356 - extern struct irq_domain *irq_get_default_host(void); 357 - extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs, 358 - irq_hw_number_t hwirq, int node, 359 - const struct irq_affinity_desc *affinity); 353 + struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, 354 + enum irq_domain_bus_token bus_token); 355 + void irq_set_default_host(struct irq_domain *host); 356 + struct irq_domain *irq_get_default_host(void); 357 + int irq_domain_alloc_descs(int virq, unsigned int nr_irqs, 358 + irq_hw_number_t hwirq, int node, 359 + const struct irq_affinity_desc *affinity); 360 360 361 361 static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node) 362 362 { ··· 370 370 return fwnode && fwnode->ops == &irqchip_fwnode_ops; 371 371 } 372 372 373 - extern void irq_domain_update_bus_token(struct irq_domain *domain, 374 - enum irq_domain_bus_token bus_token); 373 + void irq_domain_update_bus_token(struct irq_domain *domain, 374 + enum irq_domain_bus_token bus_token); 375 375 376 376 static inline 377 377 struct irq_domain *irq_find_matching_fwnode(struct fwnode_handle *fwnode, ··· 454 454 return IS_ERR(d) ? NULL : d; 455 455 } 456 456 457 - extern unsigned int irq_create_direct_mapping(struct irq_domain *host); 457 + unsigned int irq_create_direct_mapping(struct irq_domain *host); 458 458 #endif 459 459 460 460 static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node, ··· 507 507 return IS_ERR(d) ? NULL : d; 508 508 } 509 509 510 - extern void irq_domain_remove(struct irq_domain *host); 510 + void irq_domain_remove(struct irq_domain *host); 511 511 512 - extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq, 513 - irq_hw_number_t hwirq); 514 - extern void irq_domain_associate_many(struct irq_domain *domain, 515 - unsigned int irq_base, 516 - irq_hw_number_t hwirq_base, int count); 512 + int irq_domain_associate(struct irq_domain *domain, unsigned int irq, 513 + irq_hw_number_t hwirq); 514 + void irq_domain_associate_many(struct irq_domain *domain, 515 + unsigned int irq_base, 516 + irq_hw_number_t hwirq_base, int count); 517 517 518 - extern unsigned int irq_create_mapping_affinity(struct irq_domain *host, 519 - irq_hw_number_t hwirq, 520 - const struct irq_affinity_desc *affinity); 521 - extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec); 522 - extern void irq_dispose_mapping(unsigned int virq); 518 + unsigned int irq_create_mapping_affinity(struct irq_domain *host, 519 + irq_hw_number_t hwirq, 520 + const struct irq_affinity_desc *affinity); 521 + unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec); 522 + void irq_dispose_mapping(unsigned int virq); 523 523 524 524 static inline unsigned int irq_create_mapping(struct irq_domain *host, 525 525 irq_hw_number_t hwirq) ··· 527 527 return irq_create_mapping_affinity(host, hwirq, NULL); 528 528 } 529 529 530 - extern struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain, 531 - irq_hw_number_t hwirq, 532 - unsigned int *irq); 530 + struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain, 531 + irq_hw_number_t hwirq, 532 + unsigned int *irq); 533 533 534 534 static inline struct irq_desc *irq_resolve_mapping(struct irq_domain *domain, 535 535 irq_hw_number_t hwirq) ··· 587 587 int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest); 588 588 589 589 /* V2 interfaces to support hierarchy IRQ domains. */ 590 - extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, 591 - unsigned int virq); 592 - extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, 593 - irq_hw_number_t hwirq, 594 - const struct irq_chip *chip, 595 - void *chip_data, irq_flow_handler_t handler, 596 - void *handler_data, const char *handler_name); 597 - extern void irq_domain_reset_irq_data(struct irq_data *irq_data); 590 + struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, 591 + unsigned int virq); 592 + void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, 593 + irq_hw_number_t hwirq, 594 + const struct irq_chip *chip, 595 + void *chip_data, irq_flow_handler_t handler, 596 + void *handler_data, const char *handler_name); 597 + void irq_domain_reset_irq_data(struct irq_data *irq_data); 598 598 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY 599 - extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, 600 - unsigned int flags, unsigned int size, 601 - struct fwnode_handle *fwnode, 602 - const struct irq_domain_ops *ops, void *host_data); 599 + struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent, 600 + unsigned int flags, 601 + unsigned int size, 602 + struct fwnode_handle *fwnode, 603 + const struct irq_domain_ops *ops, 604 + void *host_data); 603 605 604 606 static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, 605 607 unsigned int flags, ··· 615 613 ops, host_data); 616 614 } 617 615 618 - extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base, 619 - unsigned int nr_irqs, int node, void *arg, 620 - bool realloc, 621 - const struct irq_affinity_desc *affinity); 622 - extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs); 623 - extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early); 624 - extern void irq_domain_deactivate_irq(struct irq_data *irq_data); 616 + int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base, 617 + unsigned int nr_irqs, int node, void *arg, 618 + bool realloc, 619 + const struct irq_affinity_desc *affinity); 620 + void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs); 621 + int irq_domain_activate_irq(struct irq_data *irq_data, bool early); 622 + void irq_domain_deactivate_irq(struct irq_data *irq_data); 625 623 626 624 static inline int irq_domain_alloc_irqs(struct irq_domain *domain, 627 625 unsigned int nr_irqs, int node, void *arg) ··· 630 628 NULL); 631 629 } 632 630 633 - extern int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain, 634 - unsigned int irq_base, 635 - unsigned int nr_irqs, void *arg); 636 - extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain, 637 - unsigned int virq, 638 - irq_hw_number_t hwirq, 639 - const struct irq_chip *chip, 640 - void *chip_data); 641 - extern void irq_domain_free_irqs_common(struct irq_domain *domain, 642 - unsigned int virq, 643 - unsigned int nr_irqs); 644 - extern void irq_domain_free_irqs_top(struct irq_domain *domain, 645 - unsigned int virq, unsigned int nr_irqs); 631 + int irq_domain_set_hwirq_and_chip(struct irq_domain *domain, 632 + unsigned int virq, 633 + irq_hw_number_t hwirq, 634 + const struct irq_chip *chip, 635 + void *chip_data); 636 + void irq_domain_free_irqs_common(struct irq_domain *domain, 637 + unsigned int virq, 638 + unsigned int nr_irqs); 639 + void irq_domain_free_irqs_top(struct irq_domain *domain, 640 + unsigned int virq, unsigned int nr_irqs); 646 641 647 - extern int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg); 648 - extern int irq_domain_pop_irq(struct irq_domain *domain, int virq); 642 + int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg); 643 + int irq_domain_pop_irq(struct irq_domain *domain, int virq); 649 644 650 - extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain, 651 - unsigned int irq_base, 652 - unsigned int nr_irqs, void *arg); 645 + int irq_domain_alloc_irqs_parent(struct irq_domain *domain, 646 + unsigned int irq_base, 647 + unsigned int nr_irqs, void *arg); 653 648 654 - extern void irq_domain_free_irqs_parent(struct irq_domain *domain, 655 - unsigned int irq_base, 656 - unsigned int nr_irqs); 649 + void irq_domain_free_irqs_parent(struct irq_domain *domain, 650 + unsigned int irq_base, 651 + unsigned int nr_irqs); 657 652 658 - extern int irq_domain_disconnect_hierarchy(struct irq_domain *domain, 653 + int irq_domain_disconnect_hierarchy(struct irq_domain *domain, 659 654 unsigned int virq); 660 655 661 656 static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
+15 -15
kernel/irq/chip.c
··· 232 232 } 233 233 #endif 234 234 235 + static void irq_enable(struct irq_desc *desc) 236 + { 237 + if (!irqd_irq_disabled(&desc->irq_data)) { 238 + unmask_irq(desc); 239 + } else { 240 + irq_state_clr_disabled(desc); 241 + if (desc->irq_data.chip->irq_enable) { 242 + desc->irq_data.chip->irq_enable(&desc->irq_data); 243 + irq_state_clr_masked(desc); 244 + } else { 245 + unmask_irq(desc); 246 + } 247 + } 248 + } 249 + 235 250 static int __irq_startup(struct irq_desc *desc) 236 251 { 237 252 struct irq_data *d = irq_desc_get_irq_data(desc); ··· 345 330 * it's safe to call it unconditionally. 346 331 */ 347 332 irq_domain_deactivate_irq(&desc->irq_data); 348 - } 349 - 350 - void irq_enable(struct irq_desc *desc) 351 - { 352 - if (!irqd_irq_disabled(&desc->irq_data)) { 353 - unmask_irq(desc); 354 - } else { 355 - irq_state_clr_disabled(desc); 356 - if (desc->irq_data.chip->irq_enable) { 357 - desc->irq_data.chip->irq_enable(&desc->irq_data); 358 - irq_state_clr_masked(desc); 359 - } else { 360 - unmask_irq(desc); 361 - } 362 - } 363 333 } 364 334 365 335 static void __irq_disable(struct irq_desc *desc, bool mask)
-9
kernel/irq/internals.h
··· 90 90 91 91 extern void irq_shutdown(struct irq_desc *desc); 92 92 extern void irq_shutdown_and_deactivate(struct irq_desc *desc); 93 - extern void irq_enable(struct irq_desc *desc); 94 93 extern void irq_disable(struct irq_desc *desc); 95 94 extern void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu); 96 95 extern void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu); ··· 97 98 extern void unmask_irq(struct irq_desc *desc); 98 99 extern void unmask_threaded_irq(struct irq_desc *desc); 99 100 100 - extern unsigned int kstat_irqs_desc(struct irq_desc *desc, const struct cpumask *cpumask); 101 - 102 101 #ifdef CONFIG_SPARSE_IRQ 103 102 static inline void irq_mark_irq(unsigned int irq) { } 104 103 #else 105 104 extern void irq_mark_irq(unsigned int irq); 106 105 #endif 107 - 108 - extern int __irq_get_irqchip_state(struct irq_data *data, 109 - enum irqchip_irq_state which, 110 - bool *state); 111 106 112 107 irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc); 113 108 irqreturn_t handle_irq_event_percpu(struct irq_desc *desc); ··· 131 138 #endif 132 139 133 140 extern bool irq_can_set_affinity_usr(unsigned int irq); 134 - 135 - extern void irq_set_thread_affinity(struct irq_desc *desc); 136 141 137 142 extern int irq_do_set_affinity(struct irq_data *data, 138 143 const struct cpumask *dest, bool force);
+1 -1
kernel/irq/irqdesc.c
··· 991 991 return desc && desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, cpu) : 0; 992 992 } 993 993 994 - unsigned int kstat_irqs_desc(struct irq_desc *desc, const struct cpumask *cpumask) 994 + static unsigned int kstat_irqs_desc(struct irq_desc *desc, const struct cpumask *cpumask) 995 995 { 996 996 unsigned int sum = 0; 997 997 int cpu;
+2 -3
kernel/irq/irqdomain.c
··· 1589 1589 } 1590 1590 } 1591 1591 1592 - int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain, 1593 - unsigned int irq_base, 1594 - unsigned int nr_irqs, void *arg) 1592 + static int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain, unsigned int irq_base, 1593 + unsigned int nr_irqs, void *arg) 1595 1594 { 1596 1595 if (!domain->ops->alloc) { 1597 1596 pr_debug("domain->ops->alloc() is NULL\n");
+4 -3
kernel/irq/manage.c
··· 35 35 early_param("threadirqs", setup_forced_irqthreads); 36 36 #endif 37 37 38 + static int __irq_get_irqchip_state(struct irq_data *d, enum irqchip_irq_state which, bool *state); 39 + 38 40 static void __synchronize_hardirq(struct irq_desc *desc, bool sync_chip) 39 41 { 40 42 struct irq_data *irqd = irq_desc_get_irq_data(desc); ··· 189 187 * set_cpus_allowed_ptr() here as we hold desc->lock and this 190 188 * code can be called from hard interrupt context. 191 189 */ 192 - void irq_set_thread_affinity(struct irq_desc *desc) 190 + static void irq_set_thread_affinity(struct irq_desc *desc) 193 191 { 194 192 struct irqaction *action; 195 193 ··· 2791 2789 irq_put_desc_unlock(desc, flags); 2792 2790 } 2793 2791 2794 - int __irq_get_irqchip_state(struct irq_data *data, enum irqchip_irq_state which, 2795 - bool *state) 2792 + static int __irq_get_irqchip_state(struct irq_data *data, enum irqchip_irq_state which, bool *state) 2796 2793 { 2797 2794 struct irq_chip *chip; 2798 2795 int err = -EINVAL;
+19
kernel/irq/msi.c
··· 15 15 #include <linux/mutex.h> 16 16 #include <linux/pci.h> 17 17 #include <linux/slab.h> 18 + #include <linux/seq_file.h> 18 19 #include <linux/sysfs.h> 19 20 #include <linux/types.h> 20 21 #include <linux/xarray.h> ··· 757 756 return info->ops->msi_translate(domain, fwspec, hwirq, type); 758 757 } 759 758 759 + #ifdef CONFIG_GENERIC_IRQ_DEBUGFS 760 + static void msi_domain_debug_show(struct seq_file *m, struct irq_domain *d, 761 + struct irq_data *irqd, int ind) 762 + { 763 + struct msi_desc *desc = irq_data_get_msi_desc(irqd); 764 + 765 + if (!desc) 766 + return; 767 + 768 + seq_printf(m, "\n%*saddress_hi: 0x%08x", ind + 1, "", desc->msg.address_hi); 769 + seq_printf(m, "\n%*saddress_lo: 0x%08x", ind + 1, "", desc->msg.address_lo); 770 + seq_printf(m, "\n%*smsg_data: 0x%08x\n", ind + 1, "", desc->msg.data); 771 + } 772 + #endif 773 + 760 774 static const struct irq_domain_ops msi_domain_ops = { 761 775 .alloc = msi_domain_alloc, 762 776 .free = msi_domain_free, 763 777 .activate = msi_domain_activate, 764 778 .deactivate = msi_domain_deactivate, 765 779 .translate = msi_domain_translate, 780 + #ifdef CONFIG_GENERIC_IRQ_DEBUGFS 781 + .debug_show = msi_domain_debug_show, 782 + #endif 766 783 }; 767 784 768 785 static irq_hw_number_t msi_domain_ops_get_hwirq(struct msi_domain_info *info,