Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: Disable USB2 LPM at shutdown

The QCA Rome USB Bluetooth controller has several issues once LPM gets
enabled:
- Fails to get enumerated in coldboot. [1]
- Drains more power (~ 0.2W) when the system is in S5. [2]
- Disappears after a warmboot. [2]

The issue happens because the device lingers at LPM L1 in S5, so device
can't get enumerated even after a reboot.

Disable LPM at shutdown to solve the issue.

[1] https://bugs.launchpad.net/bugs/1757218
[2] https://patchwork.kernel.org/patch/10607097/

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20190805142412.23965-1-kai.heng.feng@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kai-Heng Feng and committed by
Greg Kroah-Hartman
582ee9c5 d3523b63

+9
+9
drivers/usb/core/port.c
··· 285 285 } 286 286 #endif 287 287 288 + static void usb_port_shutdown(struct device *dev) 289 + { 290 + struct usb_port *port_dev = to_usb_port(dev); 291 + 292 + if (port_dev->child) 293 + usb_disable_usb2_hardware_lpm(port_dev->child); 294 + } 295 + 288 296 static const struct dev_pm_ops usb_port_pm_ops = { 289 297 #ifdef CONFIG_PM 290 298 .runtime_suspend = usb_port_runtime_suspend, ··· 309 301 static struct device_driver usb_port_driver = { 310 302 .name = "usb", 311 303 .owner = THIS_MODULE, 304 + .shutdown = usb_port_shutdown, 312 305 }; 313 306 314 307 static int link_peers(struct usb_port *left, struct usb_port *right)