linux/drivers/net/ethernet/smsc
Jeremy Linton e06513d78d net: smsc911x: Fix unload crash when link is up
The smsc911x driver will crash if it is rmmod'ed while the netdev
is up like:

Call trace:
  phy_detach+0x94/0x150
  phy_disconnect+0x40/0x50
  smsc911x_stop+0x104/0x128 [smsc911x]
  __dev_close_many+0xb4/0x138
  dev_close_many+0xbc/0x190
  rollback_registered_many+0x140/0x460
  rollback_registered+0x68/0xb0
  unregister_netdevice_queue+0x100/0x118
  unregister_netdev+0x28/0x38
  smsc911x_drv_remove+0x58/0x130 [smsc911x]
  platform_drv_remove+0x30/0x50
  device_release_driver_internal+0x15c/0x1f8
  driver_detach+0x54/0x98
  bus_remove_driver+0x64/0xe8
  driver_unregister+0x34/0x60
  platform_driver_unregister+0x20/0x30
  smsc911x_cleanup_module+0x14/0xbca8 [smsc911x]
  SyS_delete_module+0x1e8/0x238
  __sys_trace_return+0x0/0x4

This is caused by the mdiobus being unregistered/free'd
and the code in phy_detach() attempting to manipulate mdio
related structures from unregister_netdev() calling close()

To fix this, we delay the mdiobus teardown until after
the netdev is deregistered.

Reported-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-07 13:22:09 -05:00
..
epic100.c drivers/net: smsc: Convert timers to use timer_setup() 2017-10-28 19:09:50 +09:00
Kconfig net/smc9194: Remove bogus CONFIG_MAC reference 2018-02-22 14:44:37 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smc91c92_cs.c drivers/net: smsc: Convert timers to use timer_setup() 2017-10-28 19:09:50 +09:00
smc91x.c net: smc91x: constify dev_pm_ops structures. 2017-06-29 15:48:50 -04:00
smc91x.h net: smc91x: fix neponset breakage by pxa u16 writes 2016-10-20 11:20:57 -04:00
smc911x.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
smc911x.h
smc9194.c Annotate hardware config module parameters in drivers/net/ethernet/ 2017-04-20 12:02:32 +01:00
smc9194.h
smsc911x.c net: smsc911x: Fix unload crash when link is up 2018-03-07 13:22:09 -05:00
smsc911x.h smsc911x: Adding support for Micochip LAN9250 Ethernet controller 2017-05-03 09:41:52 -04:00
smsc9420.c drivers: net: generalize napi_complete_done() 2017-01-30 15:10:42 -05:00
smsc9420.h