700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  2. Date: Sun, 7 Nov 2021 14:20:40 +0100
  3. Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. Recent bgmac change was meant to just fix a race between "Generic PHY"
  8. and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use
  9. phy_connect() only if there is a real PHY device connected.
  10. That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a
  11. fixed PHY with the bgmac_phy_connect_direct(). That fails as another
  12. fixed PHY (also using address 0) is already registered - by bcm47xx arch
  13. code bcm47xx_register_bus_complete().
  14. This change brings origial behaviour. It connects Ethernet interface
  15. with pseudo-PHY (switch device) and adjusts Ethernet interface link to
  16. match connected switch.
  17. This fixes:
  18. [ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device
  19. [ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy
  20. Fixes: b5375509184d ("net: bgmac: improve handling PHY")
  21. Link: https://lore.kernel.org/netdev/[email protected]/T/#u
  22. Signed-off-by: Rafał Miłecki <[email protected]>
  23. ---
  24. drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +-
  25. 1 file changed, 1 insertion(+), 1 deletion(-)
  26. --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
  27. +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
  28. @@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac
  29. return 0;
  30. /* Connect to the PHY */
  31. - if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) {
  32. + if (bgmac->mii_bus) {
  33. snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id,
  34. bgmac->phyaddr);
  35. phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link,