[PATCH v2 11/25] genirq: Kill handle_percpu_devid_fasteoi_nmi()

Marc Zyngier posted 25 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH v2 11/25] genirq: Kill handle_percpu_devid_fasteoi_nmi()
Posted by Marc Zyngier 2 weeks, 3 days ago
There is no in-tree user of this flow handler anymore, so simply
remove it.

Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 include/linux/irq.h |  1 -
 kernel/irq/chip.c   | 28 ++--------------------------
 2 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 1d6b606a81efe..1381f9d1f5c9d 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -655,7 +655,6 @@ extern void handle_bad_irq(struct irq_desc *desc);
 extern void handle_nested_irq(unsigned int irq);
 
 extern void handle_fasteoi_nmi(struct irq_desc *desc);
-extern void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc);
 
 extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
 extern int irq_chip_pm_get(struct irq_data *data);
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 0d0276378c707..869068ec6ac91 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -892,7 +892,8 @@ void handle_percpu_irq(struct irq_desc *desc)
  *
  * action->percpu_dev_id is a pointer to percpu variables which
  * contain the real device id for the cpu on which this handler is
- * called
+ * called. This is also used for per-CPU NMIs, so special care is
+ * required.
  */
 void handle_percpu_devid_irq(struct irq_desc *desc)
 {
@@ -929,31 +930,6 @@ void handle_percpu_devid_irq(struct irq_desc *desc)
 		chip->irq_eoi(&desc->irq_data);
 }
 
-/**
- * handle_percpu_devid_fasteoi_nmi - Per CPU local NMI handler with per cpu
- *				     dev ids
- * @desc:	the interrupt description structure for this irq
- *
- * Similar to handle_fasteoi_nmi, but handling the dev_id cookie
- * as a percpu pointer.
- */
-void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc)
-{
-	struct irq_chip *chip = irq_desc_get_chip(desc);
-	struct irqaction *action = desc->action;
-	unsigned int irq = irq_desc_get_irq(desc);
-	irqreturn_t res;
-
-	__kstat_incr_irqs_this_cpu(desc);
-
-	trace_irq_handler_entry(irq, action);
-	res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id));
-	trace_irq_handler_exit(irq, action, res);
-
-	if (chip->irq_eoi)
-		chip->irq_eoi(&desc->irq_data);
-}
-
 static void
 __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
 		     int is_chained, const char *name)
-- 
2.39.2
Re: [PATCH v2 11/25] genirq: Kill handle_percpu_devid_fasteoi_nmi()
Posted by Jonathan Cameron 2 weeks, 1 day ago
On Mon, 15 Sep 2025 09:56:48 +0100
Marc Zyngier <maz@kernel.org> wrote:

> There is no in-tree user of this flow handler anymore, so simply
> remove it.
> 
> Suggested-by: Will Deacon <will@kernel.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---

> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index 0d0276378c707..869068ec6ac91 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -892,7 +892,8 @@ void handle_percpu_irq(struct irq_desc *desc)
>   *
>   * action->percpu_dev_id is a pointer to percpu variables which
>   * contain the real device id for the cpu on which this handler is
> - * called
> + * called. This is also used for per-CPU NMIs, so special care is
> + * required.

Probably belongs in previous patch as not really related to removing
the unused code, but meh.

>   */
Re: [PATCH v2 11/25] genirq: Kill handle_percpu_devid_fasteoi_nmi()
Posted by Marc Zyngier 1 week, 4 days ago
On Tue, 16 Sep 2025 16:38:38 +0100,
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:
> 
> On Mon, 15 Sep 2025 09:56:48 +0100
> Marc Zyngier <maz@kernel.org> wrote:
> 
> > There is no in-tree user of this flow handler anymore, so simply
> > remove it.
> > 
> > Suggested-by: Will Deacon <will@kernel.org>
> > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > ---
> 
> > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> > index 0d0276378c707..869068ec6ac91 100644
> > --- a/kernel/irq/chip.c
> > +++ b/kernel/irq/chip.c
> > @@ -892,7 +892,8 @@ void handle_percpu_irq(struct irq_desc *desc)
> >   *
> >   * action->percpu_dev_id is a pointer to percpu variables which
> >   * contain the real device id for the cpu on which this handler is
> > - * called
> > + * called. This is also used for per-CPU NMIs, so special care is
> > + * required.
> 
> Probably belongs in previous patch as not really related to removing
> the unused code, but meh.

Actually, I think I'll simply drop this comment. It really doesn't
bring much to the table.

Thanks,

	M.

-- 
Jazz isn't dead. It just smells funny.