diff options
author | David Fries <david@fries.net> | 2008-10-15 22:04:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 11:21:49 -0700 |
commit | 01e14d6db9654be005a0a5384090aea2cde39976 (patch) | |
tree | 9db896b843f763a17d97105fbcef597367d50395 /drivers/w1/w1.c | |
parent | 0d671b272af9eb06260ab3fd210d454e98dd4216 (diff) | |
download | kernel_samsung_smdk4412-01e14d6db9654be005a0a5384090aea2cde39976.zip kernel_samsung_smdk4412-01e14d6db9654be005a0a5384090aea2cde39976.tar.gz kernel_samsung_smdk4412-01e14d6db9654be005a0a5384090aea2cde39976.tar.bz2 |
W1: don't delay search start
Move the creation of the w1_process thread to after the device has been
initialized. This way w1_process doesn't have to check to see if it has
been initialized and the bus search can proceed without sleeping. That
also eliminates two checks in the w1_process loop. The sleep now happens
at the end of the loop not the beginning.
Also added a comment for why the atomic_set was 2.
Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r-- | drivers/w1/w1.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index aac03f1..730faa4 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -813,21 +813,14 @@ int w1_process(void *data) struct w1_master *dev = (struct w1_master *) data; while (!kthread_should_stop() && !test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) { + if (dev->search_count) { + mutex_lock(&dev->mutex); + w1_search_process(dev, W1_SEARCH); + mutex_unlock(&dev->mutex); + } + try_to_freeze(); msleep_interruptible(w1_timeout * 1000); - - if (kthread_should_stop() || test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) - break; - - if (!dev->initialized) - continue; - - if (dev->search_count == 0) - continue; - - mutex_lock(&dev->mutex); - w1_search_process(dev, W1_SEARCH); - mutex_unlock(&dev->mutex); } atomic_dec(&dev->refcnt); |