Commit a9fe964e authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: sfp: swap order of rtnl and st_mutex locks

Swap the order of the rtnl and st_mutex locks - st_mutex is now nested
beneath rtnl lock instead of rtnl being beneath st_mutex. This will
allow us to hold st_mutex only while manipulating the module's hardware
or software control state.
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d47e5a43
...@@ -2600,8 +2600,8 @@ static void sfp_check_state(struct sfp *sfp) ...@@ -2600,8 +2600,8 @@ static void sfp_check_state(struct sfp *sfp)
{ {
unsigned int state, i, changed; unsigned int state, i, changed;
mutex_lock(&sfp->st_mutex);
rtnl_lock(); rtnl_lock();
mutex_lock(&sfp->st_mutex);
state = sfp_get_state(sfp); state = sfp_get_state(sfp);
changed = state ^ sfp->state; changed = state ^ sfp->state;
if (sfp->tx_fault_ignore) if (sfp->tx_fault_ignore)
...@@ -2628,8 +2628,8 @@ static void sfp_check_state(struct sfp *sfp) ...@@ -2628,8 +2628,8 @@ static void sfp_check_state(struct sfp *sfp)
if (changed & SFP_F_LOS) if (changed & SFP_F_LOS)
sfp_sm_event(sfp, state & SFP_F_LOS ? sfp_sm_event(sfp, state & SFP_F_LOS ?
SFP_E_LOS_HIGH : SFP_E_LOS_LOW); SFP_E_LOS_HIGH : SFP_E_LOS_LOW);
rtnl_unlock();
mutex_unlock(&sfp->st_mutex); mutex_unlock(&sfp->st_mutex);
rtnl_unlock();
} }
static irqreturn_t sfp_irq(int irq, void *data) static irqreturn_t sfp_irq(int irq, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment