From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org,
Mathias Nyman <mathias.nyman@linux.intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2 3/3] xhci: Manually give back cancelled URB if queuing it for cancel fails
Date: Mon, 27 Mar 2017 17:57:37 +0300 [thread overview]
Message-ID: <871stikbry.fsf@linux.intel.com> (raw)
In-Reply-To: <874lyekbwg.fsf@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]
Felipe Balbi <felipe.balbi@linux.intel.com> writes:
> Hi,
>
> Mathias Nyman <mathias.nyman@linux.intel.com> 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.
not to mention the following excerpt from usb_hcd_check_unlink_urb()
kdoc:
* Return: 0 for no error, otherwise a negative error code (in which case
* the dequeue() method must fail). The possible error codes are:
*
* -EIDRM: @urb was not submitted or has already completed.
* The completion function may not have been called yet.
*
* -EBUSY: @urb has already been unlinked.
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2017-03-27 14:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1490624830-9761-1-git-send-email-mathias.nyman@linux.intel.com>
2017-03-27 14:27 ` [PATCH v2 2/3] xhci: Set URB actual length for stopped control transfers Mathias Nyman
2017-03-27 14:47 ` Felipe Balbi
2017-03-27 15:52 ` Mathias Nyman
2017-03-27 14:27 ` [PATCH v2 3/3] xhci: Manually give back cancelled URB if queuing it for cancel fails Mathias Nyman
2017-03-27 14:54 ` Felipe Balbi
2017-03-27 14:57 ` Felipe Balbi [this message]
2017-03-27 15:20 ` Mathias Nyman
2017-03-28 6:49 ` Felipe Balbi
2017-03-28 10:30 ` Mathias Nyman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871stikbry.fsf@linux.intel.com \
--to=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox