Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934253AbcJQLym (ORCPT ); Mon, 17 Oct 2016 07:54:42 -0400 Received: from mga04.intel.com ([192.55.52.120]:60323 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932335AbcJQLyl (ORCPT ); Mon, 17 Oct 2016 07:54:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,357,1473145200"; d="asc'?scan'208";a="20439671" From: Felipe Balbi To: Baolin Wang Cc: Greg KH , Mark Brown , USB , LKML Subject: Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget In-Reply-To: References: <87mvi3s2vb.fsf@linux.intel.com> Date: Mon, 17 Oct 2016 14:53:58 +0300 Message-ID: <87d1izry21.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: 1841 Lines: 52 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: >> Baolin Wang writes: >>> When we change the USB function with configfs dynamically, we possibly = met this >>> situation: one core is doing the control transfer, another core is tryi= ng to >>> unregister the USB gadget from userspace, we must wait for completing t= his >>> control tranfer, or it will hang the controller to set the DEVCTRLHLT f= lag. >>> >>> Signed-off-by: Baolin Wang >> >> Can you make sure this still works? > > With applying this patch, It can work well on my platform, but I have > some worries about the risk of accessing 'dwc->ep0state' without lock > protection in dwc3_gadget_pullup() function. hmm, I might be missing something, but I think there's no risk here. If anything, a wmb() is probably enough before reading ep0state. No? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYBLvWAAoJEMy+uJnhGpkGurIQAJHK7eaoVani+8IBUXvL4J2p dnDcrxGj3lhS9knv8gkgCul0sh4hn/26C7GfUPQjBbviyg5lZQYbrzYa33kcmEzA bvDucvg2zWv4svCgdncr2V2bexaAamdJaBvw6OEtnR4HBFAkRp1CE9MqW+rVdaI+ a5PRk5qR2t/cZbjUb6lY1HZeibSk6iQ9s59E2zokMuZ90bsSlhhieoIJJSX3cJi9 v8OwFFHwQDqxAZhE0DLbZg+G2KLC8X2u09DhBrQ4q3h6O/jS0uAq/MUNTslccjgD PKBUkhzrLwvxLqwCgrsna3QxsX8Rckm3j99PX0SVmDglpJtetHgQsmSkIqL/tfsj UAldcIKJi+wP/XilEJ1A6nJZ8UOs0NDwG2+xEjq/sgE6q7X7SIziGWg4ygPT9P/m y8kReQjkvD3gAGrpxZ2lllu0P8KjbYkat3cgrmSEZa79HNCgHYGJh8+aSFMwpxhG I1+QUpBqHvyZgPCxa7PXPOq2cKOR34ZassZ8NTv8qcCfdPDoZNIo7dvTjetwIezD VDxM3iUpvgHeaFYzQFTuRZOTzEMa506zXqWVIldyjQc9jokcEfKtclx5lfZKpvjM O3QwKjODuTsvnwO5cRXJjvS108n8Jt71GNUB52MYgfL9N4WfWdqNVg61L55CDBNS RZ6/uO7gTSNtf9R/maAI =Hrg/ -----END PGP SIGNATURE----- --=-=-=--