Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable"
@ 2021-02-18 12:37 Hans de Goede
  2021-02-18 12:37 ` [PATCH 5.12 regression fix] Bluetooth: btusb: Revert Fix the autosuspend enable and disable Hans de Goede
  2021-02-18 13:32 ` [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable" Hui Wang
  0 siblings, 2 replies; 15+ messages in thread
From: Hans de Goede @ 2021-02-18 12:37 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg; +Cc: Hans de Goede, Hui Wang, linux-bluetooth

Hi All,

From the commit msg:

"""
drivers/usb/core/hub.c: usb_new_device() contains the following:

        /* By default, forbid autosuspend for all devices.  It will be
         * allowed for hubs during binding.
         */
        usb_disable_autosuspend(udev);

So for anything which is not a hub, such as btusb devices, autosuspend is
disabled by default and we MUST call usb_enable_autosuspend(udev) to
enable it.

This means that the "Fix the autosuspend enable and disable" commit,
which drops the usb_enable_autosuspend() call when the enable_autosuspend
module option is true, is completely wrong, revert it.
"""

Hui, I guess that what you were seeing is caused by:
/lib/udev/hwdb.d/60-autosuspend-chromiumos.hwdb

Which enables autosuspend on a bunch of USB devices based on VID:PID,
overruling the kernel defaults. This is done to get better power-consumption
with devices where it is known that it is safe to do this.
 
I guess that that the device you were testing this with is on that list.
So the proper fix would be to edit that file and remove your VID:PID from it.

Hui, also next time please try to Cc the original author of the code you
are modifying. A simple "git blame drivers/bluetooth/btusb.c" would have
found you commit eff2d68ca738 ("Bluetooth: btusb: Add a Kconfig option to
enable USB autosuspend by default") and then you could have added me to
the Cc and I could have nacked the patch before it got merged.

I happen to spot this this time since I was looking into some other
btusb issue. But if I had not spotted this, this would have caused
a significant power-consumption regression on many laptops.

Btusb might not look like a big consumer, but if it does not autosuspend
it often is the only USB device not autosuspending, keeping the XHCI
controller awake, which in turn is keeping a whole power-plane awake on
what once used to be the southbridge. At least on Skylake era hw this
could lead to an extra idle powerconsumption of 1W. So a small change
can cause a big impact.

Regards,

Hans
   


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-02-26  1:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 12:37 [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable" Hans de Goede
2021-02-18 12:37 ` [PATCH 5.12 regression fix] Bluetooth: btusb: Revert Fix the autosuspend enable and disable Hans de Goede
2021-02-18 14:36   ` Hui Wang
2021-02-18 15:02     ` Hans de Goede
2021-02-18 15:43       ` Hui Wang
2021-02-18 20:01       ` Marcel Holtmann
2021-02-18 22:04         ` Hans de Goede
2021-02-18 23:41           ` Luiz Augusto von Dentz
2021-02-19  9:24             ` Hans de Goede
2021-02-25  4:37               ` Hui Wang
2021-02-25 14:17                 ` Hans de Goede
2021-02-26  1:03                   ` Hui Wang
2021-02-18 15:08   ` Bluetooth: btusb: Revert "Fix the autosuspend enable and disable" bluez.test.bot
2021-02-26  1:05   ` [PATCH 5.12 regression fix] Bluetooth: btusb: Revert Fix the autosuspend enable and disable Hui Wang
2021-02-18 13:32 ` [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable" Hui Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox