Skip to content

Commit f679616

Browse files
lvjianmin-loongsonMarc Zyngier
authored andcommitted
irqchip/loongson-pch-pic: Fix initialization of HT vector register
In an ACPI-based dual-bridge system, IRQ of each bridge's PCH PIC sent to CPU is always a zero-based number, which means that the IRQ on PCH PIC of each bridge is mapped into vector range from 0 to 63 of upstream irqchip(e.g. EIOINTC). EIOINTC N: [0 ... 63 | 64 ... 255] -------- ---------- ^ ^ | | PCH PIC N | PCH MSI N For example, the IRQ vector number of sata controller on PCH PIC of each bridge is 16, which is sent to upstream irqchip of EIOINTC when an interrupt occurs, which will set bit 16 of EIOINTC. Since hwirq of 16 on EIOINTC has been mapped to a irq_desc for sata controller during hierarchy irq allocation, the related mapped IRQ will be found through irq_resolve_mapping() in the IRQ domain of EIOINTC. So, the IRQ number set in HT vector register should be fixed to be a zero-based number. Cc: [email protected] Reviewed-by: Huacai Chen <[email protected]> Co-developed-by: liuyun <[email protected]> Signed-off-by: liuyun <[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 7877cb9 commit f679616

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,22 +401,20 @@ static int __init acpi_cascade_irqdomain_init(void)
401401
int __init pch_pic_acpi_init(struct irq_domain *parent,
402402
struct acpi_madt_bio_pic *acpi_pchpic)
403403
{
404-
int ret, vec_base;
404+
int ret;
405405
struct fwnode_handle *domain_handle;
406406

407407
if (find_pch_pic(acpi_pchpic->gsi_base) >= 0)
408408
return 0;
409409

410-
vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ;
411-
412410
domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);
413411
if (!domain_handle) {
414412
pr_err("Unable to allocate domain handle\n");
415413
return -ENOMEM;
416414
}
417415

418416
ret = pch_pic_init(acpi_pchpic->address, acpi_pchpic->size,
419-
vec_base, parent, domain_handle, acpi_pchpic->gsi_base);
417+
0, parent, domain_handle, acpi_pchpic->gsi_base);
420418

421419
if (ret < 0) {
422420
irq_domain_free_fwnode(domain_handle);

0 commit comments

Comments
 (0)