Re: btusb autosuspend failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 04, 2010 at 06:28:59PM -0400, Alan Stern wrote:
> On Sun, 4 Apr 2010, Dominik Brodowski wrote:
> 
> > Alan, Oliver,
> > 
> > On Sun, Apr 04, 2010 at 07:42:33PM +0200, Dominik Brodowski wrote:
> > > Oliver,
> > > 
> > > Unfortunately, autosuspend of btusb does not seem to work on my notebook
> > > with 2.6.34-rc3:
> > 
> > Debugging this a bit further (that's what long train rides are for):
> > 
> > 1) btusb_open() gets called, which contains a pair of 
> > 	usb_autopm_get_interface(), usb_autopm_put_interface() calls. It
> >         sets needs_remote_wakeup = 1; in between there are two calls to
> > 	usb_mark_last_busy().
> > 
> > 2) There follow a few usb_mark_last_busy() calls.
> > 
> > 3) Then, btusb_close() gets called, which again contains a pair of
> >    usb_autopm_{get,put}_interface() calls. Once btusb_close() returns,
> >    atomic_read(&intf->dev.power.usage_count) returns 0.
> > 
> > This means that after startup, this usage_count is 0. Nonetheless,
> > btusb's suspend callback is never called, despite the following settings:
> > 
> > # cat /sys/module/usbcore/parameters/autosuspend 
> > 2
> > 
> > # cat /sys/bus/usb/devices/7-1/power/level 
> > auto
> 
> The logic for autosuspend is more or less contained in
> drivers/usb/core/driver.c:autosuspend_check().  It gets called from
> usb_autopm_do_interface(), called by usb_autopm_put_interface().  
> (That's in 2.6.33; in 2.6.34-rc the arrangement is a little different
> but not too much.)  If you add some debugging statements to those
> routines you ought to be able to figure out what's going on.

usb_autopm_put_interface() gets called, the bus rt_idle function is called,
which does nothing on interfaces:

[  470.809499] btusb 7-1:1.0: calling bus rt_idle
[  470.809507] btusb 7-1:1.0: usb_autopm_put_interface: cnt 0 -> 0

rt_suspending usb 7-1 is never attempted, probably because it thinks
children are busy. Setting the interface's ignore_children to true doesn't
help. The device tree looks like this:

.
|-- 7-0:1.0
|   |-- driver -> ../../../../../bus/usb/drivers/hub
|   |-- ep_81
|-- 7-1
|   |-- 7-1:1.0
|   |   |-- bluetooth
|   |   |   `-- hci0
|   |   |       |-- device -> ../../../7-1:1.0
|   |   |       |-- rfkill2
|   |   |       |   |-- device -> ../../hci0
|   |   |       |   `-- subsystem -> ../../../../../../../../../class/rfkill
|   |   |       `-- subsystem -> ../../../../../../../../class/bluetooth
|   |   |-- driver -> ../../../../../../bus/usb/drivers/btusb
|   |   |-- ep_02
|   |   |-- ep_81
|   |   |-- ep_82
|   |-- 7-1:1.1
|   |   |-- driver -> ../../../../../../bus/usb/drivers/btusb
|   |   |-- ep_03
|   |   |-- ep_83
|   |   |-- power
|   |-- 7-1:1.2
|   |   |-- ep_04
|   |   |-- ep_84
|   |   |-- power
|   |-- 7-1:1.3
|   |   |-- power
|   |-- driver -> ../../../../../bus/usb/drivers/usb
|   |-- ep_00
|-- ep_00

Any ideas?

Best,
	Dominik
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux