Skip to content

Commit

Permalink
intrng: call pic_init_secondary on all registered PICs
Browse files Browse the repository at this point in the history
Almost any PIC registered will want its pic_init_secondary(), whether or
not it is a direct child of the root PIC.  Of PICs supporting child
PICs, only GICv3 ever bothers to call children.  In light of this, simply
go through all registered PICs and call their hook.

This means we no longer need intr_irq_root_dev initialized.  We also
nominally need the pic_list_lock held (seems unlikely to matter).

Differential Revision: https://reviews.freebsd.org/D40474
  • Loading branch information
ehem committed Jun 7, 2024
1 parent 4b8e457 commit ad1bbf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
8 changes: 1 addition & 7 deletions sys/arm64/arm64/gic_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,11 @@ static void
gic_v3_init_secondary(device_t dev)
{
struct gic_v3_setup_periph_args pargs;
device_t child;
struct gic_v3_softc *sc;
gic_v3_initseq_t *init_func;
struct intr_irqsrc *isrc;
u_int cpu, irq;
int err, i;
int err;

sc = device_get_softc(dev);
cpu = PCPU_GET(cpuid);
Expand Down Expand Up @@ -1137,11 +1136,6 @@ gic_v3_init_secondary(device_t dev)
gic_v3_enable_intr_periph(&pargs);
}
}

for (i = 0; i < sc->gic_nchildren; i++) {
child = sc->gic_children[i];
PIC_INIT_SECONDARY(child);
}
}

static void
Expand Down
13 changes: 5 additions & 8 deletions sys/kern/subr_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1541,15 +1541,12 @@ dosoftints(void)
void
intr_pic_init_secondary(void)
{
struct intr_pic *pic;

/*
* QQQ: Only root PIC is aware of other CPUs ???
*/
KASSERT(intr_irq_root_dev != NULL, ("%s: no root attached", __func__));

//mtx_lock(&isrc_table_lock);
PIC_INIT_SECONDARY(intr_irq_root_dev);
//mtx_unlock(&isrc_table_lock);
//mtx_lock(&pic_list_lock);
STAILQ_FOREACH(pic, &pic_list, pic_next)
PIC_INIT_SECONDARY(pic->pic_dev);
//mtx_unlock(&pic_list_lock);
}
#endif

Check warning on line 1552 in sys/kern/subr_intr.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit ad1bbf7

Please sign in to comment.