Re: [PATCH v2 3/3] xhci: Manually give back cancelled URB if queuing it for cancel fails

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

 



Hi,

Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> writes:
> On 27.03.2017 17:54, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> writes:
>>> Manually give back URB if we are can not add it to the cancel queue, and
>>> stop the endpoint normally.
>>
>> this sentence doesn't parse very well ;-)
>>
>>> This can happen if device just reset before URB timed out and dequeued,
>>> leading to missing endpoint ring.
>>
>> seems like this could be extended a bit too.
>>
>>> @@ -1554,6 +1553,14 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
>>>   done:
>>>   	spin_unlock_irqrestore(&xhci->lock, flags);
>>>   	return ret;
>>> +
>>> +err_giveback:
>>> +	if (urb_priv)
>>> +		xhci_urb_free_priv(urb_priv);
>>> +	usb_hcd_unlink_urb_from_ep(hcd, urb);
>>
>> well, aren't you introducing another regression here?
>>
>> if the return status from usb_hcd_check_unlink_urb() is -EBUSY, then,
>> perhaps, you really shouldn't give it back now.
>
> I'm not giving it back in that case, it works as it should:
>
>
> ret = usb_hcd_check_unlink_urb(hcd, urb, status);
> if (ret)
> 	goto done;
> ...
> done:
>   	spin_unlock_irqrestore(&xhci->lock, flags);
>   	return ret;

oh, right. I got confused with the goto labels

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