[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120501213958.GA15560@ioremap.net>
Date: Wed, 2 May 2012 01:39:58 +0400
From: Evgeniy Polyakov <zbr@...emap.net>
To: NeilBrown <neilb@...e.de>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] w1: Introduce a slave mutex for serializing IO.
On Wed, Apr 25, 2012 at 12:49:14PM +1000, NeilBrown (neilb@...e.de) wrote:
> 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.
How will this protect against master doing search for example?
It performs a number of read/write operations which are not allowed to
be interrupted by outside read.
--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists