From: Evgeniy Polyakov <zbr@ioremap.net>
To: NeilBrown <neilb@suse.de>
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] w1: Introduce a slave mutex for serializing IO.
Date: Wed, 2 May 2012 01:39:58 +0400 [thread overview]
Message-ID: <20120501213958.GA15560@ioremap.net> (raw)
In-Reply-To: <20120425124914.3187a794@notabene.brown>
On Wed, Apr 25, 2012 at 12:49:14PM +1000, NeilBrown (neilb@suse.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
next prev parent reply other threads:[~2012-05-01 21:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 2:49 [PATCH] w1: Introduce a slave mutex for serializing IO NeilBrown
2012-05-01 21:39 ` Evgeniy Polyakov [this message]
2012-05-02 6:26 ` NeilBrown
2012-05-03 17:58 ` Evgeniy Polyakov
2012-05-03 21:08 ` NeilBrown
2012-05-03 21:27 ` Evgeniy Polyakov
2012-05-09 1:43 ` NeilBrown
2012-05-15 1:26 ` Evgeniy Polyakov
2012-05-18 6:05 ` NeilBrown
2012-06-10 20:58 ` Evgeniy Polyakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120501213958.GA15560@ioremap.net \
--to=zbr@ioremap.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.