public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio <linux-gpio@vger.kernel.org>
Subject: Re: lockdep: incorrect deadlock warning with two GPIO expanders
Date: Mon, 12 Sep 2016 17:33:56 +0200	[thread overview]
Message-ID: <20160912153356.GD10121@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAMpxmJW5WNF2zE+fjmpDxubAYA_A67iQhNGTvSAL-MD-6dFTCw@mail.gmail.com>

On Mon, Sep 12, 2016 at 05:16:14PM +0200, Bartosz Golaszewski wrote:

> >>                                                - - - - -
> >>  -------             ---------  Bus segment 1 |         |
> >> |       |           |         |---------------  Devices
> >> |       | SCL/SDA   |         |               |         |
> >> | Linux |-----------| I2C MUX |                - - - - -
> >> |       |    |      |         | Bus segment 2
> >> |       |    |      |         |-------------------
> >>  -------     |       ---------                    |
> >>              |           |                    - - - - -
> >>         ------------     | MUX GPIO          |         |
> >>        |            |    |                     Devices
> >>        |    GPIO    |    |                   |         |
> >>        | Expander 1 |----                     - - - - -
> >>        |            |                             |
> >>         ------------                              | SCL/SDA
> >>                                                   |
> >>                                              ------------
> >>                                             |            |
> >>                                             |    GPIO    |
> >>                                             | Expander 2 |
> >>                                             |            |
> >>                                              ------------

> > The tricky part, and here I have absolutely no clue what so ever, is
> > being able to tell at pca953x_probe() time that this is so.
> >
> 
> AFAIK there is no clean way to tell that a GPIO is used by an I2C
> multiplexer at probe time. Linus, Alexandre could you confirm?

You cannot inspect the device tree while probing?

> It uses the fact that the two expanders we have are of different type
> (pca9534 and pca9535). The id pointer points to per-chip device info
> residing in .data which makes it suitable for mutex key.
> 
> I don't think such hack is suitable for mainline though.

Right, that works by accident rather than anything else :-)

  reply	other threads:[~2016-09-12 15:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 11:51 lockdep: incorrect deadlock warning with two GPIO expanders Bartosz Golaszewski
2016-09-12 12:09 ` Peter Zijlstra
2016-09-12 15:16   ` Bartosz Golaszewski
2016-09-12 15:33     ` Peter Zijlstra [this message]
2016-09-13 12:29       ` Linus Walleij
2016-09-15  7:51         ` Peter Zijlstra
2016-09-15 12:41           ` Linus Walleij
2016-09-15 13:20             ` Bartosz Golaszewski
2016-09-15 13:39               ` Peter Zijlstra
2016-09-15 14:08                 ` Bartosz Golaszewski
2016-09-15 14:38                   ` Peter Zijlstra
2016-09-15 15:23                     ` Bartosz Golaszewski
2016-09-16 10:56                 ` Peter Zijlstra
2016-09-16 11:14                   ` Bartosz Golaszewski
2016-09-16 12:00                     ` Bartosz Golaszewski
2016-09-16 14:21             ` Bartosz Golaszewski

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=20160912153356.GD10121@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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