Skip to content

Commit a9b8f33

Browse files
vlsunilrafaeljw
authored andcommitted
ACPI: scan: Add a weak arch_sort_irqchip_probe() to order the IRQCHIP probe
Unlike OF framework, the irqchip probe using IRQCHIP_ACPI_DECLARE has no order defined. Depending on the Makefile is not a good idea. So, usually it is worked around by mandating only root interrupt controller probed using IRQCHIP_ACPI_DECLARE and other interrupt controllers are probed via cascade mechanism. However, this is also not a clean solution because if there are multiple root controllers (ex: RINTC in RISC-V which is per CPU) which need to be probed first, then the cascade will happen for every root controller. So, introduce an architecture specific weak function arch_sort_irqchip_probe() to order the probing of the interrupt controllers which can be implemented by different architectures as per their interrupt controller hierarchy. Signed-off-by: Sunil V L <[email protected]> Tested-by: Björn Töpel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 789befd commit a9b8f33

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/acpi/scan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,8 @@ static int __init acpi_match_madt(union acpi_subtable_headers *header,
27572757
return 0;
27582758
}
27592759

2760+
void __weak arch_sort_irqchip_probe(struct acpi_probe_entry *ap_head, int nr) { }
2761+
27602762
int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr)
27612763
{
27622764
int count = 0;
@@ -2765,6 +2767,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr)
27652767
return 0;
27662768

27672769
mutex_lock(&acpi_probe_mutex);
2770+
arch_sort_irqchip_probe(ap_head, nr);
27682771
for (ape = ap_head; nr; ape++, nr--) {
27692772
if (ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) {
27702773
acpi_probe_count = 0;

include/linux/acpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,8 @@ struct acpi_probe_entry {
13431343
kernel_ulong_t driver_data;
13441344
};
13451345

1346+
void arch_sort_irqchip_probe(struct acpi_probe_entry *ap_head, int nr);
1347+
13461348
#define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, \
13471349
valid, data, fn) \
13481350
static const struct acpi_probe_entry __acpi_probe_##name \

0 commit comments

Comments
 (0)