immortalwrt/target/linux/generic/pending-6.6/720-09-net-phy-realtek-disable-MDIO-broadcast.patch
Álvaro Fernández Rojas 1eab9b8a9b generic: 6.6: backport upstream v6.15 Realtek PHY patches
bfc17c1658353 net: phy: realtek: disable PHY-mode EEE
fabcfd6d10999 net: phy: realtek: add defines for shadowed c45 standard registers
8af2136e77989 net: phy: realtek: add helper RTL822X_VND2_C22_REG
02d3b306ac2f0 net: phy: realtek: switch from paged to MMD ops in rtl822x functions
da681ed73fb98 net: phy: realtek: improve mmd register access for internal PHY's
0bea93fdbaf86 net: phy: realtek: use string choices helpers
51773846fab24 net: phy: realtek: make HWMON support a user-visible Kconfig symbol

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 7673a165a955269773eb604d3678d86d0bb7f49c)
2025-04-23 08:38:32 +02:00

28 lines
1.0 KiB
Diff

From: Daniel Golle <daniel@makrotopia.org>
Date: Thu, 30 Jan 2025 05:38:31 +0000
Subject: [PATCH] net: phy: realtek: disable MDIO broadcast
RealTek's PHYs by default also listen on MDIO address 0 which is defined
as broadcast address. This can lead to problems if there is an actual PHY
(such as MT7981 built-in PHY) present at this address, as accessing that
PHY may then confuse the RealTek PHY.
Disabled listening on the MDIO broadcast address to avoid such problems.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -852,6 +852,11 @@ static int rtl822xb_config_init(struct p
phydev->host_interfaces) ||
phydev->interface == PHY_INTERFACE_MODE_SGMII;
+ /* disable listening on MDIO broadcast address (0) */
+ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, 0xa430, BIT(13));
+ if (ret < 0)
+ return ret;
+
/* fill in possible interfaces */
__assign_bit(PHY_INTERFACE_MODE_2500BASEX, phydev->possible_interfaces,
has_2500);