Subject: kern/8240: page fault trap in usb driver by apm resume
To: None <>
From: None <>
List: netbsd-bugs
Date: 08/19/1999 17:36:04
>Number:         8240
>Category:       kern
>Synopsis:       apm resume causes a page fault trap in usb driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 19 17:35:00 1999
>Originator:     Kawamoto Yosihisa
>Release:        <NetBSD-current 1999/08/18>
	note pc (SONY VAIO 505RX)
System: NetBSD 1.4K NetBSD 1.4K (RERUN) #206: Thu Aug 19 19:29:09 JST 1999 i386

	  A resume from suspend causes a kernel page fault trap
	in usb driver.  The ddb backtrace is following:
bash$ zzz
Suspending system...
bash$ kernel: page fault trap, code=0
Stopped at tsleep+0x80: movl 0xb0(%ebx),%eax
db> trace
tsleep(f4b13c90,10,f02be41b,2,f4b13ca8) at tsleep+0x80
usb_delay_ms(f04dd000,1) at usb_delay_ms+0x53
uhci_run(f04dd000,1,f04d6f40,0,f04ea400) at uhci_run+0xcb
uhci_power(0,f04dd000) at uhci_power+0x158
	  Mr. Enami points out that p = curproc in tsleep() is NULL
	when a kernel resumes.
(gdb) set listsize 2
(gdb) l *(tsleep + 0x80)
0xf0128e74 is in tsleep (/a/
364     #ifdef KTRACE
365             if (KTRPOINT(p, KTR_CSW))
(gdb) p &((struct proc *)0)->p_traceflag
$3 = (int *) 0xb0
	Enable KTRACE kernel option.
	I have no idea.