[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220426074600.p3za7apdxxvjbq3z@h-e2.ddg>
Date: Tue, 26 Apr 2022 10:46:00 +0300
From: Ivan Bornyakov <i.bornyakov@...rotek.ru>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, system@...rotek.ru
Subject: Re: [PATCH net-next RESEND] net: phy: marvell-88x2222: set proper
phydev->port
On Mon, Apr 25, 2022 at 10:33:06PM +0100, Russell King (Oracle) wrote:
> On Mon, Apr 25, 2022 at 07:16:37AM +0300, Ivan Bornyakov wrote:
> > 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@...rotek.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;
>
> Can this PHY be used in dual-media mode, auto-switching between copper
> and fibre?
I believe, it can not.
> If so, is PORT_OTHER actually appropriate here, or should
> the old value be saved when the module is inserted and restored when
> it's removed?
Would PORT_NONE be appropriate? Saving old value would be ok also.
Powered by blists - more mailing lists