immortalwrt/target/linux
Markus Stockhausen bcb5d6b21b realtek: avoid wrong interrupt routing
The interrupt controller depends on two control registers. GIMR enables
or disables interrupts and IRRx routes these to MIPS CPU interrupts 2-7.
Wiki currently states "A value of '0' (in IRRx) disconnects this input from
the output line, independent of the line's setting in GIMR."

Contrary to normal intuition this statement DOES NOT mean, that interrupts
can be disabled by IRRx alone. The sad truth was discovered by enabling
SMP for an Zyxel XGS1010 on the 930x target. It shows that driver and
interrupts behave as follows:

- Timer 0 interrupt 7 has active routing to CPU0 and no routing to CPU1
- Timer 1 interrupt 8 has no routing to CPU0 and active routing to CPU1
- Unmasking (enabling) interrupts writes 1 bits to all GIMR registers
- Masking (disabling) interrupts writes 0 bits to both GIMR registers

During operation we can encounter a situation like

- GIMR bit for a interrupt/CPU combination is set to enabed (=1)
- IRRx routing bits for a interrupt/CPU combination are set to disabed (=0)

This setting already allows the hardware to fire interrupts to the target
CPU/VPE if the other CPU/VPE is currently busy. Especially for CPU bound
timer interrupts this is lethal. If timer interrupt 7 arrives at CPU1 and
vice versa for interrupt 8 the restart trigger gets lost. The timer dies
and a msleep() operation in the kernel will halt endlessly.

Fix this by tracking the IRRx active routing setting in a new bitfield with
0="routing active" and 1="no routing". Enable interrupts in GIMR only
for a interrupt & CPU if routing is active. Thus we have

- GIMR = 0 / IRRx = 0 -> everything disabled
- GIMR = 1 / IRRx > 0 -> active and normal routing
- GIMR = 0 / IRRx > 0 -> masked (disabled) with normal routing
- GIMR = 1 / IRRx = 0 -> no longer possible

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2022-09-18 20:38:56 +02:00
..
airoha kernel: bump 5.15 to 5.15.68 2022-09-17 14:16:37 +02:00
apm821xx kernel: bump 5.10 to 5.10.142 2022-09-11 01:30:11 +02:00
archs38 kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
armvirt armvirt: make 5.15 kernel default 2022-09-14 16:45:06 +02:00
at91 kernel: bump 5.10 to 5.10.143 2022-09-17 14:16:37 +02:00
ath25 kernel: bump 5.10 to 5.10.137 2022-08-23 10:37:04 +02:00
ath79 ath79: specify factory.bin recipe for ASUS RP-AC51 2022-09-18 03:09:19 +09:00
bcm27xx kernel: bump 5.15 to 5.15.68 2022-09-17 14:16:37 +02:00
bcm47xx kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
bcm53xx bcm53xx: update NVMEM driver for NVRAM 2022-09-14 14:21:57 +02:00
bcm63xx kernel: bump 5.15 to 5.15.62 2022-08-23 10:37:04 +02:00
bcm4908 bcm4908: fix Asus GT-AX6000 image 2022-09-03 20:43:07 +02:00
bmips kernel: bump 5.15 to 5.15.67 2022-09-09 21:08:37 +01:00
gemini kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
generic kernel: bump 5.10 to 5.10.143 2022-09-17 14:16:37 +02:00
imx kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
ipq40xx ipq40xx: disable devices with 3MiB kernel size 2022-09-18 21:33:50 +09:00
ipq806x kernel: bump 5.15 to 5.15.62 2022-08-23 10:37:04 +02:00
kirkwood kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
lantiq ltq-vdsl-app: rename to ltq-vdsl-vr9-app 2022-09-17 17:39:23 +02:00
layerscape kernel: bump 5.10 to 5.10.137 2022-08-23 10:37:04 +02:00
malta malta: make 5.15 kernel default 2022-09-14 16:45:06 +02:00
mediatek kernel: bump 5.15 to 5.15.68 2022-09-17 14:16:37 +02:00
mpc85xx kernel: bump 5.15 to 5.15.68 2022-09-17 14:16:37 +02:00
mvebu mvebu: PCI: aardvark: Implement workaround for PCIe Completion Timeout 2022-09-11 01:30:11 +02:00
mxs kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
octeon kernel: bump 5.15 to 5.15.63 2022-08-25 22:07:43 +02:00
octeontx kernel: bump 5.10 to 5.10.138 2022-08-25 20:23:59 +02:00
omap kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
oxnas oxnas: add testing support for Linux 5.15 2022-09-11 02:49:28 +01:00
pistachio kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
qoriq kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
ramips ramips: mt7621-dts: change phy-mode of gmac1 to rgmii 2022-09-18 11:50:32 +02:00
realtek realtek: avoid wrong interrupt routing 2022-09-18 20:38:56 +02:00
rockchip rockchip: add system-LED aliases specific to OpenWrt 2022-09-10 01:55:54 +02:00
sunxi kernel: bump 5.10 to 5.10.137 2022-08-23 10:37:04 +02:00
tegra tegra: add kernel 5.15 support 2022-09-14 16:45:06 +02:00
uml
x86 x86: setup netdev paths for MX100 2022-09-10 21:16:39 +02:00
zynq kernel: Activate CONFIG_GPIOLIB in generic configuration 2022-08-10 21:36:17 +02:00
Makefile