Skip to content

Commit

Permalink
w1 - call request_module with w1 master mutex unlocked
Browse files Browse the repository at this point in the history
request_module for w1 slave modules needs to be called with the w1
master mutex unlocked. Because w1_attach_slave_device gets always(?)
called with mutex locked, we need to temporarily unlock the w1 master
mutex for the loading of the w1 slave module.

Signed-off by: Hans-Frieder Vogt <[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Cc: stable <[email protected]> # 3.11+

Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
hfvogt authored and gregkh committed Oct 7, 2013
1 parent 2962aec commit bc04d76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,10 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
atomic_set(&sl->refcnt, 0);
init_completion(&sl->released);

/* slave modules need to be loaded in a context with unlocked mutex */
mutex_unlock(&dev->mutex);
request_module("w1-family-0x%0x", rn->family);
mutex_lock(&dev->mutex);

spin_lock(&w1_flock);
f = w1_family_registered(rn->family);
Expand Down

0 comments on commit bc04d76

Please sign in to comment.