]> git.karo-electronics.de Git - karo-tx-linux.git/commit
w1: introduce a slave mutex for serializing IO
authorNeilBrown <neilb@suse.de>
Thu, 3 May 2012 05:44:56 +0000 (15:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:53:02 +0000 (15:53 +1000)
commit1899079b1ab5d565f60b52550b0f502bbd5c4656
tree3ad556701318e71980cbe94a8020605be6ce2e09
parent00db93dc1171a8b987768f5d04f6cc076f5606d2
w1: introduce a slave mutex for serializing IO

w1 devices need a mutex to serial IO.  Most use master->mutex.
However that is used for other purposes and they can conflict.

In particular master->mutex is held while w1_attach_slave_device is
called.

For bq27000, this registers a 'powersupply' device which tries to read the
current status.  The attempt to read will cause a deadlock on
master->mutex.

So create a new per-slave mutex and use that for serializing IO for
bq27000.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/w1/slaves/w1_bq27000.c
drivers/w1/w1.c
drivers/w1/w1.h