Date: Fri, 4 Nov 2011 09:19:18 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227075 - head/sys/dev/usb Message-ID: <201111040919.pA49JIIu010240@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Nov 4 09:19:18 2011 New Revision: 227075 URL: http://svn.freebsd.org/changeset/base/227075 Log: Fix for panic at USB controller attach failure during cold boot. Reported by: Jan Henrik Sylvester, Xin LI and more. MFC after: 3 days Modified: head/sys/dev/usb/usb_process.c Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Fri Nov 4 06:56:59 2011 (r227074) +++ head/sys/dev/usb/usb_process.c Fri Nov 4 09:19:18 2011 (r227075) @@ -67,11 +67,13 @@ static int usb_pcount; #define USB_THREAD_CREATE(f, s, p, ...) \ kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \ 0, "usb", __VA_ARGS__) +#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check() #define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) #define USB_THREAD_EXIT(err) kthread_exit() #else #define USB_THREAD_CREATE(f, s, p, ...) \ kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) +#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check() #define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) #define USB_THREAD_EXIT(err) kthread_exit(err) #endif @@ -98,6 +100,9 @@ usb_process(void *arg) struct usb_proc_msg *pm; struct thread *td; + /* in case of attach error, check for suspended */ + USB_THREAD_SUSPEND_CHECK(); + /* adjust priority */ td = curthread; thread_lock(td);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111040919.pA49JIIu010240>