linux-stable/drivers/net/dsa/microchip
Vladimir Oltean fe4053078c net: dsa: microchip: ksz8863: be compatible with masters which unregister on shutdown
Since commit 2f1e8ea726 ("net: dsa: link interfaces with the DSA
master to get rid of lockdep warnings"), DSA gained a requirement which
it did not fulfill, which is to unlink itself from the DSA master at
shutdown time.

Since the Microchip sub-driver for KSZ8863 was introduced after the bad
commit, it has never worked with DSA masters which decide to unregister
their net_device on shutdown, effectively hanging the reboot process.
To fix that, we need to call dsa_switch_shutdown.

Since this driver expects the MDIO bus to be backed by mdio_bitbang, I
don't think there is currently any MDIO bus driver which implements its
->shutdown by redirecting it to ->remove, but in any case, to be
compatible with that pattern, it is necessary to implement an "if this
then not that" scheme, to avoid ->remove and ->shutdown from being
called both for the same struct device.

Fixes: 60a3647600 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/
Reported-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-19 12:08:37 +01:00
..
Kconfig net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00
ksz8.h net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct 2021-04-27 14:13:23 -07:00
ksz8795.c net: dsa: microchip: ksz8795: Don't use phy_port_cnt in VLAN table lookup 2021-08-10 09:58:15 +01:00
ksz8795_reg.h net: dsa: microchip: ksz8795: Fix PVID tag insertion 2021-08-10 09:58:14 +01:00
ksz8795_spi.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz8863_smi.c net: dsa: microchip: ksz8863: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz9477.c net: dsa: microchip: enable phy errata workaround on 9567 2021-05-24 14:27:18 -07:00
ksz9477_i2c.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz9477_reg.h net: dsa: microchip: Use the correct style for SPDX License Identifier 2019-10-15 14:59:58 -07:00
ksz9477_spi.c net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
ksz_common.c dsa: fix for_each_child.cocci warnings 2021-07-11 10:01:55 -07:00
ksz_common.h net: dsa: microchip: ksz8795: Reject unsupported VLAN configuration 2021-08-10 09:58:14 +01:00
Makefile net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support 2021-04-27 14:13:24 -07:00