Re: dev/psm0 not found

Previous thread: Starting with svn commit r216333 current freezes by Christian Gusenbauer on Saturday, December 18, 2010 - 2:14 am. (7 messages)

Next thread: [head tinderbox] failure on powerpc64/powerpc by FreeBSD Tinderbox on Saturday, December 18, 2010 - 6:21 pm. (1 message)
From: Ivan Klymenko
Date: Saturday, December 18, 2010 - 11:30 am

http://svn.freebsd.org/viewvc/base/head/sys/dev/atkbdc/psm.c?view=log

after updating svn revision => 216491 system is not detecting the device
psm
http://svn.freebsd.org/viewvc/base?view=revision&revision=216491




Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-CURRENT #0 r216524: Sat Dec 18 19:51:17 EET 2010
    ivan@nonamehost:/usr/obj/usr/src/sys/mk9 amd64
CPU: Intel(R) Core(TM)2 Duo CPU     T7250  @ 2.00GHz (1994.47-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x6fd  Family = 6  Model = f  Stepping = 13
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0xe3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
  AMD Features=0x20100800<SYSCALL,NX,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant
real memory  = 2147483648 (2048 MB)
avail memory = 2039611392 (1945 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <DELL   M08    >
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0: Changing APIC ID to 2
ioapic0 <Version 2.0> irqs 0-23 on motherboard
Cuse4BSD v0.1.13 @ /dev/cuse
kbd1 at kbdmux0
acpi0: <DELL M08    > on motherboard
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 900
Event timer "HPET" frequency 14318180 Hz quality 550
Event timer "HPET1" frequency 14318180 Hz quality 440
acpi0: reservation of 0, 9f000 (3) failed
acpi0: reservation of 100000, 7fd6d800 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
pcib0: <ACPI ...
From: John Baldwin
Date: Monday, December 20, 2010 - 7:58 am

Can you please get verbose dmesg's from before and after?

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: Ivan Klymenko
Date: Monday, December 20, 2010 - 9:53 am

В Mon, 20 Dec 2010 09:58:57 -0500

Voila.
From: John Baldwin
Date: Monday, December 20, 2010 - 10:49 am

Please boot with this and capture the output:

Index: psm.c
===================================================================
--- psm.c	(revision 216591)
+++ psm.c	(working copy)
@@ -1100,11 +1100,17 @@
 	 */
 	psmc = device_find_child(device_get_parent(parent),
 	    PSMCPNP_DRIVER_NAME, unit);
-	if (psmc == NULL)
+	if (psmc == NULL) {
+		printf("psm%d: could not find %s%d\n", unit,
+		    PSMCPNP_DRIVER_NAME, unit);
 		return;
+	}
 	irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0);
-	if (irq <= 0)
+	if (irq <= 0) {
+		printf("psm%d: no IRQ from %s%d\n", unit, PSMCPNP_DRIVER_NAME,
+		    unit);
 		return;
+	}
 	bus_delete_resource(psmc, SYS_RES_IRQ, 0);
 	bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
 }

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: Ivan Klymenko
Date: Monday, December 20, 2010 - 11:14 am

В Mon, 20 Dec 2010 12:49:53 -0500




С уважением, Иван!
------------------------------------------
Мы можем все - что можем себе представить!

jabber: fidaj@jabber.ru
skype: freedom_fidaj
youtube channel: http://www.youtube.com/freedomfidaj
mob.: +380938326345
http://lurkmore.ru/95%25
From: John Baldwin
Date: Monday, December 20, 2010 - 12:51 pm

Try this instead.  You can use a non-verbose dmesg to trim the spammage.

Index: psm.c
===================================================================
--- psm.c	(revision 216591)
+++ psm.c	(working copy)
@@ -1080,7 +1080,7 @@
 	device_t psmc;
 	device_t psm;
 	u_long irq;
-	int unit;
+	int error, unit;
 
 	unit = device_get_unit(parent);
 
@@ -1090,8 +1090,10 @@
 		return;
 
 	irq = bus_get_resource_start(psm, SYS_RES_IRQ, KBDC_RID_AUX);
-	if (irq > 0)
+	if (irq > 0) {
+		printf("psm%d: already has an IRQ?\n", unit);
 		return;
+	}
 
 	/*
 	 * If the PS/2 mouse device has already been reported by ACPI or
@@ -1100,13 +1102,27 @@
 	 */
 	psmc = device_find_child(device_get_parent(parent),
 	    PSMCPNP_DRIVER_NAME, unit);
-	if (psmc == NULL)
+	if (psmc == NULL) {
+		printf("psm%d: could not find %s%d\n", unit,
+		    PSMCPNP_DRIVER_NAME, unit);
 		return;
+	}
 	irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0);
-	if (irq <= 0)
+	if (irq <= 0) {
+		printf("psm%d: no IRQ from %s\n", unit,
+		    device_get_nameunit(psmc));
 		return;
-	bus_delete_resource(psmc, SYS_RES_IRQ, 0);
-	bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+	}
+	error = bus_delete_resource(psmc, SYS_RES_IRQ, 0);
+	if (error)
+		printf("psm%d: failed to remove IRQ from %s: %d\n", unit,
+		    device_get_nameunit(psmc), error);
+	error = bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+	if (error)
+		printf("psm%d: failed to add IRQ %lu: %d\n", unit, irq,
+		    error);
+	else
+		printf("psm%d: added IRQ %lu\n", unit, irq);
 }
 
 #define	endprobe(v)	do {			\

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: Ivan Klymenko
Date: Monday, December 20, 2010 - 1:03 pm

В Mon, 20 Dec 2010 14:51:15 -0500

/usr/local/libexec/ccache/world-cc -c -O2 -pipe -mtune=native -fno-strict-aliasing -march=nocona -std=c99  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/src/sys/dev/atkbdc/psm.c
distcc[38004] ERROR: compile (null) on localhost failed
/usr/src/sys/dev/atkbdc/psm.c: In function 'psmidentify':
/usr/src/sys/dev/atkbdc/psm.c:1116: error: void value not ignored as it ought to be
*** Error code 1

Stop in /usr/obj/usr/src/sys/mk9.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: John Baldwin
Date: Monday, December 20, 2010 - 2:02 pm

Ok, try this:

Index: psm.c
===================================================================
--- psm.c	(revision 216591)
+++ psm.c	(working copy)
@@ -1080,7 +1080,7 @@
 	device_t psmc;
 	device_t psm;
 	u_long irq;
-	int unit;
+	int error, unit;
 
 	unit = device_get_unit(parent);
 
@@ -1090,8 +1090,10 @@
 		return;
 
 	irq = bus_get_resource_start(psm, SYS_RES_IRQ, KBDC_RID_AUX);
-	if (irq > 0)
+	if (irq > 0) {
+		printf("psm%d: already has an IRQ?\n", unit);
 		return;
+	}
 
 	/*
 	 * If the PS/2 mouse device has already been reported by ACPI or
@@ -1100,13 +1102,24 @@
 	 */
 	psmc = device_find_child(device_get_parent(parent),
 	    PSMCPNP_DRIVER_NAME, unit);
-	if (psmc == NULL)
+	if (psmc == NULL) {
+		printf("psm%d: could not find %s%d\n", unit,
+		    PSMCPNP_DRIVER_NAME, unit);
 		return;
+	}
 	irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0);
-	if (irq <= 0)
+	if (irq <= 0) {
+		printf("psm%d: no IRQ from %s\n", unit,
+		    device_get_nameunit(psmc));
 		return;
+	}
 	bus_delete_resource(psmc, SYS_RES_IRQ, 0);
-	bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+	error = bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1);
+	if (error)
+		printf("psm%d: failed to add IRQ %lu: %d\n", unit, irq,
+		    error);
+	else
+		printf("psm%d: added IRQ %lu\n", unit, irq);
 }
 
 #define	endprobe(v)	do {			\

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: Ivan Klymenko
Date: Monday, December 20, 2010 - 2:38 pm

В Mon, 20 Dec 2010 16:02:46 -0500

Not working :(
From: John Baldwin
Date: Monday, December 20, 2010 - 3:26 pm

This was debugging, not a fix.  Try this possible fix:

Index: atkbdc_isa.c
===================================================================
--- atkbdc_isa.c	(revision 216591)
+++ atkbdc_isa.c	(working copy)
@@ -272,14 +272,16 @@
 	 * list entry so we can use a standard bus_get_resource()
 	 * method.
 	 */
-	if (sc->irq == NULL) {
-		if (resource_int_value(name, unit, "irq", &t) != 0)
-			t = -1;
-	} else
-		t = rman_get_start(sc->irq);
-	if (t > 0)
-		resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid,
-				  t, t, 1);
+	if (order == KBDC_RID_KBD) {
+		if (sc->irq == NULL) {
+			if (resource_int_value(name, unit, "irq", &t) != 0)
+				t = -1;
+		} else
+			t = rman_get_start(sc->irq);
+		if (t > 0)
+			resource_list_add(&ivar->resources, SYS_RES_IRQ,
+			    ivar->rid, t, t, 1);
+	}
 
 	if (resource_disabled(name, unit))
 		device_disable(child);

-- 
John Baldwin
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: David Wolfskill
Date: Monday, December 20, 2010 - 3:40 pm

Worked for me: FreeBSD 9.0-CURRENT #81 r216588M: Mon Dec 20 14:35:37 PST 2010

Peace,
david
-- 
David H. Wolfskill				david@catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
From: Ivan Klymenko
Date: Monday, December 20, 2010 - 3:51 pm

В Mon, 20 Dec 2010 17:26:15 -0500

It works!
Thanks!
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
From: Ivan Klymenko
Date: Tuesday, December 21, 2010 - 1:45 am

В Mon, 20 Dec 2010 17:26:15 -0500
I have a question:
these changes will appear in HEAD?

Thanks!
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous thread: Starting with svn commit r216333 current freezes by Christian Gusenbauer on Saturday, December 18, 2010 - 2:14 am. (7 messages)

Next thread: [head tinderbox] failure on powerpc64/powerpc by FreeBSD Tinderbox on Saturday, December 18, 2010 - 6:21 pm. (1 message)