From: Antti Palosaari <crope@iki.fi>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-media@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 1/2] regmap: pass map name to lockdep
Date: Fri, 19 Dec 2014 12:58:38 +0200 [thread overview]
Message-ID: <549404DE.3060905@iki.fi> (raw)
In-Reply-To: <5493485E.7020803@metafoo.de>
On 12/18/2014 11:34 PM, Lars-Peter Clausen wrote:
> On 12/18/2014 10:05 PM, Antti Palosaari wrote:
>> lockdep complains recursive locking and deadlock when two different
>> regmap instances are called in a nested order. That happen easily
>> for example when both I2C client and muxed/repeater I2C adapter are
>> using regmap. As a solution, pass regmap name for lockdep in order
>> to force lockdep validate regmap mutex per driver - not as all regmap
>> instances grouped together.
>
> That's not how it works. Locks are grouped by lock class, the name is
> just for pretty printing. The only reason you do not get a warning
> anymore is because you have now different lock classes one for configs
> with a name and one for configs without a name.
>
> You really need a way to specify a custom lock class per regmap instance
> in order to solve this problem.
I looked example for that solution from v4l controls. So it is also wrong?
https://patchwork.linuxtv.org/patch/17262/
Do you think I should change to mutex_lock_nested() as documented in
Documentation/locking/lockdep-design.txt ?
Should these macros used at all:
include/linux/lockdep.h
There is not much documentation, especially how these recursive lock
warnings should be silenced.
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2014-12-19 10:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 21:05 [PATCH 1/2] regmap: pass map name to lockdep Antti Palosaari
2014-12-18 21:05 ` [PATCH 2/2] rtl2832: add name for RegMap Antti Palosaari
2014-12-18 21:34 ` [PATCH 1/2] regmap: pass map name to lockdep Lars-Peter Clausen
2014-12-19 10:58 ` Antti Palosaari [this message]
2014-12-19 13:45 ` Lars-Peter Clausen
2014-12-19 14:19 ` Antti Palosaari
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=549404DE.3060905@iki.fi \
--to=crope@iki.fi \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-media@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).