Skip to content

Commit

Permalink
dsa: qca8k: Use nested lock to avoid splat
Browse files Browse the repository at this point in the history
qca8k_phy_eth_command() is used to probe the child MDIO bus while the
parent MDIO is locked. This causes lockdep splat, reporting a possible
deadlock. It is not an actually deadlock, because different locks are
used. By making use of mutex_lock_nested() we can avoid this false
positive.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241110175955.3053664-1-andrew@lunn.ch
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Andrew Lunn authored and Jakub Kicinski committed Nov 13, 2024
1 parent b169e76 commit 078e0d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/qca/qca8k-8xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
* We therefore need to lock the MDIO bus onto which the switch is
* connected.
*/
mutex_lock(&priv->bus->mdio_lock);
mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);

/* Actually start the request:
* 1. Send mdio master packet
Expand Down

0 comments on commit 078e0d5

Please sign in to comment.