All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-17 16:28 ` Hoang-Nam Nguyen
  0 siblings, 0 replies; 12+ messages in thread
From: Hoang-Nam Nguyen @ 2007-02-17 16:28 UTC (permalink / raw)
  To: paulus, linuxppc-dev, linux-kernel, johnrose, Sylvain Munaut; +Cc: pmac, fenkes

ibmebus has a fake root device that's not associated with an ofdt node.
Filter out any such devices in of_device_uevent().


Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---


 of_device.c |    4 ++++
 1 files changed, 4 insertions(+)


diff -urp a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
--- a/arch/powerpc/kernel/of_device.c	2007-02-17 16:36:32.116368480 +0100
+++ b/arch/powerpc/kernel/of_device.c	2007-02-17 16:44:01.319366352 +0100
@@ -180,6 +180,10 @@ int of_device_uevent(struct device *dev,
 
 	ofdev = to_of_device(dev);
 
+	/* e.g. ibmebus has a fake root device w/o ofdt node -- filter that */
+	if (!ofdev->node)
+		return -ENODEV;
+
 	if (add_uevent_var(envp, num_envp, &i,
 			   buffer, buffer_size, &length,
 			   "OF_NAME=%s", ofdev->node->name))


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

* [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-17 16:28 ` Hoang-Nam Nguyen
  0 siblings, 0 replies; 12+ messages in thread
From: Hoang-Nam Nguyen @ 2007-02-17 16:28 UTC (permalink / raw)
  To: paulus, linuxppc-dev, linux-kernel, johnrose, Sylvain Munaut; +Cc: fenkes, pmac

ibmebus has a fake root device that's not associated with an ofdt node.
Filter out any such devices in of_device_uevent().


Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---


 of_device.c |    4 ++++
 1 files changed, 4 insertions(+)


diff -urp a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
--- a/arch/powerpc/kernel/of_device.c	2007-02-17 16:36:32.116368480 +0100
+++ b/arch/powerpc/kernel/of_device.c	2007-02-17 16:44:01.319366352 +0100
@@ -180,6 +180,10 @@ int of_device_uevent(struct device *dev,
 
 	ofdev = to_of_device(dev);
 
+	/* e.g. ibmebus has a fake root device w/o ofdt node -- filter that */
+	if (!ofdev->node)
+		return -ENODEV;
+
 	if (add_uevent_var(envp, num_envp, &i,
 			   buffer, buffer_size, &length,
 			   "OF_NAME=%s", ofdev->node->name))

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
  2007-02-17 16:28 ` Hoang-Nam Nguyen
@ 2007-02-17 21:56   ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-17 21:56 UTC (permalink / raw)
  To: Hoang-Nam Nguyen
  Cc: paulus, linuxppc-dev, linux-kernel, johnrose, Sylvain Munaut,
	fenkes, pmac

On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> ibmebus has a fake root device that's not associated with an ofdt node.
> Filter out any such devices in of_device_uevent().

Doh ! You are creating an of_device with no attached device-node ? That
is totally evil ! Why do you need that ?

Ben.

> 
> Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
> ---
> 
> 
>  of_device.c |    4 ++++
>  1 files changed, 4 insertions(+)
> 
> 
> diff -urp a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
> --- a/arch/powerpc/kernel/of_device.c	2007-02-17 16:36:32.116368480 +0100
> +++ b/arch/powerpc/kernel/of_device.c	2007-02-17 16:44:01.319366352 +0100
> @@ -180,6 +180,10 @@ int of_device_uevent(struct device *dev,
>  
>  	ofdev = to_of_device(dev);
>  
> +	/* e.g. ibmebus has a fake root device w/o ofdt node -- filter that */
> +	if (!ofdev->node)
> +		return -ENODEV;
> +
>  	if (add_uevent_var(envp, num_envp, &i,
>  			   buffer, buffer_size, &length,
>  			   "OF_NAME=%s", ofdev->node->name))
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev


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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-17 21:56   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-17 21:56 UTC (permalink / raw)
  To: Hoang-Nam Nguyen
  Cc: pmac, fenkes, linux-kernel, linuxppc-dev, paulus, johnrose

On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> ibmebus has a fake root device that's not associated with an ofdt node.
> Filter out any such devices in of_device_uevent().

Doh ! You are creating an of_device with no attached device-node ? That
is totally evil ! Why do you need that ?

Ben.

> 
> Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
> ---
> 
> 
>  of_device.c |    4 ++++
>  1 files changed, 4 insertions(+)
> 
> 
> diff -urp a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
> --- a/arch/powerpc/kernel/of_device.c	2007-02-17 16:36:32.116368480 +0100
> +++ b/arch/powerpc/kernel/of_device.c	2007-02-17 16:44:01.319366352 +0100
> @@ -180,6 +180,10 @@ int of_device_uevent(struct device *dev,
>  
>  	ofdev = to_of_device(dev);
>  
> +	/* e.g. ibmebus has a fake root device w/o ofdt node -- filter that */
> +	if (!ofdev->node)
> +		return -ENODEV;
> +
>  	if (add_uevent_var(envp, num_envp, &i,
>  			   buffer, buffer_size, &length,
>  			   "OF_NAME=%s", ofdev->node->name))
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
  2007-02-17 21:56   ` Benjamin Herrenschmidt
@ 2007-02-18  0:21     ` Joachim Fenkes
  -1 siblings, 0 replies; 12+ messages in thread
From: Joachim Fenkes @ 2007-02-18  0:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Hoang-Nam Nguyen, johnrose, linux-kernel, linuxppc-dev, paulus,
	pmac, Sylvain Munaut

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007 
16:56:39:

> On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> > ibmebus has a fake root device that's not associated with an ofdt 
node.
> > Filter out any such devices in of_device_uevent().
> 
> Doh ! You are creating an of_device with no attached device-node ? That
> is totally evil ! Why do you need that ?

The driver creates a fake "ibmebus" device so all ibmebus based devices 
have
a common parent device -- the vio bus does the same.

What do you think about linking this device to the device tree "/" node? 
All
ibmebus-based devices are linked to dt nodes residing directly beneath 
"/",
so the mapping would fit.

Cheers,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer 
extraordinaire
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development 
2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 

Vorsitzender des Aufsichtsrats: Johann Weihen  --  Geschäftsführung: 
Herbert Kircher
Sitz der Gesellschaft: Böblingen  --  Registergericht: Amtsgericht 
Stuttgart, HRB 243294


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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-18  0:21     ` Joachim Fenkes
  0 siblings, 0 replies; 12+ messages in thread
From: Joachim Fenkes @ 2007-02-18  0:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: pmac, linux-kernel, linuxppc-dev, paulus, Hoang-Nam Nguyen, johnrose

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007=20
16:56:39:

> On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> > ibmebus has a fake root device that's not associated with an ofdt=20
node.
> > Filter out any such devices in of=5Fdevice=5Fuevent().
>=20
> Doh ! You are creating an of=5Fdevice with no attached device-node ? That
> is totally evil ! Why do you need that ?

The driver creates a fake "ibmebus" device so all ibmebus based devices=20
have
a common parent device -- the vio bus does the same.

What do you think about linking this device to the device tree "/" node?=20
All
ibmebus-based devices are linked to dt nodes residing directly beneath=20
"/",
so the mapping would fit.

Cheers,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer=20
extraordinaire
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development =

2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239=20

Vorsitzender des Aufsichtsrats: Johann Weihen  --  Gesch=E4ftsf=FChrung:=20
Herbert Kircher
Sitz der Gesellschaft: B=F6blingen  --  Registergericht: Amtsgericht=20
Stuttgart, HRB 243294

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
  2007-02-18  0:21     ` Joachim Fenkes
@ 2007-02-18  0:37       ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-18  0:37 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: Hoang-Nam Nguyen, johnrose, linux-kernel, linuxppc-dev, paulus,
	pmac, Sylvain Munaut

On Sat, 2007-02-17 at 19:21 -0500, Joachim Fenkes wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007 
> 16:56:39:
> 
> > On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> > > ibmebus has a fake root device that's not associated with an ofdt 
> node.
> > > Filter out any such devices in of_device_uevent().
> > 
> > Doh ! You are creating an of_device with no attached device-node ? That
> > is totally evil ! Why do you need that ?
> 
> The driver creates a fake "ibmebus" device so all ibmebus based devices 
> have
> a common parent device -- the vio bus does the same.
> 
> What do you think about linking this device to the device tree "/" node? 
> All
> ibmebus-based devices are linked to dt nodes residing directly beneath 
> "/",
> so the mapping would fit.

No. If you do that, it shouldn't be an of_device based device.

If you want then to be below a common parent, then create that parent of
a basic struct device type, that sort of thing. You should never
instanciate an of_device that has a NULL device node.

vio is different since it's not a "subclass" of of_device though I tend
to also disagree with the way it does things.

It's a generic problem with sysfs, I agree it somewhat sucks.

Ben.



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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-18  0:37       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-18  0:37 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: pmac, linux-kernel, linuxppc-dev, paulus, Hoang-Nam Nguyen, johnrose

On Sat, 2007-02-17 at 19:21 -0500, Joachim Fenkes wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007 
> 16:56:39:
> 
> > On Sat, 2007-02-17 at 17:28 +0100, Hoang-Nam Nguyen wrote:
> > > ibmebus has a fake root device that's not associated with an ofdt 
> node.
> > > Filter out any such devices in of_device_uevent().
> > 
> > Doh ! You are creating an of_device with no attached device-node ? That
> > is totally evil ! Why do you need that ?
> 
> The driver creates a fake "ibmebus" device so all ibmebus based devices 
> have
> a common parent device -- the vio bus does the same.
> 
> What do you think about linking this device to the device tree "/" node? 
> All
> ibmebus-based devices are linked to dt nodes residing directly beneath 
> "/",
> so the mapping would fit.

No. If you do that, it shouldn't be an of_device based device.

If you want then to be below a common parent, then create that parent of
a basic struct device type, that sort of thing. You should never
instanciate an of_device that has a NULL device node.

vio is different since it's not a "subclass" of of_device though I tend
to also disagree with the way it does things.

It's a generic problem with sysfs, I agree it somewhat sucks.

Ben.

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
  2007-02-18  0:37       ` Benjamin Herrenschmidt
@ 2007-02-19 16:36         ` Joachim Fenkes
  -1 siblings, 0 replies; 12+ messages in thread
From: Joachim Fenkes @ 2007-02-19 16:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Hoang-Nam Nguyen, johnrose, linux-kernel, linuxppc-dev, paulus,
	pmac, Sylvain Munaut

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007 
19:37:25:

> > > Doh ! You are creating an of_device with no attached device-node ? 
That
> > > is totally evil ! Why do you need that ?
> > 
> > The driver creates a fake "ibmebus" device so all ibmebus based 
devices 
> > have
> > a common parent device -- the vio bus does the same.
> > 
> > What do you think about linking this device to the device tree "/" 
node? 
> > All
> > ibmebus-based devices are linked to dt nodes residing directly beneath 

> > "/",
> > so the mapping would fit.
> 
> No. If you do that, it shouldn't be an of_device based device.
> 
> If you want then to be below a common parent, then create that parent of
> a basic struct device type, that sort of thing. You should never
> instanciate an of_device that has a NULL device node.

If I make the root device a basic struct device, it can't be part of 
ibmebus any
longer. If we could create a busless device, we wouldn't have a problem, 
but I
doubt that is possible.

Do you have any creative ideas?
 
> It's a generic problem with sysfs, I agree it somewhat sucks.

With ya.

Later,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer 
extraordinaire
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development 
2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 

Vorsitzender des Aufsichtsrats: Johann Weihen  --  Geschäftsführung: 
Herbert Kircher
Sitz der Gesellschaft: Böblingen  --  Registergericht: Amtsgericht 
Stuttgart, HRB 243294

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-19 16:36         ` Joachim Fenkes
  0 siblings, 0 replies; 12+ messages in thread
From: Joachim Fenkes @ 2007-02-19 16:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: pmac, linux-kernel, linuxppc-dev, paulus, Hoang-Nam Nguyen, johnrose

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote on 17.02.2007=20
19:37:25:

> > > Doh ! You are creating an of=5Fdevice with no attached device-node ? =

That
> > > is totally evil ! Why do you need that ?
> >=20
> > The driver creates a fake "ibmebus" device so all ibmebus based=20
devices=20
> > have
> > a common parent device -- the vio bus does the same.
> >=20
> > What do you think about linking this device to the device tree "/"=20
node?=20
> > All
> > ibmebus-based devices are linked to dt nodes residing directly beneath =


> > "/",
> > so the mapping would fit.
>=20
> No. If you do that, it shouldn't be an of=5Fdevice based device.
>=20
> If you want then to be below a common parent, then create that parent of
> a basic struct device type, that sort of thing. You should never
> instanciate an of=5Fdevice that has a NULL device node.

If I make the root device a basic struct device, it can't be part of=20
ibmebus any
longer. If we could create a busless device, we wouldn't have a problem,=20
but I
doubt that is possible.

Do you have any creative ideas?
=20
> It's a generic problem with sysfs, I agree it somewhat sucks.

With ya.

Later,
  Joachim

---
Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer=20
extraordinaire
IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development =

2)
Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239=20

Vorsitzender des Aufsichtsrats: Johann Weihen  --  Gesch=E4ftsf=FChrung:=20
Herbert Kircher
Sitz der Gesellschaft: B=F6blingen  --  Registergericht: Amtsgericht=20
Stuttgart, HRB 243294

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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
  2007-02-19 16:36         ` Joachim Fenkes
@ 2007-02-19 19:47           ` Benjamin Herrenschmidt
  -1 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-19 19:47 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: Hoang-Nam Nguyen, johnrose, linux-kernel, linuxppc-dev, paulus,
	pmac, Sylvain Munaut


> If I make the root device a basic struct device, it can't be part of 
> ibmebus any
> longer. If we could create a busless device, we wouldn't have a problem, 
> but I
> doubt that is possible.
> 
> Do you have any creative ideas?

Well, I think PCI does just that for PCI busses ... (a busless device)

Ben.

> > It's a generic problem with sysfs, I agree it somewhat sucks.
> 
> With ya.
> 
> Later,
>   Joachim
> 
> ---
> Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer 
> extraordinaire
> IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development 
> 2)
> Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
> eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 
> 
> Vorsitzender des Aufsichtsrats: Johann Weihen  --  Geschäftsführung: 
> Herbert Kircher
> Sitz der Gesellschaft: Böblingen  --  Registergericht: Amtsgericht 
> Stuttgart, HRB 243294


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

* Re: [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus
@ 2007-02-19 19:47           ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 12+ messages in thread
From: Benjamin Herrenschmidt @ 2007-02-19 19:47 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: pmac, linux-kernel, linuxppc-dev, paulus, Hoang-Nam Nguyen, johnrose


> If I make the root device a basic struct device, it can't be part of 
> ibmebus any
> longer. If we could create a busless device, we wouldn't have a problem, 
> but I
> doubt that is possible.
> 
> Do you have any creative ideas?

Well, I think PCI does just that for PCI busses ... (a busless device)

Ben.

> > It's a generic problem with sysfs, I agree it somewhat sucks.
> 
> With ya.
> 
> Later,
>   Joachim
> 
> ---
> Joachim Fenkes  --  eHCA Linux Driver Developer and Hardware Tamer 
> extraordinaire
> IBM Deutschland Entwicklung GmbH  --  Dept. 3627 (I/O Firmware Development 
> 2)
> Schoenaicher Strasse 220  --  71032 Boeblingen  --  Germany
> eMail: fenkes@de.ibm.com  --  Phone: +49 7031 16 1239 
> 
> Vorsitzender des Aufsichtsrats: Johann Weihen  --  Geschäftsführung: 
> Herbert Kircher
> Sitz der Gesellschaft: Böblingen  --  Registergericht: Amtsgericht 
> Stuttgart, HRB 243294

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

end of thread, other threads:[~2007-02-19 20:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17 16:28 [PATCH 2.6.21-rc1] powerpc: Make of_device_uevent() compatible with ibmebus Hoang-Nam Nguyen
2007-02-17 16:28 ` Hoang-Nam Nguyen
2007-02-17 21:56 ` Benjamin Herrenschmidt
2007-02-17 21:56   ` Benjamin Herrenschmidt
2007-02-18  0:21   ` Joachim Fenkes
2007-02-18  0:21     ` Joachim Fenkes
2007-02-18  0:37     ` Benjamin Herrenschmidt
2007-02-18  0:37       ` Benjamin Herrenschmidt
2007-02-19 16:36       ` Joachim Fenkes
2007-02-19 16:36         ` Joachim Fenkes
2007-02-19 19:47         ` Benjamin Herrenschmidt
2007-02-19 19:47           ` Benjamin Herrenschmidt

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.