Re: [PATCH 1/3] usbcore: set lpm_capable field for LPM capable root hubs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Martin MOKREJŠ wrote:
> Hi Xenia,
>   I tried these 3 patches and ... I will rather leave it up to you to decide
> if everything went right. Attached is a diff of dmesg from unpatched and patched
> 3.10.9 kernel. USB3 devices were connected before cold bootup, sadly in latter test
> the ordering changed a bit so that added to the length of the diff. Can't say
> what those Prolific-related messages mean. Just in case you need more info
> I attach "lsub -v" as well.

One more addition. When I disconnected the external hard drives from the external
HUB I got:

[ 1677.615301] usb 4-1.1: USB disconnect, device number 4
[ 1677.619345] usb 4-1.1: Set SEL for device-initiated U1 failed.
[ 1677.619369] usb 4-1.1: Set SEL for device-initiated U2 failed.
[ 1677.815570] usb 4-1.2: USB disconnect, device number 5
[ 1677.819705] usb 4-1.2: Set SEL for device-initiated U1 failed.
[ 1677.819728] usb 4-1.2: Set SEL for device-initiated U2 failed.
[ 1681.716021] usb 4-1.3: USB disconnect, device number 6
[ 1681.718342] usb 4-1.3: Set SEL for device-initiated U1 failed.
[ 1681.718364] usb 4-1.3: Set SEL for device-initiated U2 failed.
[ 1681.911026] usb 4-1.4: USB disconnect, device number 8
[ 1681.914197] usb 4-1.4: Set SEL for device-initiated U1 failed.
[ 1681.914220] usb 4-1.4: Set SEL for device-initiated U2 failed.

Both external HUBs are still connected. When I disconnect one of them:

[ 1961.448396] usb 4-1: USB disconnect, device number 2
[ 1961.448934] usb 4-1: Set SEL for device-initiated U1 failed.
[ 1961.448956] usb 4-1: Set SEL for device-initiated U2 failed.

Don't know if this isn't a false alarm. If a device is gone, the message is
useless.

Martin



> Martin
> 
> Xenia Ragiadakou wrote:
>> This patch sets the lpm_capable field for root hubs with LPM capabilities.
>>
>> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
>> Reported-by: Martin MOKREJS <mmokrejs@xxxxxxxxx>
>> Suggested-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
>> ---
>>  drivers/usb/core/hcd.c | 1 +
>>  drivers/usb/core/hub.c | 7 ++++++-
>>  drivers/usb/core/usb.h | 1 +
>>  3 files changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>> index 19ad3d2..36598e4 100644
>> --- a/drivers/usb/core/hcd.c
>> +++ b/drivers/usb/core/hcd.c
>> @@ -1038,6 +1038,7 @@ static int register_root_hub(struct usb_hcd *hcd)
>>  					dev_name(&usb_dev->dev), retval);
>>  			return retval;
>>  		}
>> +		usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
>>  	}
>>  
>>  	retval = usb_new_device (usb_dev);
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 46ce3aa..14371f8 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
>>  	return usb_get_intfdata(hdev->actconfig->interface[0]);
>>  }
>>  
>> -static int usb_device_supports_lpm(struct usb_device *udev)
>> +int usb_device_supports_lpm(struct usb_device *udev)
>>  {
>>  	/* USB 2.1 (and greater) devices indicate LPM support through
>>  	 * their USB 2.0 Extended Capabilities BOS descriptor.
>> @@ -156,6 +156,11 @@ static int usb_device_supports_lpm(struct usb_device *udev)
>>  				"Power management will be impacted.\n");
>>  		return 0;
>>  	}
>> +
>> +	/* udev is root hub */
>> +	if (!udev->parent)
>> +		return 1;
>> +
>>  	if (udev->parent->lpm_capable)
>>  		return 1;
>>  
>> diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
>> index 8238577..c493836 100644
>> --- a/drivers/usb/core/usb.h
>> +++ b/drivers/usb/core/usb.h
>> @@ -35,6 +35,7 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
>>  		unsigned int size);
>>  extern int usb_get_bos_descriptor(struct usb_device *dev);
>>  extern void usb_release_bos_descriptor(struct usb_device *dev);
>> +extern int usb_device_supports_lpm(struct usb_device *udev);
>>  extern char *usb_cache_string(struct usb_device *udev, int index);
>>  extern int usb_set_configuration(struct usb_device *dev, int configuration);
>>  extern int usb_choose_configuration(struct usb_device *udev);
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux