Message ID | E1t10na-000AWc-M6@rmk-PC.armlinux.org.uk (mailing list archive) |
---|---|
State | Accepted |
Commit | 486dc391ef439d45db3f7eda2229560fd2b52a78 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Removing more phylink cruft | expand |
On Wed, Oct 16, 2024 at 10:58:34AM +0100, Russell King (Oracle) wrote: > phylink has historically not permitted a PCS to be removed. An attempt > to permit this with phylink_set_pcs() resulted in comments indicating > that there was no need for this. This behaviour has been propagated > forward to the mac_select_pcs() approach as it was believed from these > comments that changing this would be NAK'd. > > However, with mac_select_pcs(), it takes more code and thus complexity > to maintain this behaviour, which can - and in this case has - resulted > in a bug. If mac_select_pcs() returns NULL for a particular interface > type, but there is already a PCS in-use, then we skip the pcs_validate() > method, but continue using the old PCS. Also, it wouldn't be expected > behaviour by implementers of mac_select_pcs(). > > Allow this by removing this old unnecessary restriction. > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 24a3144e870a..aa1139efc7e4 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1184,7 +1184,7 @@ static void phylink_major_config(struct phylink *pl, bool restart, return; } - pcs_changed = pcs && pl->pcs != pcs; + pcs_changed = pl->pcs != pcs; } phylink_pcs_poll_stop(pl);
phylink has historically not permitted a PCS to be removed. An attempt to permit this with phylink_set_pcs() resulted in comments indicating that there was no need for this. This behaviour has been propagated forward to the mac_select_pcs() approach as it was believed from these comments that changing this would be NAK'd. However, with mac_select_pcs(), it takes more code and thus complexity to maintain this behaviour, which can - and in this case has - resulted in a bug. If mac_select_pcs() returns NULL for a particular interface type, but there is already a PCS in-use, then we skip the pcs_validate() method, but continue using the old PCS. Also, it wouldn't be expected behaviour by implementers of mac_select_pcs(). Allow this by removing this old unnecessary restriction. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)