From: Felipe Balbi <balbi@ti.com> To: Zhuang Jin Can <jin.can.zhuang@intel.com> Cc: Felipe Balbi <balbi@ti.com>, <linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>, David Cohen <david.a.cohen@linux.intel.com> Subject: Re: [PATCH] usb: dwc3: gadget: giveback request if start transfer fail Date: Wed, 30 Apr 2014 14:58:29 -0500 [thread overview] Message-ID: <20140430195829.GA3839@saruman.home> (raw) In-Reply-To: <20140501063608.GA30575@intel.com> [-- Attachment #1: Type: text/plain, Size: 1540 bytes --] Hi, On Thu, May 01, 2014 at 02:36:08AM -0400, Zhuang Jin Can wrote: > At least we should giveback the current request to the > gadget. Otherwise, the gadget will be stuck without knowing > anything. > > It was oberved that the failure can happen if the request is > queued when the run/stop bit of controller is not set. why is your gadget queueing any requests before calling ->udc_start() ? A better question, what modification have you done to udc-core.c which broke this ? udc-core *always* calls ->udc_start() by the time you load a gadget driver so this case will *never* happen. Whatever modification you did, broke this assumption and I will *not* accept this patch because the bug is elsewhere and *not* in mainline kernel. > Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com> > --- > drivers/usb/dwc3/gadget.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 70715ee..8d0c3c7 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1000,9 +1000,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, > * here and stop, unmap, free and del each of the linked > * requests instead of what we do now. > */ > - usb_gadget_unmap_request(&dwc->gadget, &req->request, > - req->direction); > - list_del(&req->list); > + dwc3_gadget_giveback(dep, req, -ESHUTDOWN); > return ret; > } > > -- > 1.7.9.5 > -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com> To: Zhuang Jin Can <jin.can.zhuang@intel.com> Cc: Felipe Balbi <balbi@ti.com>, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, David Cohen <david.a.cohen@linux.intel.com> Subject: Re: [PATCH] usb: dwc3: gadget: giveback request if start transfer fail Date: Wed, 30 Apr 2014 14:58:29 -0500 [thread overview] Message-ID: <20140430195829.GA3839@saruman.home> (raw) In-Reply-To: <20140501063608.GA30575@intel.com> [-- Attachment #1: Type: text/plain, Size: 1540 bytes --] Hi, On Thu, May 01, 2014 at 02:36:08AM -0400, Zhuang Jin Can wrote: > At least we should giveback the current request to the > gadget. Otherwise, the gadget will be stuck without knowing > anything. > > It was oberved that the failure can happen if the request is > queued when the run/stop bit of controller is not set. why is your gadget queueing any requests before calling ->udc_start() ? A better question, what modification have you done to udc-core.c which broke this ? udc-core *always* calls ->udc_start() by the time you load a gadget driver so this case will *never* happen. Whatever modification you did, broke this assumption and I will *not* accept this patch because the bug is elsewhere and *not* in mainline kernel. > Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com> > --- > drivers/usb/dwc3/gadget.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 70715ee..8d0c3c7 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1000,9 +1000,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param, > * here and stop, unmap, free and del each of the linked > * requests instead of what we do now. > */ > - usb_gadget_unmap_request(&dwc->gadget, &req->request, > - req->direction); > - list_del(&req->list); > + dwc3_gadget_giveback(dep, req, -ESHUTDOWN); > return ret; > } > > -- > 1.7.9.5 > -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-04-30 19:58 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-05-01 6:36 [PATCH] usb: dwc3: gadget: giveback request if start transfer fail Zhuang Jin Can 2014-04-30 19:58 ` Felipe Balbi [this message] 2014-04-30 19:58 ` Felipe Balbi 2014-05-01 20:44 ` Zhuang Jin Can 2014-05-01 15:13 ` Felipe Balbi 2014-05-01 15:13 ` Felipe Balbi 2014-05-03 4:05 ` Zhuang Jin Can 2014-05-02 16:10 ` Felipe Balbi 2014-05-02 16:10 ` Felipe Balbi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20140430195829.GA3839@saruman.home \ --to=balbi@ti.com \ --cc=david.a.cohen@linux.intel.com \ --cc=jin.can.zhuang@intel.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.