From nobody Sat Sep 07 01:47:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0ww86r1pz5WSX3; Sat, 07 Sep 2024 01:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0ww861SBz4jfH; Sat, 7 Sep 2024 01:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hr3tKb4xLdGSen7w5SeSdCAD4pV2aUc6PZBw5FXorRw=; b=atDBR8/NNVLZjmJ7XibbyYCT/9zQNuV4tDdntcosReHExcfXdVc73KSCR6O1KoLRNe1bqd 8J9LQc7CJjA9m9JYYfJSZ0ObAfgsV3HfQ0u0XtK4wElUVml7uZ0lLsWrGPbk3wqFcDA9X7 ooM4tNjkG3nKifFeCZIM3wjlw6RKT/daGo0VjueFjPDdK8fT1qkbCAAiV7aVQf5eWtS8aX XBVHsqOhO1fD/WR+rehHFgkBCCS3WUN5G7MFN66UMnIMlbKtey7Pv17mtOhKEMVX01dYx6 0bz3yrTJtKio0LuB9hKYnIhzaGPHvtE/q0SKY8+kH03waUZujMQdAh1n53WFkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725673672; a=rsa-sha256; cv=none; b=djuezzhphTLE/U5+cVzsMHARmWVBOz6NK/4dcTQB9BJaafzY4lNB0JImY6kivlquYAnUJe gna0SS8kumIT9TobOvqIwjkICAAJaLd7hj2pH3nEI4MhR+wD+7nyTNGZWeyEtQWAoav2PS hwzI26cz0VlKH+xOr1T8dah5ozKxcU7OU6xoRr5bcSVdFQzKUfP4RNAh8WjNrcna5c7ItA wCFbK3kDvSebLoytKaxeayam7Dz8UNHeuzFyGIWMYjj+bI1wGWFnCuUb8ACWPzmDgocCUv d5+s3H7kUq/UhJ23gM7MPUoKSFiGCfE73/8VMZ0ykRp+XM6OEKG6/T/15OXyqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725673672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hr3tKb4xLdGSen7w5SeSdCAD4pV2aUc6PZBw5FXorRw=; b=aVz2sRzaQZ9wCU4K9pu/OavBdD7hfNyMTrQQEdHP/iOFnbb6RQRjO21RlyDoYQly7eUzf6 cImaqvokTbG40yVVyQI/BkRGXF+JyapW/EBtEh7P6GwoSlgHdxpRMw01yFb80QH4Sy6Qie EwSQ3hH5AKTY3TtClMe/bx5KYYyIqR1BfI7oMLJ/fkQI8zYkGJT4IItfKmUAO57GWxp2Pv NmqoRLsOplKfvAMXYaXO7HS5f7kx7+8foRGGwo8bLkanEcKb6mFDYX7G8pwxEtongtJuSO EGH5SEGAC9itRLzaTJBNXK+KSIPRkPKTT8I9ea1ft/2LIcIsNcW4yEIWBLTgrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X0ww85cpMzGPZ; Sat, 7 Sep 2024 01:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4871lq7H041365; Sat, 7 Sep 2024 01:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4871lqQt041362; Sat, 7 Sep 2024 01:47:52 GMT (envelope-from git) Date: Sat, 7 Sep 2024 01:47:52 GMT Message-Id: <202409070147.4871lqQt041362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: a73592e0d013 - stable/14 - intrng: Remove irq_root_ipicount and corresponding intr_pic_claim_root arg List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a73592e0d013275bd97d09d9cf168279688f7238 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=a73592e0d013275bd97d09d9cf168279688f7238 commit a73592e0d013275bd97d09d9cf168279688f7238 Author: Jessica Clarke AuthorDate: 2024-01-24 23:49:53 +0000 Commit: Jessica Clarke CommitDate: 2024-09-06 23:52:47 +0000 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 (cherry picked from commit e06afdb2856944d6db4e33d4bbe0e2dbbd057eb4) --- sys/arm/allwinner/a10/a10_intc.c | 2 +- sys/arm/arm/gic_acpi.c | 3 +-- sys/arm/arm/gic_fdt.c | 3 +-- sys/arm/broadcom/bcm2835/bcm2835_intr.c | 2 +- sys/arm/broadcom/bcm2835/bcm2836.c | 2 +- sys/arm/ti/aintc.c | 2 +- sys/arm64/arm64/gic_v3_acpi.c | 4 ++-- sys/arm64/arm64/gic_v3_fdt.c | 3 +-- sys/kern/subr_intr.c | 4 +--- sys/riscv/riscv/plic.c | 2 +- sys/sys/intr.h | 2 +- 11 files changed, 12 insertions(+), 17 deletions(-) diff --git a/sys/arm/allwinner/a10/a10_intc.c b/sys/arm/allwinner/a10/a10_intc.c index 22b29ececac5..410fba4b4728 100644 --- a/sys/arm/allwinner/a10/a10_intc.c +++ b/sys/arm/allwinner/a10/a10_intc.c @@ -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 diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c index 56ff78f9b685..67297f9879ca 100644 --- a/sys/arm/arm/gic_acpi.c +++ b/sys/arm/arm/gic_acpi.c @@ -228,8 +228,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; diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c index d6c657250ba3..e7fe503bf426 100644 --- a/sys/arm/arm/gic_fdt.c +++ b/sys/arm/arm/gic_fdt.c @@ -154,8 +154,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; diff --git a/sys/arm/broadcom/bcm2835/bcm2835_intr.c b/sys/arm/broadcom/bcm2835/bcm2835_intr.c index b49c9041810d..5a8457bc4b67 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_intr.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_intr.c @@ -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); diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index 60734abb40e3..f72bd9075982 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -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 diff --git a/sys/arm/ti/aintc.c b/sys/arm/ti/aintc.c index ce986b2d38bc..776d231c3c48 100644 --- a/sys/arm/ti/aintc.c +++ b/sys/arm/ti/aintc.c @@ -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 diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index fe13b9f15f71..199fddcbc20c 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -346,8 +346,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; } diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 9ca10167588a..f094bc6eb1fe 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -162,8 +162,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; } diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 6535c42f2404..e3ef2caf2291 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -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); diff --git a/sys/riscv/riscv/plic.c b/sys/riscv/riscv/plic.c index 27c8f59b1a87..c7d9249b2231 100644 --- a/sys/riscv/riscv/plic.c +++ b/sys/riscv/riscv/plic.c @@ -369,7 +369,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 diff --git a/sys/sys/intr.h b/sys/sys/intr.h index e91a661673d0..bdc693e6cb60 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -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 *);