lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
[an error occurred while processing this directive]
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D84EEC8F-8B65-4B0C-9EA7-E01A0BB47398@canonical.com>
Date:   Thu, 31 Jan 2019 00:01:13 +0800
From:   Kai-Heng Feng <kai.heng.feng@...onical.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] USB: Disable USB2 LPM at shutdown



> On Jan 30, 2019, at 16:21, Greg KH <gregkh@...uxfoundation.org> wrote:
> 
> On Thu, Jan 24, 2019 at 02:16:43PM +0800, Kai-Heng Feng wrote:
>> 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@...onical.com>
>> ---
>> v2: Use new LPM helpers.
>> 
>> drivers/usb/core/port.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> 
>> diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
>> index 1a06a4b5fbb1..bbbb35fa639f 100644
>> --- a/drivers/usb/core/port.c
>> +++ b/drivers/usb/core/port.c
>> @@ -285,6 +285,14 @@ static int usb_port_runtime_suspend(struct device *dev)
>> }
>> #endif
>> 
>> +static void usb_port_shutdown(struct device *dev)
>> +{
>> +	struct usb_port *port_dev = to_usb_port(dev);
>> +
>> +	if (port_dev->child)
>> +		usb_disable_usb2_hardware_lpm(port_dev->child);
>> +}
>> +
>> static const struct dev_pm_ops usb_port_pm_ops = {
>> #ifdef CONFIG_PM
>> 	.runtime_suspend =	usb_port_runtime_suspend,
>> @@ -301,6 +309,7 @@ struct device_type usb_port_device_type = {
>> static struct device_driver usb_port_driver = {
>> 	.name = "usb",
>> 	.owner = THIS_MODULE,
>> +	.shutdown = usb_port_shutdown,
>> };
> 
> So you now do this for all ports in the system, no matter what is
> plugged in or not.  Are you _SURE_ you want to do that?  It seems like a
> big hammer to solve just one single device's problems.

Yes I think this should be universally applied.

I don’t think the bug only happens to one device. Users won’t find this
unless they connect their laptop to a power meter.

Platform may not completely cut off USB bus power during shutdown,
so the device transits to L1 after system shutdown. Now xHC is disabled
so nothing can bring it back to L0 or L2.

Kai-Heng

> 
> thanks,
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ