From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH net-next v2 3/5] net: phylink: allow mac_select_pcs() to remove a PCS
Date: Wed, 16 Oct 2024 10:58:34 +0100 [thread overview]
Message-ID: <E1t10na-000AWc-M6@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <Zw-OCSv7SldjB7iU@shell.armlinux.org.uk>
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(-)
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);
--
2.30.2
next prev parent reply other threads:[~2024-10-16 9:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 9:57 [PATCH net-next v2 0/5] Removing more phylink cruft Russell King (Oracle)
2024-10-16 9:58 ` [PATCH net-next v2 1/5] net: dsa: remove dsa_port_phylink_mac_select_pcs() Russell King (Oracle)
2024-10-16 9:58 ` [PATCH net-next v2 2/5] net: dsa: mv88e6xxx: return NULL when no PCS is present Russell King (Oracle)
2024-10-16 9:58 ` Russell King (Oracle) [this message]
2024-10-17 7:00 ` [PATCH net-next v2 3/5] net: phylink: allow mac_select_pcs() to remove a PCS Vladimir Oltean
2024-10-16 9:58 ` [PATCH net-next v2 4/5] net: phylink: remove use of pl->pcs in phylink_validate_mac_and_pcs() Russell King (Oracle)
2024-10-17 7:01 ` Vladimir Oltean
2024-10-16 9:58 ` [PATCH net-next v2 5/5] net: phylink: remove "using_mac_select_pcs" Russell King (Oracle)
2024-10-17 7:06 ` Vladimir Oltean
2024-10-16 14:42 ` [PATCH net-next v2 0/5] Removing more phylink cruft Maxime Chevallier
2024-10-18 2: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=E1t10na-000AWc-M6@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/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).