Re: [PATCH net-next v2 4/8] net: usb: asix: ax88772: add phylib support

From: Jon Hunter
Date: Thu Jun 10 2021 - 08:54:23 EST



On 09/06/2021 10:59, Marek Szyprowski wrote:
> Hi Oleksij,
>
> On 07.06.2021 10:27, Oleksij Rempel wrote:
>> To be able to use ax88772 with external PHYs and use advantage of
>> existing PHY drivers, we need to port at least ax88772 part of asix
>> driver to the phylib framework.
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
>
> This patch landed recently in linux-next as commit e532a096be0e ("net:
> usb: asix: ax88772: add phylib support"). I found that it causes some
> warnings on boards with those devices, see the following log:
>
> root@target:~# time rtcwake -s10 -mmem
> rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun  9 08:16:41 2021
> [  231.226579] PM: suspend entry (deep)
> [  231.231697] Filesystems sync: 0.002 seconds
> [  231.261761] Freezing user space processes ... (elapsed 0.002 seconds)
> done.
> [  231.270526] OOM killer disabled.
> [  231.273557] Freezing remaining freezable tasks ... (elapsed 0.002
> seconds) done.
> [  231.282229] printk: Suspending console(s) (use no_console_suspend to
> debug)
> ...
> [  231.710852] Disabling non-boot CPUs ...
> ...
> [  231.901794] Enabling non-boot CPUs ...
> ...
> [  232.225640] usb usb3: root hub lost power or was reset
> [  232.225746] usb usb1: root hub lost power or was reset
> [  232.225864] usb usb5: root hub lost power or was reset
> [  232.226206] usb usb6: root hub lost power or was reset
> [  232.226207] usb usb4: root hub lost power or was reset
> [  232.297749] usb usb2: root hub lost power or was reset
> [  232.343227] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22
> [  232.343293] asix 3-1:1.0 eth0: Failed to enable software MII access
> [  232.344486] asix 3-1:1.0 eth0: Failed to read reg index 0x0000: -22
> [  232.344512] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22
> [  232.344529] PM: dpm_run_callback(): mdio_bus_phy_resume+0x0/0x78
> returns -22
> [  232.344554] Asix Electronics AX88772C usb-003:002:10: PM: failed to
> resume: error -22
> [  232.563712] usb 1-1: reset high-speed USB device number 2 using
> exynos-ehci
> [  232.757653] usb 3-1: reset high-speed USB device number 2 using xhci-hcd
> [  233.730994] OOM killer enabled.
> [  233.734122] Restarting tasks ... done.
> [  233.754992] PM: suspend exit


I am seeing a similar problem on a couple of our Tegra boards that
use AX88772A device. When resuming from suspend I see ...

[ 54.733266] PM: suspend entry (deep)

[ 54.737179] Filesystems sync: 0.000 seconds

[ 54.741904] Freezing user space processes ... (elapsed 0.001 seconds) done.

[ 54.750895] OOM killer disabled.

[ 54.754452] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.

[ 54.763505] printk: Suspending console(s) (use no_console_suspend to debug)

[ 54.898334] Disabling non-boot CPUs ...

[ 54.899546] IRQ 26: no longer affine to CPU1

[ 54.924373] Entering suspend state LP1

[ 54.924493] Enabling non-boot CPUs ...

[ 54.933164] CPU1 is up

[ 55.005166] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -113

[ 55.005226] asix 3-1:1.0 eth0: Failed to enable software MII access

[ 55.006579] asix 3-1:1.0 eth0: Failed to read reg index 0x0000: -113

[ 55.006722] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -113

[ 55.006762] asix 3-1:1.0 eth0: Failed to enable software MII access


Interestingly once commit d275afb66371 ("net: usb: asix: add error
handling for asix_mdio_* functions") is applied, then resume from
suspend completely fails because the error is propagated. Bisect
is pointing to that patch, however, it is this patch that is
causing the problem.

Cheers
Jon

--
nvpublic