Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2011 15:06:04 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r227216 - stable/9/sys/dev/usb
Message-ID:  <201111061506.pA6F64fq027006@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Nov  6 15:06:04 2011
New Revision: 227216
URL: http://svn.freebsd.org/changeset/base/227216

Log:
  MFC r227075:
  Fix for panic at USB controller attach failure during cold boot.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/usb/usb_process.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/usb/usb_process.c
==============================================================================
--- stable/9/sys/dev/usb/usb_process.c	Sun Nov  6 14:07:23 2011	(r227215)
+++ stable/9/sys/dev/usb/usb_process.c	Sun Nov  6 15:06:04 2011	(r227216)
@@ -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?201111061506.pA6F64fq027006>