Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-enetc-fix-fallback-phy-address-handling-and-do-not-skip-setting-for-addr-0'

Wei Fang says:

====================
net: enetc: fix fallback PHY address handling and do not skip setting for addr 0

There are two potential issues when PHY address 0 is used on the board,
see the commit messages of the patches for more details.

v1: https://lore.kernel.org/imx/20260303103047.228005-1-wei.fang@nxp.com/
====================

Link: https://patch.msgid.link/20260305031211.904812-1-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+10 -14
+10 -14
drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c
··· 333 333 334 334 mdio_node = of_get_child_by_name(np, "mdio"); 335 335 if (!mdio_node) 336 - return 0; 336 + return -ENODEV; 337 337 338 338 phy_node = of_get_next_child(mdio_node, NULL); 339 - if (!phy_node) 339 + if (!phy_node) { 340 + err = -ENODEV; 340 341 goto of_put_mdio_node; 342 + } 341 343 342 344 err = of_property_read_u32(phy_node, "reg", &addr); 343 345 if (err) ··· 425 423 426 424 addr = netc_get_phy_addr(gchild); 427 425 if (addr < 0) { 426 + if (addr == -ENODEV) 427 + continue; 428 + 428 429 dev_err(dev, "Failed to get PHY address\n"); 429 430 return addr; 430 431 } ··· 437 432 "Find same PHY address in EMDIO and ENETC node\n"); 438 433 return -EINVAL; 439 434 } 440 - 441 - /* The default value of LaBCR[MDIO_PHYAD_PRTAD ] is 442 - * 0, so no need to set the register. 443 - */ 444 - if (!addr) 445 - continue; 446 435 447 436 switch (bus_devfn) { 448 437 case IMX95_ENETC0_BUS_DEVFN: ··· 577 578 578 579 addr = netc_get_phy_addr(np); 579 580 if (addr < 0) { 581 + if (addr == -ENODEV) 582 + return 0; 583 + 580 584 dev_err(dev, "Failed to get PHY address\n"); 581 585 return addr; 582 586 } 583 - 584 - /* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0, 585 - * so no need to set the register. 586 - */ 587 - if (!addr) 588 - return 0; 589 587 590 588 if (phy_mask & BIT(addr)) { 591 589 dev_err(dev,