From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com ([134.134.136.65]:51040 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbcIHLC7 (ORCPT ); Thu, 8 Sep 2016 07:02:59 -0400 From: Felipe Balbi To: Lu Baolu Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/1] usb: dwc3: fix Clear Stall EP command failure In-Reply-To: <57D134AD.3020506@linux.intel.com> References: <1473324139-9965-1-git-send-email-baolu.lu@linux.intel.com> <57D134AD.3020506@linux.intel.com> Date: Thu, 08 Sep 2016 14:02:24 +0300 Message-ID: <87a8fiiri7.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. >> >> 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 >> endpoints in SuperSpeed mode. >> >> Fixes: 50c763f8c1bac ("usb: dwc3: Set the ClearPendIN bit on Clear Stall= EP command") >> Cc: stable@vger.kernel.org # 4.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_= ep *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)) >> cmd |=3D DWC3_DEPCMD_CLEARPENDIN; >>=20=20 >> memset(¶ms, 0, sizeof(params)); > > Oh, my bad. > > I'm sending you a patch which hasn't been verified on the real > hardware yet. > > My mind goes blank after a whole day's work. Poor me. :-( happens to all of us ;-) > I will send you a refreshed one tomorrow. Really sorry about it. no problem, thanks =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX0UVAAAoJEMy+uJnhGpkGA+YP+wc6ihnkQipdWhLPXLTtK6tm ZlAbicR9Eiryr1OO+JRqF/BBV0IEqi2kD+4kQj4o0Pkm0zav17LNlCeat1ZyFsjD 4wjtsGNeNsr3zHKcYF/tkOyF2CKPwCY1z1ROmnwdcpfLB+YEF5TelHf/utGYrcpZ sMLYuNtOWWKPa9kWmVDPMTcBflELs2lvoiX5Mmteci165YD12RL2JWflWhNiEi5L b4W1OCBZOwETRU5l15zSIDXtf2Bx41Kwc5VCscWfNpRGkVIxtGY66nrK46L0nkkf RZGRizQ3pPgLW7rt5kWS668V+xOytfKq1K8hvsXZckTOhDuWCe/AJAWyWLwXElRx aRPEx8n239P63OJ1HPcT+m0UwfQaPZ9IV0ou4ZdL7O98yF1T8geRNqyhNxyZUlIA bJlMCeOt48N8ggUbPF2tuDZOQ5KK1o1Cx+JaIAJ44nBydIFxEoM/F6fm+cDRljNQ MqTqhpT7i4BB/oYlqRS2fEwCxsutEvk1d2x9j5sUE6CufAP21y9srgHac3WqrXfL rht0f+vGz/FygXQs0cn6KC2+xCzo8qNAmA1z+wG4nqiBvczTVAXoqtLAP8pD7+ZD vkTWu0LzhKxfNnKlxYwwY+qmeo0q140LP9tNl8Xaeyv/5XsLONHi/V4NsxSlj+HH mlfBtf5a7n/CE8RoAru/ =rtqo -----END PGP SIGNATURE----- --=-=-=--