public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	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: Thu, 15 Sep 2016 09:51:50 +0200	[thread overview]
Message-ID: <20160915075150.GO5008@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CACRpkdb00e=YexmCRwv=evVLjBDM6Pjqtcs+Mnc8JVD1Ssa5mA@mail.gmail.com>

On Tue, Sep 13, 2016 at 02:29:24PM +0200, Linus Walleij wrote:
> On Mon, Sep 12, 2016 at 5:33 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, Sep 12, 2016 at 05:16:14PM +0200, Bartosz Golaszewski wrote:
> 
> >> 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?
> 
> Nominally, the GPIO descriptors are just abstract resources such
> as regulators or clocks, they can be used for a lot but just like
> a clock, regulator, dma channel etc does not know who is using
> it and for what, it does not know this, no.
> 
> > You cannot inspect the device tree while probing?
> 
> Of course it *can* but we would end up encoding a special
> case every time something like this happens, tied to just
> device tree, then another bolt-on for ACPI etc.
> 
> I have a hard time following the problem really, I'm
> afraid I'm simply just not smart enough :(

Why would this be DT or ACPI specific? Linux itself has a tree/graph of
all busses and devices right? That's what all this drivers/base/ stuff
is on about.

So can't you walk up that and see if you encounter the exact same driver
again?

Something like:

	for (nr = 0, parent = dev->parent; parent; parent = parent->parent) {
		if (parent->device_driver == &pca953x_driver.driver)
			nr++;
	}

Again, I have no clue how any of this works, but that seems like
something that ought to work.

  reply	other threads:[~2016-09-15  7:51 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
2016-09-13 12:29       ` Linus Walleij
2016-09-15  7:51         ` Peter Zijlstra [this message]
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=20160915075150.GO5008@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