linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "irqchip-bot for Marc Zyngier" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Marc Zyngier <maz@kernel.org>, tglx@linutronix.de
Subject: [irqchip: irq/irqchip-next] genirq: Replace irqaction:irq with a pointer to the irqdesc
Date: Sun, 06 Jun 2021 12:43:56 -0000	[thread overview]
Message-ID: <162298343659.29796.6540109093384254587.tip-bot2@tip-bot2> (raw)

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     bb33916b527fbdbe23c93c2b86375590c2fc92e2
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/bb33916b527fbdbe23c93c2b86375590c2fc92e2
Author:        Marc Zyngier <maz@kernel.org>
AuthorDate:    Tue, 20 Apr 2021 09:19:54 +01:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Wed, 02 Jun 2021 14:34:46 +01:00

genirq: Replace irqaction:irq with a pointer to the irqdesc

It is a bit odd that irqaction contains the irq number instead
of a back-pointer to the desc it is attached to, specially considering
it is an internal structure.

Replace the irq field with the backpointer.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 include/linux/interrupt.h |  2 +-
 kernel/irq/chip.c         |  2 +-
 kernel/irq/manage.c       | 15 +++++++--------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 4777850..7191950 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -119,7 +119,7 @@ struct irqaction {
 	irq_handler_t		thread_fn;
 	struct task_struct	*thread;
 	struct irqaction	*secondary;
-	unsigned int		irq;
+	struct irq_desc		*desc;
 	unsigned int		flags;
 	unsigned long		thread_flags;
 	unsigned long		thread_mask;
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 8cc8e57..764e046 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -479,7 +479,7 @@ void handle_nested_irq(unsigned int irq)
 
 	action_ret = IRQ_NONE;
 	for_each_action_of_desc(desc, action)
-		action_ret |= action->thread_fn(action->irq, action->dev_id);
+		action_ret |= action->thread_fn(irq_desc_get_irq(desc), action->dev_id);
 
 	if (!noirqdebug)
 		note_interrupt(desc, action_ret);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 4c14356..1e519e2 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1144,7 +1144,7 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action)
 	local_bh_disable();
 	if (!IS_ENABLED(CONFIG_PREEMPT_RT))
 		local_irq_disable();
-	ret = action->thread_fn(action->irq, action->dev_id);
+	ret = action->thread_fn(irq_desc_get_irq(desc), action->dev_id);
 	if (ret == IRQ_HANDLED)
 		atomic_inc(&desc->threads_handled);
 
@@ -1165,7 +1165,7 @@ static irqreturn_t irq_thread_fn(struct irq_desc *desc,
 {
 	irqreturn_t ret;
 
-	ret = action->thread_fn(action->irq, action->dev_id);
+	ret = action->thread_fn(irq_desc_get_irq(desc), action->dev_id);
 	if (ret == IRQ_HANDLED)
 		atomic_inc(&desc->threads_handled);
 
@@ -1189,12 +1189,11 @@ static void irq_thread_dtor(struct callback_head *unused)
 		return;
 
 	action = kthread_data(tsk);
+	desc = action->desc;
 
 	pr_err("exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n",
-	       tsk->comm, tsk->pid, action->irq);
+	       tsk->comm, tsk->pid, irq_desc_get_irq(desc));
 
-
-	desc = irq_to_desc(action->irq);
 	/*
 	 * If IRQTF_RUNTHREAD is set, we need to decrement
 	 * desc->threads_active and wake possible waiters.
@@ -1225,7 +1224,7 @@ static int irq_thread(void *data)
 {
 	struct callback_head on_exit_work;
 	struct irqaction *action = data;
-	struct irq_desc *desc = irq_to_desc(action->irq);
+	struct irq_desc *desc = action->desc;
 	irqreturn_t (*handler_fn)(struct irq_desc *desc,
 			struct irqaction *action);
 
@@ -1318,7 +1317,7 @@ static int irq_setup_forced_threading(struct irqaction *new)
 		new->secondary->handler = irq_forced_secondary_handler;
 		new->secondary->thread_fn = new->thread_fn;
 		new->secondary->dev_id = new->dev_id;
-		new->secondary->irq = new->irq;
+		new->secondary->desc = new->desc;
 		new->secondary->name = new->name;
 	}
 	/* Deal with the primary handler */
@@ -1444,7 +1443,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 	if (!try_module_get(desc->owner))
 		return -ENODEV;
 
-	new->irq = irq;
+	new->desc = desc;
 
 	/*
 	 * If the trigger type is not specified by the caller,

                 reply	other threads:[~2021-06-06 12:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162298343659.29796.6540109093384254587.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).