Re: [PATCH] usbtest: Fix BOS control test for USB 2.01 devices.

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

 



Hi Sarah,

On Fri, Dec 13, 2013 at 01:56:19PM -0800, Sarah Sharp wrote:
> Commit c952a8ba7136505cd1ca01735cc748ddc08c7d2f "usb: usbtest: add a
> test case to support bos for queue control" will cause USB 2.01 and USB
> 2.10 devices with a BOS descriptor to fail case 15 of the control test.
> 
> The Link PM errata (released in 2007, updated in 2011) says:
> 
> "The value of the bcdUSB field in the standard USB 2.0 Device Descriptor
> is used to indicate that the device supports the request to read the BOS
> Descriptor (i.e.  GetDescriptor(BOS)). Devices that support the BOS
> descriptor must have a bcdUSB value of 0201H or larger."
> 
> The current code says that non-SuperSpeed devices *must* return -EPIPE,
> as this comment shows:
> 
>                 /* sign of this variable means:
>                  *  -: tested code must return this (negative) error code
>                  *  +: tested code may return this (negative too) error code
>                  */
>                 int                     expected = 0;
> 
> This means the test will fail with USB 2.01 and USB 2.10 devices that
> provide a BOS descriptor.  Change it to only require a stall response if
> the USB device bcdUSB is less than 2.01.
> 
> Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>
> Cc: Huang Rui <ray.huang@xxxxxxx>

Thanks to catch and fix it.

Acked-by: Huang Rui <ray.huang@xxxxxxx>

> ---
>  drivers/usb/misc/usbtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> index bff058ea222e..446ff55e3c58 100644
> --- a/drivers/usb/misc/usbtest.c
> +++ b/drivers/usb/misc/usbtest.c
> @@ -1224,7 +1224,7 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param)
>  				len = le16_to_cpu(udev->bos->desc->wTotalLength);
>  			else
>  				len = sizeof(struct usb_bos_descriptor);
> -			if (udev->speed != USB_SPEED_SUPER)
> +			if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0201)
>  				expected = -EPIPE;
>  			break;
>  		default:
> -- 
> 1.8.3.3
> 
> 

--
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