linux/drivers/net
Fabio Estevam 96340cdd55 smsc95xx: Ignore -ENODEV errors when device is unplugged
commit c70c453abc upstream.

According to Documentation/driver-api/usb/URB.rst when a device
is unplugged usb_submit_urb() returns -ENODEV.

This error code propagates all the way up to usbnet_read_cmd() and
usbnet_write_cmd() calls inside the smsc95xx.c driver during
Ethernet cable unplug, unbind or reboot.

This causes the following errors to be shown on reboot, for example:

ci_hdrc ci_hdrc.1: remove, state 1
usb usb2: USB disconnect, device number 1
usb 2-1: USB disconnect, device number 2
usb 2-1.1: USB disconnect, device number 3
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: Failed to read reg index 0x00000114: -19
smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19
smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS
smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy
smsc95xx 2-1.1:1.0 eth1: hardware isn't capable of remote wakeup
usb 2-1.4: USB disconnect, device number 4
ci_hdrc ci_hdrc.1: USB bus 2 deregistered
ci_hdrc ci_hdrc.0: remove, state 4
usb usb1: USB disconnect, device number 1
ci_hdrc ci_hdrc.0: USB bus 1 deregistered
imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot!
reboot: Restarting system

Ignore the -ENODEV errors inside __smsc95xx_mdio_read() and
__smsc95xx_phy_wait_not_busy() and do not print error messages
when -ENODEV is returned.

Fixes: a049a30fc2 ("net: usb: Correct PHY handling of smsc95xx")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-23 09:13:29 +01:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:09:35 +01:00
bonding bonding: fix data-races around agg_select_timer 2022-02-23 12:01:02 +01:00
caif
can can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready 2022-03-19 13:44:45 +01:00
dsa net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() 2022-03-16 14:15:57 +01:00
ethernet net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload 2022-03-23 09:13:28 +01:00
fddi
fjes fjes: Check for error irq 2021-12-29 12:25:57 +01:00
hamradio hamradio: fix macro redefine warning 2022-03-08 19:09:39 +01:00
hippi
hyperv hv_netvsc: Add check for kvmalloc_array 2022-03-23 09:13:28 +01:00
ieee802154 net: ieee802154: ca8210: Fix lifs/sifs periods 2022-02-23 12:01:02 +01:00
ipa net: ipa: prevent concurrent replenish 2022-02-05 12:37:55 +01:00
ipvlan
mdio net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE 2022-02-16 12:54:26 +01:00
netdevsim netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc 2021-12-22 09:30:55 +01:00
pcs
phy net: phy: mscc: Add MODULE_FIRMWARE macros 2022-03-23 09:13:28 +01:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 10:54:01 +01:00
slip
team
usb smsc95xx: Ignore -ENODEV errors when device is unplugged 2022-03-23 09:13:29 +01:00
vmxnet3 vmxnet3: do not stop tx queues after netif_device_detach() 2021-11-18 14:03:43 +01:00
wan
wimax
wireguard wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() 2021-12-08 09:03:23 +01:00
wireless iwlwifi: don't advertise TWT support 2022-03-19 13:44:45 +01:00
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-03-16 14:16:00 +01:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 14:03:49 +01:00
Kconfig ifb: Depend on netfilter alternatively to tc 2021-11-18 14:03:46 +01:00
LICENSE.SRC
loopback.c
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:30:38 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: fix bonding active backup with arp monitoring 2021-11-26 10:39:18 +01:00
veth.c veth: fix races around rq->rx_notify_masked 2022-02-16 12:54:26 +01:00
virtio_net.c
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 11:32:36 +01:00
vsockmon.c
vxlan.c
xen-netfront.c xen/netfront: react properly to failing gnttab_end_foreign_access_ref() 2022-03-11 12:11:55 +01:00