All of lore.kernel.org
 help / color / mirror / Atom feed
* smsc95xx warning after a 'reboot' command
@ 2022-03-02 21:57 Fabio Estevam
  2022-03-02 22:12 ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2022-03-02 21:57 UTC (permalink / raw)
  To: Steve Glendinning, UNGLinuxDriver; +Cc: netdev, Andrew Lunn

Hi,

On a imx8mm iotgateway board from Compulab running 5.10 or 5.17-rc the
following warning is observed after a 'reboot' command:

[   23.077179] ci_hdrc ci_hdrc.1: remove, state 1
[   23.081674] usb usb2: USB disconnect, device number 1
[   23.086740] usb 2-1: USB disconnect, device number 2
[   23.088393] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
[   23.091718] usb 2-1.1: USB disconnect, device number 3
[   23.094090] smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx'
usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet
[   23.098869] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
[   23.098877] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
[   23.125763] ------------[ cut here ]------------
[   23.125860] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
[   23.130393] WARNING: CPU: 3 PID: 119 at drivers/net/phy/phy.c:958
phy_error+0x14/0x60
[   23.130397] Modules linked in:
[   23.137550] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
[   23.145367]  iwlmvm mac80211 libarc4
[   23.148439] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
[   23.154175]  af_alg caam_jr caamhash_desc caamalg_desc
crypto_engine rng_core authenc libdes btusb hci_uart btrtl btintel
btqca crct10dif_ce btbcm fsl_imx8_ddr_perf bluetooth ecdh_generic ecc
spi_imx spi_bitbang clk_bd718x7 at24 caam error rtc_snvs snvs_pwrkey
imx8mm_thermal imx_cpufreq_dt pwm_bl overlay iwlwifi cfg80211 rfkill
ipv6
[   23.193841] CPU: 3 PID: 119 Comm: kworker/u8:2 Not tainted
5.10.102-stable-standard #1
[   23.201764] Hardware name: CompuLab i.MX8MM IoT Gateway (DT)
[   23.207433] Workqueue: events_power_efficient phy_state_machine
[   23.213362] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   23.219375] pc : phy_error+0x14/0x60
[   23.222954] lr : phy_state_machine+0x88/0x218
[   23.227315] sp : ffff800011743d20
[   23.230631] x29: ffff800011743d20 x28: ffff800011207000
[   23.235952] x27: ffff000000008070 x26: ffff000000008020
[   23.241273] x25: 0000000000000000 x24: 00000000ffffffed
[   23.246595] x23: ffff0000002e44e8 x22: ffff000000161c80
[   23.251915] x21: ffff0000002e4000 x20: 0000000000000005
[   23.257238] x19: ffff0000002e4000 x18: 0000000000000010
[   23.262558] x17: 0000000000000000 x16: 0000000000000000
[   23.267878] x15: 0000000e9816052e x14: 0000000000000000
[   23.273198] x13: 000000000000002f x12: 0000000000000198
[   23.278518] x11: 000000000000c6f5 x10: 000000000000c6f5
[   23.283838] x9 : 0000000000000000 x8 : ffff00007fbbc0c0
[   23.289161] x7 : ffff00007fbbb600 x6 : 0000000000000000
[   23.294481] x5 : 0000000000000008 x4 : 0000000000000000
[   23.299801] x3 : ffff0000002e44e8 x2 : 0000000000000000
[   23.305121] x1 : ffff000000161c80 x0 : ffff0000002e4000
[   23.310442] Call trace:
[   23.312894]  phy_error+0x14/0x60
[   23.316125]  phy_state_machine+0x88/0x218
[   23.320144]  process_one_work+0x1bc/0x338
[   23.324158]  worker_thread+0x50/0x420
[   23.327826]  kthread+0x140/0x160
[   23.331061]  ret_from_fork+0x10/0x34
[   23.334639] ---[ end trace 2cf86ece81b89776 ]---
[   23.339391] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
[   23.346550] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
[   23.352312] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
[   23.358863] smsc95xx 2-1.1:1.0 eth1: hardware isn't capable of remote wakeup
[   23.384599] usb 2-1.4: USB disconnect, device number 4
[   23.394062] ci_hdrc ci_hdrc.1: USB bus 2 deregistered
[   23.401921] ci_hdrc ci_hdrc.0: remove, state 4
[   23.406444] usb usb1: USB disconnect, device number 1
[   23.412082] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[   23.438063] imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot!
[   23.444895] reboot: Restarting system

Would anyone have any suggestions to fix this?

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2022-03-02 22:12 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

On Wed, Mar 02, 2022 at 06:57:06PM -0300, Fabio Estevam wrote:
> Hi,
> 
> On a imx8mm iotgateway board from Compulab running 5.10 or 5.17-rc the
> following warning is observed after a 'reboot' command:

Just to make sure i'm interpreting this correctly, you are doing a
reboot with the first 20 seconds of the machine starting?

> [   23.077179] ci_hdrc ci_hdrc.1: remove, state 1
> [   23.081674] usb usb2: USB disconnect, device number 1
> [   23.086740] usb 2-1: USB disconnect, device number 2
> [   23.088393] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
> [   23.091718] usb 2-1.1: USB disconnect, device number 3
> [   23.094090] smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx'
> usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet
> [   23.098869] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
> [   23.098877] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy

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.

	Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  2022-03-02 22:12 ` Andrew Lunn
@ 2022-03-02 23:14   ` Fabio Estevam
  2022-03-02 23:50     ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2022-03-02 23:14 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

Hi Andrew,

Thanks for your reply.

On Wed, Mar 2, 2022 at 7:12 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Wed, Mar 02, 2022 at 06:57:06PM -0300, Fabio Estevam wrote:
> > Hi,
> >
> > On a imx8mm iotgateway board from Compulab running 5.10 or 5.17-rc the
> > following warning is observed after a 'reboot' command:
>
> Just to make sure i'm interpreting this correctly, you are doing a
> reboot with the first 20 seconds of the machine starting?

Yes, just for the sake of capturing the log I issued a 'reboot'
command right after reaching
the Linux prompt.

The same problem happens if 'reboot' is issued at a much later point as well.

> 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()
[   22.358039] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
[   22.358043] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
[   22.375057] ------------[ cut here ]------------
[   22.379681] called from state HALTED
[   22.383298] WARNING: CPU: 2 PID: 1 at drivers/net/phy/phy.c:1080
phy_stop+0xc4/0x198
[   22.391040] Modules linked in:
[   22.394100] CPU: 2 PID: 1 Comm: systemd-shutdow Tainted: G        W
        5.10.102-00042-ga4a140612082-dirty #29
[   22.404446] Hardware name: CompuLab i.MX8MM IoT Gateway (DT)
[   22.410108] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[   22.416116] pc : phy_stop+0xc4/0x198
[   22.419691] lr : phy_stop+0xc4/0x198
[   22.423263] sp : ffff8000113db4d0
[   22.426578] x29: ffff8000113db4d0 x28: ffff000000088000
[   22.431894] x27: ffff8000112fb8c0 x26: ffff00000f8c6000
[   22.437210] x25: ffff00000edb80a0 x24: ffff00000002db48
[   22.442528] x23: 0000000000000000 x22: ffff800010c965a0
[   22.447846] x21: ffff00000002d000 x20: ffff00000002d900
[   22.453164] x19: ffff00000edb8800 x18: 0000000000000010
[   22.458480] x17: 0000000000000000 x16: 0000000000000000
[   22.463796] x15: ffff000000088478 x14: 0000000000000191
[   22.469112] x13: ffff000000088478 x12: 00000000ffffffea
[   22.474428] x11: ffff8000112a2230 x10: ffff80001128a1f0
[   22.479744] x9 : ffff80001128a248 x8 : 0000000000017fe8
[   22.485062] x7 : c0000000ffffefff x6 : 0000000000000001
[   22.490379] x5 : 0000000000000000 x4 : 0000000000000000
[   22.495697] x3 : 00000000ffffffff x2 : ffff8000112321c0
[   22.501013] x1 : 0000000000000000 x0 : 0000000000000000
[   22.506329] Call trace:
[   22.508775]  phy_stop+0xc4/0x198
[   22.512008]  smsc95xx_disconnect_phy+0x2c/0x4c
[   22.516454]  usbnet_stop+0x90/0x1f0
[   22.519946]  __dev_close_many+0xac/0x138
[   22.523873]  dev_close_many+0x84/0x128
[   22.527624]  rollback_registered_many+0x118/0x618
[   22.532329]  unregister_netdevice_queue+0x94/0x118
[   22.537122]  unregister_netdev+0x24/0x38
[   22.541046]  usbnet_disconnect+0x38/0xd8
[   22.544971]  usb_unbind_interface+0x74/0x240
[   22.549243]  device_release_driver_internal+0x114/0x1f0
[   22.554470]  device_release_driver+0x18/0x28
[   22.558739]  bus_remove_device+0x128/0x138
[   22.562837]  device_del+0x16c/0x3d8
[   22.566327]  usb_disable_device+0x8c/0x158
[   22.570426]  usb_disconnect+0xb8/0x2b8
[   22.574177]  usb_disconnect+0xa0/0x2b8
[   22.577930]  usb_disconnect+0xa0/0x2b8
[   22.581679]  usb_remove_hcd+0xd8/0x2d0
[   22.585430]  host_stop+0x38/0xa0
[   22.588660]  ci_hdrc_host_destroy+0x20/0x30
[   22.592844]  ci_hdrc_remove+0x48/0x108
[   22.596596]  platform_drv_remove+0x2c/0x50
[   22.600694]  device_release_driver_internal+0x114/0x1f0
[   22.605919]  device_release_driver+0x18/0x28
[   22.610190]  bus_remove_device+0x128/0x138
[   22.614287]  device_del+0x16c/0x3d8
[   22.617777]  platform_device_del.part.0+0x1c/0x88
[   22.622485]  platform_device_unregister+0x24/0x40
[   22.627190]  ci_hdrc_remove_device+0x18/0x38
[   22.631463]  ci_hdrc_imx_remove+0x2c/0x118
[   22.635561]  ci_hdrc_imx_shutdown+0x10/0x20
[   22.639745]  platform_drv_shutdown+0x20/0x30
[   22.644016]  device_shutdown+0x158/0x360
[   22.647941]  kernel_restart_prepare+0x38/0x48
[   22.652298]  kernel_restart+0x18/0x68
[   22.655963]  __do_sys_reboot+0x228/0x250
[   22.659887]  __arm64_sys_reboot+0x24/0x30
[   22.663900]  el0_svc_common.constprop.0+0x78/0x1c8
[   22.668693]  do_el0_svc+0x24/0x90
[   22.672009]  el0_svc+0x14/0x20
[   22.675065]  el0_sync_handler+0xb0/0xb8
[   22.678903]  el0_sync+0x180/0x1c0
[   22.682217] ---[ end trace 25b1972853f1f1f9 ]---
[   22.686875] smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
[   22.694021] smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
[   22.699778] smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
[   22.706327] smsc95xx 2-1.1:1.0 eth1: hardware isn't capable of remote wakeup
[   22.723702] usb 2-1.4: USB disconnect, device number 4
[   22.732781] ci_hdrc ci_hdrc.1: USB bus 2 deregistered
[   22.740648] ci_hdrc ci_hdrc.0: remove, state 4
[   22.745113] usb usb1: USB disconnect, device number 1
[   22.750721] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[   22.776831] imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot!
[   22.783514] reboot: Restarting system

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  2022-03-02 23:14   ` Fabio Estevam
@ 2022-03-02 23:50     ` Andrew Lunn
  2022-03-03  0:40       ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2022-03-02 23:50 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  2022-03-02 23:50     ` Andrew Lunn
@ 2022-03-03  0:40       ` Fabio Estevam
  2022-03-03  2:32         ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2022-03-03  0:40 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

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.

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  2022-03-03  0:40       ` Fabio Estevam
@ 2022-03-03  2:32         ` Andrew Lunn
  2022-03-03 12:56           ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2022-03-03  2:32 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: smsc95xx warning after a 'reboot' command
  2022-03-03  2:32         ` Andrew Lunn
@ 2022-03-03 12:56           ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2022-03-03 12:56 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Steve Glendinning, UNGLinuxDriver, netdev

Hi Andrew,

On Wed, Mar 2, 2022 at 11:32 PM Andrew Lunn <andrew@lunn.ch> wrote:

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

Yes, with 5.17-rc6 there are smsc95xx register accesses happening
after the device gets unregistered:

smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx' usb-ci_hdrc.1-1.1,
smsc95xx USB 2.0 Ethernet
smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS

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

Yes, let me start a new thread with some USB folks on Cc.

I will focus on fixing the 5.17-rc6 issue first.

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-03 12:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-03-03 12:56           ` Fabio Estevam

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.