Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754816AbbLPQwY (ORCPT ); Wed, 16 Dec 2015 11:52:24 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:51423 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752791AbbLPQwV (ORCPT ); Wed, 16 Dec 2015 11:52:21 -0500 From: Felipe Balbi To: "Du, Changbin" CC: "gregkh@linuxfoundation.org" , "John.Youn@synopsys.com" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lkp@01.org" , "Wu, Fengguang" Subject: RE: [PATCH v2] usb: gadget: forbid queuing request to a disabled ep In-Reply-To: <0C18FE92A7765D4EB9EE5D38D86A563A01DF62CC@SHSMSX103.ccr.corp.intel.com> References: <87twnqi567.fsf@saruman.tx.rr.com> <1450064926-849-1-git-send-email-changbin.du@intel.com> <0C18FE92A7765D4EB9EE5D38D86A563A01DF62CC@SHSMSX103.ccr.corp.intel.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Wed, 16 Dec 2015 10:52:10 -0600 Message-ID: <87h9jifi9x.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2108 Lines: 62 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, "Du, Changbin" writes: >> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h >> index 3d583a1..b566a4b 100644 >> --- a/include/linux/usb/gadget.h >> +++ b/include/linux/usb/gadget.h >> @@ -402,6 +402,9 @@ static inline void usb_ep_free_request(struct usb_ep >> *ep, >> static inline int usb_ep_queue(struct usb_ep *ep, >> struct usb_request *req, gfp_t gfp_flags) >> { >> + if (WARN_ON_ONCE(!ep->enabled)) >> + return -ESHUTDOWN; >> + >> return ep->ops->queue(ep, req, gfp_flags); >> } >>=20 >> -- >> 2.5.0 > > With this patch, ep0 transfer breaks. it because the 'enabled' of ep0 > is not set. Ep0 is not enabled by usb_ep_enable, but in UDC driver. So > there need another patch to set ep0's flag also. yeah, we don't like regressions :-) So the fix should come before $subject to avoid a regression. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWcZa7AAoJEIaOsuA1yqRESo4P/jeYIrxBD+/MegbcAO4sv4OF ELvhBdcosA1SL8wawBYLp+7waUe/aVfjTFR5YJ3mKsGg/kmRJo8ELf5kP5zVOFEC xAiq9lBf6UEF1dkw7XnNVCf1+M+cRF6FyUWHqD1ENjf0Qb+4LNCQE33F/qHMZa4M fnalfi04jbsPA23yLBaLlNxO5n7wvQHSI4cvVeS01CCg8tIErAhb7lCIKeyDSwAL Yxqk0MvJetsa9oboaQ2FqzM8vIIsfVnOxSM0tt/lKvIA6NROgAILkg7VXCtvcYel 7LKQ3npdJXewq1e0FM7ri98hJEtJKNADZfwmy4DrSBzzn5YXhWXhBVHKH3l5uiz3 XtX5HLSDFFoTYM3/pibiLYddyOwoJ5r2Ehm+bqJB+5ZWTZDjQhyvXYJ3raSQGpjC gn4GW35bPfrQX7iP3CFTd9kkSWRrmM3i3aUHXU/5Y+MXms6p1OhrM7T+mDi0GQed HsC5SZEr8vrLO4jn24OT+PepDqL01LPC2b2YoisrCZvO/I02Q6RuNG3vrlM14UYQ rg3nbsYO+lZqErhnMYhgKFXsCoxmgvDFZpjxQOH1fTVi22l7UK/ouqJI5mtOMODb VXFGLN3D0MA/Ds3C21NPAbtOfMFrAOkhWueRQF+KQKEGMB8yTmWI8IhZ3Pop92gr DVqFrmuvpsNuBSFr4pQ3 =2FBv -----END PGP SIGNATURE----- --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/