Linux bluetooth development
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Hui Wang <hui.wang@canonical.com>,
	linux-bluetooth@vger.kernel.org
Subject: [PATCH 5.12 regression fix 0/1] Bluetooth: btusb: Revert "Fix the autosuspend enable and disable"
Date: Thu, 18 Feb 2021 13:37:27 +0100	[thread overview]
Message-ID: <20210218123728.17067-1-hdegoede@redhat.com> (raw)

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
   


             reply	other threads:[~2021-02-18 14:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 12:37 Hans de Goede [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210218123728.17067-1-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hui.wang@canonical.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox