Thread (24 messages) 24 messages, 5 authors, 2021-06-10

Re: [PATCH net-next v3 8/9] net: dsa: dsa_slave_phy_connect(): extend phy's flags with port specific phy flags

flat view

From: Oleksij Rempel <o.rempel@pengutronix.de>
Date: 2021-06-10 10:04:20
Also in: lkml

On Wed, May 26, 2021 at 04:08:11PM +0100, Russell King (Oracle) wrote:
On Wed, May 26, 2021 at 06:30:36AM +0200, Oleksij Rempel wrote:
quoted
This patch extends the flags of the phy that's being connected with the
port specific flags of the switch port.

This is needed to handle a port specific erratum of the KSZ8873 switch,
which is added in a later patch.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/phy/phylink.c | 2 +-
 net/dsa/slave.c           | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 96d8e88b4e46..167c2277814f 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1029,7 +1029,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,
 	if (pl->phydev)
 		return -EBUSY;
 
-	return phy_attach_direct(pl->netdev, phy, 0, interface);
+	return phy_attach_direct(pl->netdev, phy, phy->dev_flags, interface);
I don't think this has any benefit. phy_attach_direct() does this
internally:

        phydev->dev_flags |= flags;

which means the above change is effectively doing:

        phydev->dev_flags |= phydev->dev_flags;

So, are you sure you need this?
Ah, good point. Back for two years, phy_attach_direct() was doing
	phydev->dev_flags = flags;

I didn't noticed this change.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help