X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fw1%2Fw1_family.c;h=ccde36d0fed55ad6fca6cb8d7ce9a0bf17071ec7;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=6a62d2adb9d18665dda57d3168119125c7137d85;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c index 6a62d2adb..ccde36d0f 100644 --- a/drivers/w1/w1_family.c +++ b/drivers/w1/w1_family.c @@ -21,10 +21,11 @@ #include #include +#include #include "w1_family.h" -spinlock_t w1_flock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(w1_flock); static LIST_HEAD(w1_families); static int w1_check_family(struct w1_family *f) @@ -84,8 +85,13 @@ void w1_unregister_family(struct w1_family *fent) spin_unlock(&w1_flock); - while (atomic_read(&fent->refcnt)) - schedule_timeout(10); + while (atomic_read(&fent->refcnt)) { + printk(KERN_INFO "Waiting for family %u to become free: refcnt=%d.\n", + fent->fid, atomic_read(&fent->refcnt)); + + if (msleep_interruptible(1000)) + flush_signals(current); + } } /*