diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2021-11-08 15:55:40 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2021-11-08 15:55:40 +0100 |
commit | 6cdac994012003065a7040ceba3186f80db3cdbe (patch) | |
tree | 24d0d0e1c53789192331ad12ad4b60a1c58d1237 /target | |
parent | 4cd97e4760899172a1d6339ea5644992775e504e (diff) | |
download | upstream-6cdac994012003065a7040ceba3186f80db3cdbe.tar.gz upstream-6cdac994012003065a7040ceba3186f80db3cdbe.tar.bz2 upstream-6cdac994012003065a7040ceba3186f80db3cdbe.zip |
bcm47xx: fix bgmac regression present in 5.10 kernel
This fixes:
[ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device
[ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy
and downstream (swconfig-based) b53 driver failing to load.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/bcm47xx/patches-5.10/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/bcm47xx/patches-5.10/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch b/target/linux/bcm47xx/patches-5.10/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch new file mode 100644 index 0000000000..2fcfbb7438 --- /dev/null +++ b/target/linux/bcm47xx/patches-5.10/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch @@ -0,0 +1,42 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> +Date: Sun, 7 Nov 2021 14:20:40 +0100 +Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recent bgmac change was meant to just fix a race between "Generic PHY" +and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use +phy_connect() only if there is a real PHY device connected. + +That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a +fixed PHY with the bgmac_phy_connect_direct(). That fails as another +fixed PHY (also using address 0) is already registered - by bcm47xx arch +code bcm47xx_register_bus_complete(). + +This change brings origial behaviour. It connects Ethernet interface +with pseudo-PHY (switch device) and adjusts Ethernet interface link to +match connected switch. + +This fixes: +[ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device +[ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy + +Fixes: b5375509184d ("net: bgmac: improve handling PHY") +Link: https://lore.kernel.org/netdev/3639116e-9292-03ca-b9d9-d741118a4541@gmail.com/T/#u +Signed-off-by: Rafał Miłecki <rafal@milecki.pl> +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac + return 0; + + /* Connect to the PHY */ +- if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) { ++ if (bgmac->mii_bus) { + snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id, + bgmac->phyaddr); + phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link, |