2023-01-16 13:08:35

by Michael Walle

[permalink] [raw]
Subject: [PATCH net-next 5/6] net: phy: Decide on C45 capabilities based on presence of method

From: Andrew Lunn <[email protected]>

Some PHYs provide invalid IDs in C22 space. If C45 is supported on the
bus an attempt can be made to get the IDs from the C45 space. Decide
on this based on the presence of the C45 read method in the bus
structure. This will allow the unreliable probe_capabilities to be
removed.

Signed-off-by: Andrew Lunn <[email protected]>
Signed-off-by: Michael Walle <[email protected]>
---
drivers/net/phy/phy_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0d371a0a49f2..9ba8f973f26f 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -946,7 +946,7 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45)
* probe with C45 to see if we're able to get a valid PHY ID in the C45
* space, if successful, create the C45 PHY device.
*/
- if (!is_c45 && phy_id == 0 && bus->probe_capabilities >= MDIOBUS_C45) {
+ if (!is_c45 && phy_id == 0 && bus->read_c45) {
r = get_phy_c45_ids(bus, addr, &c45_ids);
if (!r)
return phy_device_create(bus, addr, phy_id,

--
2.30.2


2023-01-18 01:55:02

by Jesse Brandeburg

[permalink] [raw]
Subject: Re: [PATCH net-next 5/6] net: phy: Decide on C45 capabilities based on presence of method

On 1/16/2023 4:55 AM, Michael Walle wrote:
> From: Andrew Lunn <[email protected]>
>
> Some PHYs provide invalid IDs in C22 space. If C45 is supported on the
> bus an attempt can be made to get the IDs from the C45 space. Decide
> on this based on the presence of the C45 read method in the bus
> structure. This will allow the unreliable probe_capabilities to be
> removed.
>
> Signed-off-by: Andrew Lunn <[email protected]>
> Signed-off-by: Michael Walle <[email protected]>

Reviewed-by: Jesse Brandeburg <[email protected]>