linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] i2c-core: fix for dep-lock validator
Date: Fri, 7 Sep 2012 22:51:22 +0200	[thread overview]
Message-ID: <20120907225122.06fec12e@endymion.delvare> (raw)
In-Reply-To: <50473FC9.6000203-Mmb7MZpHnFY@public.gmane.org>

On Wed, 05 Sep 2012 14:04:25 +0200, Michael Lawnick wrote:
> Documentation originally recommends to use an enum.
> This is not applicable for a tree with unlimited depth.
> This is why I use the adapter id which is expected
> to be unique and monotonic increasing with the depth of
> the tree.

For the records, "monotonic increasing with the depth of the tree"
isn't guaranteed. It is generally true, but with i2c adapter removal
and hot-plugging, it can happen that an adapter has a lower id than its
parent. For example:

* Register adapters 0, 1 and 2.
* Remove adapter 1.
* Instantiate a multiplexer on bus 2. The first child adapter will get
  number 1, and 1 < 2.

That being said, after looking at the code, I don't think lockdep cares
about locks with lower class being taken first. OTOH it cares about
locking order being always the same, and with i2c adapters coming and
going, this would have been impossible to guarantee with your first
implementation (although I very much doubt this would have been a
problem in practice.)

Of course these points are all moot anyway as we have a better
implementation which (hopefully) doesn't suffer from any of the
problems yours had.

-- 
Jean Delvare

      parent reply	other threads:[~2012-09-07 20:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 12:04 [PATCH] i2c-core: fix for dep-lock validator Michael Lawnick
     [not found] ` <50473FC9.6000203-Mmb7MZpHnFY@public.gmane.org>
2012-09-07 13:00   ` Michael Lawnick
     [not found]     ` <5049F005.2040300-Mmb7MZpHnFY@public.gmane.org>
2012-09-07 13:28       ` Jean Delvare
     [not found]         ` <20120907152840.4de537b3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-09-07 13:58           ` Michael Lawnick
     [not found]             ` <5049FD7E.9080709-Mmb7MZpHnFY@public.gmane.org>
2012-09-07 14:20               ` Jean Delvare
     [not found]                 ` <20120907162032.140f0419-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-09-07 18:07                   ` Jean Delvare
2012-09-07 20:51   ` Jean Delvare [this message]

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=20120907225122.06fec12e@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ml.lawnick-Mmb7MZpHnFY@public.gmane.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).