public inbox for netdev@vger.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 03:32:13 +0100	[thread overview]
Message-ID: <YiAorTOXfE20snfz@lunn.ch> (raw)
In-Reply-To: <CAOMZO5ChowWZgryE14DoQG5ORNnKrLQAdQwt6Qsotsacneww3Q@mail.gmail.com>

On Wed, Mar 02, 2022 at 09:40:54PM -0300, Fabio Estevam wrote:
> On Wed, Mar 2, 2022 at 8:50 PM Andrew Lunn <andrew@lunn.ch> wrote:
> 
> > 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?
> 
> Just tested 5.17-rc6 and I get no stack strace at all after a 'reboot' command:
> 
> [   21.953945] ci_hdrc ci_hdrc.1: remove, state 1
> [   21.958418] usb usb2: USB disconnect, device number 1
> [   21.963493] usb 2-1: USB disconnect, device number 2
> [   21.964227] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [   21.968469] usb 2-1.1: USB disconnect, device number 3
> [   21.970808] smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx'
> usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet
> [   21.975619] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
> [   21.975625] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
> [   22.002479] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [   22.009630] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
> [   22.015392] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
> [   22.021939] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [   22.029087] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
> [   22.034845] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
> [   22.041743] smsc95xx 2-1.1:1.0 eth1: hardware isn't capable of remote wakeup
> [   22.068706] usb 2-1.4: USB disconnect, device number 4
> [   22.077327] ci_hdrc ci_hdrc.1: USB bus 2 deregistered
> [   22.085222] ci_hdrc ci_hdrc.0: remove, state 4
> [   22.089685] usb usb1: USB disconnect, device number 1
> [   22.095284] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
> [   22.122356] imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot!
> [   22.129073] reboot: Restarting system
> 
> I applied a049a30fc 27c ("net: usb: Correct PHY handling of smsc95xx")
> into 5.10.102, but it did not help.

I'm not a USB expert, but to me, it looks like the smsc95xx device is
being disconnected, rather than being unloaded. So it is already gone
by the time the PHY device is disconnected.

It would be good to have somebody who understands USB net devices to
take a look at this, in particularly the order. I'm wondering if there
is a hub in the middle, and the hub is being disabled, or a regulator
for the hub etc?

    Andrew

  reply	other threads:[~2022-03-03  2:32 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
2022-03-03  0:40       ` Fabio Estevam
2022-03-03  2:32         ` Andrew Lunn [this message]
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=YiAorTOXfE20snfz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox