From: Thierry Reding <thierry.reding@gmail.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>,
Greg KH <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>,
Grant Likely <grant.likely@linaro.org>,
Paul Walmsley <paul@pwsan.com>,
Rob Herring <robherring2@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of/platform: Fix no irq domain found errors when populating interrupts
Date: Fri, 11 Apr 2014 20:36:26 +0200 [thread overview]
Message-ID: <20140411183625.GB3673@mithrandir> (raw)
In-Reply-To: <20140411092028.GI16119@n2100.arm.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]
On Fri, Apr 11, 2014 at 10:20:28AM +0100, Russell King - ARM Linux wrote:
> On Thu, Apr 10, 2014 at 02:38:09PM -0700, Tony Lindgren wrote:
> > Currently we get the following kind of errors if we try to use interrupt
> > phandles to irqchips that have not yet initialized:
> >
> > irq: no irq domain found for /ocp/pinmux@48002030 !
> > ------------[ cut here ]------------
> > WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184()
> > Modules linked in:
> > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012
> > (show_stack+0x14/0x1c)
> > (dump_stack+0x6c/0xa0)
> > (warn_slowpath_common+0x64/0x84)
> > (warn_slowpath_null+0x1c/0x24)
> > (of_device_alloc+0x144/0x184)
> > (of_platform_device_create_pdata+0x44/0x9c)
> > (of_platform_bus_create+0xd0/0x170)
> > (of_platform_bus_create+0x12c/0x170)
> > (of_platform_populate+0x60/0x98)
> >
> > This is because we're wrongly trying to populate resources that are not yet
> > available. It's perfectly valid to create irqchips dynamically, so let's
> > fix up the issue by populating the interrupt resources at the driver probe
> > time instead.
> >
> > Note that at least currently we cannot dynamically allocate the resources as bus
> > specific code may add legacy resources with platform_device_add_resources()
> > before the driver probe. At least omap_device_alloc() currently relies on
> > num_resources to determine if legacy resources should be added. Some of these
> > will clear automatically when mach-omap2 boots with DT only, but there are
> > probably other places too where platform_device_add_resources() modifies
> > things before driver probe.
> >
> > This patch was discussed quite a bit earlier, but so far it seems we don't
> > have any better options to fix the problem. For the earlier discussion,
> > please see:
> >
> > https://lkml.org/lkml/2013/11/22/520
> >
> > The addition of of_platform_probe() is based on patches posted earlier by
> > Thierry Reding <thierry.reding@gmail.com>.
> >
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> So what happens if a device driver probe function:
>
> - creates a new platform device
> - copies the resources from the original to the new device
> - copies the of_node from the original to the new device
> - registers the new device
>
> Yes, it's broken (because it can result in the same driver being re-probed
> by the new device) but we *do* have stuff in the kernel tree which does
> this.
From what I can tell the only clean solution would be to allow the OF
functions to properly propagate errors. My earlier attempt was exactly
that, but was deemed too invasive.
But that doesn't really solve the case you describe above either. So I
think the only good generic solution would be for all resources to be
resolved by the driver's .probe() function so that resources aren't
"cached" in the device node.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-11 18:36 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 21:38 [PATCH] of/platform: Fix no irq domain found errors when populating interrupts Tony Lindgren
2014-04-11 0:29 ` Rob Herring
2014-04-11 18:43 ` Thierry Reding
2014-04-18 20:55 ` Tony Lindgren
2014-04-11 9:20 ` Russell King - ARM Linux
2014-04-11 18:36 ` Thierry Reding [this message]
2014-04-18 21:37 ` Tony Lindgren
2014-04-18 23:18 ` Russell King - ARM Linux
-- strict thread matches above, loose matches on Subject: below --
2013-11-23 0:43 Tony Lindgren
2013-11-23 0:43 ` Tony Lindgren
2013-11-23 0:43 ` Tony Lindgren
2013-11-23 0:55 ` Russell King - ARM Linux
2013-11-23 0:55 ` Russell King - ARM Linux
2013-11-23 0:55 ` Russell King - ARM Linux
2013-11-23 1:08 ` Tony Lindgren
2013-11-23 1:08 ` Tony Lindgren
2013-11-23 1:15 ` Tony Lindgren
2013-11-23 1:15 ` Tony Lindgren
2013-11-23 1:50 ` Tony Lindgren
2013-11-23 1:50 ` Tony Lindgren
2013-11-23 1:50 ` Tony Lindgren
2013-11-23 15:42 ` Rob Herring
2013-11-23 15:42 ` Rob Herring
2013-11-23 15:42 ` Rob Herring
2013-11-23 16:32 ` Tony Lindgren
2013-11-23 16:32 ` Tony Lindgren
2013-11-23 16:32 ` Tony Lindgren
2013-11-25 9:34 ` Thierry Reding
2013-11-25 9:34 ` Thierry Reding
2013-11-25 9:34 ` Thierry Reding
2013-11-25 19:46 ` Tony Lindgren
2013-11-25 19:46 ` Tony Lindgren
2013-11-25 19:46 ` Tony Lindgren
2013-11-24 21:27 ` Grant Likely
2013-11-24 21:27 ` Grant Likely
2013-12-10 3:39 ` Paul Walmsley
2013-12-10 3:39 ` Paul Walmsley
2013-12-30 22:10 ` Paul Walmsley
2013-12-30 22:10 ` Paul Walmsley
2013-12-30 22:10 ` Paul Walmsley
[not found] ` <alpine.DEB.2.02.1312302209200.8869-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2013-12-31 16:33 ` Rob Herring
2013-12-31 16:33 ` Rob Herring
2013-12-31 16:33 ` Rob Herring
2014-01-06 23:41 ` Paul Walmsley
2014-01-06 23:41 ` Paul Walmsley
2014-01-08 1:19 ` Tony Lindgren
2014-01-08 1:19 ` Tony Lindgren
2013-11-23 1:07 ` Tony Lindgren
2013-11-23 1:07 ` Tony Lindgren
2013-11-23 1:07 ` Tony Lindgren
2013-11-24 21:36 ` Grant Likely
2013-11-24 21:36 ` Grant Likely
2013-11-24 21:36 ` Grant Likely
2013-11-25 9:25 ` Thierry Reding
2013-11-25 9:25 ` Thierry Reding
2013-11-25 9:25 ` Thierry Reding
[not found] ` < 20131125094954.GF22043@ulmo.nvidia.com>
2013-11-25 9:49 ` Thierry Reding
2013-11-25 9:49 ` Thierry Reding
2013-11-25 9:49 ` Thierry Reding
2013-11-25 19:50 ` Tony Lindgren
2013-11-25 19:50 ` Tony Lindgren
2013-11-27 15:56 ` Grant Likely
2013-11-27 15:56 ` Grant Likely
2013-11-28 15:46 ` Thierry Reding
2013-11-28 15:46 ` Thierry Reding
2013-11-28 15:46 ` Thierry Reding
2013-12-11 13:45 ` Grant Likely
2013-12-11 13:45 ` Grant Likely
2013-12-11 15:12 ` Thierry Reding
2013-12-11 15:12 ` Thierry Reding
2013-12-11 15:12 ` Thierry Reding
2013-12-11 16:43 ` Tony Lindgren
2013-12-11 16:43 ` Tony Lindgren
2013-11-27 15:54 ` Grant Likely
2013-11-27 15:54 ` Grant Likely
2013-11-27 15:54 ` Grant Likely
2013-11-27 21:53 ` Tony Lindgren
2013-11-27 21:53 ` Tony Lindgren
2013-11-27 21:53 ` Tony Lindgren
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=20140411183625.GB3673@mithrandir \
--to=thierry.reding@gmail.com \
--cc=arnd@arndb.de \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=paul@pwsan.com \
--cc=robherring2@gmail.com \
--cc=tony@atomide.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 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.