[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YiACuNTd9lzN6Wym@lunn.ch>
Date: Thu, 3 Mar 2022 00:50:16 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Fabio Estevam <festevam@...il.com>
Cc: Steve Glendinning <steve.glendinning@...well.net>,
UNGLinuxDriver@...rochip.com, netdev <netdev@...r.kernel.org>
Subject: Re: smsc95xx warning after a 'reboot' command
>> > So it looks like the PHY state machine has not been told to stop using
> > the PHY. That suggests smsc95xx_disconnect_phy() has not been
> > called. Could you confirm this by putting a printk() in there.
>
> I added a printk (*********** smsc95xx_disconnect_phy())
> and confirmed that smsc95xx_disconnect_phy() is being called.
>
> Please see the log below, thanks.
>
> [ 22.140598] ci_hdrc ci_hdrc.1: remove, state 1
> [ 22.145077] usb usb2: USB disconnect, device number 1
> [ 22.146674] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [ 22.150146] usb 2-1: USB disconnect, device number 2
> [ 22.157275] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
> [ 22.162237] usb 2-1.1: USB disconnect, device number 3
> [ 22.167986] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
> [ 22.174690] smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx'
> usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet
> [ 22.179732] ------------[ cut here ]------------
> [ 22.193687] WARNING: CPU: 1 PID: 114 at drivers/net/phy/phy.c:958
> phy_error+0x14/0x60
> [ 22.201514] Modules linked in:
> [ 22.204577] CPU: 1 PID: 114 Comm: kworker/u8:2 Not tainted
> 5.10.102-00042-ga4a140612082-dirty #29
> [ 22.213447] Hardware name: CompuLab i.MX8MM IoT Gateway (DT)
> [ 22.219112] Workqueue: events_power_efficient phy_state_machine
> [ 22.225036] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
> [ 22.231043] pc : phy_error+0x14/0x60
> [ 22.234620] lr : phy_state_machine+0x88/0x218
> [ 22.238975] sp : ffff800011733d20
> [ 22.242289] x29: ffff800011733d20 x28: ffff800011217000
> [ 22.247608] x27: ffff000000008070 x26: ffff000000008020
> [ 22.252924] x25: 0000000000000000 x24: 00000000ffffffed
> [ 22.258240] x23: ffff00000edb8ce8 x22: ffff000002165580
> [ 22.263558] x21: ffff00000edb8800 x20: 0000000000000005
> [ 22.268875] x19: ffff00000edb8800 x18: 0000000000000010
> [ 22.274193] x17: 0000000000000000 x16: 0000000000000000
> [ 22.279509] x15: ffff0000021659f8 x14: 00000000000000dd
> [ 22.284825] x13: 0000000000000001 x12: 0000000000000000
> [ 22.290140] x11: 0000000000000000 x10: 00000000000009d0
> [ 22.295456] x9 : ffff8000117338a0 x8 : ffff000002165fb0
> [ 22.300772] x7 : ffff00007fb8d680 x6 : 000000000000000e
> [ 22.306088] x5 : 00000000410fd030 x4 : 0000000000000000
> [ 22.311406] x3 : ffff00000edb8ce8 x2 : 0000000000000000
> [ 22.316723] x1 : ffff000002165580 x0 : ffff00000edb8800
> [ 22.322039] Call trace:
> [ 22.324490] phy_error+0x14/0x60
> [ 22.327722] phy_state_machine+0x88/0x218
> [ 22.331736] process_one_work+0x1bc/0x338
> [ 22.335747] worker_thread+0x50/0x420
> [ 22.339411] kthread+0x140/0x160
> [ 22.342642] ret_from_fork+0x10/0x34
> [ 22.346219] ---[ end trace 25b1972853f1f1f8 ]---
> [ 22.350892] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [ 22.350975] *********** smsc95xx_disconnect_phy()
If i'm reading this correctly, this is way to late, the device has
already gone. The PHY needs to be stopped while the device is still
connected to the USB bus.
I could understand a trace like this with a hot unplug, but not with a
reboot. I would expect things to be shut down starting from the leaves
of the USB tree, so the smsc95xx should have a chance to perform a
controlled shutdown before the device is removed.
This code got reworked recently. smsc95xx_disconnect_phy() has been
removed, and the phy is now disconnected in smsc95xx_unbind(). Do you
get the same stack trace with 5.17-rc? Or is it a different stack
trace?
Andrew
Powered by blists - more mailing lists