From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com ([192.55.52.120]:34824 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbdC0O51 (ORCPT ); Mon, 27 Mar 2017 10:57:27 -0400 From: Felipe Balbi To: Mathias Nyman , gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, Mathias Nyman , stable@vger.kernel.org Subject: Re: [PATCH v2 3/3] xhci: Manually give back cancelled URB if queuing it for cancel fails In-Reply-To: <1490624830-9761-4-git-send-email-mathias.nyman@linux.intel.com> References: <1490624830-9761-1-git-send-email-mathias.nyman@linux.intel.com> <1490624830-9761-4-git-send-email-mathias.nyman@linux.intel.com> Date: Mon, 27 Mar 2017 17:54:55 +0300 Message-ID: <874lyekbwg.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: stable-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Mathias Nyman 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 u= rb *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. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAljZJ78ACgkQzL64meEa mQY7ZQ//Qq6IT9pqn+LW2Njobymfk6PBSs6ootj43QkpJYYvD4X3SswVNNterJSo 9Y+UeP7ZVaEmj2yGvJZUwRXqZiRbqs766JeZuZLEE1NtOByT3a8llF/oLKqdkdPj sUCu688BsD+jgMQSnLpCsLRs31RilAqtq/wdddLSGrv51kLCu500zqwNKE2G1NpJ fc2Bm41D1Q0nxuDkAH7M9Mkuyfwom1yzh5Y+5Fr+B+3e37Dv9Dmx54Cp3EFMKxdc 53zg50mlpKTaPhSmSOOQymkbAjODPVpJ8vCwxlGy6D97PxqQG1SNI+wYRKBSd/2O RweZpwTiV7yQRTmQmbKNwyVorGVjrF/8wTX+om85gVpj7CB7LPUxBIqKvEHUrbd/ Us1P2nfyCU+xTjhq46Y9c9vPOrtubJZSTXei7jDWyvRCK3ASmMd/TVrJnEwZHJs4 OGA+a+dQcrG5PCUcJdqCzgBMHYfY26qJ7cG87LrjqJ2Tza0c0FK7sat15rCZ2GDY /qXEYwOSlXAp77/JHIv/jEsDScLk8e1CJxaDPE3D4jsT2tIL/akp8iEEi/csN2h2 Yqw0YQSypy0Q1zG3+jRV4smioondpFYHwVrL7TiOzddLwYw2cLsEjfZ2WGHRz2Fg 62k34MdxY932C72P5DqStSHUpO6AnVTjjbHwgJZybVq8koYumPQ= =URDF -----END PGP SIGNATURE----- --=-=-=--