On Thu, Aug 2, 2018 at 8:21 PM, Alan Stern <[email protected]> wrote:
> On Thu, 2 Aug 2018, Muni Sekhar wrote:
>
>> On Thu, Aug 2, 2018 at 7:08 PM, Alan Stern <[email protected]> wrote:
>> > On Thu, 2 Aug 2018, Muni Sekhar wrote:
>> >
>> >> [ Please keep me in CC as I'm not subscribed to the list]
>> >>
>> >>
>> >> Hello All,
>> >>
>> >>
>> >> I’ve an Ubuntu 16.04 LTS PC with 4.4.0-124-generic kernel version.
>> >>
>> >> I want to test the dynamic suspend for the below mentioned connected
>> >> USB device.
>> >>
>> >> Bus 003 Device 028: ID 0cf3:e300 Atheros Communications, Inc.
>> >>
>> >>
>> >> First I’d like to know the required configuration(kernel built) of the
>> >> kernel for supporting the dynamic suspend for USB.
>> >>
>> >> My kernel had been built with the below mentioned configuration:
>> >> CONFIG_SUSPEND=y
>> >> CONFIG_HIBERNATION=y
>> >> CONFIG_PM=y
>> >>
>> >> Any other kernel configuration required for supporting the dynamic
>> >> suspend?
>> >
>> > No.
>> >
>> >> How can I suspend a particular USB device?
>> >
>> > You have to do something like:
>> >
>> > echo auto >/sys/bus/usb/devices/.../power/control
>> >
>> > where the "..." is filled in with the appropriate name for the
>> > particular device. There are some programs, like powertop, which will
>> > do this for you automatically.
>> Thank you Alan for this information. I wrote 'auto' to power/control,
>> but still device not going to suspend mode(power/runtime_status is
>> 'active'). Any other factors needs to be considered?
>
> Yes, there are other factors. They depend on how device's driver is
> written.
>
> I don't know exactly what kind of device you're talking about, what
> driver it uses, or what the driver's requirements are. Since the
> vendor is Atheros, I guess it's a wifi card. Perhaps turning wifi off
> will allow the device to be suspended; you'll probably have to check
> with the driver's author or maintainer to find out for certain.
I see that CONFIG_PM_RUNTIME & CONFIG_USB_SUSPEND are not enabled. Is that fine?
The device is using btusb driver. Does unloading the driver helps?
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#= 68 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=e300 Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
I ran ‘lsof’ and and I see that the USB device was being held open by
fwupd, not sure what is ‘fwupd’?
# sudo lsof +D /dev/bus/usb
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
fwupd 1631 root 49u CHR 189,67 0t0 547 /dev/bus/usb/001/068
So I killed that process(fwupd), but still device is not going to SUSPEND mode.
# sudo lsof +D /dev/bus/usb
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
# cat /sys/bus/usb/devices/1-1.3/power/runtime_status
active
>
> Alan Stern
>
>> Here is the my log:
>>
>> # cat /sys/bus/usb/devices/1-1.3/idVendor
>> 0cf3
>> # cat /sys/bus/usb/devices/1-1.3/idProduct
>> e300
>> # cat /sys/bus/usb/devices/1-1.3/power/control
>> on
>> # cat /sys/bus/usb/devices/1-1.3/power/runtime_status
>> active
>> # cat /sys/bus/usb/devices/1-1.3/power/runtime_suspended_time
>> 0
>> # echo auto > /sys/bus/usb/devices/1-1.3/power/control
>> # cat /sys/bus/usb/devices/1-1.3/power/control
>> auto
>> # cat /sys/bus/usb/devices/1-1.3/power/runtime_status
>> active
>
--
Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html