RE: [PATCH] usb/fsl_udc: fix dequeuing a request in progress

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

 




>-----Original Message-----
>From: Peter Chen [mailto:hzpeterchen@xxxxxxxxx]
>Sent: Wednesday, November 23, 2011 11:02 AM
>To: Li Yang-R58472
>Cc: Chen Peter-B29397; balbi@xxxxxx; gregkh@xxxxxxx; linux-
>usb@xxxxxxxxxxxxxxx; linuxppc-dev@xxxxxxxxxxxxxxxx
>Subject: Re: [PATCH] usb/fsl_udc: fix dequeuing a request in progress
>
>On Tue, Nov 22, 2011 at 7:48 PM, Peter Chen <hzpeterchen@xxxxxxxxx> wrote:
>>>>It seems to can't get the correct qh pointer, you may still need to
>>>>use below code to get it
>>>>       int i = ep_index(ep) * 2 + ep_is_in(ep);
>>>>       struct ep_queue_head *dQH = &ep->udc->ep_qh[i];
>>>
>>> Thanks for trying.    It will be much easier if we can dereference QH
>from the ep structure.  It is really strange that the ep->qh pointer is
>not working somehow.
>>>
>>
>> Seems only ep0-out's qh pointer is assigned at ep structure.
>> At probe:
>> /* setup udc->eps[] for ep0 */
>> struct_ep_setup(udc_controller, 0, "ep0", 0);
>>
>>
>>> We have initialized it in struct_ep_setup():
>>>        ep->qh = &udc->ep_qh[index];
>>>
>>> Can you do me a favor on investigating why it's failing?
>>>
>Leo, I have debugged this issue at my board just now, the reason of
>failure is we only have one ep struct for ep0, so when talking about ep0,
>it always pointers to udc->ep[0]. So even we initialize the current qh
>address for ep0in at probe, it still can't get the ep0in's qh address
>through ep structure, as ep0 is always udc->ep[0].

Oops.  I forgot the fact that we used a single ep structure to handle both IN and OUT ep0 because the gadget layer only knows about one ep0 structure.

I guess currently we have no other way out unless the gadget layer do honor ep0 with direction.  IMHO, it is a limitation to current gadget APIs that each udc driver need to take too much care of the protocol related stuff on ep0.

Thanks,
Leo

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