From: Vladimir Oltean <olteanv@gmail.com>
To: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King - ARM Linux admin <linux@armlinux.org.uk>,
Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Ong Boon Leong <boon.leong.ong@intel.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [RFC PATCH net-next 0/8] Convert xpcs to phylink_pcs_ops
Date: Fri, 28 May 2021 12:12:30 +0300 [thread overview]
Message-ID: <20210528091230.hzuzhotuna34amhj@skbuf> (raw)
In-Reply-To: <20210528021521.GA20022@linux.intel.com>
Hi VK,
On Fri, May 28, 2021 at 10:15:21AM +0800, Wong Vee Khee wrote:
> I got the following kernel panic after applying [1], and followed by
> this patch series.
>
> [1] https://patchwork.kernel.org/project/netdevbpf/patch/20210527155959.3270478-1-olteanv@gmail.com/
>
> [ 10.742057] libphy: stmmac: probed
> [ 10.750396] mdio_bus stmmac-1:01: attached PHY driver [unbound] (mii_bus:phy_addr=stmmac-1:01, irq=POLL)
> [ 10.818222] intel-eth-pci 0000:00:1e.4 (unnamed net_device) (uninitialized): failed to validate link configuration for in-band status
> [ 10.830348] intel-eth-pci 0000:00:1e.4 (unnamed net_device) (uninitialized): failed to setup phy (-22)
Thanks a lot for testing. Sadly I can't figure out what is the mistake.
Could you please add this debugging patch on top and let me know what it
prints?
-----------------------------[ cut here ]-----------------------------
From 1d745a51b53b38df432a33849632a1b553d3f90a Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Fri, 28 May 2021 12:00:17 +0300
Subject: [PATCH] xpcs debug
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/pcs/pcs-xpcs.c | 44 +++++++++++++++++++++++++++-----------
1 file changed, 31 insertions(+), 13 deletions(-)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 194b79da547b..4268b8bb8db0 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -675,30 +675,39 @@ static void xpcs_resolve_pma(struct mdio_xpcs_args *xpcs,
void xpcs_validate(struct mdio_xpcs_args *xpcs, unsigned long *supported,
struct phylink_link_state *state)
{
- bool valid_interface;
-
- if (state->interface == PHY_INTERFACE_MODE_NA) {
- valid_interface = true;
- } else {
+ if (state->interface != PHY_INTERFACE_MODE_NA) {
struct xpcs_id *id = xpcs->id;
+ bool valid_interface = false;
int i;
- valid_interface = false;
-
for (i = 0; id->interface[i] != PHY_INTERFACE_MODE_MAX; i++) {
- if (id->interface[i] != state->interface)
+ if (id->interface[i] != state->interface) {
+ dev_err(&xpcs->mdiodev->dev,
+ "%s: provided interface %s does not match supported interface %d (%s)\n",
+ __func__, phy_modes(state->interface),
+ i, phy_modes(id->interface[i]));
continue;
+ }
valid_interface = true;
break;
}
- }
- if (!valid_interface) {
- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
- return;
+ if (!valid_interface) {
+ dev_err(&xpcs->mdiodev->dev,
+ "%s: provided interface %s does not match any supported interface\n",
+ __func__, phy_modes(state->interface));
+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
+ return;
+ }
}
+ dev_err(&xpcs->mdiodev->dev,
+ "%s: supported mask for interface %s is %*pb, received supported mask is %*pb\n",
+ __func__, phy_modes(state->interface),
+ __ETHTOOL_LINK_MODE_MASK_NBITS, xpcs->supported,
+ __ETHTOOL_LINK_MODE_MASK_NBITS, supported);
+
linkmode_and(supported, supported, xpcs->supported);
linkmode_and(state->advertising, state->advertising, xpcs->supported);
}
@@ -987,8 +996,17 @@ struct mdio_xpcs_args *xpcs_create(struct mdio_device *mdiodev)
if ((xpcs_id & entry->mask) != entry->id)
continue;
- for (i = 0; entry->supported[i] != __ETHTOOL_LINK_MODE_MASK_NBITS; i++)
+ dev_err(&mdiodev->dev, "%s: xpcs_id %x matched on entry %d\n",
+ __func__, xpcs_id, i);
+
+ for (i = 0; entry->supported[i] != __ETHTOOL_LINK_MODE_MASK_NBITS; i++) {
+ dev_err(&mdiodev->dev, "%s: setting entry->supported bit %d\n",
+ __func__, entry->supported[i]);
set_bit(entry->supported[i], xpcs->supported);
+ }
+
+ dev_err(&mdiodev->dev, "%s: xpcs->supported %*pb\n", __func__,
+ __ETHTOOL_LINK_MODE_MASK_NBITS, xpcs->supported);
xpcs->id = entry;
xpcs->an_mode = entry->an_mode;
-----------------------------[ cut here ]-----------------------------
next prev parent reply other threads:[~2021-05-28 9:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 20:45 [RFC PATCH net-next 0/8] Convert xpcs to phylink_pcs_ops Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 1/8] net: pcs: xpcs: delete shim definition for mdio_xpcs_get_ops() Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 2/8] net: pcs: xpcs: check for supported PHY interface modes in phylink_validate Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 3/8] net: pcs: xpcs: export xpcs_validate Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 4/8] net: pcs: export xpcs_config_eee Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 5/8] net: pcs: xpcs: export xpcs_probe Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 6/8] net: pcs: xpcs: convert to phylink_pcs_ops Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 7/8] net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write} Vladimir Oltean
2021-05-27 20:45 ` [RFC PATCH net-next 8/8] net: pcs: xpcs: convert to mdio_device Vladimir Oltean
2021-05-28 2:15 ` [RFC PATCH net-next 0/8] Convert xpcs to phylink_pcs_ops Wong Vee Khee
2021-05-28 9:12 ` Vladimir Oltean [this message]
2021-05-31 2:30 ` Wong Vee Khee
2021-05-31 10:07 ` Vladimir Oltean
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=20210528091230.hzuzhotuna34amhj@skbuf \
--to=olteanv@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=boon.leong.ong@intel.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=michael.wei.hong.sit@intel.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=vee.khee.wong@linux.intel.com \
--cc=vladimir.oltean@nxp.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