Re: [PATCH 7/9] musb_host: don't limit interval for low speed devices

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

 



On Wednesday 04 February 2009, Sergei Shtylyov wrote:
> Remove wrongly applied upper limit on the interrupt transfer interval for the
> low speed devices (not much of an error per se, according to the USB specs)...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

OK for 2.6.29-rc, though as "not much of an error"
I wouldn't push for it.


> ---
> The patch is against the recent Linus' kernel.
> 
>  drivers/usb/musb/musb_host.c |   18 ++++++++++--------
>  1 files changed, 10 insertions(+), 8 deletions(-)
> 
> Index: linux-2.6/drivers/usb/musb/musb_host.c
> ===================================================================
> --- linux-2.6.orig/drivers/usb/musb/musb_host.c
> +++ linux-2.6/drivers/usb/musb/musb_host.c
> @@ -1857,19 +1857,21 @@ static int musb_urb_enqueue(
>  	}
>  	qh->type_reg = type_reg;
>  
> -	/* precompute rxinterval/txinterval register */
> -	interval = min((u8)16, epd->bInterval);	/* log encoding */
> +	/* Precompute RXINTERVAL/TXINTERVAL register */
>  	switch (qh->type) {
>  	case USB_ENDPOINT_XFER_INT:
> -		/* fullspeed uses linear encoding */
> -		if (USB_SPEED_FULL == urb->dev->speed) {
> -			interval = epd->bInterval;
> -			if (!interval)
> -				interval = 1;
> +		/*
> +		 * Full/low speeds use the  linear encoding,
> +		 * high speed uses the logarithmic encoding.
> +		 */
> +		if (urb->dev->speed <= USB_SPEED_FULL) {
> +			interval = max_t(u8, epd->bInterval, 1);
> +			break;
>  		}
>  		/* FALLTHROUGH */
>  	case USB_ENDPOINT_XFER_ISOC:
> -		/* iso always uses log encoding */
> +		/* ISO always uses logarithmic encoding */
> +		interval = min_t(u8, epd->bInterval, 16);
>  		break;
>  	default:
>  		/* REVISIT we actually want to use NAK limits, hinting to the
> 
> 


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