Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210625

Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism

From Felipe Balbi <balbi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism
Date 2015-08-20 18:50 +0200
Message-ID <pZBcn-290-11@gated-at.bofh.it> (permalink)
References <pSjay-7Xm-3@gated-at.bofh.it> <pSjay-7Xm-11@gated-at.bofh.it> <pZA6C-Cj-17@gated-at.bofh.it> <pZAT0-1Mh-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Aug 20, 2015 at 06:28:14PM +0200, Robert Baldyga wrote:
> Hi Felipe,
> 
> On 08/20/2015 05:35 PM, Felipe Balbi wrote:
> [...]
> >just letting you know that this regresses all gadget drivers making them
> >try to disable previously disabled endpoints and enable previously
> >enabled endpoints.
> >
> >I have a possible fix (see below) but then it shows a problem on the
> >host side when using with g_zero (see further below):
> >
> >commit 3b8932100aacb6cfbffe288ca93025d8b8430c00
> >Author: Felipe Balbi <balbi@ti.com>
> >Date:   Wed Aug 19 18:05:27 2015 -0500
> >
> >     usb: gadget: fix ep->claimed lifetime
> >
> >     In order to fix a regression introduced by commit
> >     cc476b42a39d ("usb: gadget: encapsulate endpoint
> >     claiming mechanism") we have to introduce a simple
> >     helper to check if a particular is enabled or not.
> >
> >     After that, we need to move ep->claimed lifetime to
> >     usb_ep_enable() and usb_ep_disable() since those
> >     are the only functions which actually enable and
> >     disable endpoints.
> >
> >     A follow-up patch will come to drop all driver_data
> >     checks from function drivers, since those are, now,
> >     pointless.
> >
> >     Fixes: cc476b42a39d ("usb: gadget: encapsulate endpoint
> >     	claiming mechanism")
> >     Cc: Robert Baldyga <r.baldyga@samsung.com>
> >     Signed-off-by: Felipe Balbi <balbi@ti.com>
> >
> >diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
> >index 978435a51038..ad45070cd76f 100644
> >--- a/drivers/usb/gadget/epautoconf.c
> >+++ b/drivers/usb/gadget/epautoconf.c
> >@@ -126,7 +126,6 @@ found_ep:
> >  	ep->address = desc->bEndpointAddress;
> >  	ep->desc = NULL;
> >  	ep->comp_desc = NULL;
> >-	ep->claimed = true;
> 
> Removing this line causes autoconfig can return the same endpoint many
> times. This probably causes problems with g_zero.
> 
> I will try to fix it ASAP.

I was considering the same thing, but the lifetime of ->claimed doesn't
look correct to me either way. Note that once the flag is enabled, it
won't get disabled by most gadget drivers.

-- 
balbi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming  mechanism Felipe Balbi <balbi@ti.com> - 2015-08-20 17:40 +0200
  Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism Robert Baldyga <r.baldyga@hackerion.com> - 2015-08-20 18:30 +0200
    Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming  mechanism Felipe Balbi <balbi@ti.com> - 2015-08-20 18:50 +0200
      Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming mechanism Robert Baldyga <r.baldyga@hackerion.com> - 2015-08-20 19:20 +0200
        Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming  mechanism Felipe Balbi <balbi@ti.com> - 2015-08-20 19:50 +0200
          Re: [PATCH v5 01/46] usb: gadget: encapsulate endpoint claiming  mechanism John Youn <John.Youn@synopsys.com> - 2015-08-20 22:10 +0200

csiph-web