From nobody Thu Oct 2 06:29:51 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5807F304BA0; Mon, 22 Sep 2025 08:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758529730; cv=none; b=h/I51ydxX2mLf6VE0wciI/aBpfIjD7H6m+jv5tt+CyDmOpzkAzqsdHR4aC4fUipZbe6sO4VQ4HlQGeJwtpgRQo+j1tfhbBToFYxKzm/QgjdPAkJogqB0IXMebs3CN1f7lyjFPB5zE6X7Wjh36fibvFJbSwhNmnKXs370GS2iWko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758529730; c=relaxed/simple; bh=t699EEFxKxPFwzesa61qP1yBrUEIdyhLy4vHQuVgrl4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o4Aob7amtxKwhTN3ZThM5zEdvapzDhM+PcvBKcwNTj27d2pl1BmLyULcUQBiV6mUm/JbycjmyJQaCnYM2jeiab4VKzRo/aLI+RwpE2vdRpabaAERKrRwa5V4+QDW+BJddjfYvWcD00mMSIjEfXpShFluMBr8DxwB2itIMAN8wF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b5H96t7u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b5H96t7u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD18C116C6; Mon, 22 Sep 2025 08:28:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758529730; bh=t699EEFxKxPFwzesa61qP1yBrUEIdyhLy4vHQuVgrl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b5H96t7ucBRTfDFg/9SxaaUHERbq3eRsWNntjh/0A4ZkJA+Qr/++coQjhNePciRGD JoTJFDM4Sk6o2lqgEznmaaGNdArN5dCUzmHlUbMZDiHdT67qiYhMS0Je12kMGOXBKM 13fBBm7NFVVqJSpzTl9xO/CSp1Vqy3o5w8Jm5Kctxr4GhRTQFZxasd4GQE8tglnCYo Hx2MaFb+36Hl44Te3i1gdpuepOFQImvgSbekGuEmXYFGZD7J9w/lJQZdEqn5u2b9ye 73ZUwVy5xwJJKfS5cuyC51KJ3G5J1o+J8jnS8erF9Hii6LuomBQhPyRejCPvPHntTt o+rYJu4n1ubKw== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v0bui-00000008Kds-15Gs; Mon, 22 Sep 2025 08:28:48 +0000 From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Cc: Thomas Gleixner , Mark Rutland , Will Deacon , "Rafael J. Wysocki" , Rob Herring , Saravana Kannan , Greg Kroah-Hartman , Sven Peter , Janne Grunau , Suzuki K Poulose , James Clark , Jonathan Cameron Subject: [PATCH v3 23/26] irqchip: Kill irq-partition-percpu Date: Mon, 22 Sep 2025 09:28:30 +0100 Message-ID: <20250922082833.2038905-24-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250922082833.2038905-1-maz@kernel.org> References: <20250922082833.2038905-1-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, tglx@linutronix.de, mark.rutland@arm.com, will@kernel.org, rafael@kernel.org, robh@kernel.org, saravanak@google.com, gregkh@linuxfoundation.org, sven@kernel.org, j@jannau.net, suzuki.poulose@arm.com, james.clark@linaro.org, jonathan.cameron@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Content-Type: text/plain; charset="utf-8" This code is now completely unused, and nobody will ever miss it. Signed-off-by: Marc Zyngier --- drivers/irqchip/Kconfig | 3 - drivers/irqchip/Makefile | 1 - drivers/irqchip/irq-partition-percpu.c | 241 ------------------- include/linux/irqchip/irq-partition-percpu.h | 53 ---- 4 files changed, 298 deletions(-) delete mode 100644 drivers/irqchip/irq-partition-percpu.c delete mode 100644 include/linux/irqchip/irq-partition-percpu.h diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index c31d2f99d7b91..4bb25d21f6e9b 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -450,9 +450,6 @@ config LS_SCFG_MSI depends on PCI_MSI select IRQ_MSI_LIB =20 -config PARTITION_PERCPU - bool - config STM32MP_EXTI tristate "STM32MP extended interrupts and event controller" depends on (ARCH_STM32 && !ARM_SINGLE_ARMV7M) || COMPILE_TEST diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 93e3ced023bb8..da429f3e29ec7 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -36,7 +36,6 @@ obj-$(CONFIG_ARM_GIC_V3) +=3D irq-gic-v3.o irq-gic-v3-mb= i.o irq-gic-common.o obj-$(CONFIG_ARM_GIC_ITS_PARENT) +=3D irq-gic-its-msi-parent.o obj-$(CONFIG_ARM_GIC_V3_ITS) +=3D irq-gic-v3-its.o irq-gic-v4.o obj-$(CONFIG_ARM_GIC_V3_ITS_FSL_MC) +=3D irq-gic-v3-its-fsl-mc-msi.o -obj-$(CONFIG_PARTITION_PERCPU) +=3D irq-partition-percpu.o obj-$(CONFIG_ARM_GIC_V5) +=3D irq-gic-v5.o irq-gic-v5-irs.o irq-gic-v5-it= s.o \ irq-gic-v5-iwb.o obj-$(CONFIG_HISILICON_IRQ_MBIGEN) +=3D irq-mbigen.o diff --git a/drivers/irqchip/irq-partition-percpu.c b/drivers/irqchip/irq-p= artition-percpu.c deleted file mode 100644 index 4441ffe149ea0..0000000000000 --- a/drivers/irqchip/irq-partition-percpu.c +++ /dev/null @@ -1,241 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2016 ARM Limited, All Rights Reserved. - * Author: Marc Zyngier - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -struct partition_desc { - int nr_parts; - struct partition_affinity *parts; - struct irq_domain *domain; - struct irq_desc *chained_desc; - unsigned long *bitmap; - struct irq_domain_ops ops; -}; - -static bool partition_check_cpu(struct partition_desc *part, - unsigned int cpu, unsigned int hwirq) -{ - return cpumask_test_cpu(cpu, &part->parts[hwirq].mask); -} - -static void partition_irq_mask(struct irq_data *d) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - if (partition_check_cpu(part, smp_processor_id(), d->hwirq) && - chip->irq_mask) - chip->irq_mask(data); -} - -static void partition_irq_unmask(struct irq_data *d) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - if (partition_check_cpu(part, smp_processor_id(), d->hwirq) && - chip->irq_unmask) - chip->irq_unmask(data); -} - -static int partition_irq_set_irqchip_state(struct irq_data *d, - enum irqchip_irq_state which, - bool val) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - if (partition_check_cpu(part, smp_processor_id(), d->hwirq) && - chip->irq_set_irqchip_state) - return chip->irq_set_irqchip_state(data, which, val); - - return -EINVAL; -} - -static int partition_irq_get_irqchip_state(struct irq_data *d, - enum irqchip_irq_state which, - bool *val) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - if (partition_check_cpu(part, smp_processor_id(), d->hwirq) && - chip->irq_get_irqchip_state) - return chip->irq_get_irqchip_state(data, which, val); - - return -EINVAL; -} - -static int partition_irq_set_type(struct irq_data *d, unsigned int type) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - if (chip->irq_set_type) - return chip->irq_set_type(data, type); - - return -EINVAL; -} - -static void partition_irq_print_chip(struct irq_data *d, struct seq_file *= p) -{ - struct partition_desc *part =3D irq_data_get_irq_chip_data(d); - struct irq_chip *chip =3D irq_desc_get_chip(part->chained_desc); - struct irq_data *data =3D irq_desc_get_irq_data(part->chained_desc); - - seq_printf(p, "%5s-%lu", chip->name, data->hwirq); -} - -static struct irq_chip partition_irq_chip =3D { - .irq_mask =3D partition_irq_mask, - .irq_unmask =3D partition_irq_unmask, - .irq_set_type =3D partition_irq_set_type, - .irq_get_irqchip_state =3D partition_irq_get_irqchip_state, - .irq_set_irqchip_state =3D partition_irq_set_irqchip_state, - .irq_print_chip =3D partition_irq_print_chip, -}; - -static void partition_handle_irq(struct irq_desc *desc) -{ - struct partition_desc *part =3D irq_desc_get_handler_data(desc); - struct irq_chip *chip =3D irq_desc_get_chip(desc); - int cpu =3D smp_processor_id(); - int hwirq; - - chained_irq_enter(chip, desc); - - for_each_set_bit(hwirq, part->bitmap, part->nr_parts) { - if (partition_check_cpu(part, cpu, hwirq)) - break; - } - - if (unlikely(hwirq =3D=3D part->nr_parts)) - handle_bad_irq(desc); - else - generic_handle_domain_irq(part->domain, hwirq); - - chained_irq_exit(chip, desc); -} - -static int partition_domain_alloc(struct irq_domain *domain, unsigned int = virq, - unsigned int nr_irqs, void *arg) -{ - int ret; - irq_hw_number_t hwirq; - unsigned int type; - struct irq_fwspec *fwspec =3D arg; - struct partition_desc *part; - - BUG_ON(nr_irqs !=3D 1); - ret =3D domain->ops->translate(domain, fwspec, &hwirq, &type); - if (ret) - return ret; - - part =3D domain->host_data; - - set_bit(hwirq, part->bitmap); - irq_set_chained_handler_and_data(irq_desc_get_irq(part->chained_desc), - partition_handle_irq, part); - irq_set_percpu_devid_partition(virq, &part->parts[hwirq].mask); - irq_domain_set_info(domain, virq, hwirq, &partition_irq_chip, part, - handle_percpu_devid_irq, NULL, NULL); - irq_set_status_flags(virq, IRQ_NOAUTOEN); - - return 0; -} - -static void partition_domain_free(struct irq_domain *domain, unsigned int = virq, - unsigned int nr_irqs) -{ - struct irq_data *d; - - BUG_ON(nr_irqs !=3D 1); - - d =3D irq_domain_get_irq_data(domain, virq); - irq_set_handler(virq, NULL); - irq_domain_reset_irq_data(d); -} - -int partition_translate_id(struct partition_desc *desc, void *partition_id) -{ - struct partition_affinity *part =3D NULL; - int i; - - for (i =3D 0; i < desc->nr_parts; i++) { - if (desc->parts[i].partition_id =3D=3D partition_id) { - part =3D &desc->parts[i]; - break; - } - } - - if (WARN_ON(!part)) { - pr_err("Failed to find partition\n"); - return -EINVAL; - } - - return i; -} - -struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode, - struct partition_affinity *parts, - int nr_parts, - int chained_irq, - const struct irq_domain_ops *ops) -{ - struct partition_desc *desc; - struct irq_domain *d; - - BUG_ON(!ops->select || !ops->translate); - - desc =3D kzalloc(sizeof(*desc), GFP_KERNEL); - if (!desc) - return NULL; - - desc->ops =3D *ops; - desc->ops.free =3D partition_domain_free; - desc->ops.alloc =3D partition_domain_alloc; - - d =3D irq_domain_create_linear(fwnode, nr_parts, &desc->ops, desc); - if (!d) - goto out; - desc->domain =3D d; - - desc->bitmap =3D bitmap_zalloc(nr_parts, GFP_KERNEL); - if (WARN_ON(!desc->bitmap)) - goto out; - - desc->chained_desc =3D irq_to_desc(chained_irq); - desc->nr_parts =3D nr_parts; - desc->parts =3D parts; - - return desc; -out: - if (d) - irq_domain_remove(d); - kfree(desc); - - return NULL; -} - -struct irq_domain *partition_get_domain(struct partition_desc *dsc) -{ - if (dsc) - return dsc->domain; - - return NULL; -} diff --git a/include/linux/irqchip/irq-partition-percpu.h b/include/linux/i= rqchip/irq-partition-percpu.h deleted file mode 100644 index b35ee22c278f8..0000000000000 --- a/include/linux/irqchip/irq-partition-percpu.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (C) 2016 ARM Limited, All Rights Reserved. - * Author: Marc Zyngier - */ - -#ifndef __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H -#define __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H - -#include -#include -#include - -struct partition_affinity { - cpumask_t mask; - void *partition_id; -}; - -struct partition_desc; - -#ifdef CONFIG_PARTITION_PERCPU -int partition_translate_id(struct partition_desc *desc, void *partition_id= ); -struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode, - struct partition_affinity *parts, - int nr_parts, - int chained_irq, - const struct irq_domain_ops *ops); -struct irq_domain *partition_get_domain(struct partition_desc *dsc); -#else -static inline int partition_translate_id(struct partition_desc *desc, - void *partition_id) -{ - return -EINVAL; -} - -static inline -struct partition_desc *partition_create_desc(struct fwnode_handle *fwnode, - struct partition_affinity *parts, - int nr_parts, - int chained_irq, - const struct irq_domain_ops *ops) -{ - return NULL; -} - -static inline -struct irq_domain *partition_get_domain(struct partition_desc *dsc) -{ - return NULL; -} -#endif - -#endif /* __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H */ --=20 2.47.3