net: phy: implement fallback mechanism for negative phy adresses
Subsystems (2)
PATCH v3 1/1 net: phy: implement fallback mechanism for negative phy adresses
Negative phy-addresses can occour if the caller function was not able to determine a valid phy address (from device-tree for example). In this case we catch this here and search for ANY phy device on the given mdio- bus.
---
Changes in v3:
- fix commit message
Changes in v2:
- cosmetic changes
drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/phy.c +2 -1
@@ -922,13 +922,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,#endif {struct phy_device *phydev =NULL ; +uint mask = (addr >0 ) ? (1 << addr) :0xffffffff ;#ifdef CONFIG_PHY_FIXED phydev =phy_connect_fixed (bus, dev, interface);#endif if (!phydev) - phydev =phy_find_by_mask (bus,1 << addr, interface); + phydev =phy_find_by_mask (bus, mask, interface);if (phydev)phy_connect_dev (phydev, dev);
Signature · 1 line
2.7.4
PATCH v3 1/1 net: phy: implement fallback mechanism for negative phy adresses
Quoted 29 lines · Hannes Schmelzer
Negative phy-addresses can occour if the caller function was not able to determine a valid phy address (from device-tree for example). In this case we catch this here and search for ANY phy device on the given mdio- bus.
Signed-off-by Hannes Schmelzer <[email protected]>---
Changes in v3:
- fix commit messageChanges in v2:
- cosmetic changesdrivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/phy/phy.c +1
-0@@ -922,13 +922,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,#endif {struct phy_device *phydev =NULL ; +uint mask = (addr >0 ) ? (1 << addr) :0xffffffff ;
drivers/net/phy/phy.c struct phy_device *phy_connect(struct mii_dev *bus, int addr, · line 935
Quoted 10 lines
drivers/net/phy/phy.c +1
-1#ifdef CONFIG_PHY_FIXED phydev =phy_connect_fixed (bus, dev, interface);#endif if (!phydev) - phydev =phy_find_by_mask (bus,1 << addr, interface); + phydev =phy_find_by_mask (bus, mask, interface);if (phydev)phy_connect_dev (phydev, dev);
Thanks,
Michal
PATCH v3 1/1 net: phy: implement fallback mechanism for negative phy adresses
In reply to Hannes SchmelzerHi Hannes,
Quoted 28 lines
Negative phy-addresses can occour if the caller function was not able to determine a valid phy address (from device-tree for example). In this case we catch this here and search for ANY phy device on the given mdio- bus.
Signed-off-by Hannes Schmelzer <[email protected]>---
Changes in v3:
- fix commit messageChanges in v2:
- cosmetic changesdrivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/phy/phy.c +1
-0@@ -922,13 +922,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, #endif {struct phy_device *phydev =NULL ; +uint mask = (addr >0 ) ? (1 << addr) :0xffffffff ;
drivers/net/phy/phy.c struct phy_device *phy_connect(struct mii_dev · line 935
Quoted 10 lines
drivers/net/phy/phy.c +1
-1#ifdef CONFIG_PHY_FIXED phydev =phy_connect_fixed (bus, dev, interface);#endif if (!phydev) - phydev =phy_find_by_mask (bus,1 << addr, interface); + phydev =phy_find_by_mask (bus, mask, interface);if (phydev)phy_connect_dev (phydev, dev);
Test HW: imx53 (HSC device).
Could this patch be applied to v2019.04, please ?
(So there is NO need to revert:
"drivers/net/fec: phy_init: remove redundant logic").
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190403/23325b8c/attachment.sig>
PATCH v3 1/1 net: phy: implement fallback mechanism for negative phy adresses
Hi Tom,
Quoted 44 lines
Hi Hannes,
Quoted 38 lines
Negative phy-addresses can occour if the caller function was not able to determine a valid phy address (from device-tree for example). In this case we catch this here and search for ANY phy device on the given mdio- bus.
Signed-off-by Hannes Schmelzer <[email protected]>---
Changes in v3:
- fix commit messageChanges in v2:
- cosmetic changesdrivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/phy/phy.c +2
-1@@ -922,13 +922,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, #endif {struct phy_device *phydev =NULL ; +uint mask = (addr >0 ) ? (1 << addr) :0xffffffff ;#ifdef CONFIG_PHY_FIXED phydev =phy_connect_fixed (bus, dev, interface);#endif if (!phydev) - phydev =phy_find_by_mask (bus,1 << addr, interface); + phydev =phy_find_by_mask (bus, mask, interface);if (phydev)Quoted 1 line
phy_connect_dev(phydev, dev);Tested-by Lukasz Majewski <[email protected]>
Quoted 7 lines
Test HW: imx53 (HSC device).
Could this patch be applied to v2019.04, please ?
(So there is NO need to revert:
"drivers/net/fec:phy_init: remove redundant logic").
Tom, do you plan to add thins commit to v2019.04 ?
Quoted 11 lines
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
lukma at denx.de
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190407/5f0f1117/attachment.sig>
PATCH v3 1/1 net: phy: implement fallback mechanism for negative phy adresses
In reply to Hannes SchmelzerQuoted 8 lines · Hannes Schmelzer
Negative phy-addresses can occour if the caller function was not able to determine a valid phy address (from device-tree for example). In this case we catch this here and search for ANY phy device on the given mdio- bus.
Signed-off-by Hannes Schmelzer <[email protected]>Tested-by Michal Simek <[email protected]>Tested-by Lukasz Majewski <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190408/3bb023ba/attachment.sig>