openwrt-mirror/target/linux/generic/pending-6.12/720-09-net-phy-realtek-disable-MDIO-broadcast.patch
Aleksander Jan Bajkowski 48c9e55094 kernel: backport upstream Realtek PHY patches
Backport of the latest upstream Realtek PHY patches. WoL uses
devm_pm_set_wake_irq(), so the patch that adds this function
has also been backported.

Changelog:
4465ae435ddc net: phy: realtek: create rtl8211f_config_phy_eee() helper
bb78b71faf60 net: phy: realtek: eliminate priv->phycr1 variable
e1a31c41bef6 net: phy: realtek: allow CLKOUT to be disabled on RTL8211F(D)(I)-VD-CG
910ac7bfb1af net: phy: realtek: eliminate has_phycr2 variable
27033d069177 net: phy: realtek: eliminate priv->phycr2 variable
8e982441ba60 net: phy: realtek: create rtl8211f_config_rgmii_delay()
b826bf795564 net: phy: realtek: fix RTL8211F wake-on-lan support

Tested on Netgear WAX206 with RTL8221B-VB-CG.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20987
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-30 19:39:50 +01: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
@@ -1260,6 +1260,11 @@ static int rtl822x_set_serdes_option_mod
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);