linux_dsm_epyc7002/drivers/net/phy
Mark Salter b6c6aedcbc phylib: fix device deletion order in mdiobus_unregister()
commit 8b63ec1837 ("phylib: Make PHYs children of their MDIO bus, not
the bus' parent.") uncovered a problem in mdiobus_unregister() which
leads to this warning when I reboot an APM Mustang (arm64) platform:

  WARNING: CPU: 7 PID: 4239 at fs/sysfs/group.c:224 sysfs_remove_group+0xa0/0xa4()
  sysfs group fffffe0000e07a10 not found for kobject 'xgene-mii-eth0:03'
  ...
  CPU: 7 PID: 4239 Comm: reboot Tainted: G            E   4.2.0-0.18.el7.test15.aarch64 #1
  Hardware name: AppliedMicro Mustang/Mustang, BIOS 1.1.0 Aug 26 2015
  Call Trace:
  [<fffffe000009739c>] dump_backtrace+0x0/0x170
  [<fffffe000009752c>] show_stack+0x20/0x2c
  [<fffffe00007436f0>] dump_stack+0x78/0x9c
  [<fffffe00000c2cb4>] warn_slowpath_common+0xa0/0xd8
  [<fffffe00000c2d60>] warn_slowpath_fmt+0x74/0x88
  [<fffffe0000293d3c>] sysfs_remove_group+0x9c/0xa4
  [<fffffe00004a8bac>] dpm_sysfs_remove+0x5c/0x70
  [<fffffe000049b388>] device_del+0x44/0x208
  [<fffffe000049b578>] device_unregister+0x2c/0x7c
  [<fffffe000050dc68>] mdiobus_unregister+0x48/0x94
  [<fffffe000052afd0>] xgene_enet_mdio_remove+0x28/0x44
  [<fffffe000052d3f0>] xgene_enet_remove+0xd0/0xd8
  [<fffffe000052d424>] xgene_enet_shutdown+0x2c/0x3c
  [<fffffe00004a204c>] platform_drv_shutdown+0x24/0x40
  [<fffffe000049d4f4>] device_shutdown+0xf0/0x1b4
  [<fffffe00000e31ec>] kernel_restart_prepare+0x40/0x4c
  [<fffffe00000e32f8>] kernel_restart+0x1c/0x80
  [<fffffe00000e3670>] SyS_reboot+0x17c/0x250

The problem is that mdiobus_unregister() deletes the bus device before
unregistering the phy devices on the bus. This wasn't a problem before
because the phys were not children of the bus:

  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0:03
  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0

But now that they are:

  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0/xgene-mii-eth0:03

when mdiobus_unregister deletes the bus device, the phy subdirs are
removed from sysfs also. So when the phys are unregistered afterward,
we get the warning. This patch changes the order so that phys are
unregistered before the bus device is deleted.

Fixes: 8b63ec1837 ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Signed-off-by: Mark Salter <msalter@redhat.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-09-01 15:02:36 -07:00
..
amd.c net: phy: replace phy_driver_register calls 2014-11-12 13:52:53 -05:00
aquantia.c net: phy: add interrupt support for aquantia phy 2015-08-23 23:14:14 -07:00
at803x.c net: phy: at803x: simplify using devm_gpiod_get_optional and its 4th argument 2015-04-01 12:44:04 -04:00
bcm7xxx.c net: phy: bcm7xxx: workaround MDIO management controller initial read 2015-06-28 20:28:20 -07:00
bcm63xx.c net: phy: replace phy_drivers_register calls 2014-11-12 13:52:53 -05:00
bcm87xx.c net: phy: replace phy_drivers_register calls 2014-11-12 13:52:53 -05:00
broadcom.c net: phy: broadcom: Add BCM54616S phy entry 2015-04-08 15:28:13 -04:00
cicada.c net: phy: replace phy_drivers_register calls 2014-11-12 13:52:53 -05:00
davicom.c net: phy: davicom: add IDs for DM9161B and C variants 2015-06-11 00:24:53 -07:00
dp83640_reg.h
dp83640.c dp83640: only report generic filters in ts_info 2015-07-17 19:59:06 -07:00
dp83867.c net: phy: dp83867: fix simple_return.cocci warnings 2015-07-27 00:59:16 -07:00
et1011c.c net: phy: replace phy_driver_register calls 2014-11-12 13:52:53 -05:00
fixed_phy.c net: phy: fixed_phy: Set phy capabilities even when link down. 2015-08-31 14:48:03 -07:00
icplus.c net: phy: Utilize phy_interface_is_rgmii 2015-05-27 00:27:35 -04:00
Kconfig net: phy: add driver for aquantia phy 2015-07-31 15:28:19 -07:00
lxt.c net: phy: replace phy_drivers_register calls 2014-11-12 13:52:53 -05:00
Makefile net: phy: add driver for aquantia phy 2015-07-31 15:28:19 -07:00
marvell.c net: phy: select copper mode when Marvel 88e1111 in SGMII 2015-08-10 13:31:18 -07:00
mdio_bus.c phylib: fix device deletion order in mdiobus_unregister() 2015-09-01 15:02:36 -07:00
mdio-bcm-unimac.c net: phy: mdio-bcm-unimac: workaround initial read failures for integrated PHYs 2015-06-28 20:28:20 -07:00
mdio-bitbang.c net: phy: mdio-gpio: Handle phy_ignore_ta_mask 2015-05-14 13:40:55 -04:00
mdio-gpio.c mdio-gpio: Propagate mii_bus.phy_ignore_ta_mask 2015-05-14 22:35:13 -04:00
mdio-moxart.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
mdio-mux-gpio.c gpiolib: rename gpiod_set_array to gpiod_set_array_value 2015-06-01 15:10:09 +02:00
mdio-mux-mmioreg.c net: phy: constify of_device_id array 2015-03-17 15:00:23 -04:00
mdio-mux.c
mdio-octeon.c net: mdio-octeon: Fix octeon_mdiobus_probe function for return values 2015-07-29 17:17:44 -07:00
mdio-sun4i.c net: sun4i: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
micrel.c net/phy: micrel: Center FLP timing at 16ms 2015-06-08 00:50:48 -07:00
national.c net: phy: replace phy_driver_register calls 2014-11-12 13:52:53 -05:00
phy_device.c phylib: simplify NULL checks 2015-08-28 14:15:25 -07:00
phy.c phylib: simplify NULL checks 2015-08-28 14:15:25 -07:00
qsemi.c net: phy: replace phy_driver_register calls 2014-11-12 13:52:53 -05:00
realtek.c net: phy: add RealTek RTL8211DN phy id 2015-08-09 22:52:15 -07:00
smsc.c net: phy: fix semicolon.cocci warnings 2015-08-17 15:53:06 -07:00
spi_ks8995.c net: phy: spi_ks8995: clean up ks8995_registers_read/write 2015-07-30 14:16:45 -07:00
ste10Xp.c net: phy: replace phy_drivers_register calls 2014-11-12 13:52:53 -05:00
teranetics.c net: phy: fix auto negotiation checking for teranetics 2015-07-27 01:04:30 -07:00
vitesse.c net/phy: Add Vitesse 8641 phy ID 2015-06-25 02:13:05 -07:00