[PATCH v1 3/3] realtek: backport SoC interrupt vIRQ mapping fix

Sander Vanheule sander at svanheule.net
Sun Feb 13 06:42:57 PST 2022


The hwirq/virq mix-up causes issues on RTL930x, where low index SoC
interrupts are used. Since the HW IRQ number then clashes with the MIPS
CPU interrupt number space, a different vIRQ number was assigned,
resulting in a bad irqchip assignment.

Reported-by: Birger Koblitz <mail at birger-koblitz.de>
Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 ...realtek-rtl-map-control-data-to-virq.patch | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 target/linux/realtek/patches-5.10/010-5.15.19-irqchip-realtek-rtl-map-control-data-to-virq.patch

diff --git a/target/linux/realtek/patches-5.10/010-5.15.19-irqchip-realtek-rtl-map-control-data-to-virq.patch b/target/linux/realtek/patches-5.10/010-5.15.19-irqchip-realtek-rtl-map-control-data-to-virq.patch
new file mode 100644
index 000000000000..0f13a09d7b23
--- /dev/null
+++ b/target/linux/realtek/patches-5.10/010-5.15.19-irqchip-realtek-rtl-map-control-data-to-virq.patch
@@ -0,0 +1,35 @@
+From 291e79c7e2eb6fdc016453597b78482e06199d0f Mon Sep 17 00:00:00 2001
+From: Sander Vanheule <sander at svanheule.net>
+Date: Sun, 9 Jan 2022 15:54:32 +0100
+Subject: irqchip/realtek-rtl: Map control data to virq
+
+From: Sander Vanheule <sander at svanheule.net>
+
+commit 291e79c7e2eb6fdc016453597b78482e06199d0f upstream.
+
+The driver assigned the irqchip and irq handler to the hardware irq,
+instead of the virq. This is incorrect, and only worked because these
+irq numbers happened to be the same on the devices used for testing the
+original driver.
+
+Fixes: 9f3a0f34b84a ("irqchip: Add support for Realtek RTL838x/RTL839x interrupt controller")
+Signed-off-by: Sander Vanheule <sander at svanheule.net>
+Signed-off-by: Marc Zyngier <maz at kernel.org>
+Link: https://lore.kernel.org/r/4b4936606480265db47df152f00bc2ed46340599.1641739718.git.sander@svanheule.net
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal at kernel.org>
+---
+ drivers/irqchip/irq-realtek-rtl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/irqchip/irq-realtek-rtl.c
++++ b/drivers/irqchip/irq-realtek-rtl.c
+@@ -62,7 +62,7 @@ static struct irq_chip realtek_ictl_irq
+ 
+ static int intc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
+ {
+-	irq_set_chip_and_handler(hw, &realtek_ictl_irq, handle_level_irq);
++	irq_set_chip_and_handler(irq, &realtek_ictl_irq, handle_level_irq);
+ 
+ 	return 0;
+ }
-- 
2.34.1




More information about the openwrt-devel mailing list