From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Ivan Bornyakov <i.bornyakov@metrotek.ru>
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: Mon, 25 Apr 2022 22:33:06 +0100 [thread overview]
Message-ID: <YmcTkkNcDrtdcGTM@shell.armlinux.org.uk> (raw)
In-Reply-To: <20220425041637.5946-1-i.bornyakov@metrotek.ru>
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? 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?
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2022-04-25 22:21 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) [this message]
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
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=YmcTkkNcDrtdcGTM@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=i.bornyakov@metrotek.ru \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).