All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: marvell-88x2222: set proper phydev->port
@ 2022-04-05 15:03 Ivan Bornyakov
  2022-04-05 16:14 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ivan Bornyakov @ 2022-04-05 15:03 UTC (permalink / raw)
  Cc: andrew, hkallweit1, linux, davem, kuba, pabeni, netdev,
	linux-kernel, system, Ivan Bornyakov

phydev->port was not set and always reported as PORT_TP.
Set phydev->port according to inserted SFP module.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
---
 drivers/net/phy/marvell-88x2222.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/marvell-88x2222.c b/drivers/net/phy/marvell-88x2222.c
index ec4f1407a78c..9f971b37ec35 100644
--- a/drivers/net/phy/marvell-88x2222.c
+++ b/drivers/net/phy/marvell-88x2222.c
@@ -603,6 +603,7 @@ static int mv2222_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
 	dev = &phydev->mdio.dev;
 
 	sfp_parse_support(phydev->sfp_bus, id, sfp_supported);
+	phydev->port = sfp_parse_port(phydev->sfp_bus, id, sfp_supported);
 	sfp_interface = sfp_select_interface(phydev->sfp_bus, sfp_supported);
 
 	dev_info(dev, "%s SFP module inserted\n", phy_modes(sfp_interface));
@@ -639,6 +640,7 @@ static void mv2222_sfp_remove(void *upstream)
 
 	priv->line_interface = PHY_INTERFACE_MODE_NA;
 	linkmode_zero(priv->supported);
+	phydev->port = PORT_OTHER;
 }
 
 static void mv2222_sfp_link_up(void *upstream)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-15  8:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 15:03 [PATCH net] net: phy: marvell-88x2222: set proper phydev->port Ivan Bornyakov
2022-04-05 16:14 ` Andrew Lunn
2022-04-06  9:09   ` Ivan Bornyakov
2022-04-25  4:16 ` [PATCH net-next RESEND] " Ivan Bornyakov
2022-04-25 21:33   ` Russell King (Oracle)
2022-04-26  7:46     ` Ivan Bornyakov
2022-06-12 18:19 ` [PATCH v2 net-next] " Ivan Bornyakov
2022-06-15  8:30   ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.