* [PATCH] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack by generic
@ 2024-12-24 0:17 linux
2025-01-03 4:44 ` Florian Fainelli
2025-01-15 9:16 ` [tip: irq/core] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function tip-bot2 for Dr. David Alan Gilbert
0 siblings, 2 replies; 3+ messages in thread
From: linux @ 2024-12-24 0:17 UTC (permalink / raw)
To: florian.fainelli, bcm-kernel-feedback-list, tglx
Cc: linux-mips, linux-arm-kernel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Replace brcmstb_l2_mask_and_ack() by the generic
irq_gc_mask_disable_and_ack_set().
brcmstb_l2_mask_and_ack() was added by
commit 49aa6ef0b439 ("irqchip/brcmstb-l2: Remove some processing from the
handler") in September 2017 with a comment saying it was actually
generic and someone should add it to the generic code.
commit 20608924cc2e ("genirq: generic chip: Add
irq_gc_mask_disable_and_ack_set()") did that a few weeks later,
however no one went back and took the original out.
Build tested only.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/irqchip/irq-brcmstb-l2.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
index c988886917f7..db4c9721fcf2 100644
--- a/drivers/irqchip/irq-brcmstb-l2.c
+++ b/drivers/irqchip/irq-brcmstb-l2.c
@@ -61,32 +61,6 @@ struct brcmstb_l2_intc_data {
u32 saved_mask; /* for suspend/resume */
};
-/**
- * brcmstb_l2_mask_and_ack - Mask and ack pending interrupt
- * @d: irq_data
- *
- * Chip has separate enable/disable registers instead of a single mask
- * register and pending interrupt is acknowledged by setting a bit.
- *
- * Note: This function is generic and could easily be added to the
- * generic irqchip implementation if there ever becomes a will to do so.
- * Perhaps with a name like irq_gc_mask_disable_and_ack_set().
- *
- * e.g.: https://patchwork.kernel.org/patch/9831047/
- */
-static void brcmstb_l2_mask_and_ack(struct irq_data *d)
-{
- struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
- struct irq_chip_type *ct = irq_data_get_chip_type(d);
- u32 mask = d->mask;
-
- irq_gc_lock(gc);
- irq_reg_writel(gc, mask, ct->regs.disable);
- *ct->mask_cache &= ~mask;
- irq_reg_writel(gc, mask, ct->regs.ack);
- irq_gc_unlock(gc);
-}
-
static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
{
struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc);
@@ -248,7 +222,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
if (init_params->cpu_clear >= 0) {
ct->regs.ack = init_params->cpu_clear;
ct->chip.irq_ack = irq_gc_ack_set_bit;
- ct->chip.irq_mask_ack = brcmstb_l2_mask_and_ack;
+ ct->chip.irq_mask_ack = irq_gc_mask_disable_and_ack_set;
} else {
/* No Ack - but still slightly more efficient to define this */
ct->chip.irq_mask_ack = irq_gc_mask_disable_reg;
--
2.47.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack by generic
2024-12-24 0:17 [PATCH] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack by generic linux
@ 2025-01-03 4:44 ` Florian Fainelli
2025-01-15 9:16 ` [tip: irq/core] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function tip-bot2 for Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2025-01-03 4:44 UTC (permalink / raw)
To: linux, bcm-kernel-feedback-list, tglx
Cc: linux-mips, linux-arm-kernel, linux-kernel
On 12/23/2024 4:17 PM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Replace brcmstb_l2_mask_and_ack() by the generic
> irq_gc_mask_disable_and_ack_set().
>
> brcmstb_l2_mask_and_ack() was added by
> commit 49aa6ef0b439 ("irqchip/brcmstb-l2: Remove some processing from the
> handler") in September 2017 with a comment saying it was actually
> generic and someone should add it to the generic code.
>
> commit 20608924cc2e ("genirq: generic chip: Add
> irq_gc_mask_disable_and_ack_set()") did that a few weeks later,
> however no one went back and took the original out.
>
> Build tested only.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread* [tip: irq/core] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function
2024-12-24 0:17 [PATCH] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack by generic linux
2025-01-03 4:44 ` Florian Fainelli
@ 2025-01-15 9:16 ` tip-bot2 for Dr. David Alan Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Dr. David Alan Gilbert @ 2025-01-15 9:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: Dr. David Alan Gilbert, Thomas Gleixner, Florian Fainelli, x86,
linux-kernel, maz
The following commit has been merged into the irq/core branch of tip:
Commit-ID: dd1f17a9faf5359d76644236cde4cc1720f1184d
Gitweb: https://git.kernel.org/tip/dd1f17a9faf5359d76644236cde4cc1720f1184d
Author: Dr. David Alan Gilbert <linux@treblig.org>
AuthorDate: Tue, 24 Dec 2024 00:17:27
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 15 Jan 2025 09:47:46 +01:00
irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function
Replace brcmstb_l2_mask_and_ack() by the generic
irq_gc_mask_disable_and_ack_set().
brcmstb_l2_mask_and_ack() was added in commit 49aa6ef0b439
("irqchip/brcmstb-l2: Remove some processing from the handler") in
September 2017 with a comment saying it was actually generic and someone
should add it to the generic code.
commit 20608924cc2e ("genirq: generic chip: Add
irq_gc_mask_disable_and_ack_set()") did that a few weeks later, however no
one went back and took the brcmstb variant out.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/all/20241224001727.149337-1-linux@treblig.org
---
drivers/irqchip/irq-brcmstb-l2.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c
index c988886..db4c972 100644
--- a/drivers/irqchip/irq-brcmstb-l2.c
+++ b/drivers/irqchip/irq-brcmstb-l2.c
@@ -61,32 +61,6 @@ struct brcmstb_l2_intc_data {
u32 saved_mask; /* for suspend/resume */
};
-/**
- * brcmstb_l2_mask_and_ack - Mask and ack pending interrupt
- * @d: irq_data
- *
- * Chip has separate enable/disable registers instead of a single mask
- * register and pending interrupt is acknowledged by setting a bit.
- *
- * Note: This function is generic and could easily be added to the
- * generic irqchip implementation if there ever becomes a will to do so.
- * Perhaps with a name like irq_gc_mask_disable_and_ack_set().
- *
- * e.g.: https://patchwork.kernel.org/patch/9831047/
- */
-static void brcmstb_l2_mask_and_ack(struct irq_data *d)
-{
- struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
- struct irq_chip_type *ct = irq_data_get_chip_type(d);
- u32 mask = d->mask;
-
- irq_gc_lock(gc);
- irq_reg_writel(gc, mask, ct->regs.disable);
- *ct->mask_cache &= ~mask;
- irq_reg_writel(gc, mask, ct->regs.ack);
- irq_gc_unlock(gc);
-}
-
static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
{
struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc);
@@ -248,7 +222,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np,
if (init_params->cpu_clear >= 0) {
ct->regs.ack = init_params->cpu_clear;
ct->chip.irq_ack = irq_gc_ack_set_bit;
- ct->chip.irq_mask_ack = brcmstb_l2_mask_and_ack;
+ ct->chip.irq_mask_ack = irq_gc_mask_disable_and_ack_set;
} else {
/* No Ack - but still slightly more efficient to define this */
ct->chip.irq_mask_ack = irq_gc_mask_disable_reg;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-15 9:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-24 0:17 [PATCH] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack by generic linux
2025-01-03 4:44 ` Florian Fainelli
2025-01-15 9:16 ` [tip: irq/core] irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function tip-bot2 for Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®