intrng: Remove irq_root_ipicount and corresponding intr_pic_claim_root arg

The static irq_root_ipicount variable is only ever written to (with the
value passed to irq_root_ipicount), never read. Moreover, the bcm2836
driver, as used by the Raspberry Pi 2B and 3A/B (but not 4, which uses a
GIC-400, though does have the legacy interrupt controller present too)
passes 0 as ipicount, despite implementing IPIs. It's thus inaccurate
and serves no purpose, so should be removed.

Reviewed by:	mmel, imp, mhorne
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D35897
This commit is contained in:
Jessica Clarke 2024-01-24 23:49:53 +00:00
parent d56ce5915c
commit e06afdb285
11 changed files with 12 additions and 17 deletions

View file

@ -236,7 +236,7 @@ a10_intr_pic_attach(struct a10_aintc_softc *sc)
if (pic == NULL)
return (ENXIO);
return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0));
return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc));
}
static void

View file

@ -227,8 +227,7 @@ gic_acpi_attach(device_t dev)
/*
* Controller is root:
*/
if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) {
device_printf(dev, "could not set PIC as a root\n");
intr_pic_deregister(dev, xref);
goto cleanup;

View file

@ -153,8 +153,7 @@ gic_fdt_attach(device_t dev)
*/
pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev));
if (pxref == 0 || xref == pxref) {
if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
if (intr_pic_claim_root(dev, xref, arm_gic_intr, sc) != 0) {
device_printf(dev, "could not set PIC as a root\n");
intr_pic_deregister(dev, xref);
goto cleanup;

View file

@ -405,7 +405,7 @@ bcm_intc_attach(device_t dev)
sc->intc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE);
if (sc->intc_irq_res == NULL) {
if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc, 0) != 0) {
if (intr_pic_claim_root(dev, xref, bcm2835_intc_intr, sc) != 0) {
/* XXX clean up */
device_printf(dev, "could not set PIC as a root\n");
return (ENXIO);

View file

@ -646,7 +646,7 @@ bcm_lintc_pic_attach(struct bcm_lintc_softc *sc)
if (pic == NULL)
return (ENXIO);
return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc, 0));
return (intr_pic_claim_root(sc->bls_dev, xref, bcm_lintc_intr, sc));
}
static int

View file

@ -230,7 +230,7 @@ ti_aintc_pic_attach(struct ti_aintc_softc *sc)
if (pic == NULL)
return (ENXIO);
return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc, 0));
return (intr_pic_claim_root(sc->sc_dev, xref, ti_aintc_intr, sc));
}
static int

View file

@ -345,8 +345,8 @@ gic_v3_acpi_attach(device_t dev)
}
}
if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc)
!= 0) {
err = ENXIO;
goto error;
}

View file

@ -161,8 +161,7 @@ gic_v3_fdt_attach(device_t dev)
/* Register xref */
OF_device_register_xref(xref, dev);
if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc) != 0) {
err = ENXIO;
goto error;
}

View file

@ -100,7 +100,6 @@ void intr_irq_handler(struct trapframe *tf);
device_t intr_irq_root_dev;
static intr_irq_filter_t *irq_root_filter;
static void *irq_root_arg;
static u_int irq_root_ipicount;
struct intr_pic_child {
SLIST_ENTRY(intr_pic_child) pc_next;
@ -884,7 +883,7 @@ intr_pic_deregister(device_t dev, intptr_t xref)
*/
int
intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter,
void *arg, u_int ipicount)
void *arg)
{
struct intr_pic *pic;
@ -916,7 +915,6 @@ intr_pic_claim_root(device_t dev, intptr_t xref, intr_irq_filter_t *filter,
intr_irq_root_dev = dev;
irq_root_filter = filter;
irq_root_arg = arg;
irq_root_ipicount = ipicount;
debugf("irq root set to %s\n", device_get_nameunit(dev));
return (0);

View file

@ -368,7 +368,7 @@ plic_attach(device_t dev)
csr_set(sie, SIE_SEIE);
return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc, 0));
return (intr_pic_claim_root(sc->dev, xref, plic_intr, sc));
}
static void

View file

@ -110,7 +110,7 @@ u_int intr_irq_next_cpu(u_int current_cpu, cpuset_t *cpumask);
struct intr_pic *intr_pic_register(device_t, intptr_t);
int intr_pic_deregister(device_t, intptr_t);
int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *, u_int);
int intr_pic_claim_root(device_t, intptr_t, intr_irq_filter_t *, void *);
int intr_pic_add_handler(device_t, struct intr_pic *,
intr_child_irq_filter_t *, void *, uintptr_t, uintptr_t);
bool intr_is_per_cpu(struct resource *);