Re: -rc6: something (probably active usb bluetooth) blocks suspend

From: Alan Stern
Date: Mon Nov 16 2009 - 11:05:34 EST


On Mon, 16 Nov 2009, Oliver Neukum wrote:

> Am Samstag, 14. November 2009 12:10:21 schrieb Pavel Machek:
> > On Mon 2009-11-16 12:48:29, Oliver Neukum wrote:
> > > Am Montag, 16. November 2009 12:22:54 schrieb Pavel Machek:
> > >
> > > Hi Pavle,
> > >
> > :-)
> > :
> > > first the obvious question. Does it work if you down the interface?
> > > (not by killswitch)
> >
> > Well, I'm not sure how repeatable it is. It happens once in two tries
> > today.
>
> Ok, so it looks like a race.
>
> > > > usb 5-1: usb suspend
> > > > usb 5-1: usb auto-resume
> > > > uhci_hcd 0000:00:1d.3: port 1 portsc 0095,01
> > > > usb 5-1: finish resume
> > > > uhci_hcd 0000:00:1d.3: reserve dev 2 ep81-INT, period 1, phase 0, 23
> > > > us
> > >
> > > Why is the device autoresumed here? Are you using autosuspend?
> > > This is odd, as the freezer should block the send path and remote
> > > wakeups should be deferred.
> >
> > I believe I have it enabled in kconfig but not during runtime.
>
> Please check.

If you want to learn the source of the autoresume, do something like
this:

Index: usb-2.6/drivers/usb/core/hub.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/hub.c
+++ usb-2.6/drivers/usb/core/hub.c
@@ -2334,6 +2334,8 @@ int usb_port_resume(struct usb_device *u
/* drive resume for at least 20 msec */
dev_dbg(&udev->dev, "usb %sresume\n",
(msg.event & PM_EVENT_AUTO ? "auto-" : ""));
+ if ((msg.event & PM_EVENT_AUTO) && udev->maxchild == 0)
+ dump_stack();
msleep(25);

/* Virtual root hubs can trigger on GET_PORT_STATUS to

This will show you what is responsible for all autoresumes of non-hub
USB devices.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/