aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorHans-Frieder Vogt <hfvogt@gmx.net>2013-10-06 15:13:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-07 03:12:14 -0400
commitbc04d76d6942068f75c10790072280b847ec6f1f (patch)
treea43736bbba5414a42cd61a15477c6efbb6b48e0c /drivers/w1
parent2962aecef2878e2192ac9676700469678507c24d (diff)
w1 - call request_module with w1 master mutex unlocked
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 <hfvogt@gmx.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Cc: stable <stable@vger.kernel.org> # 3.11+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 0781217d2396..fa932c2f7d97 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -716,7 +716,10 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
716 atomic_set(&sl->refcnt, 0); 716 atomic_set(&sl->refcnt, 0);
717 init_completion(&sl->released); 717 init_completion(&sl->released);
718 718
719 /* slave modules need to be loaded in a context with unlocked mutex */
720 mutex_unlock(&dev->mutex);
719 request_module("w1-family-0x%0x", rn->family); 721 request_module("w1-family-0x%0x", rn->family);
722 mutex_lock(&dev->mutex);
720 723
721 spin_lock(&w1_flock); 724 spin_lock(&w1_flock);
722 f = w1_family_registered(rn->family); 725 f = w1_family_registered(rn->family);