From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com ([134.134.136.100]:46406 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965725AbcIHJsv (ORCPT ); Thu, 8 Sep 2016 05:48:51 -0400 From: Felipe Balbi To: Lu Baolu Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu , stable@vger.kernel.org Subject: Re: [PATCH 1/1] usb: dwc3: fix Clear Stall EP command failure In-Reply-To: <1473324139-9965-1-git-send-email-baolu.lu@linux.intel.com> References: <1473324139-9965-1-git-send-email-baolu.lu@linux.intel.com> Date: Thu, 08 Sep 2016 12:48:11 +0300 Message-ID: <87inu6iuxw.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, Lu Baolu writes: > Commit 50c763f8c1bac ("usb: dwc3: Set the ClearPendIN bit on Clear > Stall EP command") sets ClearPendIN bit for all IN endpoints in > v2.60a+ cores no matter which speed mode they're in. This causes > Clear Stall EP command failing on some Intel devices. Well, the fact that is fails on some Intel device is, IMO, a symptom. You should have said that ClearStall command fails on 2.60+ operating in HighSpeed mode. That's the real failure. It doesn't matter if it's Intel or not, what matters is the *current* speed. > In page 539 of 2.60a specification, it says: > > "When issuing Clear Stall command for IN endpoints in SuperSpeed > mode, the software must set the "ClearPendIN" bit to '1' to > clear any pending IN transcations, so that the device does not > expect any ACK TP from the host for the data sent earlier." > > It's obviously that we only need to apply this rule to those IN s/obviously/obvious/ > endpoints in SuperSpeed mode. endpoints currently operating in SuperSpeed mode. > Fixes: 50c763f8c1bac ("usb: dwc3: Set the ClearPendIN bit on Clear Stall = EP command") > Cc: stable@vger.kernel.org # 4.7+ please use proper email format: Cc: # v4.7+ > Signed-off-by: Lu Baolu > --- > drivers/usb/dwc3/gadget.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 7a8d3d8..f1858d6 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -348,7 +348,8 @@ static int dwc3_send_clear_stall_ep_cmd(struct dwc3_e= p *dep) > * IN transfers due to a mishandled error condition. Synopsys > * STAR 9000614252. > */ > - if (dep->direction && (dwc->revision >=3D DWC3_REVISION_260A)) > + if (dep->direction && (dwc->revision >=3D DWC3_REVISION_260A) && > + (dwc->maximum_speed >=3D USB_SPEED_SUPER)) not sure this is correct. Based on text quoted above, it seems to be me we should check *current* speed, not maximum speed. We hold current speed in dwc->gadget.speed. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX0TPbAAoJEMy+uJnhGpkGnakP/0br+xykZoBpKJSz5ns4mi/c dokY3Afup72BaZUaYEqBOajKzd2Lgg6Coaxbt750Ttso35l7B5/vOsU30ZSNgJkU h0NdJb67OlGaSKs0IS1hILngA1UsB0gkT98pOboWhDliNjbNuyqpq/IAj6Mrbrhq 9wRbNUD2IRFpHuIzt6kamjwHZkDkfrngJtxRXfOuzneSoKTrjt/q5y9OQB4c21lW beHg6c2EvZjZcekSAoLdES3bBPRKu0PFAUYtLAgSKv4XtiSQWFTBaHG5Ic3Thsck 0303c+bfW7Qh83WnHir+b+SVwa8ob30TzJdVP0ejx6DsBEkjJ4fEV7XayNHcHNE9 P/O/m9dHsZ6JmZlA94QFlelPTeFr3fqnCkeQCoY7qOPP0OpE9/KJ+kyZBko/fvFd 24Sr17A1TgjaKIEL1F7sLtPdXsbDkmX9jRLHY1/KSdOmnMBBw/ocXs272z5BRgPx TjvjmOjutAMTBjusQwcOL31eRT97v0J4ZsFIGrIrgyDM5yTcQ9bjvaEljR34bxOq kN2E88I6CgBrvXUAWQvpzpZuam9quoancRIb56tSywjFzWwaYI3A1zgOZBGRz/sx tMfqZo6gGAAVKC7L1ktJaH9O6kHBmTxb1+yNMngFvUPQSqaDpBTdWTTf6C9d8Ktg 0VEY4qgEZkuiyDirES+l =HeAo -----END PGP SIGNATURE----- --=-=-=--