Re: [PATCH] usb: musb_gadget: rm unnecessary ep check

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

 



Hi,

On Mon, Jul 11, 2011 at 05:18:18PM +0800, Bob Liu wrote:
> g_zero test during loopback mode will fail like this:
> zero gadget: can't loop ep6out to ep5in: -22
> 
> The reason is this check "if (request->ep != musb_ep)" in musb_gadget,
> this patch rm it.
> 
> Signed-off-by: Bob Liu <lliubbo@xxxxxxxxx>
> ---
>  drivers/usb/musb/musb_gadget.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index b67a062..7318a20 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -1289,9 +1289,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
>  	request = to_musb_request(req);
>  	request->musb = musb;
>  
> -	if (request->ep != musb_ep)
> -		return -EINVAL;

I believe the problem is somewhere else. If request->ep != musb_ep we
would be queueing a request to the wrong endpoint. Is g_zero simply
re-using a request it just received from ep6out and queueing it straight
away to ep5in ?? I mean.. I'm not sure we should allow:

usb_ep_alloc_request(ep6out, GFP_KERNEL);
usb_ep_queue(ep5in, GFP_KERNEL);

The request, clearly, wasn't queued for that endpoint.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux