Subject: Re: newer G4 models and panic: lockmgr: pid 0, not exclusive lock holder
To: Makoto Fujiwara <makoto@ki.nu>
From: Aymeric Vincent <Aymeric.Vincent@labri.fr>
List: port-macppc
Date: 07/05/2002 18:14:04
Woohoo! After hours of random debugging, I think I found the stupid
problem that generated the "trap 200..." panic at boot time.

OF_call_method() can return negative values different from -1 to
indicate failure.

The following patch (and it alone) makes things work like a charm on
my iBook (late 2001, 600MHz).

Can anyone please confirm that it won't fail on older open firmwares?

I plan to commit this in two days and request a pull up for 1.6.

 Aymeric

Index: machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/macppc/machdep.c,v
retrieving revision 1.114
diff -u -r1.114 machdep.c
--- machdep.c	2002/06/19 17:01:20	1.114
+++ machdep.c	2002/07/05 16:09:07
@@ -977,7 +977,7 @@
 	 */
 
 #if NUKBD > 0
-	if (OF_call_method("`usb-kbd-ihandles", stdin, 0, 1, &ukbds) != -1 &&
+	if (OF_call_method("`usb-kbd-ihandles", stdin, 0, 1, &ukbds) >= 0 &&
 	    ukbds != NULL && ukbds->ihandle != 0 &&
 	    OF_instance_to_package(ukbds->ihandle) != -1) {
 		printf("console keyboard type: USB\n");
@@ -985,7 +985,7 @@
 		goto kbd_found;
 	}
 	/* Try old method name. */
-	if (OF_call_method("`usb-kbd-ihandle", stdin, 0, 1, &ukbd) != -1 &&
+	if (OF_call_method("`usb-kbd-ihandle", stdin, 0, 1, &ukbd) >= 0 &&
 	    ukbd != 0 &&
 	    OF_instance_to_package(ukbd) != -1) {
 		printf("console keyboard type: USB\n");
@@ -996,7 +996,7 @@
 #endif
 
 #if NAKBD > 0
-	if (OF_call_method("`adb-kbd-ihandle", stdin, 0, 1, &akbd) != -1 &&
+	if (OF_call_method("`adb-kbd-ihandle", stdin, 0, 1, &akbd) >= 0 &&
 	    akbd != 0 &&
 	    OF_instance_to_package(akbd) != -1) {
 		printf("console keyboard type: ADB\n");