Resume broken in 8.3-PRERELEASE
Jung-uk Kim
jkim at FreeBSD.org
Fri Mar 2 19:25:46 UTC 2012
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
-------------- next part --------------
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);
More information about the freebsd-stable
mailing list