summaryrefslogtreecommitdiff
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-09-17 16:34:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-09 14:11:03 +0200
commitab3bbb6277caf0cb47d68200b1a38246c2a8bddb (patch)
tree9601ffef899c9d6b3d9b52284b0a31d5396dde03 /include/linux/mdio.h
parent6db10b4d5efdc38ff06dfdde28dc5477f754b0bd (diff)
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>
Diffstat (limited to 'include/linux/mdio.h')
-rw-r--r--include/linux/mdio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index bfa7114167d7..85325e110a79 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -66,6 +66,9 @@ struct mdio_driver {
/* Clears up any memory if needed */
void (*remove)(struct mdio_device *mdiodev);
+
+ /* Quiesces the device on system shutdown, turns off interrupts etc */
+ void (*shutdown)(struct mdio_device *mdiodev);
};
#define to_mdio_driver(d) \
container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)