[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8l8NRmFfm/a8LFv@shell.armlinux.org.uk>
Date: Thu, 19 Jan 2023 17:21:57 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Bjørn Mork <bjorn@...k.no>
Cc: netdev@...r.kernel.org, Felix Fietkau <nbd@....name>,
John Crispin <john@...ozen.org>,
Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Daniel Golle <daniel@...rotopia.org>,
Alexander Couzens <lynxis@...0.eu>
Subject: Re: [PATCH net 2/3] net: mediatek: sgmii: autonegotiation is required
On Thu, Jan 19, 2023 at 06:12:47PM +0100, Bjørn Mork wrote:
> sgmii mode fails if autonegotiation is disabled.
>
> Signed-off-by: Bjørn Mork <bjorn@...k.no>
> ---
> drivers/net/ethernet/mediatek/mtk_sgmii.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_sgmii.c b/drivers/net/ethernet/mediatek/mtk_sgmii.c
> index 481f2f1e39f5..d1f2bcb21242 100644
> --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
> +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
> @@ -62,14 +62,9 @@ static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
> * other words, 1000Mbps or 2500Mbps).
> */
> if (interface == PHY_INTERFACE_MODE_SGMII) {
> - sgm_mode = SGMII_IF_MODE_SGMII;
> - if (phylink_autoneg_inband(mode)) {
> - sgm_mode |= SGMII_REMOTE_FAULT_DIS |
> - SGMII_SPEED_DUPLEX_AN;
> - use_an = true;
> - } else {
> - use_an = false;
> - }
> + sgm_mode = SGMII_IF_MODE_SGMII | SGMII_REMOTE_FAULT_DIS |
> + SGMII_SPEED_DUPLEX_AN;
> + use_an = true;
I wasn't actually suggesting in our discussion that this is something
which should be changed.
The reference implementation for the expected behaviour is
phylink_mii_c22_pcs_config(), and it only enables in-band if "mode"
says so. If we have a PHY which has in-band disabled (yes, they do
exist) then having SGMII in-band unconditionally enabled breaks them,
and yes, those PHYs appear on SFP modules.
The proper answer is to use 'managed = "in-band-status";' in your DT
to have in-band used with SGMII.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists