* [PATCH 0/2] irqchip/ocelot: Fix trigger register address
@ 2024-09-25 18:44 Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 1/2] " Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 2/2] irqchip/ocelot: Comment sticky register clearing code Sergey Matsievskiy
0 siblings, 2 replies; 5+ messages in thread
From: Sergey Matsievskiy @ 2024-09-25 18:44 UTC (permalink / raw)
To: tglx
Cc: maz, alexandre.belloni, gregory.clement, lars.povlsen,
UNGLinuxDriver, linux-mips, linux-kernel, Sergey Matsievskiy
Use main interrupt trigger registers instead of device interrupt trigger
registers.
Controllers, supported by this driver, have two sets of registers:
* (main) interrupt registers control peripheral interrupt sources;
* device interrupt registers configure per-device (network interface)
interrupts and act as an extra stage before the main interrupt registers.
In the driver unmask code, device trigger registers are used in the mask
calculation of the main interrupt sticky register, mixing two kinds of
registers.
This mix up does not manifest itself because the current implementation
only uses level interrupts, but will be evident with addition of the edge
interrupts. The first patch fixes this mix up.
Second patch adds the comment to the sticky bit clearing code as it's not
immediately obvious why Serval family is not handled specially, even though
it has only one interrupt trigger register replication.
Interrupt controller behavior was tested on Jaguar2C VSC7448.
Sergey Matsievskiy (2):
irqchip/ocelot: Fix trigger register address
irqchip/ocelot: Comment sticky register clearing code
drivers/irqchip/irq-mscc-ocelot.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] irqchip/ocelot: Fix trigger register address
2024-09-25 18:44 [PATCH 0/2] irqchip/ocelot: Fix trigger register address Sergey Matsievskiy
@ 2024-09-25 18:44 ` Sergey Matsievskiy
2024-10-02 15:43 ` [tip: irq/urgent] " tip-bot2 for Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 2/2] irqchip/ocelot: Comment sticky register clearing code Sergey Matsievskiy
1 sibling, 1 reply; 5+ messages in thread
From: Sergey Matsievskiy @ 2024-09-25 18:44 UTC (permalink / raw)
To: tglx
Cc: maz, alexandre.belloni, gregory.clement, lars.povlsen,
UNGLinuxDriver, linux-mips, linux-kernel, Sergey Matsievskiy
Use main interrupt trigger registers instead of device interrupt trigger
registers.
Controllers, supported by this driver, have two sets of registers:
* (main) interrupt registers control peripheral interrupt sources;
* device interrupt registers configure per-device (network interface)
interrupts and act as an extra stage before the main interrupt registers.
In the driver unmask code, device trigger registers are used in the mask
calculation of the main interrupt sticky register, mixing two kinds of
registers. Use main interrupt trigger register instead.
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
---
drivers/irqchip/irq-mscc-ocelot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index 4d0c3532dbe7..c19ab379e8c5 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -37,7 +37,7 @@ static struct chip_props ocelot_props = {
.reg_off_ena_clr = 0x1c,
.reg_off_ena_set = 0x20,
.reg_off_ident = 0x38,
- .reg_off_trigger = 0x5c,
+ .reg_off_trigger = 0x4,
.n_irq = 24,
};
@@ -70,7 +70,7 @@ static struct chip_props jaguar2_props = {
.reg_off_ena_clr = 0x1c,
.reg_off_ena_set = 0x20,
.reg_off_ident = 0x38,
- .reg_off_trigger = 0x5c,
+ .reg_off_trigger = 0x4,
.n_irq = 29,
};
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread* [tip: irq/urgent] irqchip/ocelot: Fix trigger register address
2024-09-25 18:44 ` [PATCH 1/2] " Sergey Matsievskiy
@ 2024-10-02 15:43 ` tip-bot2 for Sergey Matsievskiy
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Sergey Matsievskiy @ 2024-10-02 15:43 UTC (permalink / raw)
To: linux-tip-commits
Cc: Sergey Matsievskiy, Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 9e9c4666abb5bb444dac37e2d7eb5250c8d52a45
Gitweb: https://git.kernel.org/tip/9e9c4666abb5bb444dac37e2d7eb5250c8d52a45
Author: Sergey Matsievskiy <matsievskiysv@gmail.com>
AuthorDate: Wed, 25 Sep 2024 21:44:15 +03:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 02 Oct 2024 15:11:07 +02:00
irqchip/ocelot: Fix trigger register address
Controllers, supported by this driver, have two sets of registers:
* (main) interrupt registers control peripheral interrupt sources.
* device interrupt registers configure per-device (network interface)
interrupts and act as an extra stage before the main interrupt
registers.
In the driver unmask code, device trigger registers are used in the mask
calculation of the main interrupt sticky register, mixing two kinds of
registers.
Use the main interrupt trigger register instead.
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240925184416.54204-2-matsievskiysv@gmail.com
---
drivers/irqchip/irq-mscc-ocelot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index 4d0c353..c19ab37 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -37,7 +37,7 @@ static struct chip_props ocelot_props = {
.reg_off_ena_clr = 0x1c,
.reg_off_ena_set = 0x20,
.reg_off_ident = 0x38,
- .reg_off_trigger = 0x5c,
+ .reg_off_trigger = 0x4,
.n_irq = 24,
};
@@ -70,7 +70,7 @@ static struct chip_props jaguar2_props = {
.reg_off_ena_clr = 0x1c,
.reg_off_ena_set = 0x20,
.reg_off_ident = 0x38,
- .reg_off_trigger = 0x5c,
+ .reg_off_trigger = 0x4,
.n_irq = 29,
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] irqchip/ocelot: Comment sticky register clearing code
2024-09-25 18:44 [PATCH 0/2] irqchip/ocelot: Fix trigger register address Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 1/2] " Sergey Matsievskiy
@ 2024-09-25 18:44 ` Sergey Matsievskiy
2024-10-02 15:43 ` [tip: irq/urgent] " tip-bot2 for Sergey Matsievskiy
1 sibling, 1 reply; 5+ messages in thread
From: Sergey Matsievskiy @ 2024-09-25 18:44 UTC (permalink / raw)
To: tglx
Cc: maz, alexandre.belloni, gregory.clement, lars.povlsen,
UNGLinuxDriver, linux-mips, linux-kernel, Sergey Matsievskiy
Add comment to the sticky register clearing code.
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
---
drivers/irqchip/irq-mscc-ocelot.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index c19ab379e8c5..3dc745b14caf 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -84,6 +84,12 @@ static void ocelot_irq_unmask(struct irq_data *data)
u32 val;
irq_gc_lock(gc);
+ /*
+ * Clear sticky bits for edge mode interrupts.
+ * Serval has only one trigger register replication, but the adjacent
+ * register is always read as zero, so there's no need to handle this
+ * case separately.
+ */
val = irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 0)) |
irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 1));
if (!(val & mask))
--
2.39.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip: irq/urgent] irqchip/ocelot: Comment sticky register clearing code
2024-09-25 18:44 ` [PATCH 2/2] irqchip/ocelot: Comment sticky register clearing code Sergey Matsievskiy
@ 2024-10-02 15:43 ` tip-bot2 for Sergey Matsievskiy
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Sergey Matsievskiy @ 2024-10-02 15:43 UTC (permalink / raw)
To: linux-tip-commits
Cc: Sergey Matsievskiy, Thomas Gleixner, x86, linux-kernel, maz
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 7f1f78b903c933617cbd352f9eafe9e3644f3b92
Gitweb: https://git.kernel.org/tip/7f1f78b903c933617cbd352f9eafe9e3644f3b92
Author: Sergey Matsievskiy <matsievskiysv@gmail.com>
AuthorDate: Wed, 25 Sep 2024 21:44:16 +03:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 02 Oct 2024 15:11:07 +02:00
irqchip/ocelot: Comment sticky register clearing code
Add comment to the sticky register clearing code.
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240925184416.54204-3-matsievskiysv@gmail.com
---
drivers/irqchip/irq-mscc-ocelot.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
index c19ab37..3dc745b 100644
--- a/drivers/irqchip/irq-mscc-ocelot.c
+++ b/drivers/irqchip/irq-mscc-ocelot.c
@@ -84,6 +84,12 @@ static void ocelot_irq_unmask(struct irq_data *data)
u32 val;
irq_gc_lock(gc);
+ /*
+ * Clear sticky bits for edge mode interrupts.
+ * Serval has only one trigger register replication, but the adjacent
+ * register is always read as zero, so there's no need to handle this
+ * case separately.
+ */
val = irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 0)) |
irq_reg_readl(gc, ICPU_CFG_INTR_INTR_TRIGGER(p, 1));
if (!(val & mask))
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-02 15:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-25 18:44 [PATCH 0/2] irqchip/ocelot: Fix trigger register address Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 1/2] " Sergey Matsievskiy
2024-10-02 15:43 ` [tip: irq/urgent] " tip-bot2 for Sergey Matsievskiy
2024-09-25 18:44 ` [PATCH 2/2] irqchip/ocelot: Comment sticky register clearing code Sergey Matsievskiy
2024-10-02 15:43 ` [tip: irq/urgent] " tip-bot2 for Sergey Matsievskiy
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®