All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Bornyakov <i.bornyakov@metrotek.ru>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	system@metrotek.ru
Subject: Re: [PATCH net-next RESEND] net: phy: marvell-88x2222: set proper phydev->port
Date: Tue, 26 Apr 2022 10:46:00 +0300	[thread overview]
Message-ID: <20220426074600.p3za7apdxxvjbq3z@h-e2.ddg> (raw)
In-Reply-To: <YmcTkkNcDrtdcGTM@shell.armlinux.org.uk>

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@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;
> 
> 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.


  reply	other threads:[~2022-04-26  7:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-06-12 18:19 ` [PATCH v2 net-next] " Ivan Bornyakov
2022-06-15  8:30   ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220426074600.p3za7apdxxvjbq3z@h-e2.ddg \
    --to=i.bornyakov@metrotek.ru \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=system@metrotek.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.