All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Fabio Estevam <festevam@gmail.com>
Cc: Steve Glendinning <steve.glendinning@shawell.net>,
	UNGLinuxDriver@microchip.com, netdev <netdev@vger.kernel.org>
Subject: Re: smsc95xx warning after a 'reboot' command
Date: Thu, 3 Mar 2022 00:50:16 +0100	[thread overview]
Message-ID: <YiACuNTd9lzN6Wym@lunn.ch> (raw)
In-Reply-To: <CAOMZO5D1X2Vy1aCoLsa=ga94y74Az2RrbwcZgUfmx=Eyi4LcWw@mail.gmail.com>

>> > 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


  reply	other threads:[~2022-03-02 23:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 21:57 smsc95xx warning after a 'reboot' command Fabio Estevam
2022-03-02 22:12 ` Andrew Lunn
2022-03-02 23:14   ` Fabio Estevam
2022-03-02 23:50     ` Andrew Lunn [this message]
2022-03-03  0:40       ` Fabio Estevam
2022-03-03  2:32         ` Andrew Lunn
2022-03-03 12:56           ` Fabio Estevam

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=YiACuNTd9lzN6Wym@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=festevam@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=steve.glendinning@shawell.net \
    /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.