[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210528091230.hzuzhotuna34amhj@skbuf>
Date: Fri, 28 May 2021 12:12:30 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Wong Vee Khee <vee.khee.wong@...ux.intel.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King - ARM Linux admin <linux@...linux.org.uk>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Ong Boon Leong <boon.leong.ong@...el.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [RFC PATCH net-next 0/8] Convert xpcs to phylink_pcs_ops
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@....com>
Date: Fri, 28 May 2021 12:00:17 +0300
Subject: [PATCH] xpcs debug
Signed-off-by: Vladimir Oltean <vladimir.oltean@....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 ]-----------------------------
Powered by blists - more mailing lists