Skip to content

Commit 48ce2d7

Browse files
lvjianmin-loongsonMarc Zyngier
authored andcommitted
irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling
For dual-bridges scenario, pch_pic_acpi_init() will be called in following path: cpuintc_acpi_init acpi_cascade_irqdomain_init(in cpuintc driver) acpi_table_parse_madt eiointc_parse_madt eiointc_acpi_init /* this will be called two times correspondingto parsing two eiointc entries in MADT under dual-bridges scenario*/ acpi_cascade_irqdomain_init(in eiointc driver) acpi_table_parse_madt pch_pic_parse_madt pch_pic_acpi_init /* this will be called depend on valid parent IRQ domain handle for one or two times corresponding to parsing two pchpic entries in MADT druring calling eiointc_acpi_init() under dual-bridges scenario*/ During the first eiointc_acpi_init() calling, the pch_pic_acpi_init() will be called just one time since only one valid parent IRQ domain handle will be found for current eiointc IRQ domain. During the second eiointc_acpi_init() calling, the pch_pic_acpi_init() will be called two times since two valid parent IRQ domain handles will be found. So in pch_pic_acpi_init(), we must have a reasonable way to prevent from creating second same pch_pic IRQ domain. The patch matches gsi base information in created pch_pic IRQ domains to check if the target domain has been created to avoid the bug mentioned above. Cc: [email protected] Signed-off-by: Jianmin Lv <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c84efbb commit 48ce2d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/irqchip/irq-loongson-pch-pic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ int __init pch_pic_acpi_init(struct irq_domain *parent,
404404
int ret, vec_base;
405405
struct fwnode_handle *domain_handle;
406406

407+
if (find_pch_pic(acpi_pchpic->gsi_base) >= 0)
408+
return 0;
409+
407410
vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ;
408411

409412
domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);

0 commit comments

Comments
 (0)