Re: [PATCH] w1: Introduce a slave mutex for serializing IO.

From: Evgeniy Polyakov
Date: Sun Jun 10 2012 - 16:59:06 EST


Hi

Sorry for *that* long delay, this mail was somehow dropped.

On Fri, May 18, 2012 at 04:05:07PM +1000, NeilBrown (neilb@xxxxxxx) wrote:
> So to avoid deadlocks between w1 slaves and sysfs, these must be
> two separate locks. Making them separate means that the work around
> in ds2780 and ds2781 can be removed.
>
> So this patch:
> - adds a new mutex: "bus_mutex" which serialises access to the bus.
> - takes mutex in w1_search and ds1wm_search while they access
> the bus for searching. The mutex is dropped before calling the
> callback which adds the slave.
> - changes all slaves to use bus_mutex instead of mutex to
> protect access to the bus
> - removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the
> related code from drivers/power/ds278[01]_battery.c which
> calls them.

Greg, can you put it into the tree when merge window opens (sorry, I do
not really know release cycle dates). Since other drivers basically are
not affected (only mutex name changed for them), it should be ok, but
this new feature should be told for all new device.

Also if deadlock will be caught somewhere in w1 in current tree (which
is possible, although unlikely - w1 users are usually embedded devices
where new sysfs files are created only at startup time), we can direct
authors to this thread.

> Signed-off-by: NeilBrown <neilb@xxxxxxx>

Acked-by: Evgeniy Polyakov <zbr@xxxxxxxxxxx>

--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/