linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 4/8] net: usb: asix: ax88772: add phylib support
Date: Thu, 10 Jun 2021 12:31:29 +0200	[thread overview]
Message-ID: <6b90f8ef-6d86-68a6-690d-d5255b6308df@samsung.com> (raw)
In-Reply-To: <20210609124609.zngg6sfcu6cj4p2m@pengutronix.de>

Hi Oleksij,

On 09.06.2021 14:46, Oleksij Rempel wrote:
> On Wed, Jun 09, 2021 at 11:59:23AM +0200, Marek Szyprowski wrote:
>> 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@pengutronix.de>
>> 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
>>
>> real    0m11.546s
>> user    0m0.000s
>> sys     0m0.530s
>> root@target:~# sleep 2
>> root@target:~# time rtcwake -s10 -mmem
>> rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun  9 08:17:02 2021
>> [  241.959608] PM: suspend entry (deep)
>> [  241.963446] Filesystems sync: 0.001 seconds
>> [  241.978619] Freezing user space processes ... (elapsed 0.004 seconds)
>> done.
>> [  241.989199] OOM killer disabled.
>> [  241.992215] Freezing remaining freezable tasks ... (elapsed 0.005
>> seconds) done.
>> [  242.003979] printk: Suspending console(s) (use no_console_suspend to
>> debug)
>> ...
>> [  242.592030] Disabling non-boot CPUs ...
>> ...
>> [  242.879721] Enabling non-boot CPUs ...
>> ...
>> [  243.145870] usb usb3: root hub lost power or was reset
>> [  243.145910] usb usb4: root hub lost power or was reset
>> [  243.147084] usb usb5: root hub lost power or was reset
>> [  243.147157] usb usb6: root hub lost power or was reset
>> [  243.147298] usb usb1: root hub lost power or was reset
>> [  243.217137] usb usb2: root hub lost power or was reset
>> [  243.283807] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22
>> [  243.284005] asix 3-1:1.0 eth0: Failed to enable software MII access
>> [  243.285526] asix 3-1:1.0 eth0: Failed to read reg index 0x0000: -22
>> [  243.285676] asix 3-1:1.0 eth0: Failed to read reg index 0x0004: -22
>> [  243.285769] ------------[ cut here ]------------
>> [  243.286011] WARNING: CPU: 2 PID: 2069 at drivers/net/phy/phy.c:916
>> phy_error+0x28/0x68
>> [  243.286115] Modules linked in: cmac bnep mwifiex_sdio mwifiex
>> sha256_generic libsha256 sha256_arm cfg80211 btmrvl_sdio btmrvl
>> bluetooth s5p_mfc uvcvideo s5p_jpeg exynos_gsc v
>> [  243.287490] CPU: 2 PID: 2069 Comm: kworker/2:5 Not tainted
>> 5.13.0-rc5-next-20210608 #10443
>> [  243.287555] Hardware name: Samsung Exynos (Flattened Device Tree)
>> [  243.287609] Workqueue: events_power_efficient phy_state_machine
>> [  243.287716] [<c0111920>] (unwind_backtrace) from [<c010d0cc>]
>> (show_stack+0x10/0x14)
>> [  243.287807] [<c010d0cc>] (show_stack) from [<c0b62360>]
>> (dump_stack_lvl+0xa0/0xc0)
>> [  243.287882] [<c0b62360>] (dump_stack_lvl) from [<c0127960>]
>> (__warn+0x118/0x11c)
>> [  243.287954] [<c0127960>] (__warn) from [<c0127a18>]
>> (warn_slowpath_fmt+0xb4/0xbc)
>> [  243.288021] [<c0127a18>] (warn_slowpath_fmt) from [<c0734968>]
>> (phy_error+0x28/0x68)
>> [  243.288094] [<c0734968>] (phy_error) from [<c0735d6c>]
>> (phy_state_machine+0x218/0x278)
>> [  243.288173] [<c0735d6c>] (phy_state_machine) from [<c014ae08>]
>> (process_one_work+0x30c/0x884)
>> [  243.288254] [<c014ae08>] (process_one_work) from [<c014b3d8>]
>> (worker_thread+0x58/0x594)
>> [  243.288333] [<c014b3d8>] (worker_thread) from [<c0153944>]
>> (kthread+0x160/0x1c0)
>> [  243.288408] [<c0153944>] (kthread) from [<c010011c>]
>> (ret_from_fork+0x14/0x38)
>> [  243.288475] Exception stack(0xc4683fb0 to 0xc4683ff8)
>> [  243.288531] 3fa0:                                     00000000
>> 00000000 00000000 00000000
>> [  243.288587] 3fc0: 00000000 00000000 00000000 00000000 00000000
>> 00000000 00000000 00000000
>> [  243.288641] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
>> [  243.288690] irq event stamp: 1611
>> [  243.288744] hardirqs last  enabled at (1619): [<c01a6ef0>]
>> vprintk_emit+0x230/0x290
>> [  243.288830] hardirqs last disabled at (1626): [<c01a6f2c>]
>> vprintk_emit+0x26c/0x290
>> [  243.288906] softirqs last  enabled at (1012): [<c0101768>]
>> __do_softirq+0x500/0x63c
>> [  243.288978] softirqs last disabled at (1007): [<c01315b4>]
>> irq_exit+0x214/0x220
>> [  243.289055] ---[ end trace eeacda95eb7db60a ]---
>> [  243.289345] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22
>> [  243.289466] asix 3-1:1.0 eth0: Failed to write Medium Mode mode to
>> 0x0000: ffffffea
>> [  243.289540] asix 3-1:1.0 eth0: Link is Down
>> [  243.482809] usb 1-1: reset high-speed USB device number 2 using
>> exynos-ehci
>> [  243.647251] usb 3-1: reset high-speed USB device number 2 using xhci-hcd
>> [  244.847161] OOM killer enabled.
>> [  244.850221] Restarting tasks ... done.
>> [  244.861372] PM: suspend exit
>>
>> real    0m13.050s
>> user    0m0.000s
>> sys     0m1.152s
>> root@target:~#
>>
>> It looks that some kind of system suspend/resume integration for phylib
>> is not implemented.
> Probably it is should be handled only by the asix driver. I'll take a
> look in to it. Did interface was able to resume after printing some
> warnings?

Nope. The network is not operational after suspend/resume cycle after 
applying this patch.

Best regards

-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  parent reply	other threads:[~2021-06-10 10:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07  8:27 [PATCH net-next v2 0/8] port asix ax88772 to the PHYlib Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 1/8] net: usb: asix: ax88772_bind: use devm_kzalloc() instead of kzalloc() Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 2/8] net: usb: asix: refactor asix_read_phy_addr() and handle errors on return Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 3/8] net: usb/phy: asix: add support for ax88772A/C PHYs Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 4/8] net: usb: asix: ax88772: add phylib support Oleksij Rempel
     [not found]   ` <CGME20210609095923eucas1p2e692c9a482151742d543316c91f29802@eucas1p2.samsung.com>
2021-06-09  9:59     ` Marek Szyprowski
2021-06-09 12:46       ` Oleksij Rempel
2021-06-09 13:12         ` Heiner Kallweit
2021-06-10 13:36           ` Oleksij Rempel
2021-06-10 10:31         ` Marek Szyprowski [this message]
2021-06-10 12:54       ` Jon Hunter
2021-06-10 14:22         ` Oleksij Rempel
     [not found]   ` <CGME20210618083914eucas1p240f88e7064a7bf15b68370b7506d24a9@eucas1p2.samsung.com>
2021-06-18  8:39     ` Marek Szyprowski
2021-06-18 10:13       ` Oleksij Rempel
2021-06-18 10:45         ` Marek Szyprowski
2021-06-18 10:57           ` Marek Szyprowski
2021-06-18 13:10             ` Oleksij Rempel
2021-06-18 11:04         ` Heiner Kallweit
2021-06-18 11:11           ` Marek Szyprowski
2021-06-18 13:20             ` Oleksij Rempel
2021-06-21  6:05               ` Marek Szyprowski
2021-06-23  7:06                 ` Oleksij Rempel
2021-06-28  8:27                   ` Marek Szyprowski
2021-06-07  8:27 ` [PATCH net-next v2 5/8] net: usb: asix: ax88772: add generic selftest support Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 6/8] net: usb: asix: add error handling for asix_mdio_* functions Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 7/8] net: phy: do not print dump stack if device was removed Oleksij Rempel
2021-06-07  8:27 ` [PATCH net-next v2 8/8] usbnet: run unbind() before unregister_netdev() Oleksij Rempel
2021-06-07 20:40 ` [PATCH net-next v2 0/8] port asix ax88772 to the PHYlib patchwork-bot+netdevbpf

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=6b90f8ef-6d86-68a6-690d-d5255b6308df@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).