Date: Fri, 2 Mar 2012 14:25:32 -0500 From: Jung-uk Kim <jkim@FreeBSD.org> To: freebsd-stable@FreeBSD.org Cc: Alexey Dokuchaev <danfe@nsu.ru>, Hans Petter Selasky <hselasky@c2i.net> Subject: Re: Resume broken in 8.3-PRERELEASE Message-ID: <201203021425.34456.jkim@FreeBSD.org> In-Reply-To: <20120302085012.GA25811@regency.nsu.ru> References: <20120227152238.GA2940@regency.nsu.ru> <201203011655.05964.jkim@FreeBSD.org> <20120302085012.GA25811@regency.nsu.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--Boundary-00=_u6RUPjiXMRgeD5V Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 02 March 2012 03:50 am, Alexey Dokuchaev wrote: > On Thu, Mar 01, 2012 at 04:55:03PM -0500, Jung-uk Kim wrote: > > It does not make a difference for me (i.e., usb suspend/resume > > still broken) but I think I found a typo: > > > > --- sys/dev/usb/controller/usb_controller.c (revision 232365) > > +++ sys/dev/usb/controller/usb_controller.c (working copy) > > @@ -407,7 +407,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) > > > > USB_BUS_UNLOCK(bus); > > > > - bus_generic_shutdown(bus->bdev); > > + bus_generic_suspend(bus->bdev); > > > > usbd_enum_lock(udev); > > Same thing here, does not seem to improve anything. It might > suspend, resume (with keyboard working), then die on next suspend > completely. Or it may die on the first suspend (without suspending > -- fans are spinning, screen is black and no response to anything > except hard power-off), this actually happens more often. Try the attached patch. At least, it fixed my problem. > ./danfe > > P.S. Also, doing "ps" in debugger shows that acpiconf(8) is > running in the userland upon resume (and hang). Not sure if it > helps or not though. It usually means a device driver couldn't resume (and hang). Jung-uk Kim --Boundary-00=_u6RUPjiXMRgeD5V Content-Type: text/plain; charset="iso-8859-1"; name="usb.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="usb.diff" Index: sys/dev/usb/controller/usb_controller.c =================================================================== --- sys/dev/usb/controller/usb_controller.c (revision 232401) +++ sys/dev/usb/controller/usb_controller.c (working copy) @@ -89,10 +89,15 @@ TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wa SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); +static int usb_no_suspend_wait = 0; +TUNABLE_INT("hw.usb.no_suspend_wait", &usb_no_suspend_wait); +SYSCTL_INT(_hw_usb, OID_AUTO, no_suspend_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_suspend_wait, 0, "No USB device waiting at system suspend."); + static int usb_no_shutdown_wait = 0; TUNABLE_INT("hw.usb.no_shutdown_wait", &usb_no_shutdown_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, &usb_no_shutdown_wait, 0, - "No USB device waiting at system shutdown."); +SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RW|CTLFLAG_TUN, + &usb_no_shutdown_wait, 0, "No USB device waiting at system shutdown."); static devclass_t usb_devclass; @@ -240,6 +245,11 @@ usb_suspend(device_t dev) USB_BUS_LOCK(bus); usb_proc_msignal(&bus->explore_proc, &bus->suspend_msg[0], &bus->suspend_msg[1]); + if (usb_no_suspend_wait == 0) { + /* wait for suspend callback to be executed */ + usb_proc_mwait(&bus->explore_proc, + &bus->suspend_msg[0], &bus->suspend_msg[1]); + } USB_BUS_UNLOCK(bus); return (0); @@ -407,7 +417,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) USB_BUS_UNLOCK(bus); - bus_generic_shutdown(bus->bdev); + bus_generic_suspend(bus->bdev); usbd_enum_lock(udev); --Boundary-00=_u6RUPjiXMRgeD5V--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203021425.34456.jkim>