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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ffe9b05-8a45-fa8f-8230-e97fb7dda466@linux.intel.com>
Date:   Fri, 17 Nov 2017 19:45:35 +0200
From:   Mathias Nyman <mathias.nyman@...ux.intel.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Alan Stern <stern@...land.harvard.edu>
Subject: Re: question about usb_rebind_intf

On 17.11.2017 19:09, Greg Kroah-Hartman wrote:
> On Fri, Nov 17, 2017 at 09:35:51AM -0700, Jerry Snitselaar wrote:
>> Should this skip warning that the rebind failed if device_attach
>> is returning -EPROBE_DEFER? If I do something like 'rtcwake -m mem -s 30'
>> on a laptop I have here I will see a couple "rebind failed: -517" messages
>> as it comes back out of suspend. Since the device probe eventually happens
>> once probes are not deferred wondering if this warning this be given in that
>> case.
>>
>>
>> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
>> index 64262a9a8829..5d3408010112 100644
>> --- a/drivers/usb/core/driver.c
>> +++ b/drivers/usb/core/driver.c
>> @@ -1070,7 +1070,7 @@ static void usb_rebind_intf(struct usb_interface *intf)
>>         if (!intf->dev.power.is_prepared) {
>>                 intf->needs_binding = 0;
>>                 rc = device_attach(&intf->dev);
>> -               if (rc < 0)
>> +               if (rc < 0 && rc != -EPROBE_DEFER)
>>                         dev_warn(&intf->dev, "rebind failed: %d\n", rc);
>>         }
>> }
> 
> What USB driver is returning -EPROBE_DEFER to cause this to be an issue?
> Shouldn't that really only be for "platform" drivers and the like?  USB
> interface drivers should all be "self-contained" within reason.
> 

I see this as well with btusb driver in resume if port was reset.

drivers/base/dd.c really_probe() returns -EPROBE_DEFER if it's called before
device_unblock_probing() is called.

drivers/base/power/main/dpm_complete() will unlock probing after it has
finished resuming all devices and called all the pm_ops .complete callbacks.

The usb_device_pm_ops .complete callback will try to rebind the interface driver
if device was reset at resume, leading to them -EPROBE_DEFER.
  
I guess we either need to rework a few things, or remove that warning.

-Mathias   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ