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

Li Yang-R58472 r58472 at freescale.com
Tue Nov 22 20:49:25 EST 2011


>Subject: Re: [PATCH] usb/fsl_udc: fix dequeuing a request in progress
>
>On Fri, Nov 11, 2011 at 08:38:13PM +0800, Li Yang wrote:
>> The original implementation of dequeuing a request in progress is not
>> correct.  Change to use a correct process and also clean up the
>> related functions a little bit.
>>
>> Signed-off-by: Li Yang <leoli at freescale.com>
>> ---
>>  drivers/usb/gadget/fsl_udc_core.c |   62 +++++++++++++++++-------------
>------
>>  1 files changed, 29 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/fsl_udc_core.c
>> b/drivers/usb/gadget/fsl_udc_core.c
>> index b2c44e1..beef9b7 100644
>> --- a/drivers/usb/gadget/fsl_udc_core.c
>> +++ b/drivers/usb/gadget/fsl_udc_core.c
>> @@ -696,12 +696,31 @@ static void fsl_free_request(struct usb_ep *_ep,
>struct usb_request *_req)
>>  		kfree(req);
>>  }
>>
>> -/*-------------------------------------------------------------------
>> ------*/
>> +/* Actually add a dTD chain to an empty dQH and let go */ static void
>> +fsl_prime_ep(struct fsl_ep *ep, struct ep_td_struct *td) {
>> +	struct ep_queue_head *qh = ep->qh;
>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.

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?

Thanks,
Leo



More information about the Linuxppc-dev mailing list