[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60551ce1-80f5-49e1-9e1d-81c71ab2e11e@lunn.ch>
Date: Sat, 25 Nov 2023 18:18:14 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Jakub Kicinski <kuba@...nel.org>,
Marek BehĂșn <kabel@...nel.org>,
netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 10/10] net: phylink: use the PHY's
possible_interfaces if populated
On Fri, Nov 24, 2023 at 12:28:39PM +0000, Russell King (Oracle) wrote:
> Some PHYs such as Aquantia, Broadcom 84881, and Marvell 88X33x0 can
> switch between a set of interface types depending on the negotiated
> media speed, or can use rate adaption for some or all of these
> interface types.
>
> We currently assume that these are Clause 45 PHYs that are configured
> not to use a specific set of interface modes, which has worked so far,
> but is just a work-around. In this workaround, we validate using all
> interfaces that the MAC supports, which can lead to extra modes being
> advertised that can not be supported.
>
> To properly address this, switch to using the newly introduced PHY
> possible_interfaces bitmap which indicates which interface modes will
> be used by the PHY as configured. We calculate the union of the PHY's
> possible interfaces and MACs supported interfaces, checking that is
> non-empty. If the PHY is on a SFP, we further reduce the set by those
> which can be used on a SFP module, again checking that is non-empty.
> Finally, we validate the subset of interfaces, taking account of
> whether rate matching will be used for each individual interface mode.
>
> This becomes independent of whether the PHY is clause 22 or clause 45.
>
> It is encouraged that all PHYs that switch interface modes or use
> rate matching should populate phydev->possible_interfaces.
>
> Tested-by: Luo Jie <quic_luoj@...cinc.com>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists