mbox series

[0/6] backport fixes and improvements for MT7530

Message ID 20220203120705.3532684-1-dqfext@gmail.com
Headers show
Series backport fixes and improvements for MT7530 | expand

Message

Qingfang Deng Feb. 3, 2022, 12:06 p.m. UTC
Hi,

This series backports some patches from upstream to address the current
MT7530 DSA driver's problems.

Thanks.

DENG Qingfang (6):
  kernel: backport MediaTek jumbo frame support
  kernel: backport MT7530 ageing time support
  kernel: backport MT7530 VLAN fix
  kernel: backport MT7530 MDB operations
  kernel: backport MediaTek Ethernet PHY driver
  kernel: backport MT7530 IRQ support

 ...thernet-mediatek-support-setting-MTU.patch | 138 ++++++
 ...1-net-dsa-mt7530-support-setting-MTU.patch | 112 +++++
 ...-dsa-mt7530-enable-MTU-normalization.patch |  36 ++
 ...a-mt7530-support-setting-ageing-time.patch |  99 ++++
 ...disable-learning-on-standalone-ports.patch |  65 +++
 ...enable-assisted-learning-on-CPU-port.patch | 102 +++++
 ...se-independent-VLAN-learning-on-VLAN.patch | 262 +++++++++++
 ...-mt7530-set-STP-state-on-filter-ID-1.patch |  40 ++
 ...lways-install-FDB-entries-with-IVL-a.patch |  54 +++
 ...et-dsa-mt7530-support-MDB-operations.patch | 171 +++++++
 ...MediaTek-Gigabit-Ethernet-PHY-driver.patch | 162 +++++++
 ...net-dsa-mt7530-add-interrupt-support.patch | 428 ++++++++++++++++++
 target/linux/generic/config-5.10              |   1 +
 target/linux/mediatek/mt7622/config-5.10      |   1 +
 target/linux/mediatek/mt7623/config-5.10      |   1 +
 target/linux/ramips/dts/mt7621.dtsi           |   3 +
 target/linux/ramips/mt7621/config-5.10        |   1 +
 17 files changed, 1676 insertions(+)
 create mode 100644 target/linux/generic/backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch
 create mode 100644 target/linux/generic/backport-5.10/762-v5.11-net-dsa-mt7530-support-setting-MTU.patch
 create mode 100644 target/linux/generic/backport-5.10/763-v5.11-net-dsa-mt7530-enable-MTU-normalization.patch
 create mode 100644 target/linux/generic/backport-5.10/764-v5.11-net-dsa-mt7530-support-setting-ageing-time.patch
 create mode 100644 target/linux/generic/backport-5.10/765-v5.15-net-dsa-mt7530-disable-learning-on-standalone-ports.patch
 create mode 100644 target/linux/generic/backport-5.10/766-v5.15-net-dsa-mt7530-enable-assisted-learning-on-CPU-port.patch
 create mode 100644 target/linux/generic/backport-5.10/767-v5.15-net-dsa-mt7530-use-independent-VLAN-learning-on-VLAN.patch
 create mode 100644 target/linux/generic/backport-5.10/768-v5.15-net-dsa-mt7530-set-STP-state-on-filter-ID-1.patch
 create mode 100644 target/linux/generic/backport-5.10/769-v5.15-net-dsa-mt7530-always-install-FDB-entries-with-IVL-a.patch
 create mode 100644 target/linux/generic/backport-5.10/770-v5.15-net-dsa-mt7530-support-MDB-operations.patch
 create mode 100644 target/linux/generic/backport-5.10/771-v5.14-net-phy-add-MediaTek-Gigabit-Ethernet-PHY-driver.patch
 create mode 100644 target/linux/generic/backport-5.10/772-v5.14-net-dsa-mt7530-add-interrupt-support.patch

Comments

Arınç ÜNAL Feb. 4, 2022, 11:27 a.m. UTC | #1
Tested this patch series on a private mt7621a board. With the Mediatek 
GE PHY driver, the link instability issue on the MT7530 switch ports is 
gone. You can use my tested-by tag on all of the patches.

Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>

Cheers.
Arınç
Hauke Mehrtens Feb. 5, 2022, 6:08 p.m. UTC | #2
On 2/3/22 13:06, DENG Qingfang wrote:
> Hi,
> 
> This series backports some patches from upstream to address the current
> MT7530 DSA driver's problems.
> 
> Thanks.
> 
> DENG Qingfang (6):
>    kernel: backport MediaTek jumbo frame support
>    kernel: backport MT7530 ageing time support
>    kernel: backport MT7530 VLAN fix
>    kernel: backport MT7530 MDB operations
>    kernel: backport MediaTek Ethernet PHY driver
>    kernel: backport MT7530 IRQ support
> 
Hi,

The last two patches are breaking the Linksys e8450 (mt7622) for me.

I am getting these errors:
-------------------------
[    1.243304] pci_bus 0001:00: bus scan returning with max=00
[    1.249219] mtk_hsdma 1b007000.dma-controller: Using 3 as missing 
dma-requests property
[    1.257493] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver 
registered
[    1.300554] mt7530 mdio-bus:00: no interrupt support
[    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to 
connect to PHY: -EINVAL
[    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22 
setting up PHY for tree 0, switch 0, port 0
[    1.331163] mt7530 mdio-bus:00 lan2 (uninitialized): failed to 
connect to PHY: -EINVAL
[    1.339085] mt7530 mdio-bus:00 lan2 (uninitialized): error -22 
setting up PHY for tree 0, switch 0, port 1
[    1.349321] mt7530 mdio-bus:00 lan3 (uninitialized): failed to 
connect to PHY: -EINVAL
[    1.357241] mt7530 mdio-bus:00 lan3 (uninitialized): error -22 
setting up PHY for tree 0, switch 0, port 2
[    1.367452] mt7530 mdio-bus:00 lan4 (uninitialized): failed to 
connect to PHY: -EINVAL
[    1.375367] mt7530 mdio-bus:00 lan4 (uninitialized): error -22 
setting up PHY for tree 0, switch 0, port 3
[    1.385750] mt7530 mdio-bus:00 wan (uninitialized): failed to connect 
to PHY: -EINVAL
[    1.393575] mt7530 mdio-bus:00 wan (uninitialized): error -22 setting 
up PHY for tree 0, switch 0, port 4
[    1.404399] mt7530 mdio-bus:00: configuring for fixed/2500base-x link 
mode
[    1.411452] DSA: tree 0 setup
[    1.411640] mt7530 mdio-bus:00: Link is Up - 2.5Gbps/Full - flow 
control rx/tx
-------------------------

I will revert both patches in master now.

Hauke
Rosen Penev Feb. 5, 2022, 6:21 p.m. UTC | #3
On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> On 2/3/22 13:06, DENG Qingfang wrote:
> > Hi,
> >
> > This series backports some patches from upstream to address the current
> > MT7530 DSA driver's problems.
> >
> > Thanks.
> >
> > DENG Qingfang (6):
> >    kernel: backport MediaTek jumbo frame support
> >    kernel: backport MT7530 ageing time support
> >    kernel: backport MT7530 VLAN fix
> >    kernel: backport MT7530 MDB operations
> >    kernel: backport MediaTek Ethernet PHY driver
> >    kernel: backport MT7530 IRQ support
> >
> Hi,
>
> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>
> I am getting these errors:
Note the commentary in
https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6

The message in dmesg is harmless. It just says the functionality in
this patch needs dts bindings, which were only provided for ramips.
> -------------------------
> [    1.243304] pci_bus 0001:00: bus scan returning with max=00
> [    1.249219] mtk_hsdma 1b007000.dma-controller: Using 3 as missing
> dma-requests property
> [    1.257493] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver
> registered
> [    1.300554] mt7530 mdio-bus:00: no interrupt support
> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
> connect to PHY: -EINVAL
> [    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 0
> [    1.331163] mt7530 mdio-bus:00 lan2 (uninitialized): failed to
> connect to PHY: -EINVAL
> [    1.339085] mt7530 mdio-bus:00 lan2 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 1
> [    1.349321] mt7530 mdio-bus:00 lan3 (uninitialized): failed to
> connect to PHY: -EINVAL
> [    1.357241] mt7530 mdio-bus:00 lan3 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 2
> [    1.367452] mt7530 mdio-bus:00 lan4 (uninitialized): failed to
> connect to PHY: -EINVAL
> [    1.375367] mt7530 mdio-bus:00 lan4 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 3
> [    1.385750] mt7530 mdio-bus:00 wan (uninitialized): failed to connect
> to PHY: -EINVAL
> [    1.393575] mt7530 mdio-bus:00 wan (uninitialized): error -22 setting
> up PHY for tree 0, switch 0, port 4
> [    1.404399] mt7530 mdio-bus:00: configuring for fixed/2500base-x link
> mode
> [    1.411452] DSA: tree 0 setup
> [    1.411640] mt7530 mdio-bus:00: Link is Up - 2.5Gbps/Full - flow
> control rx/tx
> -------------------------
>
> I will revert both patches in master now.
>
> Hauke
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Hauke Mehrtens Feb. 5, 2022, 6:23 p.m. UTC | #4
On 2/5/22 19:21, Rosen Penev wrote:
> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>
>> On 2/3/22 13:06, DENG Qingfang wrote:
>>> Hi,
>>>
>>> This series backports some patches from upstream to address the current
>>> MT7530 DSA driver's problems.
>>>
>>> Thanks.
>>>
>>> DENG Qingfang (6):
>>>     kernel: backport MediaTek jumbo frame support
>>>     kernel: backport MT7530 ageing time support
>>>     kernel: backport MT7530 VLAN fix
>>>     kernel: backport MT7530 MDB operations
>>>     kernel: backport MediaTek Ethernet PHY driver
>>>     kernel: backport MT7530 IRQ support
>>>
>> Hi,
>>
>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>
>> I am getting these errors:
> Note the commentary in
> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
> 
> The message in dmesg is harmless. It just says the functionality in
> this patch needs dts bindings, which were only provided for ramips.

The following error messages are a bigger problem:
--------
[    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to 
connect to PHY: -EINVAL
[    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22 
setting up PHY for tree 0, switch 0, port 0
---------

The LAN ports are not registered and then LAN is not working at all.

Hauke
Rosen Penev Feb. 5, 2022, 6:30 p.m. UTC | #5
On Sat, Feb 5, 2022 at 10:23 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> On 2/5/22 19:21, Rosen Penev wrote:
> > On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >>
> >> On 2/3/22 13:06, DENG Qingfang wrote:
> >>> Hi,
> >>>
> >>> This series backports some patches from upstream to address the current
> >>> MT7530 DSA driver's problems.
> >>>
> >>> Thanks.
> >>>
> >>> DENG Qingfang (6):
> >>>     kernel: backport MediaTek jumbo frame support
> >>>     kernel: backport MT7530 ageing time support
> >>>     kernel: backport MT7530 VLAN fix
> >>>     kernel: backport MT7530 MDB operations
> >>>     kernel: backport MediaTek Ethernet PHY driver
> >>>     kernel: backport MT7530 IRQ support
> >>>
> >> Hi,
> >>
> >> The last two patches are breaking the Linksys e8450 (mt7622) for me.
> >>
> >> I am getting these errors:
> > Note the commentary in
> > https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
> >
> > The message in dmesg is harmless. It just says the functionality in
> > this patch needs dts bindings, which were only provided for ramips.
>
> The following error messages are a bigger problem:
> --------
> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
> connect to PHY: -EINVAL
> [    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 0
> ---------
>
> The LAN ports are not registered and then LAN is not working at all.
I think the PHY driver was written for mt7530. The e8450 uses mt7531 AFAIK.

>
> Hauke
Qingfang Deng Feb. 5, 2022, 6:34 p.m. UTC | #6
On Sun, Feb 6, 2022 at 2:23 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> On 2/5/22 19:21, Rosen Penev wrote:
> > On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >>
> >> On 2/3/22 13:06, DENG Qingfang wrote:
> >>> Hi,
> >>>
> >>> This series backports some patches from upstream to address the current
> >>> MT7530 DSA driver's problems.
> >>>
> >>> Thanks.
> >>>
> >>> DENG Qingfang (6):
> >>>     kernel: backport MediaTek jumbo frame support
> >>>     kernel: backport MT7530 ageing time support
> >>>     kernel: backport MT7530 VLAN fix
> >>>     kernel: backport MT7530 MDB operations
> >>>     kernel: backport MediaTek Ethernet PHY driver
> >>>     kernel: backport MT7530 IRQ support
> >>>
> >> Hi,
> >>
> >> The last two patches are breaking the Linksys e8450 (mt7622) for me.
> >>
> >> I am getting these errors:
> > Note the commentary in
> > https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
> >
> > The message in dmesg is harmless. It just says the functionality in
> > this patch needs dts bindings, which were only provided for ramips.
>
> The following error messages are a bigger problem:
> --------
> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
> connect to PHY: -EINVAL

Try removing the PHY_INTERFACE_MODE_INTERNAL check in mt7531_phy_config_init,
the only place that returns -EINVAL.

> [    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22
> setting up PHY for tree 0, switch 0, port 0
> ---------
>
> The LAN ports are not registered and then LAN is not working at all.
>
> Hauke
Hauke Mehrtens Feb. 5, 2022, 6:43 p.m. UTC | #7
On 2/5/22 19:34, DENG Qingfang wrote:
> On Sun, Feb 6, 2022 at 2:23 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>
>> On 2/5/22 19:21, Rosen Penev wrote:
>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>>
>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>> Hi,
>>>>>
>>>>> This series backports some patches from upstream to address the current
>>>>> MT7530 DSA driver's problems.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> DENG Qingfang (6):
>>>>>      kernel: backport MediaTek jumbo frame support
>>>>>      kernel: backport MT7530 ageing time support
>>>>>      kernel: backport MT7530 VLAN fix
>>>>>      kernel: backport MT7530 MDB operations
>>>>>      kernel: backport MediaTek Ethernet PHY driver
>>>>>      kernel: backport MT7530 IRQ support
>>>>>
>>>> Hi,
>>>>
>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>
>>>> I am getting these errors:
>>> Note the commentary in
>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
>>>
>>> The message in dmesg is harmless. It just says the functionality in
>>> this patch needs dts bindings, which were only provided for ramips.
>>
>> The following error messages are a bigger problem:
>> --------
>> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
>> connect to PHY: -EINVAL
> 
> Try removing the PHY_INTERFACE_MODE_INTERNAL check in mt7531_phy_config_init,
> the only place that returns -EINVAL.

Hi,

When I remove this check it works for me:
-------------------
[    1.257277] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver 
registered
[    1.300344] mt7530 mdio-bus:00: no interrupt support
[    1.321463] mt7530 mdio-bus:00 lan1 (uninitialized): PHY 
[mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[    1.341285] mt7530 mdio-bus:00 lan2 (uninitialized): PHY 
[mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[    1.361106] mt7530 mdio-bus:00 lan3 (uninitialized): PHY 
[mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[    1.380935] mt7530 mdio-bus:00 lan4 (uninitialized): PHY 
[mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[    1.400947] mt7530 mdio-bus:00 wan (uninitialized): PHY [mt7530-0:04] 
driver [MediaTek MT7531 PHY] (irq=POLL)
[    1.412626] mt7530 mdio-bus:00: configuring for fixed/2500base-x link 
mode
[    1.419713] DSA: tree 0 setup
[    1.419879] mt7530 mdio-bus:00: Link is Up - 2.5Gbps/Full - flow 
control rx/tx
------------------------

I already pushed the revert for these two patches already.
Could you send a new patches and test them also on other platforms please.

Hauke
Qingfang Deng Feb. 5, 2022, 7 p.m. UTC | #8
On Sun, Feb 6, 2022 at 2:43 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>
> Hi,
>
> When I remove this check it works for me:

If you change the check to PHY_INTERFACE_MODE_NA, does it still work?

> -------------------
> [    1.257277] mtk_hsdma 1b007000.dma-controller: MediaTek HSDMA driver
> registered
> [    1.300344] mt7530 mdio-bus:00: no interrupt support
> [    1.321463] mt7530 mdio-bus:00 lan1 (uninitialized): PHY
> [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
> [    1.341285] mt7530 mdio-bus:00 lan2 (uninitialized): PHY
> [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
> [    1.361106] mt7530 mdio-bus:00 lan3 (uninitialized): PHY
> [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
> [    1.380935] mt7530 mdio-bus:00 lan4 (uninitialized): PHY
> [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
> [    1.400947] mt7530 mdio-bus:00 wan (uninitialized): PHY [mt7530-0:04]
> driver [MediaTek MT7531 PHY] (irq=POLL)
> [    1.412626] mt7530 mdio-bus:00: configuring for fixed/2500base-x link
> mode
> [    1.419713] DSA: tree 0 setup
> [    1.419879] mt7530 mdio-bus:00: Link is Up - 2.5Gbps/Full - flow
> control rx/tx
> ------------------------
>
> I already pushed the revert for these two patches already.
> Could you send a new patches and test them also on other platforms please.
>
> Hauke
Hauke Mehrtens Feb. 5, 2022, 9:08 p.m. UTC | #9
On 2/5/22 20:00, DENG Qingfang wrote:
> On Sun, Feb 6, 2022 at 2:43 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>
>> Hi,
>>
>> When I remove this check it works for me:
> 
> If you change the check to PHY_INTERFACE_MODE_NA, does it still work?
> 
It is set to PHY_INTERFACE_MODE_GMII by default on this board.
If I change the check to != PHY_INTERFACE_MODE_GMII it works.

The phy-mode is not defined in this device tree file and also missing in 
some others. I would suggest to make this a warning and also update the 
device tree files using this switch to phy-mode = "internal".

Hauke
Arınç ÜNAL Feb. 5, 2022, 9:15 p.m. UTC | #10
On 05/02/2022 21:30, Rosen Penev wrote:
> On Sat, Feb 5, 2022 at 10:23 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>
>> On 2/5/22 19:21, Rosen Penev wrote:
>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>>
>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>> Hi,
>>>>>
>>>>> This series backports some patches from upstream to address the current
>>>>> MT7530 DSA driver's problems.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> DENG Qingfang (6):
>>>>>      kernel: backport MediaTek jumbo frame support
>>>>>      kernel: backport MT7530 ageing time support
>>>>>      kernel: backport MT7530 VLAN fix
>>>>>      kernel: backport MT7530 MDB operations
>>>>>      kernel: backport MediaTek Ethernet PHY driver
>>>>>      kernel: backport MT7530 IRQ support
>>>>>
>>>> Hi,
>>>>
>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>
>>>> I am getting these errors:
>>> Note the commentary in
>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
>>>
>>> The message in dmesg is harmless. It just says the functionality in
>>> this patch needs dts bindings, which were only provided for ramips.
>>
>> The following error messages are a bigger problem:
>> --------
>> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
>> connect to PHY: -EINVAL
>> [    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22
>> setting up PHY for tree 0, switch 0, port 0
>> ---------
>>
>> The LAN ports are not registered and then LAN is not working at all.
> I think the PHY driver was written for mt7530. The e8450 uses mt7531 AFAIK.

No, the Mediatek GE PHY driver supports both mt7530 and mt7531 switch 
PHYs. Linksys E8450 has an MT7622B chip which seems to have a built-in 
MT7531 switch.

Arınç
Arınç ÜNAL Feb. 5, 2022, 9:15 p.m. UTC | #11
On 05/02/2022 21:23, Hauke Mehrtens wrote:
> On 2/5/22 19:21, Rosen Penev wrote:
>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>
>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>> Hi,
>>>>
>>>> This series backports some patches from upstream to address the current
>>>> MT7530 DSA driver's problems.
>>>>
>>>> Thanks.
>>>>
>>>> DENG Qingfang (6):
>>>>     kernel: backport MediaTek jumbo frame support
>>>>     kernel: backport MT7530 ageing time support
>>>>     kernel: backport MT7530 VLAN fix
>>>>     kernel: backport MT7530 MDB operations
>>>>     kernel: backport MediaTek Ethernet PHY driver
>>>>     kernel: backport MT7530 IRQ support
>>>>
>>> Hi,
>>>
>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>
>>> I am getting these errors:
>> Note the commentary in
>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6 
>>
>>
>> The message in dmesg is harmless. It just says the functionality in
>> this patch needs dts bindings, which were only provided for ramips.
> 
> The following error messages are a bigger problem:

There was nothing wrong with that commit to revert it. But you could've 
reverted the series as a whole since, technically, this patch series 
broke the process so I guess it's better than nothing.

I wonder if the PHY driver even works at its current state on upstream 
for mt7531 or, more specifically, the built-in mt7531 on the MT7622X chips.

Arınç
Hauke Mehrtens Feb. 5, 2022, 9:43 p.m. UTC | #12
On 2/5/22 22:15, Arınç ÜNAL wrote:
> On 05/02/2022 21:23, Hauke Mehrtens wrote:
>> On 2/5/22 19:21, Rosen Penev wrote:
>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>>
>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>> Hi,
>>>>>
>>>>> This series backports some patches from upstream to address the 
>>>>> current
>>>>> MT7530 DSA driver's problems.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> DENG Qingfang (6):
>>>>>     kernel: backport MediaTek jumbo frame support
>>>>>     kernel: backport MT7530 ageing time support
>>>>>     kernel: backport MT7530 VLAN fix
>>>>>     kernel: backport MT7530 MDB operations
>>>>>     kernel: backport MediaTek Ethernet PHY driver
>>>>>     kernel: backport MT7530 IRQ support
>>>>>
>>>> Hi,
>>>>
>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>
>>>> I am getting these errors:
>>> Note the commentary in
>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6 
>>>
>>>
>>> The message in dmesg is harmless. It just says the functionality in
>>> this patch needs dts bindings, which were only provided for ramips.
>>
>> The following error messages are a bigger problem:
> 
> There was nothing wrong with that commit to revert it. But you could've 
> reverted the series as a whole since, technically, this patch series 
> broke the process so I guess it's better than nothing.

Ethernet was not working at all on my device. I did not want to debug 
this, but revert the braking changes in master.

> I wonder if the PHY driver even works at its current state on upstream 
> for mt7531 or, more specifically, the built-in mt7531 on the MT7622X chips.

The PHY driver expects that the correct PHY mode is configured, but we 
do not specify any phy-mode in the dts for this device and probably also 
others.

Hauke
Arınç ÜNAL Feb. 5, 2022, 10:26 p.m. UTC | #13
On 06/02/2022 00:43, Hauke Mehrtens wrote:
> On 2/5/22 22:15, Arınç ÜNAL wrote:
>> On 05/02/2022 21:23, Hauke Mehrtens wrote:
>>> On 2/5/22 19:21, Rosen Penev wrote:
>>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> 
>>>> wrote:
>>>>>
>>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> This series backports some patches from upstream to address the 
>>>>>> current
>>>>>> MT7530 DSA driver's problems.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> DENG Qingfang (6):
>>>>>>     kernel: backport MediaTek jumbo frame support
>>>>>>     kernel: backport MT7530 ageing time support
>>>>>>     kernel: backport MT7530 VLAN fix
>>>>>>     kernel: backport MT7530 MDB operations
>>>>>>     kernel: backport MediaTek Ethernet PHY driver
>>>>>>     kernel: backport MT7530 IRQ support
>>>>>>
>>>>> Hi,
>>>>>
>>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>>
>>>>> I am getting these errors:
>>>> Note the commentary in
>>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6 
>>>>
>>>>
>>>> The message in dmesg is harmless. It just says the functionality in
>>>> this patch needs dts bindings, which were only provided for ramips.
>>>
>>> The following error messages are a bigger problem:
>>
>> There was nothing wrong with that commit to revert it. But you 
>> could've reverted the series as a whole since, technically, this patch 
>> series broke the process so I guess it's better than nothing.
> 
> Ethernet was not working at all on my device. I did not want to debug 
> this, but revert the braking changes in master.
> 
>> I wonder if the PHY driver even works at its current state on upstream 
>> for mt7531 or, more specifically, the built-in mt7531 on the MT7622X 
>> chips.
> 
> The PHY driver expects that the correct PHY mode is configured, but we 
> do not specify any phy-mode in the dts for this device and probably also 
> others.

Hmm, it seems to do that only for mt7531. That must be why mt7530 on our 
mt7621a works fine. I wonder why this check is there for mt7531 but not 
mt7530.

Arınç
Arınç ÜNAL Feb. 6, 2022, 8:43 a.m. UTC | #14
On 06/02/2022 00:15, Arınç ÜNAL wrote:
> On 05/02/2022 21:30, Rosen Penev wrote:
>> On Sat, Feb 5, 2022 at 10:23 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>
>>> On 2/5/22 19:21, Rosen Penev wrote:
>>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> 
>>>> wrote:
>>>>>
>>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> This series backports some patches from upstream to address the 
>>>>>> current
>>>>>> MT7530 DSA driver's problems.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> DENG Qingfang (6):
>>>>>>      kernel: backport MediaTek jumbo frame support
>>>>>>      kernel: backport MT7530 ageing time support
>>>>>>      kernel: backport MT7530 VLAN fix
>>>>>>      kernel: backport MT7530 MDB operations
>>>>>>      kernel: backport MediaTek Ethernet PHY driver
>>>>>>      kernel: backport MT7530 IRQ support
>>>>>>
>>>>> Hi,
>>>>>
>>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>>
>>>>> I am getting these errors:
>>>> Note the commentary in
>>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6 
>>>>
>>>>
>>>> The message in dmesg is harmless. It just says the functionality in
>>>> this patch needs dts bindings, which were only provided for ramips.
>>>
>>> The following error messages are a bigger problem:
>>> --------
>>> [    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to
>>> connect to PHY: -EINVAL
>>> [    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22
>>> setting up PHY for tree 0, switch 0, port 0
>>> ---------
>>>
>>> The LAN ports are not registered and then LAN is not working at all.
>> I think the PHY driver was written for mt7530. The e8450 uses mt7531 
>> AFAIK.
> 
> No, the Mediatek GE PHY driver supports both mt7530 and mt7531 switch 
> PHYs. Linksys E8450 has an MT7622B chip which seems to have a built-in 
> MT7531 switch.

Correction:
MT7622X chips do not have a built-in mt7531 switch, there's a Fast 
Ethernet switch which is different. Linksys put an external mt7531 chip 
on the board for their E8450.

Arınç
Arınç ÜNAL Feb. 6, 2022, 8:51 a.m. UTC | #15
On 06/02/2022 00:15, Arınç ÜNAL wrote:
> On 05/02/2022 21:23, Hauke Mehrtens wrote:
>> On 2/5/22 19:21, Rosen Penev wrote:
>>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>>
>>>> On 2/3/22 13:06, DENG Qingfang wrote:
>>>>> Hi,
>>>>>
>>>>> This series backports some patches from upstream to address the 
>>>>> current
>>>>> MT7530 DSA driver's problems.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> DENG Qingfang (6):
>>>>>     kernel: backport MediaTek jumbo frame support
>>>>>     kernel: backport MT7530 ageing time support
>>>>>     kernel: backport MT7530 VLAN fix
>>>>>     kernel: backport MT7530 MDB operations
>>>>>     kernel: backport MediaTek Ethernet PHY driver
>>>>>     kernel: backport MT7530 IRQ support
>>>>>
>>>> Hi,
>>>>
>>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
>>>>
>>>> I am getting these errors:
>>> Note the commentary in
>>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6 
>>>
>>>
>>> The message in dmesg is harmless. It just says the functionality in
>>> this patch needs dts bindings, which were only provided for ramips.
>>
>> The following error messages are a bigger problem:
> 
> There was nothing wrong with that commit to revert it. But you could've 
> reverted the series as a whole since, technically, this patch series 
> broke the process so I guess it's better than nothing.
> 
> I wonder if the PHY driver even works at its current state on upstream 
> for mt7531 or, more specifically, the built-in mt7531 on the MT7622X chips.

Correction:
MT7622X chips do not have a built-in mt7531 switch, there's a Fast 
Ethernet switch which is different.

Arınç
Kristian Evensen Feb. 6, 2022, 12:26 p.m. UTC | #16
Hi,

On Sun, Feb 6, 2022 at 9:52 AM Arınç ÜNAL <arinc.unal@arinc9.com> wrote:
>
> On 06/02/2022 00:15, Arınç ÜNAL wrote:
> > On 05/02/2022 21:23, Hauke Mehrtens wrote:
> >> On 2/5/22 19:21, Rosen Penev wrote:
> >>> On Sat, Feb 5, 2022 at 10:12 AM Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >>>>
> >>>> On 2/3/22 13:06, DENG Qingfang wrote:
> >>>>> Hi,
> >>>>>
> >>>>> This series backports some patches from upstream to address the
> >>>>> current
> >>>>> MT7530 DSA driver's problems.
> >>>>>
> >>>>> Thanks.
> >>>>>
> >>>>> DENG Qingfang (6):
> >>>>>     kernel: backport MediaTek jumbo frame support
> >>>>>     kernel: backport MT7530 ageing time support
> >>>>>     kernel: backport MT7530 VLAN fix
> >>>>>     kernel: backport MT7530 MDB operations
> >>>>>     kernel: backport MediaTek Ethernet PHY driver
> >>>>>     kernel: backport MT7530 IRQ support
> >>>>>
> >>>> Hi,
> >>>>
> >>>> The last two patches are breaking the Linksys e8450 (mt7622) for me.
> >>>>
> >>>> I am getting these errors:
> >>> Note the commentary in
> >>> https://github.com/openwrt/openwrt/commit/3f4301e123f29348b4ad87578d62b7d1f5f210c6
> >>>
> >>>
> >>> The message in dmesg is harmless. It just says the functionality in
> >>> this patch needs dts bindings, which were only provided for ramips.
> >>
> >> The following error messages are a bigger problem:
> >
> > There was nothing wrong with that commit to revert it. But you could've
> > reverted the series as a whole since, technically, this patch series
> > broke the process so I guess it's better than nothing.
> >
> > I wonder if the PHY driver even works at its current state on upstream
> > for mt7531 or, more specifically, the built-in mt7531 on the MT7622X chips.
>
> Correction:
> MT7622X chips do not have a built-in mt7531 switch, there's a Fast
> Ethernet switch which is different.

When I applied the patches, I experienced the same issue as Hauke on a
custom mt7622 board (but with same switch setup). My "fix" was to add
the following to the mt7622 kernel-config to disable the PHY driver (I
have never experienced any of the issues reported on mt7621 without
the PHY driver):

# CONFIG_MEDIATEK_GE_PHY is not set

Otherwise, the patches included in this series turned out to be the
missing pieces of my performance analysis puzzle. My ISP gives a
non-standard (< 1500) MTU, so without the possibility to change MTU I
experienced fragmentation, etc.

Kristian