]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
USB: Consolidate LPM checks to avoid enabling LPM twice
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 22 Jan 2019 08:07:29 +0000 (16:07 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
commita960ff9c50f2a7af13bc64d20a069dce6f884f98
treea32d31f8729ca884ef14979c1ff41aa5da8edbad
parent91a4abc022cda78fb9a580b2479ebcba1ec973ee
USB: Consolidate LPM checks to avoid enabling LPM twice

BugLink: https://bugs.launchpad.net/bugs/1812812
USB Bluetooth controller QCA ROME (0cf3:e007) sometimes stops working
after S3:
[ 165.110742] Bluetooth: hci0: using NVM file: qca/nvm_usb_00000302.bin
[ 168.432065] Bluetooth: hci0: Failed to send body at 4 of 1953 (-110)

After some experiments, I found that disabling LPM can workaround the
issue.

On some platforms, the USB power is cut during S3, so the driver uses
reset-resume to resume the device. During port resume, LPM gets enabled
twice, by usb_reset_and_verify_device() and usb_port_resume().

Consolidate all checks into new LPM helpers to make sure LPM only gets
enabled once.

Fixes: de68bab4fa96 ("usb: Don't enable USB 2.0 Link PM by default.”)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org> # after much soaking
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(backported from commit d7a6c0ce8d26412903c7981503bad9e1cc7c45d2 linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/core/message.c