From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758219AbbLCEXg (ORCPT ); Wed, 2 Dec 2015 23:23:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:28158 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755111AbbLCEXe convert rfc822-to-8bit (ORCPT ); Wed, 2 Dec 2015 23:23:34 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,376,1444719600"; d="scan'208";a="865534930" From: "Du, Changbin" To: John Youn CC: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "balbi@ti.com" Subject: RE: [PATCH 0/2] Two fix for dwc2 gadget driver Thread-Topic: [PATCH 0/2] Two fix for dwc2 gadget driver Thread-Index: AQHRKzAPeUc/pOiJV0+jLzLm8yohTp64p+xA Date: Thu, 3 Dec 2015 04:23:09 +0000 Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A01DE83B2@SHSMSX103.ccr.corp.intel.com> References: <1448860888-9841-1-git-send-email-changbin.du@intel.com> <2B3535C5ECE8B5419E3ECBE30077290901DC3ED679@US01WEMBX2.internal.synopsys.com> In-Reply-To: <2B3535C5ECE8B5419E3ECBE30077290901DC3ED679@US01WEMBX2.internal.synopsys.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 > On 11/29/2015 9:29 PM, changbin.du@intel.com wrote: > > From: "Du, Changbin" > > > > With the first patch, enable a enabled ep will return -EBUSY. > > The second patch forbid queuing on disabled ep to avoid panic. > > > The usb_ep->enabled flag was added in 4.4. > > It looks like these same checks are also added at the API level in the > usb_ep_enable() and usb_ep_disable(). > > In case this is bypassed we should probably add them in the gadget > anyways but using the existing flag. > > Regards, > John > Hmm, just learnt the flag on gadget API layer. And I just see usb_ep_enable return success if it is already enabled. But I think it should return an error to inform the caller. Because the ep configuration may probably be changed. In this case, usb_ep_enable will do different behavior. Hmm, the usb_ep_queue doesn't check the enabled flag. Should be added. Let me have a try. Best Regards, Changbin