linux-stable/drivers/net
Arınç ÜNAL d564809f27 net: dsa: mt7530: fix enabling EEE on MT7531 switch on all boards
commit 06dfcd4098 upstream.

The commit 40b5d2f15c ("net: dsa: mt7530: Add support for EEE features")
brought EEE support but did not enable EEE on MT7531 switch MACs. EEE is
enabled on MT7531 switch MACs by pulling the LAN2LED0 pin low on the board
(bootstrapping), unsetting the EEE_DIS bit on the trap register, or setting
the internal EEE switch bit on the CORE_PLL_GROUP4 register. Thanks to
SkyLake Huang (黃啟澤) from MediaTek for providing information on the
internal EEE switch bit.

There are existing boards that were not designed to pull the pin low.
Because of that, the EEE status currently depends on the board design.

The EEE_DIS bit on the trap pertains to the LAN2LED0 pin which is usually
used to control an LED. Once the bit is unset, the pin will be low. That
will make the active low LED turn on. The pin is controlled by the switch
PHY. It seems that the PHY controls the pin in the way that it inverts the
pin state. That means depending on the wiring of the LED connected to
LAN2LED0 on the board, the LED may be on without an active link.

To not cause this unwanted behaviour whilst enabling EEE on all boards, set
the internal EEE switch bit on the CORE_PLL_GROUP4 register.

My testing on MT7531 shows a certain amount of traffic loss when EEE is
enabled. That said, I haven't come across a board that enables EEE. So
enable EEE on the switch MACs but disable EEE advertisement on the switch
PHYs. This way, we don't change the behaviour of the majority of the boards
that have this switch. The mediatek-ge PHY driver already disables EEE
advertisement on the switch PHYs but my testing shows that it is somehow
enabled afterwards. Disabling EEE advertisement before the PHY driver
initialises keeps it off.

With this change, EEE can now be enabled using ethtool.

Fixes: 40b5d2f15c ("net: dsa: mt7530: Add support for EEE features")
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/20240408-for-net-mt7530-fix-eee-for-mt7531-mt7988-v3-1-84fdef1f008b@arinc9.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-27 17:05:29 +02:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:36:35 +01:00
bonding bonding: remove print in bond_verify_device_path 2024-02-23 08:54:55 +01:00
caif
can
dsa net: dsa: mt7530: fix enabling EEE on MT7531 switch on all boards 2024-04-27 17:05:29 +02:00
ethernet net: ethernet: ti: am65-cpsw-nuss: cleanup DMA Channels before using them 2024-04-27 17:05:25 +02:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-02-23 08:54:30 +01:00
hamradio
hippi
hyperv hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed 2024-03-15 10:48:21 -04:00
ieee802154
ipa
ipvlan
mctp
mdio
netdevsim
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:01:43 +02:00
phy net: phy: fix phy_read_poll_timeout argument type in genphy_loopback 2024-03-26 18:21:36 -04:00
plip
ppp ppp_async: limit MRU to 64K 2024-02-23 08:54:58 +01:00
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 15:17:41 +01:00
usb drivers: net: convert to boolean for the mac_managed_pm flag 2024-04-10 16:19:40 +02:00
vmxnet3
vxlan
wan
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-10 16:18:43 +02:00
wireless wifi: ath11k: decrease MHI channel buffer length to 8KB 2024-04-13 13:01:43 +02:00
wwan
xen-netback xen-netback: properly sync TX responses 2024-02-23 08:55:05 +01:00
bareudp.c
dummy.c
eql.c
geneve.c geneve: fix header validation in geneve[6]_xmit_skb 2024-04-17 11:15:14 +02:00
gtp.c gtp: fix use-after-free and null-ptr-deref in gtp_newlink() 2024-03-06 14:38:48 +00:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: limit printing rate when illegal packet received by tun dev 2024-04-27 17:05:24 +02:00
veth.c net: veth: do not manipulate GRO when using XDP 2024-03-26 18:21:35 -04:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-02-23 08:54:51 +01:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:19:37 +02:00