All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 31 May 2021 13:07:15 +0300	[thread overview]
Message-ID: <20210531100715.mjjs4flzen67a5kr@skbuf> (raw)
In-Reply-To: <20210531023019.GA5494@linux.intel.com>

Hi VK,

On Mon, May 31, 2021 at 10:30:19AM +0800, Wong Vee Khee wrote:
> On Fri, May 28, 2021 at 12:12:30PM +0300, Vladimir Oltean wrote:
> > 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?
> > 
> 
> Sorry for the late response. Here the debug log:
> 
> [   11.474302] mdio_bus stmmac-1:01: attached PHY driver [unbound] (mii_bus:phy_addr=stmmac-1:01, irq=POLL)
> [   11.495564] mdio_bus stmmac-1:16: xpcs_create: xpcs_id 7996ced0 matched on entry 0
> [   11.503154] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 13
> [   11.510377] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 14
> [   11.517590] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 6
> [   11.524725] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 17
> [   11.531946] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 18
> [   11.539278] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 19
> [   11.541316] ish-hid {33AECD58-B679-4E54-9BD9-A04D34F0C226}: [hid-ish]: enum_devices_done OK, num_hid_devices=6
> [   11.546487] mdio_bus stmmac-1:16: xpcs_create: setting entry->supported bit 15
> [   11.546489] mdio_bus stmmac-1:16: xpcs_create: xpcs->supported 0000000,00000000,000ee040
> [   11.584687] hid-generic 001F:8087:0AC2.0001: device has no listeners, quitting
> [   11.599461] mdio_bus stmmac-1:16: xpcs_validate: provided interface sgmii does not match supported interface 0 (usxgmii)
> [   11.606538] hid-generic 001F:8087:0AC2.0002: device has no listeners, quitting
> [   11.610306] mdio_bus stmmac-1:16: xpcs_validate: provided interface sgmii does not match any supported interface
> [   11.610309] mdio_bus stmmac-1:16: xpcs_validate: provided interface sgmii does not match supported interface 0 (usxgmii)
> [   11.626259] hid-generic 001F:8087:0AC2.0003: device has no listeners, quitting
> [   11.627675] mdio_bus stmmac-1:16: xpcs_validate: provided interface sgmii does not match any supported interface
> [   11.627677] intel-eth-pci 0000:00:1e.4 (unnamed net_device) (uninitialized): failed to validate link configuration for in-band status
> [   11.641996] hid-generic 001F:8087:0AC2.0004: device has no listeners, quitting
> [   11.645729] intel-eth-pci 0000:00:1e.4 (unnamed net_device) (uninitialized): failed to setup phy (-22)

Ha ha, this works as expected, but I was led into error due to the code
structure.

See, everything in pcs-xpcs.c is laid out as if there are different PHY
IDs for SGMII, USXGMII etc. But if you pay close attention, they are all
equal to 0x7996ced0:

#define SYNOPSYS_XPCS_USXGMII_ID	0x7996ced0
#define SYNOPSYS_XPCS_10GKR_ID		0x7996ced0
#define SYNOPSYS_XPCS_XLGMII_ID		0x7996ced0
#define SYNOPSYS_XPCS_SGMII_ID		0x7996ced0
#define SYNOPSYS_XPCS_MASK		0xffffffff

With the old code, it works because the probing code gets a nudge from
the caller of xpcs_probe by being told what is the expected phy_interface_t.
The xpcs then uses the phy_interface_t _as_part_of_ the PHY ID matching
sequence.

So.. yeah. I got the information I needed. I will come back with a way
for the same PCS PHY ID to support multiple PHY interface types.

Thanks again for testing.

      reply	other threads:[~2021-05-31 10:09 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
2021-05-31  2:30     ` Wong Vee Khee
2021-05-31 10:07       ` Vladimir Oltean [this message]

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=20210531100715.mjjs4flzen67a5kr@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.