aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-04-11 21:40:05 +0200
committerDavid S. Miller <davem@davemloft.net>2016-04-11 21:15:48 -0400
commit9a6f2b0113c8fce815db7c9d23754bdea4b428a0 (patch)
tree05e5b4205fb6aebdcf105fa8866cfeceeec93ff9 /include/linux/mdio.h
parentMerge branch 'rprpc-2nd-rewrite-part-1' (diff)
downloadlinux-dev-9a6f2b0113c8fce815db7c9d23754bdea4b428a0.tar.xz
linux-dev-9a6f2b0113c8fce815db7c9d23754bdea4b428a0.zip
net: mdio: Fix lockdep falls positive splat
MDIO devices can be stacked upon each other. The current code supports two levels, which until recently has been enough for a DSA mdio bus on top of another bus. Now we have hardware which has an MDIO mux in the middle. Define an MDIO MUTEX class with three levels. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mdio.h')
-rw-r--r--include/linux/mdio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 5bfd99d1a40a..bf9d1d750693 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -13,6 +13,17 @@
struct mii_bus;
+/* Multiple levels of nesting are possible. However typically this is
+ * limited to nested DSA like layer, a MUX layer, and the normal
+ * user. Instead of trying to handle the general case, just define
+ * these cases.
+ */
+enum mdio_mutex_lock_class {
+ MDIO_MUTEX_NORMAL,
+ MDIO_MUTEX_MUX,
+ MDIO_MUTEX_NESTED,
+};
+
struct mdio_device {
struct device dev;