linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Pegasos keyboard detection
       [not found] <200707230616.l6N6GaPg1212004@shell01.TheWorld.com>
@ 2007-07-25  1:28 ` Alan Curry
  2007-07-25  6:22   ` Benjamin Herrenschmidt
                     ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Alan Curry @ 2007-07-25  1:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev

As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <pacman@world.std.com>

--- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 19:04:17.000000000 -0500
+++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 -0500
@@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
 	switch(base_port) {
 	case I8042_DATA_REG:
 		np = of_find_node_by_type(NULL, "8042");
+		/* Pegasos has no device_type on its 8042 node, look for the
+		 * name instead */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-25  1:28 ` [PATCH] powerpc: Pegasos keyboard detection Alan Curry
@ 2007-07-25  6:22   ` Benjamin Herrenschmidt
  2007-07-25  6:45     ` Alan Curry
  2007-07-25  7:12   ` Benjamin Herrenschmidt
  2007-07-31 21:26   ` Segher Boessenkool
  2 siblings, 1 reply; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-25  6:22 UTC (permalink / raw)
  To: Alan Curry; +Cc: linuxppc-dev, linux-kernel

On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
> on the PegasosPPC. This is because of a feature/bug in the OF device tree:
> the "device_type" attribute is an empty string instead of "8042" as the
> kernel expects. This patch (against 2.6.22.1) adds a secondary detection
> which looks for a device whose *name* is "8042" if there is no device whose
> *type* is "8042".
> 
> Signed-off-by: Alan Curry <pacman@world.std.com>

Doesn't it have something in "compatible" instead ? that would be the
way to go.

Ben.

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-25  6:22   ` Benjamin Herrenschmidt
@ 2007-07-25  6:45     ` Alan Curry
  0 siblings, 0 replies; 21+ messages in thread
From: Alan Curry @ 2007-07-25  6:45 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel

Benjamin Herrenschmidt writes the following:
>
>Doesn't it have something in "compatible" instead ? that would be the
>way to go.
>

Assuming that would be represented as a file named "compatible" in the
directory /proc/device-tree/*/*/8042@i60 ... no, it doesn't have one of
those.

For the amusement of all, I offer the entire device-tree as presented in
/proc by my running 2.6.22.1 kernel. Available for a limited time from
http://world.std.com/~pacman/pegasosII_proc_device-tree.tar.gz

-- 
Alan Curry
pacman@world.std.com

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-25  1:28 ` [PATCH] powerpc: Pegasos keyboard detection Alan Curry
  2007-07-25  6:22   ` Benjamin Herrenschmidt
@ 2007-07-25  7:12   ` Benjamin Herrenschmidt
  2007-07-27  1:48     ` Andrew Morton
  2007-07-31 21:26   ` Segher Boessenkool
  2 siblings, 1 reply; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-25  7:12 UTC (permalink / raw)
  To: Alan Curry; +Cc: linuxppc-dev, linux-kernel

On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
> on the PegasosPPC. This is because of a feature/bug in the OF device tree:
> the "device_type" attribute is an empty string instead of "8042" as the
> kernel expects. This patch (against 2.6.22.1) adds a secondary detection
> which looks for a device whose *name* is "8042" if there is no device whose
> *type* is "8042".
> 
> Signed-off-by: Alan Curry <pacman@world.std.com>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note, if there's a volunteer, we could probably turn that code into a
nice table lookup.

Cheers,
Ben.

> --- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 19:04:17.000000000 -0500
> +++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 -0500
> @@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
>  	switch(base_port) {
>  	case I8042_DATA_REG:
>  		np = of_find_node_by_type(NULL, "8042");
> +		/* Pegasos has no device_type on its 8042 node, look for the
> +		 * name instead */
> +		if (!np)
> +			np = of_find_node_by_name(NULL, "8042");
>  		break;
>  	case FDC_BASE: /* FDC1 */
>  		np = of_find_node_by_type(NULL, "fdc");
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-25  7:12   ` Benjamin Herrenschmidt
@ 2007-07-27  1:48     ` Andrew Morton
  2007-07-27  3:00       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Morton @ 2007-07-27  1:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Alan Curry, linux-kernel

On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
> > As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
> > on the PegasosPPC. This is because of a feature/bug in the OF device tree:
> > the "device_type" attribute is an empty string instead of "8042" as the
> > kernel expects. This patch (against 2.6.22.1) adds a secondary detection
> > which looks for a device whose *name* is "8042" if there is no device whose
> > *type* is "8042".
> > 
> > Signed-off-by: Alan Curry <pacman@world.std.com>
> 
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Note, if there's a volunteer, we could probably turn that code into a
> nice table lookup.

Did this get merged, or otherwise fixed?  Even though the code in there has
changed quite a bit, it looks to my untrained eye like the fix is still
applicable?


From: Alan Curry <pacman@TheWorld.com>

As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse
controller on the PegasosPPC.  This is because of a feature/bug in the OF
device tree: the "device_type" attribute is an empty string instead of
"8042" as the kernel expects.  This patch (against 2.6.22.1) adds a
secondary detection which looks for a device whose *name* is "8042" if
there is no device whose *type* is "8042".

Signed-off-by: Alan Curry <pacman@world.std.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/kernel/setup-common.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN /dev/null /dev/null
diff -puN arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection arch/powerpc/kernel/setup-common.c
--- a/arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection
+++ a/arch/powerpc/kernel/setup-common.c
@@ -496,6 +496,12 @@ int check_legacy_ioport(unsigned long ba
 			break;
 		}
 		np = of_find_node_by_type(NULL, "8042");
+		/*
+		 * Pegasos has no device_type on its 8042 node, look for the
+		 * name instead
+		 */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");
_


And ALan says that 2.6.22 is bust, but this patch no won't apply there so
if we want to fix 2.6.22.x then Alan's original patch would be needed.

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-27  1:48     ` Andrew Morton
@ 2007-07-27  3:00       ` Benjamin Herrenschmidt
  2007-07-27  4:22         ` Andrew Morton
  0 siblings, 1 reply; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-27  3:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Alan Curry, linux-kernel

On Thu, 2007-07-26 at 18:48 -0700, Andrew Morton wrote:
> On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> 
> > On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
> > > As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
> > > on the PegasosPPC. This is because of a feature/bug in the OF device tree:
> > > the "device_type" attribute is an empty string instead of "8042" as the
> > > kernel expects. This patch (against 2.6.22.1) adds a secondary detection
> > > which looks for a device whose *name* is "8042" if there is no device whose
> > > *type* is "8042".
> > > 
> > > Signed-off-by: Alan Curry <pacman@world.std.com>
> > 
> > Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > 
> > Note, if there's a volunteer, we could probably turn that code into a
> > nice table lookup.
> 
> Did this get merged, or otherwise fixed?  Even though the code in there has
> changed quite a bit, it looks to my untrained eye like the fix is still
> applicable?

Merged a fixed version:

f5d834fc34e61f1a40435981062000e5d2b2baa8

(In linus tree as of now)

Cheers,
Ben.

> 
> From: Alan Curry <pacman@TheWorld.com>
> 
> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse
> controller on the PegasosPPC.  This is because of a feature/bug in the OF
> device tree: the "device_type" attribute is an empty string instead of
> "8042" as the kernel expects.  This patch (against 2.6.22.1) adds a
> secondary detection which looks for a device whose *name* is "8042" if
> there is no device whose *type* is "8042".
> 
> Signed-off-by: Alan Curry <pacman@world.std.com>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  arch/powerpc/kernel/setup-common.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff -puN /dev/null /dev/null
> diff -puN arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection arch/powerpc/kernel/setup-common.c
> --- a/arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection
> +++ a/arch/powerpc/kernel/setup-common.c
> @@ -496,6 +496,12 @@ int check_legacy_ioport(unsigned long ba
>  			break;
>  		}
>  		np = of_find_node_by_type(NULL, "8042");
> +		/*
> +		 * Pegasos has no device_type on its 8042 node, look for the
> +		 * name instead
> +		 */
> +		if (!np)
> +			np = of_find_node_by_name(NULL, "8042");
>  		break;
>  	case FDC_BASE: /* FDC1 */
>  		np = of_find_node_by_type(NULL, "fdc");
> _
> 
> 
> And ALan says that 2.6.22 is bust, but this patch no won't apply there so
> if we want to fix 2.6.22.x then Alan's original patch would be needed.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-27  3:00       ` Benjamin Herrenschmidt
@ 2007-07-27  4:22         ` Andrew Morton
  2007-07-27  4:48           ` Alan Curry
  2007-07-27  7:15           ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 21+ messages in thread
From: Andrew Morton @ 2007-07-27  4:22 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Alan Curry, linux-kernel

On Fri, 27 Jul 2007 13:00:21 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Thu, 2007-07-26 at 18:48 -0700, Andrew Morton wrote:
> > On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > 
> > > On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
> > > > As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
> > > > on the PegasosPPC. This is because of a feature/bug in the OF device tree:
> > > > the "device_type" attribute is an empty string instead of "8042" as the
> > > > kernel expects. This patch (against 2.6.22.1) adds a secondary detection
> > > > which looks for a device whose *name* is "8042" if there is no device whose
> > > > *type* is "8042".
> > > > 
> > > > Signed-off-by: Alan Curry <pacman@world.std.com>
> > > 
> > > Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > 
> > > Note, if there's a volunteer, we could probably turn that code into a
> > > nice table lookup.
> > 
> > Did this get merged, or otherwise fixed?  Even though the code in there has
> > changed quite a bit, it looks to my untrained eye like the fix is still
> > applicable?
> 
> Merged a fixed version:
> 
> f5d834fc34e61f1a40435981062000e5d2b2baa8
> 
> (In linus tree as of now)

I hope so.  Alan's patch looks rather different from what you have now:
fall back to of_find_node_by_name() if of_find_node_by_type() failed.

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-27  4:22         ` Andrew Morton
@ 2007-07-27  4:48           ` Alan Curry
  2007-07-27  7:15           ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 21+ messages in thread
From: Alan Curry @ 2007-07-27  4:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linuxppc-dev

Andrew Morton writes the following:
>> > 
>> > Did this get merged, or otherwise fixed?  Even though the code in there has
>> > changed quite a bit, it looks to my untrained eye like the fix is still
>> > applicable?
>> 
>> Merged a fixed version:
>> 
>> f5d834fc34e61f1a40435981062000e5d2b2baa8
>> 
>> (In linus tree as of now)
>
>I hope so.  Alan's patch looks rather different from what you have now:
>fall back to of_find_node_by_name() if of_find_node_by_type() failed.
>

Looking at it via gitweb, I think the commit mentioned above is actually the
same as what I submitted. The diff context lines are different because there
was a similar patch in between the 2.6.22 release and my patch, which
apparently fixed the same problem on a different type of machine. It looks
like these 2 workarounds will function independently of each other.

The first 8042-detection fix was:
db0dbae9d9680bce69fe1ce775709e60c8ee9c29

And mine is:
f5d834fc34e61f1a40435981062000e5d2b2baa8

-- 
Alan Curry
pacman@world.std.com

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-27  4:22         ` Andrew Morton
  2007-07-27  4:48           ` Alan Curry
@ 2007-07-27  7:15           ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-27  7:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Alan Curry, linux-kernel

On Thu, 2007-07-26 at 21:22 -0700, Andrew Morton wrote:
> 
> > Merged a fixed version:
> > 
> > f5d834fc34e61f1a40435981062000e5d2b2baa8
> > 
> > (In linus tree as of now)
> 
> I hope so.  Alan's patch looks rather different from what you have
> now:
> fall back to of_find_node_by_name() if of_find_node_by_type() failed.

Which is just waht that commit does :-)

Ben.

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-25  1:28 ` [PATCH] powerpc: Pegasos keyboard detection Alan Curry
  2007-07-25  6:22   ` Benjamin Herrenschmidt
  2007-07-25  7:12   ` Benjamin Herrenschmidt
@ 2007-07-31 21:26   ` Segher Boessenkool
  2007-08-01  7:25     ` Matt Sealey
  2 siblings, 1 reply; 21+ messages in thread
From: Segher Boessenkool @ 2007-07-31 21:26 UTC (permalink / raw)
  To: Alan Curry; +Cc: linuxppc-dev, linux-kernel

> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse 
> controller
> on the PegasosPPC. This is because of a feature/bug in the OF device 
> tree:
> the "device_type" attribute is an empty string instead of "8042" as the
> kernel expects. This patch (against 2.6.22.1) adds a secondary 
> detection
> which looks for a device whose *name* is "8042" if there is no device 
> whose
> *type* is "8042".
>
> Signed-off-by: Alan Curry <pacman@world.std.com>
>
> --- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 
> 19:04:17.000000000 -0500
> +++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 
> -0500
> @@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
>  	switch(base_port) {
>  	case I8042_DATA_REG:
>  		np = of_find_node_by_type(NULL, "8042");
> +		/* Pegasos has no device_type on its 8042 node, look for the
> +		 * name instead */
> +		if (!np)
> +			np = of_find_node_by_name(NULL, "8042");

[I know it already got merged, I'm behind on mail, but anyway...]

Could board-specific quirks like this please always include a
check for that board?  Or, even better, do a fixup in the
bootwrapper.

In this case the workaround won't likely trigger on the wrong
boards, but "just a little bit" more dangerous workarounds
_will_, and the law of big numbers works against us...


Segher

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-07-31 21:26   ` Segher Boessenkool
@ 2007-08-01  7:25     ` Matt Sealey
  2007-08-01  7:28       ` Matt Sealey
  2007-08-02  4:40       ` Alan Curry
  0 siblings, 2 replies; 21+ messages in thread
From: Matt Sealey @ 2007-08-01  7:25 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel

Yeah please do a fixup for the boot wrapper.

Or, if you have trouble, go into the firmware and type "nvedit", add
these lines;

" /isa/8042" find-device
" 8042" encode-string device-type

(then ctrl-c to exit and nvstore to run it on next reboot. Try it without
the patch first, on the firmware console, just to be sure I got it right,
because I can't test it here)

You don't need to patch Linux at all. In fact for silly things like this
I would recommend against it :)

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations




Segher Boessenkool wrote:
>> As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse 
>> controller
>> on the PegasosPPC. This is because of a feature/bug in the OF device 
>> tree:
>> the "device_type" attribute is an empty string instead of "8042" as the
>> kernel expects. This patch (against 2.6.22.1) adds a secondary 
>> detection
>> which looks for a device whose *name* is "8042" if there is no device 
>> whose
>> *type* is "8042".
>>
>> Signed-off-by: Alan Curry <pacman@world.std.com>
>>
>> --- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 
>> 19:04:17.000000000 -0500
>> +++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 
>> -0500
>> @@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
>>  	switch(base_port) {
>>  	case I8042_DATA_REG:
>>  		np = of_find_node_by_type(NULL, "8042");
>> +		/* Pegasos has no device_type on its 8042 node, look for the
>> +		 * name instead */
>> +		if (!np)
>> +			np = of_find_node_by_name(NULL, "8042");
> 
> [I know it already got merged, I'm behind on mail, but anyway...]
> 
> Could board-specific quirks like this please always include a
> check for that board?  Or, even better, do a fixup in the
> bootwrapper.
> 
> In this case the workaround won't likely trigger on the wrong
> boards, but "just a little bit" more dangerous workarounds
> _will_, and the law of big numbers works against us...
> 
> 
> Segher
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-01  7:25     ` Matt Sealey
@ 2007-08-01  7:28       ` Matt Sealey
  2007-08-02  4:40       ` Alan Curry
  1 sibling, 0 replies; 21+ messages in thread
From: Matt Sealey @ 2007-08-01  7:28 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel


Just so you guys have it all in one pretty little package, these will remove
the need for the Pegasos IDE and ISA fixups in the prom_init.c too.

s" /pci@80000000/ide@C,1" find-device
d# 14 encode-int 0 encode-int
d# 15 encode-int 0 encode-int
encode+ encode+ encode+ s" interrupts" property
0x1018a encode-int s" class-code" property
device-end

s" /pci@80000000/isa@C" find-device
0x1 encode-int 0x0 encode-int 0x1006000 encode-int
0x0 encode-int 0x0 encode-int 0x1000 encode-int
encode+ encode+ encode+ encode+ encode+ s" ranges" property
device-end

If anyone wants to test and confirm the 8042 fix and then we can add
it to the end here.. we can unclutter the kernel.

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

Matt Sealey wrote:
> Yeah please do a fixup for the boot wrapper.
> 
> Or, if you have trouble, go into the firmware and type "nvedit", add
> these lines;
> 
> " /isa/8042" find-device
> " 8042" encode-string device-type
> 
> (then ctrl-c to exit and nvstore to run it on next reboot. Try it without
> the patch first, on the firmware console, just to be sure I got it right,
> because I can't test it here)
> 
> You don't need to patch Linux at all. In fact for silly things like this
> I would recommend against it :)
> 

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-01  7:25     ` Matt Sealey
  2007-08-01  7:28       ` Matt Sealey
@ 2007-08-02  4:40       ` Alan Curry
  2007-08-06 18:45         ` Segher Boessenkool
  2007-08-06 21:40         ` Matt Sealey
  1 sibling, 2 replies; 21+ messages in thread
From: Alan Curry @ 2007-08-02  4:40 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev, linux-kernel

Matt Sealey writes the following:
>
>Yeah please do a fixup for the boot wrapper.
>
>Or, if you have trouble, go into the firmware and type "nvedit", add
>these lines;
>
>" /isa/8042" find-device
>" 8042" encode-string device-type
>
>(then ctrl-c to exit and nvstore to run it on next reboot. Try it without
>the patch first, on the firmware console, just to be sure I got it right,
>because I can't test it here)

It works from the ok prompt but in the nvramrc it doesn't find the device.
(pci/isa nodes not created yet?)

But the larger point:

>
>You don't need to patch Linux at all. In fact for silly things like this
>I would recommend against it :)

If the workaround doesn't go into the kernel, everybody with affected
hardware has to individually find out about the bug (probably by experiencing
an annoying keyboardless boot) and fix it himself. Is that worth the
reduction in kernel clutter?

-- 
Alan Curry
pacman@world.std.com

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-02  4:40       ` Alan Curry
@ 2007-08-06 18:45         ` Segher Boessenkool
  2007-08-06 21:40         ` Matt Sealey
  1 sibling, 0 replies; 21+ messages in thread
From: Segher Boessenkool @ 2007-08-06 18:45 UTC (permalink / raw)
  To: Alan Curry; +Cc: linux-kernel, linuxppc-dev

>> You don't need to patch Linux at all. In fact for silly things like 
>> this
>> I would recommend against it :)
>
> If the workaround doesn't go into the kernel, everybody with affected
> hardware has to individually find out about the bug (probably by 
> experiencing
> an annoying keyboardless boot) and fix it himself.

That's one of the reasons why this should go into a bootwrapper.


Segher

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-02  4:40       ` Alan Curry
  2007-08-06 18:45         ` Segher Boessenkool
@ 2007-08-06 21:40         ` Matt Sealey
  2007-08-06 21:57           ` Segher Boessenkool
  2007-08-07  4:16           ` Alan Curry
  1 sibling, 2 replies; 21+ messages in thread
From: Matt Sealey @ 2007-08-06 21:40 UTC (permalink / raw)
  To: Alan Curry; +Cc: linuxppc-dev, linux-kernel

Okay before you add to the nvramrc you also need to add probe-all to build the
device tree first; I assumed this was common knowledge.

probe-all
" /pci/isa/8042" find-device
" 8042" encode-string device-type
install-console
banner

That should do it. Without probe-all/install-console/banner in the nvramrc they
will be run by the boot process (this is documented in the IEEE 1275 specs)

Yeah it will break for people on their first boot but let's put a few things
across;

1) Pegasos has been discontinued. The number of people with this bug are in
the low thousands - if they upgrade to 2.6.22 at all.

2) The fix was in the wrong place anyway, if it was going to be done anywhere
at all it needs to be in arch/powerpc/kernel/prom_init.c:fixup_device_tree_chrp()
like the ISA ranges breakage (which is on Briq) and IDE IRQ misnumbering fix.
Not the keyboard platform driver.

3) In any case this should be something that is fixed in the firmware, as any
stalwart, stubborn Linux developer will rant at you about. If you can't get a
firmware update or it's not fixed, this is the best place to do it.

As for Segher, bootwrapper not such a good place as that's still mussing up
the kernel with these fixes. Let the boot loader do it for the OS, and don't
mess up the OS with device-tree fixups. After all it may not just be Linux
that stumbles on it. Why have the same patch in every OS?

With nvramrc, the fix is done for EVERY operating system from firmware upwards.
The semi-official Genesi line of support and what I have been told by the board
designer is if you need to fix something in the device tree, that is what nvramrc
is for, and that is why Open Firmware runs Forth scripts.

I have a fixup script for Pegasos and one for Efika which I may publish at some
point in the very near future. We may ship a small patch for Marcin Kurek's
"BootCreator" (http://tbs-software.com/morgoth/projects.html) which includes
all the stuff. We may write our own binary bootloader.. I am waiting for the
result of the new firmware feature requests before we waste time on stuff
bplan is silently fixing.

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

Alan Curry wrote:
> Matt Sealey writes the following:
>> Yeah please do a fixup for the boot wrapper.
>>
>> Or, if you have trouble, go into the firmware and type "nvedit", add
>> these lines;
>>
>> " /isa/8042" find-device
>> " 8042" encode-string device-type
>>
>> (then ctrl-c to exit and nvstore to run it on next reboot. Try it without
>> the patch first, on the firmware console, just to be sure I got it right,
>> because I can't test it here)
> 
> It works from the ok prompt but in the nvramrc it doesn't find the device.
> (pci/isa nodes not created yet?)
> 
> But the larger point:
> 
>> You don't need to patch Linux at all. In fact for silly things like this
>> I would recommend against it :)
> 
> If the workaround doesn't go into the kernel, everybody with affected
> hardware has to individually find out about the bug (probably by experiencing
> an annoying keyboardless boot) and fix it himself. Is that worth the
> reduction in kernel clutter?
> 

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-06 21:40         ` Matt Sealey
@ 2007-08-06 21:57           ` Segher Boessenkool
  2007-08-07 16:21             ` Matt Sealey
  2007-08-07  4:16           ` Alan Curry
  1 sibling, 1 reply; 21+ messages in thread
From: Segher Boessenkool @ 2007-08-06 21:57 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev, Alan Curry, linux-kernel

> 2) The fix was in the wrong place anyway, if it was going to be done 
> anywhere
> at all it needs to be in 
> arch/powerpc/kernel/prom_init.c:fixup_device_tree_chrp()
> like the ISA ranges breakage (which is on Briq) and IDE IRQ 
> misnumbering fix.
> Not the keyboard platform driver.

Yeah.  In the bootwrapper.

> 3) In any case this should be something that is fixed in the firmware, 
> as any
> stalwart, stubborn Linux developer will rant at you about.

Sure, if you *can* get a fix for the firmware.  Until every
user has this update, fixing it in the kernel wrapper helps
users.

> As for Segher, bootwrapper not such a good place as that's still 
> mussing up
> the kernel with these fixes. Let the boot loader do it for the OS, and 
> don't
> mess up the OS with device-tree fixups.

Sure, the bootloader can do it too, but then we need to fix
every bootloader that's used with Linux on this platform.
Maybe that's just one, that would make things simple :-)

> After all it may not just be Linux
> that stumbles on it. Why have the same patch in every OS?

This is just pragmatics: Linux needs the workaround -> Linux
implements the workaround.  Sure it is not a _proper_ fix, but
a correctly implemented workaround "fixes" it for all users,
forever.

> With nvramrc, the fix is done for EVERY operating system from firmware 
> upwards.

But it's something every user has to do separately.

> The semi-official Genesi line of support and what I have been told by 
> the board
> designer is if you need to fix something in the device tree, that is 
> what nvramrc
> is for, and that is why Open Firmware runs Forth scripts.

That's hardly the only reason.  But yeah, that's one way to
implement the workaround, but _we_ (the Linux community) cannot
do it like that (easily) for all users.


Segher

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-06 21:40         ` Matt Sealey
  2007-08-06 21:57           ` Segher Boessenkool
@ 2007-08-07  4:16           ` Alan Curry
  2007-08-07 16:27             ` Matt Sealey
  1 sibling, 1 reply; 21+ messages in thread
From: Alan Curry @ 2007-08-07  4:16 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev, linux-kernel

I'm almost sorry I spoke up...

Matt Sealey writes the following:
>
>Okay before you add to the nvramrc you also need to add probe-all to build the
>device tree first; I assumed this was common knowledge.

Maybe for experienced OpenFirmware developers; this is the first time I've
had to touch the stuff. So first I had to learn Forth. To patch the kernel
you only need to know C. (Of course I already knew C -- it's common
knowledge.)

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-06 21:57           ` Segher Boessenkool
@ 2007-08-07 16:21             ` Matt Sealey
  2007-08-09 16:30               ` Segher Boessenkool
  0 siblings, 1 reply; 21+ messages in thread
From: Matt Sealey @ 2007-08-07 16:21 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel


Segher Boessenkool wrote:
> 
> That's hardly the only reason.  But yeah, that's one way to
> implement the workaround, but _we_ (the Linux community) cannot
> do it like that (easily) for all users.

But you're the guy who told us our firmware sucks and we should fix our
firmware rather than clutter Linux with too many fixups. There are about
200 lines of code required to bring the Efika device tree up to the
Linux "specification" of a 5200B device tree, which will never make it
into code. Pegasos is ostensibly the same way.

Linux is already a bad enough moving target, and none of these fixes help
other operating systems or developers, if we only patch Linux, and only
say, you must run the latest Linux kernel version, and the latest U-Boot,
and the latest FDT binary, and encourage users to upgrade it all regardless
of your worries.

So, there are two opinions here;

1) the reports as we had when Efika was released and continually levied
against Pegasos firmware, that the firmware is broken and must be fixed
to comply, and no fixes will be considered because "bplan sucks and must
fix it"

2) As long as the patches are 2 lines big, you will allow them in, because
it is too much for a user to update firmware or run a script to boot?

Would you guys rather we shipped a boot script that ran the OS, fixed
all these issues in-place in-firmware, so Linux did not have to have these
workarounds, or are you accepting patches now? Because I can write those
200 lines of code to work around Efika device tree mistakes you yourself
complained about at Christmas last year..

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-07  4:16           ` Alan Curry
@ 2007-08-07 16:27             ` Matt Sealey
  0 siblings, 0 replies; 21+ messages in thread
From: Matt Sealey @ 2007-08-07 16:27 UTC (permalink / raw)
  To: Alan Curry; +Cc: linuxppc-dev, linux-kernel


Okay, you don't need to be an experienced Open Firmware developer.

In fact I know we have had experienced Open Firmware developers who have
said that our firmware sucks (some comment about "shitty German engineering",
I really did quit caring after that point) because they could not run probe-all
from the "ok" prompt.

In the first few pages of the OF spec, it very clearly states that this will
probably make your system explode.

So even experts do not know what they are doing. I don't expect users to.
But as an engineer, here, I think patching the device-type in the boot
wrapper (be it the chrp boot loader) is the wrong place, because we have
had real experts here (Ben, Segher etc.) complain that fixing the device
tree in the boot wrapper is no substitute for a correctly working
firmware.

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

Alan Curry wrote:
> I'm almost sorry I spoke up...
> 
> Matt Sealey writes the following:
>> Okay before you add to the nvramrc you also need to add probe-all to build the
>> device tree first; I assumed this was common knowledge.
> 
> Maybe for experienced OpenFirmware developers; this is the first time I've
> had to touch the stuff. So first I had to learn Forth. To patch the kernel
> you only need to know C. (Of course I already knew C -- it's common
> knowledge.)
> 

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-07 16:21             ` Matt Sealey
@ 2007-08-09 16:30               ` Segher Boessenkool
  2007-08-09 16:46                 ` Matt Sealey
  0 siblings, 1 reply; 21+ messages in thread
From: Segher Boessenkool @ 2007-08-09 16:30 UTC (permalink / raw)
  To: Matt Sealey; +Cc: linuxppc-dev, Alan Curry, linux-kernel

>> That's hardly the only reason.  But yeah, that's one way to
>> implement the workaround, but _we_ (the Linux community) cannot
>> do it like that (easily) for all users.
>
> But you're the guy who told us our firmware sucks and we should fix our
> firmware

Yes, and?  You _should_ fix your firmware, it is buggy after all.
Esp. back then as it wasn't shipping yet.

> rather than clutter Linux with too many fixups.

Also, putting fixups in the wrapper is a wholly different thing from
putting fixups deep inside the kernel code proper.

> Linux is already a bad enough moving target, and none of these fixes 
> help
> other operating systems or developers, if we only patch Linux,

But that's not Linux' concern.  You might care, we don't.  Is
this so hard to understand?

> 1) the reports as we had when Efika was released and continually levied
> against Pegasos firmware, that the firmware is broken and must be fixed
> to comply, and no fixes will be considered because "bplan sucks and 
> must
> fix it"
>
> 2) As long as the patches are 2 lines big, you will allow them in, 
> because
> it is too much for a user to update firmware or run a script to boot?

Our only two concerns are what is best on technical grounds, and what
is best for our users.

> Would you guys rather we shipped a boot script that ran the OS, fixed
> all these issues in-place in-firmware, so Linux did not have to have 
> these
> workarounds,

Sure, if you can do that, that would be great.


Segher

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

* Re: [PATCH] powerpc: Pegasos keyboard detection
  2007-08-09 16:30               ` Segher Boessenkool
@ 2007-08-09 16:46                 ` Matt Sealey
  0 siblings, 0 replies; 21+ messages in thread
From: Matt Sealey @ 2007-08-09 16:46 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Alan Curry, linux-kernel


Segher Boessenkool wrote:
>> Would you guys rather we shipped a boot script that ran the OS, fixed
>> all these issues in-place in-firmware, so Linux did not have to have 
>> these
>> workarounds,
> 
> Sure, if you can do that, that would be great.

Right, so don't accept that keyboard fix, and we will work on the script
instead.

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

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

end of thread, other threads:[~2007-08-09 16:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200707230616.l6N6GaPg1212004@shell01.TheWorld.com>
2007-07-25  1:28 ` [PATCH] powerpc: Pegasos keyboard detection Alan Curry
2007-07-25  6:22   ` Benjamin Herrenschmidt
2007-07-25  6:45     ` Alan Curry
2007-07-25  7:12   ` Benjamin Herrenschmidt
2007-07-27  1:48     ` Andrew Morton
2007-07-27  3:00       ` Benjamin Herrenschmidt
2007-07-27  4:22         ` Andrew Morton
2007-07-27  4:48           ` Alan Curry
2007-07-27  7:15           ` Benjamin Herrenschmidt
2007-07-31 21:26   ` Segher Boessenkool
2007-08-01  7:25     ` Matt Sealey
2007-08-01  7:28       ` Matt Sealey
2007-08-02  4:40       ` Alan Curry
2007-08-06 18:45         ` Segher Boessenkool
2007-08-06 21:40         ` Matt Sealey
2007-08-06 21:57           ` Segher Boessenkool
2007-08-07 16:21             ` Matt Sealey
2007-08-09 16:30               ` Segher Boessenkool
2007-08-09 16:46                 ` Matt Sealey
2007-08-07  4:16           ` Alan Curry
2007-08-07 16:27             ` Matt Sealey

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