Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbcJMHKL (ORCPT ); Thu, 13 Oct 2016 03:10:11 -0400 Received: from mga02.intel.com ([134.134.136.20]:56358 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbcJMHJz (ORCPT ); Thu, 13 Oct 2016 03:09:55 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,339,1473145200"; d="asc'?scan'208";a="19085338" From: Felipe Balbi To: Baolin Wang Cc: gregkh@linuxfoundation.org, broonie@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: Re: [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget In-Reply-To: <0e1e7e00e3e2aacf0fe0ee91854e6a0ee81cc320.1475570367.git.baolin.wang@linaro.org> References: <521625dd7f5e335e2a681ec65ebffc5832207e5f.1475570367.git.baolin.wang@linaro.org> <0e1e7e00e3e2aacf0fe0ee91854e6a0ee81cc320.1475570367.git.baolin.wang@linaro.org> Date: Thu, 13 Oct 2016 10:08:52 +0300 Message-ID: <87lgxsvi7v.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1801 Lines: 54 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: > @@ -1487,10 +1496,22 @@ static int dwc3_gadget_pullup(struct usb_gadget *= g, int is_on) >=20=20 > is_on =3D !!is_on; >=20=20 > +try_again: > spin_lock_irqsave(&dwc->lock, flags); > ret =3D dwc3_gadget_run_stop(dwc, is_on, false); > spin_unlock_irqrestore(&dwc->lock, flags); >=20=20 > + if (ret =3D=3D -EBUSY) { > + ret =3D wait_for_completion_timeout(&dwc->ep0_in_setup, > + msecs_to_jiffies(500)); > + if (ret =3D=3D 0) { > + dev_err(dwc->dev, "timeout to stop gadget.\n"); > + ret =3D -ETIMEDOUT; > + } else { > + goto try_again; you are not really reading my comments. It's the third time I tell you there's no need for try_again. If you can't complete a control transfer in 500ms, you already have other issues. Take this thing out of here. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX/zMEAAoJEMy+uJnhGpkGHDwQAN2P/DvIDXk0IJpQNDbC+jLH BB32bWluZOqtm8B/Tdw5SxVCF9r3gM0v/Xl56hjIwWsbPdALtw7GjS9t9q/bODce YFKzwScAbflcV6NJrhyYvFyyTyNZSxx29MxDltFF6/8gomqZ3D7GVW8NDaZ1Dhsh gFyVWV4MqnWzjcr49OvnYeXxsH1M/LyvYVa06+2gnE1asb7Sl6IGGJ0Cob+b0On1 ul57EmDNTnvHUHbluAUWZKh//+R1od5TdMTdEzNyPbIZmVfOdvbd9/W2GNFziMqj j3p5FjszsChEDhYvOR4zPjB7tvblnTDiuJam5TqmEmibscqOFBxIoNFjhfdsf/73 pTxsG1phV5dm8Zkxwpvis5mByua/6u5ieqieZgkuRoxxw7CndYpPzXXl7EHTm1NV NWRv1Ir0/X7CF0Zle2FONRQ+xXKnxghAgZTeF5tdqxQ95Ul83l6tHuHF+LPdVBqx i0tFkxLegjbRSKdnvc7ahywLm8iU5ZTovOX787fXv6r+ESjLa5EJ1gnoFlWZG5GH 6kIhb+4N9HNneLI+Q1Rm0/VYkX0qvSB1O0ot/AWfV73XJMHPQ8+sgFghPFfcQpLh CMUdtgyE9kn7BvAF+jTjnUz0DQUsjSmFEMkzP99I7Y5VMS+vh5WWYBVBmXNcMU1G HeVIQmqGM2ZYZqV4q6XR =13AP -----END PGP SIGNATURE----- --=-=-=--