RE: musb: Clear_TT_Buffer implementation

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

 



On Thu, 2 Nov 2017, Gervais, Francois wrote:

> We had another go at it and this is what we have now.
> 
> Already we can tell that it's much more efficient when we have multiple
> errors in a row we don't send as much clear requests.
> 
> Can somebody comment?
> 
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index 26bda88..0f5a916 100755
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -307,6 +307,21 @@ start:
>         }
>  }
>  
> +static void musb_clear_tt_buffer_complete(struct usb_hcd *hcd,
> +               struct usb_host_endpoint *ep)
> +{
> +       struct musb             *musb = hcd_to_musb(hcd);
> +       struct musb_qh          *qh = ep->hcpriv;
> +       unsigned long           flags;
> +
> +       if (!qh)
> +               return;
> +
> +       spin_lock_irqsave(&musb->lock, flags);
> +       qh->clearing_tt = 0;
> +       spin_unlock_irqrestore(&musb->lock, flags);
> +}

You might need to check qh->clearing_tt in the endpoint_disable 
routine.  Otherwise qh could be deallocated before this code is 
executed.

Alan Stern

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