Skip to content

Commit

Permalink
intrng: add calling pic_init_secondary on all registered PICs
Browse files Browse the repository at this point in the history
There is potential for non-root PICs to need per-processor
initialization.  Few root PICs try to propogate the call.  As such add
a pass of calling pic_init_secondary() on all children with a non-root
value.

Differential Revision: https://reviews.freebsd.org/D40474
  • Loading branch information
ehem committed Nov 5, 2024
1 parent 50aa4b7 commit 6cfac4b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sys/arm/arm/gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ arm_gic_init_secondary(device_t dev, uint32_t rootnum)
struct arm_gic_softc *sc = device_get_softc(dev);
u_int irq, cpu;

if (root_type >= INTR_ROOT_COUNT)
return;

/* Set the mask so we can find this CPU to send it IPIs */
cpu = PCPU_GET(cpuid);
MPASS(cpu < GIC_MAXCPU);
Expand Down
3 changes: 3 additions & 0 deletions sys/arm/broadcom/bcm2835/bcm2836.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ bcm_lintc_init_secondary(device_t dev, uint32_t rootnum)
u_int cpu;
struct bcm_lintc_softc *sc;

if (root_type >= INTR_ROOT_COUNT)
return;

cpu = PCPU_GET(cpuid);
sc = device_get_softc(dev);

Expand Down
3 changes: 3 additions & 0 deletions sys/arm64/arm64/gic_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,9 @@ gic_v3_init_secondary(device_t dev, uint32_t rootnum)
u_int cpu, irq;
int err, i;

if (root_type >= INTR_ROOT_COUNT)
return;

sc = device_get_softc(dev);
cpu = PCPU_GET(cpuid);

Expand Down
3 changes: 3 additions & 0 deletions sys/arm64/arm64/gicv3_its.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,9 @@ gicv3_its_init_secondary(device_t dev, uint32_t rootnum)
{
struct gicv3_its_softc *sc;

if (root_type >= INTR_ROOT_COUNT)
return;

sc = device_get_softc(dev);

/*
Expand Down
7 changes: 4 additions & 3 deletions sys/kern/subr_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1570,19 +1570,20 @@ dosoftints(void)
void
intr_pic_init_secondary(void)
{
struct intr_pic *pic;
device_t dev;
uint32_t rootnum;

/*
* QQQ: Only root PICs are aware of other CPUs ???
*/
//mtx_lock(&isrc_table_lock);
for (rootnum = 0; rootnum < INTR_ROOT_COUNT; rootnum++) {
dev = intr_irq_roots[rootnum].dev;
if (dev != NULL) {
PIC_INIT_SECONDARY(dev, rootnum);
}
}

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

Check warning on line 1589 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 6cfac4b

Please sign in to comment.