linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* issues calling of_platform_bus_probe() twice
@ 2012-03-16 21:21 Kumar Gala
  2012-03-16 21:23 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 9+ messages in thread
From: Kumar Gala @ 2012-03-16 21:21 UTC (permalink / raw)
  To: Grant Likely, Benjamin Herrenschmidt
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list, Timur Tabi

Guys,

Are you aware of any reason that we can't call of_platform_bus_probe() =
or multiple times.  Timur's run into an issue in which all devices don't =
get registered properly if we call of_platform_bus_probe() times with =
different of_device_id struct's.

- k=

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-16 21:21 issues calling of_platform_bus_probe() twice Kumar Gala
@ 2012-03-16 21:23 ` Benjamin Herrenschmidt
  2012-03-17  7:27   ` Grant Likely
  0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2012-03-16 21:23 UTC (permalink / raw)
  To: Kumar Gala
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list, Timur Tabi

On Fri, 2012-03-16 at 16:21 -0500, Kumar Gala wrote:
> Guys,
> 
> Are you aware of any reason that we can't call of_platform_bus_probe()
> or multiple times.  Timur's run into an issue in which all devices
> don't get registered properly if we call of_platform_bus_probe() times
> with different of_device_id struct's.

Nothing comes to mind... Grant ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-16 21:23 ` Benjamin Herrenschmidt
@ 2012-03-17  7:27   ` Grant Likely
  2012-03-17 13:35     ` Tabi Timur-B04825
  0 siblings, 1 reply; 9+ messages in thread
From: Grant Likely @ 2012-03-17  7:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Kumar Gala
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list, Timur Tabi

On Sat, 17 Mar 2012 08:23:54 +1100, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Fri, 2012-03-16 at 16:21 -0500, Kumar Gala wrote:
> > Guys,
> > 
> > Are you aware of any reason that we can't call of_platform_bus_probe()
> > or multiple times.  Timur's run into an issue in which all devices
> > don't get registered properly if we call of_platform_bus_probe() times
> > with different of_device_id struct's.
> 
> Nothing comes to mind... Grant ?

Neither for me.  Should work.

g.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-17  7:27   ` Grant Likely
@ 2012-03-17 13:35     ` Tabi Timur-B04825
  2012-03-17 23:29       ` Benjamin Herrenschmidt
  2012-03-18  9:08       ` Grant Likely
  0 siblings, 2 replies; 9+ messages in thread
From: Tabi Timur-B04825 @ 2012-03-17 13:35 UTC (permalink / raw)
  To: Grant Likely
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

Grant Likely wrote:
>>> >  >  Are you aware of any reason that we can't call of_platform_bus_pr=
obe()
>>> >  >  or multiple times.  Timur's run into an issue in which all device=
s
>>> >  >  don't get registered properly if we call of_platform_bus_probe() =
times
>>> >  >  with different of_device_id struct's.
>> >
>> >  Nothing comes to mind... Grant ?
> Neither for me.  Should work.

I posted a work-around patch here:

http://patchwork.ozlabs.org/patch/128533/

Without this patch, drivers cannot probe on DMA *channels*, or any other=20
grandchildren of the root node.

--=20
Timur Tabi
Linux kernel developer at Freescale=

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-17 13:35     ` Tabi Timur-B04825
@ 2012-03-17 23:29       ` Benjamin Herrenschmidt
  2012-03-17 23:33         ` Tabi Timur-B04825
  2012-03-18  9:08       ` Grant Likely
  1 sibling, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2012-03-17 23:29 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

On Sat, 2012-03-17 at 13:35 +0000, Tabi Timur-B04825 wrote:
> >>> >  >  Are you aware of any reason that we can't call
> of_platform_bus_probe()
> >>> >  >  or multiple times.  Timur's run into an issue in which all
> devices
> >>> >  >  don't get registered properly if we call
> of_platform_bus_probe() times
> >>> >  >  with different of_device_id struct's.
> >> >
> >> >  Nothing comes to mind... Grant ?
> > Neither for me.  Should work.
> 
> I posted a work-around patch here:
> 
> http://patchwork.ozlabs.org/patch/128533/
> 
> Without this patch, drivers cannot probe on DMA *channels*, or any
> other 
> grandchildren of the root node. 

Why don't you track down the actual bug instead ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-17 23:29       ` Benjamin Herrenschmidt
@ 2012-03-17 23:33         ` Tabi Timur-B04825
  0 siblings, 0 replies; 9+ messages in thread
From: Tabi Timur-B04825 @ 2012-03-17 23:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

Benjamin Herrenschmidt wrote:
> Why don't you track down the actual bug instead ?

I was hoping that someone who is very familiar with the code would take a=20
look.  I don't know the OF layer that well.

--=20
Timur Tabi
Linux kernel developer at Freescale=

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-17 13:35     ` Tabi Timur-B04825
  2012-03-17 23:29       ` Benjamin Herrenschmidt
@ 2012-03-18  9:08       ` Grant Likely
  2012-03-18 16:14         ` Tabi Timur-B04825
  1 sibling, 1 reply; 9+ messages in thread
From: Grant Likely @ 2012-03-18  9:08 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

On Sat, 17 Mar 2012 13:35:02 +0000, Tabi Timur-B04825 <B04825@freescale.com> wrote:
> Grant Likely wrote:
> >>> >  >  Are you aware of any reason that we can't call of_platform_bus_probe()
> >>> >  >  or multiple times.  Timur's run into an issue in which all devices
> >>> >  >  don't get registered properly if we call of_platform_bus_probe() times
> >>> >  >  with different of_device_id struct's.
> >> >
> >> >  Nothing comes to mind... Grant ?
> > Neither for me.  Should work.
> 
> I posted a work-around patch here:
> 
> http://patchwork.ozlabs.org/patch/128533/
> 
> Without this patch, drivers cannot probe on DMA *channels*, or any other 
> grandchildren of the root node.

That's because you're using it wrong.  of_platform_bus_probe() creates
platform devices at the starting level and every level below it as
described by the bus ids.  It is illegal to call of_platform_bus_probe()
twice at the same level in the DT.

g.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-18  9:08       ` Grant Likely
@ 2012-03-18 16:14         ` Tabi Timur-B04825
  2012-03-18 18:22           ` Grant Likely
  0 siblings, 1 reply; 9+ messages in thread
From: Tabi Timur-B04825 @ 2012-03-18 16:14 UTC (permalink / raw)
  To: Grant Likely
  Cc: dbaryshkov@gmail.com, devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

Grant Likely wrote:
> That's because you're using it wrong.  of_platform_bus_probe() creates
> platform devices at the starting level and every level below it as
> described by the bus ids.  It is illegal to call of_platform_bus_probe()
> twice at the same level in the DT.

Well, *I* am not using it wrong.  Notice that my patch fixes (or works=20
around) the commit that *did* do it wrong:

http://patchwork.ozlabs.org/patch/126289/

--=20
Timur Tabi
Linux kernel developer at Freescale=

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: issues calling of_platform_bus_probe() twice
  2012-03-18 16:14         ` Tabi Timur-B04825
@ 2012-03-18 18:22           ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2012-03-18 18:22 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: dbaryshkov@gmail.com, devicetree-discuss@lists.ozlabs.org Discuss,
	linuxppc-dev@lists.ozlabs.org list

On Sun, 18 Mar 2012 16:14:23 +0000, Tabi Timur-B04825 <B04825@freescale.com> wrote:
> Grant Likely wrote:
> > That's because you're using it wrong.  of_platform_bus_probe() creates
> > platform devices at the starting level and every level below it as
> > described by the bus ids.  It is illegal to call of_platform_bus_probe()
> > twice at the same level in the DT.
> 
> Well, *I* am not using it wrong.  Notice that my patch fixes (or works 
> around) the commit that *did* do it wrong:
> 
> http://patchwork.ozlabs.org/patch/126289/

Fair enough; I just wanted to point out that there it can only dig as
deep into the tree as is specified by the bus ids.  The exact problem
wasn't calling the function twice, but rather trying to call the
function twice from the same level of the tree.

BTW, I also recommend moving to of_platform_populate() for new code.
I think the behaviour is more consistent for fdt platforms and it
is more convenient for devices that are children of the root.

g.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-03-18 18:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 21:21 issues calling of_platform_bus_probe() twice Kumar Gala
2012-03-16 21:23 ` Benjamin Herrenschmidt
2012-03-17  7:27   ` Grant Likely
2012-03-17 13:35     ` Tabi Timur-B04825
2012-03-17 23:29       ` Benjamin Herrenschmidt
2012-03-17 23:33         ` Tabi Timur-B04825
2012-03-18  9:08       ` Grant Likely
2012-03-18 16:14         ` Tabi Timur-B04825
2012-03-18 18:22           ` Grant Likely

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).