2022-07-06 15:24:59

by Michael Walle

[permalink] [raw]
Subject: [PATCH 1/2] genirq: allow irq_set_chip_handler_name_locked() to take a const irq_chip

Similar to commit 393e1280f765 ("genirq: Allow irq_chip registration
functions to take a const irq_chip"), allow the
irq_set_chip_handler_name_locked() function to take a const irq_chip
argument.

Signed-off-by: Michael Walle <[email protected]>
---
Given this is the correct approach, can this go through the pinctrl tree?
Of not, do we need an immutable tag?

include/linux/irqdesc.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index a77584593f7d..1cd4e36890fb 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -209,14 +209,15 @@ static inline void irq_set_handler_locked(struct irq_data *data,
* Must be called with irq_desc locked and valid parameters.
*/
static inline void
-irq_set_chip_handler_name_locked(struct irq_data *data, struct irq_chip *chip,
+irq_set_chip_handler_name_locked(struct irq_data *data,
+ const struct irq_chip *chip,
irq_flow_handler_t handler, const char *name)
{
struct irq_desc *desc = irq_data_to_desc(data);

desc->handle_irq = handler;
desc->name = name;
- data->chip = chip;
+ data->chip = (struct irq_chip *)chip;
}

bool irq_check_status_bit(unsigned int irq, unsigned int bitmask);
--
2.30.2


2022-07-11 10:15:35

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH 1/2] genirq: allow irq_set_chip_handler_name_locked() to take a const irq_chip

On Wed, 06 Jul 2022 16:15:52 +0100,
Michael Walle <[email protected]> wrote:
>
> Similar to commit 393e1280f765 ("genirq: Allow irq_chip registration
> functions to take a const irq_chip"), allow the
> irq_set_chip_handler_name_locked() function to take a const irq_chip
> argument.
>
> Signed-off-by: Michael Walle <[email protected]>
> ---
> Given this is the correct approach, can this go through the pinctrl tree?
> Of not, do we need an immutable tag?

I'd prefer this sort of change went into the IRQ tree, as it
potentially has a wide ranging effect, and that the rest of these
changes went via the IRQ tree too. It makes it easy to take the branch
down if something goes wrong.

Given that I already do carry a bunch of GPIO related patches, I'm
happy to add that to the mix if Linus ack the second patch.

The change itself looks good to me.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.

Subject: [irqchip: irq/irqchip-next] genirq: Allow irq_set_chip_handler_name_locked() to take a const irq_chip

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

Commit-ID: ef6e5d61eb7a0a30f776a829274573094185d03d
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/ef6e5d61eb7a0a30f776a829274573094185d03d
Author: Michael Walle <[email protected]>
AuthorDate: Wed, 06 Jul 2022 17:15:52 +02:00
Committer: Marc Zyngier <[email protected]>
CommitterDate: Mon, 11 Jul 2022 10:12:49 +01:00

genirq: Allow irq_set_chip_handler_name_locked() to take a const irq_chip

Similar to commit 393e1280f765 ("genirq: Allow irq_chip registration
functions to take a const irq_chip"), allow the
irq_set_chip_handler_name_locked() function to take a const irq_chip
argument.

Signed-off-by: Michael Walle <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
include/linux/irqdesc.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index a775845..1cd4e36 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -209,14 +209,15 @@ static inline void irq_set_handler_locked(struct irq_data *data,
* Must be called with irq_desc locked and valid parameters.
*/
static inline void
-irq_set_chip_handler_name_locked(struct irq_data *data, struct irq_chip *chip,
+irq_set_chip_handler_name_locked(struct irq_data *data,
+ const struct irq_chip *chip,
irq_flow_handler_t handler, const char *name)
{
struct irq_desc *desc = irq_data_to_desc(data);

desc->handle_irq = handler;
desc->name = name;
- data->chip = chip;
+ data->chip = (struct irq_chip *)chip;
}

bool irq_check_status_bit(unsigned int irq, unsigned int bitmask);

2022-07-11 12:32:15

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/2] genirq: allow irq_set_chip_handler_name_locked() to take a const irq_chip

On Mon, Jul 11, 2022 at 11:11 AM Marc Zyngier <[email protected]> wrote:
> On Wed, 06 Jul 2022 16:15:52 +0100,
> Michael Walle <[email protected]> wrote:
> >
> > Similar to commit 393e1280f765 ("genirq: Allow irq_chip registration
> > functions to take a const irq_chip"), allow the
> > irq_set_chip_handler_name_locked() function to take a const irq_chip
> > argument.
> >
> > Signed-off-by: Michael Walle <[email protected]>
> > ---
> > Given this is the correct approach, can this go through the pinctrl tree?
> > Of not, do we need an immutable tag?
>
> I'd prefer this sort of change went into the IRQ tree, as it
> potentially has a wide ranging effect, and that the rest of these
> changes went via the IRQ tree too. It makes it easy to take the branch
> down if something goes wrong.
>
> Given that I already do carry a bunch of GPIO related patches, I'm
> happy to add that to the mix if Linus ack the second patch.

I ACKed it! Go ahead.

Yours,
Linus Walleij