riscv defconfig CONFIG_PM/macb/generic PHY regression in v5.18-rc1

Conor.Dooley at microchip.com Conor.Dooley at microchip.com
Tue Apr 5 06:05:12 PDT 2022


Hey,
I seem to have come across a regression in the default riscv defconfig
between riscv-for-linus-5.18-mw0 (bbde015227e8) & v5.18-rc1, exposed by
c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt
machine") which causes the ethernet phy to not come up on my Icicle kit:
[ 3.179864] macb 20112000.ethernet eth0: validation of sgmii with support 0000000,00000000,00006280 and advertisement 0000000,00000000,00004280 failed: -EINVAL
[ 3.194490] macb 20112000.ethernet eth0: Could not attach PHY (-22)

I did try to bisect normally, but unfortunately it was not trivial for
me to do, because the following two commits from Linus' tree that
arrived after riscv-for-linus-5.18-mw0 are required actually bring up
the icicle kit & its ethernet:
37f7860602b5 net: macb: Align the dma and coherent dma masks
635e5e73370e clk: microchip: Add driver for Microchip PolarFire SoC

I went down a rabbit hole of checking the net side of things & found
that the failing check is in the call to phylink_validate in
phylink_bringup_phy. Some digging points to v5.18-rc1's
drivers/net/phy/phylink.c:L457 as the culprit, with the
phylink_is_empty_linkmode check failing.

At riscv-for-linus-5.18-mw0, cherry-picking those two commits brings it
up fine:
[ 2.818894] macb 20112000.ethernet eth0: PHY [20112000.ethernet-ffffffff:09] driver [Generic PHY] (irq=POLL)
[ 2.828915] macb 20112000.ethernet eth0: configuring for phy/sgmii link mode
[11.045411] macb 20112000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[11.053247] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

At riscv-for-linus-5.18-mw1 (1464d00b27b2) with those two commits
applied, I get the same validation failure as with v5.18-rc1.

I did some manual reversions of everything in
drivers/net/ethernet/cadence/ & drivers/net/phy/phylink.c that was
added since 5.17 to no avail.
Turns out the problem was exposed by riscv-for-linus-5.18-mw1 and
reverting c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver
for QEMU virt machine") avoided the problem for me.

Is this some sort of lack of support for CONFIG_PM=y in my clock driver,
that's leading to the PHY getting stuck in reset?
Or an interaction between CONFIG_PM=y & the macb/generic phy drivers?

I am kinda lost at this point & would appreciate any help investigating
further. I have attached the full log in case that helps.
Thanks,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: failure.log
Type: text/x-log
Size: 10541 bytes
Desc: failure.log
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20220405/7fc1c8c8/attachment.bin>


More information about the linux-riscv mailing list