To add interrupt controllers in DTS, or not?

What are your opinions about adding interrupt controllers to eth nodes in DTS especially in Mediatek MT7531 switches? Are those worth it? I mean the board works fine without it.. I used AX80 US firmware on AX80 EU with this eth nodes for 2 months just fine, which has these code below. But AI says, with wrong interrupt controllers sometimes this IRQ storm happens, where there seems to be internet, but no accessing the web interface. The switch is supposedly working but silent. The code I mean is these:

                switch@1f {
                        compatible = "mediatek,mt7531";
                        reg = <31>;
                        reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
                        interrupt-controller;
                        #interrupt-cells = <1>;
                        interrupt-parent = <&pio>;
                        interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;


This is what happening after adding that:

root@Archer-AX80:~# dmesg | grep mt753
[    4.977123] mt7530-mdio mdio-bus:1f: no interrupt support
[    4.996687] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    5.005914] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control off
[    5.015883] mt7530-mdio mdio-bus:1f lan0 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.037278] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.058358] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[    5.079406] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[    6.934915] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   19.600843] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[   19.625576] mt7530-mdio mdio-bus:1f lan3: entered allmulticast mode
[   19.642065] mt7530-mdio mdio-bus:1f lan3: entered promiscuous mode
[   19.719957] mt7530-mdio mdio-bus:1f lan0: configuring for phy/gmii link mode
[   19.739133] mt7530-mdio mdio-bus:1f lan0: entered allmulticast mode
[   19.747812] mt7530-mdio mdio-bus:1f lan0: entered promiscuous mode
[   19.762597] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   19.784858] mt7530-mdio mdio-bus:1f lan1: entered allmulticast mode
[   19.793039] mt7530-mdio mdio-bus:1f lan1: entered promiscuous mode
[   19.807184] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[   19.829075] mt7530-mdio mdio-bus:1f lan2: entered allmulticast mode
[   19.837355] mt7530-mdio mdio-bus:1f lan2: entered promiscuous mode
[   22.718225] mt7530-mdio mdio-bus:1f lan3: Link is Up - 100Mbps/Full - flow control off
[   23.998167] mt7530-mdio mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
root@Archer-AX80:~# 


You also need to add interrupts to the PHY built into the MT7531. The general rule is that if something is available in hw, it should also be described in the DTS.

1 Like

I did it like this instead, I think with interrupt controllers it works better:

        switch: switch@1f {
                compatible = "mediatek,mt7531";
                reg = <31>;
                interrupt-controller;
                #interrupt-cells = <1>;
                reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
                interrupt-parent = <&pio>;
                interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;        };

Is this ok:

root@Archer-AX80:~# cat /proc/interrupts | grep 66
 81:          6          0          0          0   mt-eint  66 Level     mt7530
root@Archer-AX80:~# dmesg | grep mt753
[    4.990718] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[    4.999982] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    5.009945] mt7530-mdio mdio-bus:1f lan0 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=124)
[    5.031364] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=125)
[    5.052461] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=126)
[    5.073522] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=127)
[    6.961817] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   20.471055] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[   20.495658] mt7530-mdio mdio-bus:1f lan3: entered allmulticast mode
[   20.512277] mt7530-mdio mdio-bus:1f lan3: entered promiscuous mode
[   20.589981] mt7530-mdio mdio-bus:1f lan0: configuring for phy/gmii link mode
[   20.612019] mt7530-mdio mdio-bus:1f lan0: entered allmulticast mode
[   20.620620] mt7530-mdio mdio-bus:1f lan0: entered promiscuous mode
[   20.635962] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[   20.658205] mt7530-mdio mdio-bus:1f lan1: entered allmulticast mode
[   20.666361] mt7530-mdio mdio-bus:1f lan1: entered promiscuous mode
[   20.680656] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[   20.702683] mt7530-mdio mdio-bus:1f lan2: entered allmulticast mode
[   20.710978] mt7530-mdio mdio-bus:1f lan2: entered promiscuous mode
[   22.885699] mt7530-mdio mdio-bus:1f lan3: Link is Up - 100Mbps/Full - flow control off
[   24.008033] mt7530-mdio mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx