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? -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- 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