Re: [PATCH 1/9] usb: Use the USB_SS_MULT() macro to get the burst multiplier.

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

 



On Fri, Sep 18, 2015 at 05:42:05PM +0300, Mathias Nyman wrote:
> Bits 1:0 of the bmAttributes are used for the burst multiplier.
> The rest of the bits used to be reserverd (zero), but USB3.1 takes bit 7
> into use.
> 
> Use the existing USB_SS_MULT() macro instead to make sure the mult value
> and hence max packet calculations are correct for USB3.1 devices.
> 
> Note that burts multipier in bmAttributes is zero based and that
> the USB_SS_MULT() macro adds one.
> 
> Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/core/config.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
> index b2a540b..b9ddf0c 100644
> --- a/drivers/usb/core/config.c
> +++ b/drivers/usb/core/config.c
> @@ -112,7 +112,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
>  				cfgno, inum, asnum, ep->desc.bEndpointAddress);
>  		ep->ss_ep_comp.bmAttributes = 16;
>  	} else if (usb_endpoint_xfer_isoc(&ep->desc) &&
> -			desc->bmAttributes > 2) {
> +		   USB_SS_MULT(desc->bmAttributes) > 3) {
>  		dev_warn(ddev, "Isoc endpoint has Mult of %d in "
>  				"config %d interface %d altsetting %d ep %d: "
>  				"setting to 3\n", desc->bmAttributes + 1,
> @@ -121,7 +121,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
>  	}
>  
>  	if (usb_endpoint_xfer_isoc(&ep->desc))
> -		max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
> +		max_tx = (desc->bMaxBurst + 1) *
> +			(USB_SS_MULT(desc->bmAttributes)) *
>  			usb_endpoint_maxp(&ep->desc);
>  	else if (usb_endpoint_xfer_int(&ep->desc))
>  		max_tx = usb_endpoint_maxp(&ep->desc) *

Can this wait for 4.4?  This isn't a bugfix for 4.3, so I don't see why
it's really needed right now.

thanks,

greg k-h
--
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