netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: [PATCH net-next 03/13] net: phylink: add debug for phylink_major_config()
Date: Tue, 03 Dec 2024 15:30:57 +0000	[thread overview]
Message-ID: <E1tIUrZ-006ITt-Fa@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <Z08kCwxdkU4n2V6x@shell.armlinux.org.uk>

Now that we have a more complexity in phylink_major_config(), augment
the debugging so we can see what's going on there.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 098021f1ab49..fda53dd58285 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -175,6 +175,24 @@ static const char *phylink_an_mode_str(unsigned int mode)
 	return mode < ARRAY_SIZE(modestr) ? modestr[mode] : "unknown";
 }
 
+static const char *phylink_pcs_mode_str(unsigned int mode)
+{
+	if (!mode)
+		return "none";
+
+	if (mode & PHYLINK_PCS_NEG_OUTBAND)
+		return "outband";
+
+	if (mode & PHYLINK_PCS_NEG_INBAND) {
+		if (mode & PHYLINK_PCS_NEG_ENABLED)
+			return "inband,an-enabled";
+		else
+			return "inband,an-disabled";
+	}
+
+	return "unknown";
+}
+
 static unsigned int phylink_interface_signal_rate(phy_interface_t interface)
 {
 	switch (interface) {
@@ -1164,7 +1182,9 @@ static void phylink_major_config(struct phylink *pl, bool restart,
 	unsigned int neg_mode;
 	int err;
 
-	phylink_dbg(pl, "major config %s\n", phy_modes(state->interface));
+	phylink_dbg(pl, "major config, requested %s/%s\n",
+		    phylink_an_mode_str(pl->req_link_an_mode),
+		    phy_modes(state->interface));
 
 	if (pl->mac_ops->mac_select_pcs) {
 		pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
@@ -1180,6 +1200,11 @@ static void phylink_major_config(struct phylink *pl, bool restart,
 
 	phylink_pcs_neg_mode(pl, pcs, state->interface, state->advertising);
 
+	phylink_dbg(pl, "major config, active %s/%s/%s\n",
+		    phylink_an_mode_str(pl->act_link_an_mode),
+		    phylink_pcs_mode_str(pl->pcs_neg_mode),
+		    phy_modes(state->interface));
+
 	phylink_pcs_poll_stop(pl);
 
 	if (pl->mac_ops->mac_prepare) {
-- 
2.30.2


  parent reply	other threads:[~2024-12-03 15:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 15:30 [PATCH net-next 00/13] net: add negotiation of in-band capabilities Russell King (Oracle)
2024-12-03 15:30 ` [PATCH net-next 01/13] net: phylink: pass phylink and pcs into phylink_pcs_neg_mode() Russell King (Oracle)
2024-12-03 15:30 ` [PATCH net-next 02/13] net: phylink: split cur_link_an_mode into requested and active Russell King (Oracle)
2024-12-03 15:30 ` Russell King (Oracle) [this message]
2024-12-03 15:31 ` [PATCH net-next 04/13] net: phy: add phy_inband_caps() Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 05/13] net: phy: bcm84881: implement phy_inband_caps() method Russell King (Oracle)
2024-12-03 16:45   ` Florian Fainelli
2024-12-03 15:31 ` [PATCH net-next 06/13] net: phy: marvell: " Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 07/13] net: phy: add phy_config_inband() Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 08/13] net: phy: marvell: implement config_inband() method Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 09/13] net: phylink: add pcs_inband_caps() method Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 10/13] net: mvneta: implement " Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 11/13] net: mvpp2: " Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 12/13] net: phylink: add negotiation of in-band capabilities Russell King (Oracle)
2024-12-03 15:31 ` [PATCH net-next 13/13] net: phylink: remove phylink_phy_no_inband() Russell King (Oracle)
2024-12-05  3:30 ` [PATCH net-next 00/13] net: add negotiation of in-band capabilities 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=E1tIUrZ-006ITt-Fa@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).