Skip to content

Commit 8873016

Browse files
committed
Merge tag 'irq-urgent-2026-01-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc irqchip fixes from Ingo Molnar: - Fix an endianness bug in the gic-v5 irqchip driver - Revert a broken commit from the riscv-imsic irqchip driver * tag 'irq-urgent-2026-01-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "irqchip/riscv-imsic: Embed the vector array in lpriv" irqchip/gic-v5: Fix gicv5_its_map_event() ITTE read endianness
2 parents 2e4b28c + a33d16d commit 8873016

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/irqchip/irq-gic-v5-its.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32
849849

850850
itte = gicv5_its_device_get_itte_ref(its_dev, event_id);
851851

852-
if (FIELD_GET(GICV5_ITTL2E_VALID, *itte))
852+
if (FIELD_GET(GICV5_ITTL2E_VALID, le64_to_cpu(*itte)))
853853
return -EEXIST;
854854

855855
itt_entry = FIELD_PREP(GICV5_ITTL2E_LPI_ID, lpi) |

drivers/irqchip/irq-riscv-imsic-state.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ static void __init imsic_local_cleanup(void)
477477
lpriv = per_cpu_ptr(imsic->lpriv, cpu);
478478

479479
bitmap_free(lpriv->dirty_bitmap);
480+
kfree(lpriv->vectors);
480481
}
481482

482483
free_percpu(imsic->lpriv);
@@ -490,8 +491,7 @@ static int __init imsic_local_init(void)
490491
int cpu, i;
491492

492493
/* Allocate per-CPU private state */
493-
imsic->lpriv = __alloc_percpu(struct_size(imsic->lpriv, vectors, global->nr_ids + 1),
494-
__alignof__(*imsic->lpriv));
494+
imsic->lpriv = alloc_percpu(typeof(*imsic->lpriv));
495495
if (!imsic->lpriv)
496496
return -ENOMEM;
497497

@@ -511,6 +511,12 @@ static int __init imsic_local_init(void)
511511
timer_setup(&lpriv->timer, imsic_local_timer_callback, TIMER_PINNED);
512512
#endif
513513

514+
/* Allocate vector array */
515+
lpriv->vectors = kcalloc(global->nr_ids + 1, sizeof(*lpriv->vectors),
516+
GFP_KERNEL);
517+
if (!lpriv->vectors)
518+
goto fail_local_cleanup;
519+
514520
/* Setup vector array */
515521
for (i = 0; i <= global->nr_ids; i++) {
516522
vec = &lpriv->vectors[i];

drivers/irqchip/irq-riscv-imsic-state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct imsic_local_priv {
4040
#endif
4141

4242
/* Local vector table */
43-
struct imsic_vector vectors[];
43+
struct imsic_vector *vectors;
4444
};
4545

4646
struct imsic_priv {

0 commit comments

Comments
 (0)