Re: [PATCH 2/2] USB: gadget: update ci13xxx to work with g_ether

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

 



On 12/13/2010 12:08 AM, Pavan Kondeti wrote:
> On 12/13/2010 1:32 PM, Artem Leonenko wrote:
>>>> @@ -2170,7 +2169,9 @@ static int ep_queue(struct usb_ep *ep, struct
>>>>>> usb_request *req,
>>>>>>  	mReq->req.actual = 0;
>>>>>>  	list_add_tail(&mReq->queue, &mEp->qh[mEp->dir].queue);
>>>>>>
>>>>>> -	retval = _hardware_enqueue(mEp, mReq);
>>>>>> +	if (list_is_singular(&mEp->qh[mEp->dir].queue))
>>>>>> +		retval = _hardware_enqueue(mEp, mReq);
>>>>>> +
>>>>>>  	if (retval == -EALREADY || retval == -EBUSY) {
>>>>>>  		dbg_event(_usb_addr(mEp), "QUEUE", retval);
>>>>>>  		retval = 0;
>>>>
>>>> Given that _hardware_enqueue is called only when endpoint is in
>>>> un-primed state, may be we should pass the value returned by
>>>> _hardware_enqueue back to usb_ep_queue() caller.
>>>>
>> How can we do that if caller puts more than one request to the queue? If
>> there are already requests in the queue then ep_queue returns and
>> _hardware_enqueue will be called later in isr_tr_complete_low().
>>
>>
> Earlier we are calling _hardware_enqueue every time ep_queue is called.
> So we were converting -EBUSY to success. But now we will call
> _hardware_enqueue only when we know that ep is unprimed and expect
> _hardware_enqueue return success. Then why converting -EBUSY to success?

Good point. I can't think of any scenario with primed endpoint and empty
queue. That's definitely an error.

--
Cheers,
Artem
--
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