Skip to content

Commit 128ab2c

Browse files
vlkondratievKAGA-KOKO
authored andcommitted
irqchip/aslint-sswi: Resolve hart index
Resolve hart index according to assignment in the "riscv,hart-indexes" property as defined in the specification [1] Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250612143911.3224046-6-vladimir.kondratiev@mobileye.com Link: https://github.com/riscvarchive/riscv-aclint [1]
1 parent c8c8443 commit 128ab2c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/irqchip/irq-aclint-sswi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
7171
for (u32 i = 0; i < contexts; i++) {
7272
struct of_phandle_args parent;
7373
unsigned long hartid;
74+
u32 hart_index;
7475
int rc, cpu;
7576

7677
rc = of_irq_parse_one(to_of_node(fwnode), i, &parent);
@@ -86,6 +87,11 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
8687

8788
cpu = riscv_hartid_to_cpuid(hartid);
8889

90+
rc = riscv_get_hart_index(fwnode, i, &hart_index);
91+
if (rc) {
92+
pr_warn("%pfwP: hart index [%d] not found\n", fwnode, i);
93+
return -EINVAL;
94+
}
8995
per_cpu(sswi_cpu_regs, cpu) = reg + hart_index * 4;
9096
}
9197

0 commit comments

Comments
 (0)