Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932390AbbLNKUo (ORCPT ); Mon, 14 Dec 2015 05:20:44 -0500 Received: from mga11.intel.com ([192.55.52.93]:37680 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148AbbLNKUl convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2015 05:20:41 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,426,1444719600"; d="scan'208";a="706914421" From: "Du, Changbin" To: "balbi@ti.com" 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 Thread-Topic: [PATCH v2] usb: gadget: forbid queuing request to a disabled ep Thread-Index: AQHRNiOBB4GUT2RkY0urSX+e3x3Jgp7KRD9g Date: Mon, 14 Dec 2015 10:20:38 +0000 Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A01DF62CC@SHSMSX103.ccr.corp.intel.com> References: <87twnqi567.fsf@saruman.tx.rr.com> <1450064926-849-1-git-send-email-changbin.du@intel.com> In-Reply-To: <1450064926-849-1-git-send-email-changbin.du@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 939 Lines: 26 > 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); > } > > -- > 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. -- 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/