net: mdio: introduce a shutdown method to mdio device drivers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 17 Sep 2021 13:34:32 +0000 (16:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Oct 2021 12:09:45 +0000 (14:09 +0200)
commite8c19822789f43f6e678b687172ff7361e141a34
treeb3931702d1d10dfda9aabb63daecae6134d3307f
parent756db2ba8bde4ead58ceb54e9cbc71f526f9a98f
net: mdio: introduce a shutdown method to mdio device drivers

[ Upstream commit cf9579976f724ad517cc15b7caadea728c7e245c ]

MDIO-attached devices might have interrupts and other things that might
need quiesced when we kexec into a new kernel. Things are even more
creepy when those interrupt lines are shared, and in that case it is
absolutely mandatory to disable all interrupt sources.

Moreover, MDIO devices might be DSA switches, and DSA needs its own
shutdown method to unlink from the DSA master, which is a new
requirement that appeared after commit 2f1e8ea726e9 ("net: dsa: link
interfaces with the DSA master to get rid of lockdep warnings").

So introduce a ->shutdown method in the MDIO device driver structure.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mdio_device.c
include/linux/mdio.h