From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manu Gautam Subject: Re: [PATCH v1 1/1] usb: gadget: f_fs: Add support for SuperSpeed Mode Date: Tue, 17 Sep 2013 16:47:05 +0530 Message-ID: <52383A31.6080204@codeaurora.org> References: <1379324414-7007-1-git-send-email-mgautam@codeaurora.org> <20130917004514.GA22750@usblab-sd-06.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.codeaurora.org ([198.145.11.231]:40055 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563Ab3IQLRL (ORCPT ); Tue, 17 Sep 2013 07:17:11 -0400 In-Reply-To: <20130917004514.GA22750@usblab-sd-06.qualcomm.com> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Jack Pham Cc: balbi@ti.com, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, pheatwol@codeaurora.org On 9/17/2013 6:15 AM, Jack Pham wrote: > Hi Manu, > > An intern working with us here (thanks Peter!) found a bug. > > On Mon, Sep 16, 2013 at 03:10:14PM +0530, Manu Gautam wrote: >> @@ -1569,7 +1573,20 @@ static int ffs_func_eps_enable(struct ffs_function *func) >> spin_lock_irqsave(&func->ffs->eps_lock, flags); >> do { >> struct usb_endpoint_descriptor *ds; >> - ds = ep->descs[ep->descs[1] ? 1 : 0]; >> + int desc_idx; >> + >> + if (ffs->gadget->speed == USB_SPEED_SUPER) >> + desc_idx = 2; >> + if (ffs->gadget->speed == USB_SPEED_HIGH) > This should be "else if", otherwise if the gadget is superspeed, it will > fall through to the full speed case below and desc_idx will be set to 0, > resulting in FS descriptors being used instead. Thanks. I will fix this in my next patch. >> + desc_idx = 1; >> + else >> + desc_idx = 0; >> + >> + ds = ep->descs[desc_idx]