[RFC PATCH] usb: gadget: mass_storage: Add GET_EVENT_STATUS_NOTIFICATION

2018-07-26 Thread Benjamin Herrenschmidt
? Not-Yet-Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/function/f_mass_storage.c | 49 +++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 7b13928077c9

[PATCH] usb: gadget: aspeed: Workaround memory ordering issue

2018-07-11 Thread Benjamin Herrenschmidt
The Aspeed SoC has a memory ordering issue that (thankfully) only affects the USB gadget device. A read back is necessary after writing to memory and before letting the device DMA from it. Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/udc/aspeed-vhub/ep0.c | 2 ++ drivers/usb

[PATCH] usb: gadget: aspeed-vhub: Fix SETUP packets with OUT data phase

2018-06-27 Thread Benjamin Herrenschmidt
. The other problem relates to stalling such a packet before the data phase, in which case we don't get an ACK cycle, and get the next SETUP packet directly, so we shouldn't reject it. Signed-off-by: Benjamin Herrenschmidt --- Felipe, please send upstream before 4.18 close. (Resent with proper

[PATCH] usb: gadget: Fix OS descriptors support

2018-06-26 Thread Benjamin Herrenschmidt
ris rework to remove the local queuing inside the if { } block of the redefined request. Signed-off-by: Benjamin Herrenschmidt Fixes: 636ba13aec8a ("usb: gadget: composite: remove duplicated code in OS desc handling") CC: sta...@vger.kernel.org [v4.17] --- drivers/usb/gadget/composite.c | 1

usb: gadget: aspeed-vhub: Fix SETUP packets with OUT data phase

2018-06-26 Thread Benjamin Herrenschmidt
. The other problem relates to stalling such a packet before the data phase, in which case we don't get an ACK cycle, and get the next SETUP packet directly, so we shouldn't reject it. Signed-off-by: Benjamin Herrenschmidt --- Felipe, please send upstream before 4.18 close. drivers/usb/gadget

Re: UDC ep0 desc or no desc

2018-06-25 Thread Benjamin Herrenschmidt
On Mon, 2018-06-25 at 13:28 +0300, Felipe Balbi wrote: > > > > That would be a pretty strange thing to do. I'd say it's not worth > > > worrying about until somebody makes that mistake. > > > > Well, things like usb_endpoint_maxp() seem not *completely* far fetched > > but yeah EP0 is usually

Re: UDC ep0 desc or no desc

2018-06-23 Thread Benjamin Herrenschmidt
On Sat, 2018-06-23 at 11:07 -0400, Alan Stern wrote: > On Sat, 23 Jun 2018, Benjamin Herrenschmidt wrote: > > > Hi folks ! > > > > I noticed some UDC drivers setup a "desc" pointer for ep0.desc for the > > driver, some don't. > > > > Is it of

UDC ep0 desc or no desc

2018-06-22 Thread Benjamin Herrenschmidt
Hi folks ! I noticed some UDC drivers setup a "desc" pointer for ep0.desc for the driver, some don't. Is it officially needed ? Additionally some UCDs NULL out the desc pointer in ep_disable, is that also a requirement ? I somewhat fear that if somebody calls stuff like usb_ep_align() on ep0

[PATCH v10 1/2] usb/gadget: Constify usb_gadget_get_string "table" argument

2018-05-03 Thread Benjamin Herrenschmidt
The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/usbstring.c | 2 +- include/linux/usb/gadget.h | 2 +- 2 files chan

[PATCH v10 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-05-03 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v10. - Set the port connection changed state after power on of a downstream port if it has an attached gadget or some OSes will fail to re-enumerate properly

[PATCH v9 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-05-02 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v9. - Fix lock recursion issues when replying to standard SETUP packets - Fix lifetime of the port_dev struct device v8. - Rework ast_vhub_rep_desc() to avoid incorrec

[PATCH v9 1/2] usb/gadget: Constify usb_gadget_get_string "table" argument

2018-05-02 Thread Benjamin Herrenschmidt
The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/usbstring.c | 2 +- include/linux/usb/gadget.h | 2 +- 2 files chan

Re: [RESEND v8 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-04-21 Thread Benjamin Herrenschmidt
On Thu, 2018-04-19 at 14:40 +1000, Benjamin Herrenschmidt wrote: > The Aspeed BMC SoCs support a "virtual hub" function. It provides some > HW support for a top-level USB2 hub behind which sit 5 gadget "ports". > > This driver adds support for the full functionali

[RESEND v8 1/2] usb/gadget: Constify usb_gadget_get_string "table" argument

2018-04-18 Thread Benjamin Herrenschmidt
The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/usbstring.c | 2 +- include/linux/usb/gadget.h | 2 +- 2 files chan

[RESEND v8 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-04-18 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v8. - Rework ast_vhub_rep_desc() to avoid incorrect built error when fortify is enabled - Rework ast_vhub_rep_string() to use usb_gadget_get_string() instead

[PATCH v8 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-28 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v8. - Rework ast_vhub_rep_desc() to avoid incorrect built error when fortify is enabled - Rework ast_vhub_rep_string() to use usb_gadget_get_string() instead

[PATCH v8 1/2] usb/gadget: Constify usb_gadget_get_string "table" argument

2018-03-28 Thread Benjamin Herrenschmidt
The table is never modified by the function. This allows us to use it on a statically defined table that is marked const. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/usbstring.c | 2 +- include/linux/usb/gadget.h | 2 +- 2 files chan

Re: [PATCH v7] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-28 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 09:26 +1100, Benjamin Herrenschmidt wrote: > On Thu, 2018-03-29 at 09:19 +1100, Benjamin Herrenschmidt wrote: > > On Tue, 2018-03-27 at 10:30 +0300, Felipe Balbi wrote: > > > $ gcc --version > > > gcc (Debian 7.3.0-12) 7.3.0 > > &

Re: [PATCH v7] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-28 Thread Benjamin Herrenschmidt
On Thu, 2018-03-29 at 09:19 +1100, Benjamin Herrenschmidt wrote: > On Tue, 2018-03-27 at 10:30 +0300, Felipe Balbi wrote: > > $ gcc --version > > gcc (Debian 7.3.0-12) 7.3.0 > > BTW. What debian version while at it ? > > I still haven't managed to find a gcc that repro

Re: [PATCH v7] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-28 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 10:30 +0300, Felipe Balbi wrote: > $ gcc --version > gcc (Debian 7.3.0-12) 7.3.0 BTW. What debian version while at it ? I still haven't managed to find a gcc that reproduces this, so I probably need to get the exact same distro you are using installed somewhere :-( Cheers,

Re: [PATCH v7] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-27 Thread Benjamin Herrenschmidt
On Tue, 2018-03-27 at 10:30 +0300, Felipe Balbi wrote: > Hi, > > Benjamin Herrenschmidt <b...@kernel.crashing.org> writes: > > > > > +static int ast_vhub_rep_desc(struct ast_vhub_ep *ep, > > +u8 desc_type, u16 len) > > +{ >

[PATCH v7] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-25 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v7. - Fix OF match list - Remove unused variable in hub code v6. - Fix bug with 0-length packets on IN endpoints in desc mode v5. - Remove #ifdef's and hard coded values

Re: [PATCH v6 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-25 Thread Benjamin Herrenschmidt
On Sun, 2018-03-25 at 12:25 +1100, Benjamin Herrenschmidt wrote: > On Sat, 2018-03-24 at 12:19 +1100, Benjamin Herrenschmidt wrote: > > > In function ‘memcpy’, > > > inlined from ‘ast_vhub_rep_desc’ at > > > drivers/usb/gadget/udc/aspeed-vhub/hub.c:276:2: > &

Re: [PATCH v6 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-24 Thread Benjamin Herrenschmidt
On Sat, 2018-03-24 at 12:19 +1100, Benjamin Herrenschmidt wrote: > > In function ‘memcpy’, > > inlined from ‘ast_vhub_rep_desc’ at > > drivers/usb/gadget/udc/aspeed-vhub/hub.c:276:2: > > ./include/linux/string.h:341:4: error: call to ‘__read_overflow2’ declared

Re: [PATCH v6 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-23 Thread Benjamin Herrenschmidt
On Fri, 2018-03-23 at 09:54 +0200, Felipe Balbi wrote: > Hi, > > Benjamin Herrenschmidt <b...@kernel.crashing.org> writes: > > > The Aspeed BMC SoCs support a "virtual hub" function. It provides some > > HW support for a top-level USB2 hub behind which si

[PATCH v6 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-22 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v6. - Fix bug with 0-length packets on IN endpoints in desc mode v5. - Remove #ifdef's and hard coded values - Remove module parameters - Honor maximum speed d

[PATCH v6 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-03-22 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: [PATCH v5 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-19 Thread Benjamin Herrenschmidt
On Fri, 2018-03-16 at 11:44 +1100, Benjamin Herrenschmidt wrote: > The Aspeed BMC SoCs support a "virtual hub" function. It provides some > HW support for a top-level USB2 hub behind which sit 5 gadget "ports". > > This driver adds support for the full functionali

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-19 Thread Benjamin Herrenschmidt
On Sat, 2018-03-17 at 09:50 -0400, Alan Stern wrote: > On Sat, 17 Mar 2018, Benjamin Herrenschmidt wrote: > > > On Fri, 2018-03-16 at 16:56 -0400, Alan Stern wrote: > > > On Fri, 16 Mar 2018, Benjamin Herrenschmidt wrote: > > > > > > > On Thu, 2018-03

Re: [PATCH v5 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-03-19 Thread Benjamin Herrenschmidt
On Mon, 2018-03-19 at 12:56 +0200, Felipe Balbi wrote: > >> do you really need this to be safe? You don't seem to be modifying > >> ep_list here. > > > > Yes, ep->dispose() may do just that. In my Aspeed implementation in > > fact that's pretty much the first thing it does. > > > > IE, I'm

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-16 Thread Benjamin Herrenschmidt
On Sat, 2018-03-17 at 11:29 +1100, Benjamin Herrenschmidt wrote: > The guest just show config selection messages. I'll dig a bit next week > in case there's an issue with my UDC driver there. I meant the "gadget" just shows ... Cheers, Ben. -- To unsubscribe from this lis

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-16 Thread Benjamin Herrenschmidt
On Fri, 2018-03-16 at 09:23 +0200, Felipe Balbi wrote: > > > > If I just create a mass storage function set to be "removable" and > > "cdrom" with no file attached, and enable it, I get an endless stream > > of resets. It looks like the host constantly does USB resets. > > > > I suspect the host

Re: [PATCH v5 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-03-16 Thread Benjamin Herrenschmidt
On Fri, 2018-03-16 at 13:02 +0200, Felipe Balbi wrote: > Hi, > > Benjamin Herrenschmidt <b...@kernel.crashing.org> writes: > > Some UDC may want to allocate endpoints dynamically, either because > > the HW supports an arbitrary large number or because (like the Asp

Re: [PATCH v5 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-16 Thread Benjamin Herrenschmidt
> > url: > https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180317-004216 > config: m32r-allyesconfig (attached as .config) > compiler: m32r-linux-gcc (GCC) 7.2.0 Didn't we drop testing on mr32 ?

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-16 Thread Benjamin Herrenschmidt
On Fri, 2018-03-16 at 16:56 -0400, Alan Stern wrote: > On Fri, 16 Mar 2018, Benjamin Herrenschmidt wrote: > > > On Thu, 2018-03-15 at 08:03 +1100, Benjamin Herrenschmidt wrote: > > > > > Do you have more comments for the rest of the driver or that's it ? >

Re: [PATCH v5 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-16 Thread Benjamin Herrenschmidt
us a note to > help improve the system] Wow, interesting, but it looks like a false positive, or am I missing something ? > url: > https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180317-004216 > co

[PATCH v5 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-15 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v5. - Remove #ifdef's and hard coded values - Remove module parameters - Honor maximum speed device-tree property - Remove useless list_empty test - Cosmetic/sp

[PATCH v5 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-03-15 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-15 Thread Benjamin Herrenschmidt
On Thu, 2018-03-15 at 08:03 +1100, Benjamin Herrenschmidt wrote: > > > Do you have more comments for the rest of the driver or that's it ? > > > > so far, that's it. > > Ok. I'll re-send. So I'll resend in a minute, doing a few more tests, however, I've noticed someth

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-14 Thread Benjamin Herrenschmidt
On Wed, 2018-03-14 at 10:54 +0200, Felipe Balbi wrote: > Hi, > > Benjamin Herrenschmidt <b...@kernel.crashing.org> writes: > > On Tue, 2018-03-13 at 09:35 +1100, Benjamin Herrenschmidt wrote: > > > On Fri, 2018-03-09 at 11:20 +0200, Felipe Balbi wrote: > > >

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-13 Thread Benjamin Herrenschmidt
On Tue, 2018-03-13 at 09:35 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2018-03-09 at 11:20 +0200, Felipe Balbi wrote: > > > > > diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c > > > b/drivers/usb/gadget/udc/aspeed-vhub/core.c > > > new file

Re: [PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-03-12 Thread Benjamin Herrenschmidt
On Fri, 2018-03-09 at 11:20 +0200, Felipe Balbi wrote: > > > diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c > > b/drivers/usb/gadget/udc/aspeed-vhub/core.c > > new file mode 100644 > > index ..31ed2b6e241b > > --- /dev/null > > +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-27 Thread Benjamin Herrenschmidt
On Fri, 2018-01-26 at 12:55 +0800, Fengguang Wu wrote: > > > > > > UDCVDBG(vhub, "irq status=%08x, ep_acks=%08x ep_nacks=%08x\n", > > > > This is rather bogus too. m32r's readl() is returning unsigned long, it > > should be unsigned int or u32. > > Unfortunately m32r is marked orphaned in

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-25 Thread Benjamin Herrenschmidt
tree, please drop us a note to > help improve the system] This seems to be bogosity in m32r more than problems with the driver... > url: > https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/2

[PATCH v4 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-25 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v4. - Fix missing unlock ast_vhub_udc_wakeup() error path - Make "irq" signed to deal with error from platform_get_irq - Fix Makefile for module builds -

[PATCH v4 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-01-25 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub (fwd)

2018-01-24 Thread Benjamin Herrenschmidt
ulia.law...@lip6.fr> > Subject: Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub > > CC: kbuild-...@01.org > In-Reply-To: <2018012716.7039-2-b...@kernel.crashing.org> > References: <2018012716.7039-2-b...@kernel.crashing.org> > TO: Benjamin

Re: [PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-23 Thread Benjamin Herrenschmidt
us a note to > help improve the system] Looks like my Makefile is rotten for module build. I'll fix that up. Felipe, don't let that hold a review of the driver itself, this looks like a rather trivial Makefile issue. Cheers, Ben. > url: > https://github.com/0day-ci/linux/commits/Ben

[PATCH v3 2/2] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-22 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v3. - Rebased - Add clk stuff v2. - Cosmetic fixes - Properly "allocate" device addresses instead of using a never reset counter - Move .dts

[PATCH v3 1/2] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-01-22 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: [PATCH v3 2/3] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-01-22 Thread Benjamin Herrenschmidt
On Mon, 2018-01-22 at 15:33 +0100, Greg KH wrote: > On Fri, Jan 12, 2018 at 05:50:03PM +1100, Benjamin Herrenschmidt wrote: > > Some UDC may want to allocate endpoints dynamically, either because > > the HW supports an arbitrary large number or because (like the Aspeed > >

Re: [PATCH] dts-bindings: usb-uhci: Document newly added properties

2018-01-19 Thread Benjamin Herrenschmidt
On Fri, 2018-01-19 at 17:22 -0600, Rob Herring wrote: > On Tue, Jan 16, 2018 at 11:06:15AM +1100, Benjamin Herrenschmidt wrote: > > Commit 4642d34a439f80e16af0d56ed6258a33abae257a > > "usb/uhci: Add support for Aspeed BMC SoCs" added > > support for a new #ports

[PATCH v5] usb: uhci: Add clk support to uhci-platform

2018-01-16 Thread Benjamin Herrenschmidt
-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- v5. Don't call clk_disable_unprepare in probe() if clk_prepare_enable() failed. v4. Remove unnecessary NULL checks v3. Fix tab vs. spaces and probe error path v2. Don't forget to gi

Re: [PATCH v4] usb: uhci: Add clk support to uhci-platform

2018-01-16 Thread Benjamin Herrenschmidt
On Tue, 2018-01-16 at 11:36 +0300, Sergei Shtylyov wrote: > Hello! > > On 1/16/2018 12:53 AM, Benjamin Herrenschmidt wrote: > > > > > The Aspeed SoCs use uhci-platform. With the new dynamic clock > > > > control framework, the corresponding IP block cl

[PATCH] dts-bindings: usb-uhci: Document newly added properties

2018-01-15 Thread Benjamin Herrenschmidt
Commit 4642d34a439f80e16af0d56ed6258a33abae257a "usb/uhci: Add support for Aspeed BMC SoCs" added support for a new #ports property, along with Aspeed specific compatible strings. This adds documentation for them. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --

Re: [PATCH v4] usb: uhci: Add clk support to uhci-platform

2018-01-15 Thread Benjamin Herrenschmidt
On Mon, 2018-01-15 at 11:41 +0300, Sergei Shtylyov wrote: > Hello! > > On 1/15/2018 1:59 AM, Benjamin Herrenschmidt wrote: > > > The Aspeed SoCs use uhci-platform. With the new dynamic clock > > control framework, the corresponding IP block clock must

[PATCH v4] usb: uhci: Add clk support to uhci-platform

2018-01-14 Thread Benjamin Herrenschmidt
-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- v4. Remove unnecessary NULL checks v3. Fix tab vs. spaces and probe error path v2. Don't forget to git add latest changes :-) This adds the part where we turn the clock off w

Re: [PATCH v3] usb: uhci: Add clk support to uhci-platform

2018-01-12 Thread Benjamin Herrenschmidt
On Fri, 2018-01-12 at 22:35 -0500, Alan Stern wrote: > On Sat, 13 Jan 2018, Benjamin Herrenschmidt wrote: > > > The Aspeed SoCs use uhci-platform. With the new dynamic clock > > control framework, the corresponding IP block clock must be > > properly enabled. > > &g

[PATCH v3] usb: uhci: Add clk support to uhci-platform

2018-01-12 Thread Benjamin Herrenschmidt
-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v3. Fix tab vs. spaces and probe error path v2. Don't forget to git add latest changes :-) This adds the part where we turn the clock off when removing the driver. drivers/usb/host/uhci-hcd.h | 3 +++ drivers/usb/host/uhci-plat

Re: [PATCH v2] usb: uhci: Add clk support to uhci-platform

2018-01-12 Thread Benjamin Herrenschmidt
On Sat, 2018-01-13 at 09:28 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2018-01-12 at 10:52 -0500, Alan Stern wrote: > > > > As Sergei mentioned, please be consistent in the use of tabs vs. > > spaces. > > > > Do you have to worry about EPROBE_DEFER errors at

Re: [PATCH v3 1/3] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

2018-01-12 Thread Benjamin Herrenschmidt
On Fri, 2018-01-12 at 10:53 -0500, Alan Stern wrote: > On Fri, 12 Jan 2018, Benjamin Herrenschmidt wrote: > > > The current code tries to test for bits that are masked out by > > usb_endpoint_maxp(). Instead, use the proper accessor to access > > the new high bandwidth b

Re: [PATCH v2] usb: uhci: Add clk support to uhci-platform

2018-01-12 Thread Benjamin Herrenschmidt
On Fri, 2018-01-12 at 10:52 -0500, Alan Stern wrote: > > As Sergei mentioned, please be consistent in the use of tabs vs. > spaces. > > Do you have to worry about EPROBE_DEFER errors at any point? I don't think so, not on the SoC I'm using but it might be worthwhile adding support for it just

Re: [PATCH] usb: uhci: Add clk support to uhci-platform

2018-01-12 Thread Benjamin Herrenschmidt
On Fri, 2018-01-12 at 10:35 +0300, Sergei Shtylyov wrote: > Hello! > > On 1/12/2018 8:51 AM, Benjamin Herrenschmidt wrote: > > > The Aspeed SoCs use uhci-platform. With the new dynamic clock > > control framework, the corresponding IP block clock must

[PATCH v3 2/3] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-01-11 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

[PATCH v3 3/3] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-11 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v3. - Rebased - Add clk stuff v2. - Cosmetic fixes - Properly "allocate" device addresses instead of using a never reset counter - Move .dts

[PATCH v3 1/3] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

2018-01-11 Thread Benjamin Herrenschmidt
The current code tries to test for bits that are masked out by usb_endpoint_maxp(). Instead, use the proper accessor to access the new high bandwidth bits. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion

[PATCH v2] usb: uhci: Add clk support to uhci-platform

2018-01-11 Thread Benjamin Herrenschmidt
-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. Don't forget to git add latest changes :-) This adds the part where we turn the clock off when removing the driver. drivers/usb/host/uhci-hcd.h | 3 +++ drivers/usb/host/uhci-platform.c | 18 ++ 2 files chang

[PATCH] usb: uhci: Add clk support to uhci-platform

2018-01-11 Thread Benjamin Herrenschmidt
-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/host/uhci-hcd.h | 3 +++ drivers/usb/host/uhci-platform.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h index f1cc47292a59..7f9f33c8c232

Re: dwc2: Error message on AMCC 405EX SoC

2017-08-30 Thread Benjamin Herrenschmidt
On Wed, 2017-08-30 at 17:21 +1000, Benjamin Herrenschmidt wrote: > Hi ! > > (Adding the mailing list) > > On the AMCC 405EX SoC, if I enable the OTG, I get this occasional > message: > > dwc2 ef6c.usbotg: dwc2_hc_chhltd_intr_dma: Channel 1 - ChHltd set, but &g

dwc2: Error message on AMCC 405EX SoC

2017-08-30 Thread Benjamin Herrenschmidt
Hi ! (Adding the mailing list) On the AMCC 405EX SoC, if I enable the OTG, I get this occasional message: dwc2 ef6c.usbotg: dwc2_hc_chhltd_intr_dma: Channel 1 - ChHltd set, but reason is unknown dwc2 ef6c.usbotg: hcint 0x0002, intsts 0x04400029 The core version is: dwc2

Re: [PATCH 3/3] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-07-08 Thread Benjamin Herrenschmidt
On Sat, 2017-07-08 at 14:38 -0500, Benjamin Herrenschmidt wrote: > The Aspeed BMC SoCs support a "virtual hub" function. It provides some > HW support for a top-level USB2 hub behind which sit 5 gadget "ports". > > This driver adds support for the full functionali

[PATCH 3/3] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-07-08 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/udc/Kconfig | 2 + drivers/usb/gadget/udc/Makefile | 1 + drivers/usb/gadget/udc/aspeed-vhub/Kconfig | 6 + drivers/usb/gadget/

[PATCH 1/3] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

2017-07-08 Thread Benjamin Herrenschmidt
The current code tries to test for bits that are masked out by usb_endpoint_maxp(). Instead, use the proper accessor to access the new high bandwidth bits. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion

[PATCH 2/3] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2017-07-08 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: [PATCH 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-26 Thread Benjamin Herrenschmidt
On Mon, 2017-06-26 at 12:45 +0300, Sergei Shtylyov wrote: > > > arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++ > > arch/arm/boot/dts/aspeed-g5.dtsi | 22 ++ > > 2 files changed, 37 insertions(+) > > If the patch only changes .dtsi files, the subject needs to

Re: [PATCH 4/4] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-06-26 Thread Benjamin Herrenschmidt
a note to > help improve the system] Hrm... I wouldn't worry about these as this IP only exists on 32-bit SoC's, but if you're adamant then I'll look into putting the gory horrible format strings in a respin... > url: > https://github.com/0day-ci/linux/commits/Benjamin-Herrensch

Re: [PATCH 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-25 Thread Benjamin Herrenschmidt
On Sun, 2017-06-25 at 15:18 -0500, Benjamin Herrenschmidt wrote: > Now that the necessary tweaks for the Aspeed variant of UHCI > are supported, this adds the USB controllers to the DT > template of the AST24xx and AST25xx SoCs. > > The EHCI works with the current un

[PATCH 2/4] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

2017-06-25 Thread Benjamin Herrenschmidt
The current code tries to test for bits that are masked out by usb_endpoint_maxp(). Instead, use the proper accessor to access the new high bandwidth bits. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion

[PATCH 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-25 Thread Benjamin Herrenschmidt
. This will be done when we have the necessary clock/reset and pinmux support. In the meantime though, this will work if u-boot configures things properly. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++ arch/arm/boot/dts/aspeed-g

[PATCH 4/4] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-06-25 Thread Benjamin Herrenschmidt
things up and return those EPs to the shared pool. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/arm/boot/dts/aspeed-g4.dtsi| 7 + arch/arm/boot/dts/aspeed-g5.dtsi| 7 + drivers/usb/gadget/udc/Kconfig | 2 + drivers/usb/gadget/

[PATCH 3/4] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2017-06-25 Thread Benjamin Herrenschmidt
. However we have no good place to "free" them. This implements a "simple" variant of this, which calls an EP dispose callback on all EPs associated with a gadget when the composite device gets unbound. This is required by my upcoming Aspeed vHub driver. Signed-off-by: Benja

Re: Oddity with EP configuration

2017-06-15 Thread Benjamin Herrenschmidt
On Thu, 2017-06-15 at 14:13 +0300, Felipe Balbi wrote: > > I don't have a clear idea of the best approach for this problem.  > > Perhaps Felipe will suggest something. > > I wonder if introducing the idea of "gadget ports" would be better > here. It might be simpler to implement a single gadget

[RFC/PATCH] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-06-15 Thread Benjamin Herrenschmidt
unbound, the new hook will allow the UDC to clean things up and return those EPs to the shared pool. Not-quite-Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/arm/boot/dts/aspeed-g5.dtsi| 7 + drivers/usb/gadget/udc/Kconfig | 2 + driv

Re: Oddity with EP configuration

2017-06-14 Thread Benjamin Herrenschmidt
On Wed, 2017-06-14 at 10:19 -0400, Alan Stern wrote: > I think the problem is that you misunderstand how epautoconf is > intended to work. > > I'm not the expert on this stuff -- Felipe is.  Still, as best I > understand, the idea is that a gadget driver or the composite core will > attempt to

[RFC/PATCH] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2017-06-14 Thread Benjamin Herrenschmidt
but that's overkill at this stage. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/usb/gadget/composite.c | 10 +- drivers/usb/gadget/epautoconf.c | 8 ++-- include/linux/usb/gadget.h | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff

Re: Oddity with EP configuration

2017-06-13 Thread Benjamin Herrenschmidt
On Wed, 2017-06-14 at 12:00 +1000, Benjamin Herrenschmidt wrote: > On Wed, 2017-06-14 at 10:33 +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2017-06-13 at 15:08 +1000, Benjamin Herrenschmidt wrote: > > > Now, what I observe is that when the mass storage gets bound to th

Re: Oddity with EP configuration

2017-06-13 Thread Benjamin Herrenschmidt
On Wed, 2017-06-14 at 10:33 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2017-06-13 at 15:08 +1000, Benjamin Herrenschmidt wrote: > > Now, what I observe is that when the mass storage gets bound to the > > UDC driver: > > > >  - First the endpoints are properly all

Re: Oddity with EP configuration

2017-06-13 Thread Benjamin Herrenschmidt
On Tue, 2017-06-13 at 15:08 +1000, Benjamin Herrenschmidt wrote: > Now, what I observe is that when the mass storage gets bound to the > UDC driver: > >  - First the endpoints are properly allocated by my match callback, > ie, epautoconf is called to allocate EPs

[PATCH] usb: Fix typo in the definition of Endpoint[out]Request

2017-06-13 Thread Benjamin Herrenschmidt
The current definition is wrong. This breaks my upcoming Aspeed virtual hub driver. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- include/linux/usb/hcd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/usb/hcd.h b/include/lin

Oddity with EP configuration

2017-06-12 Thread Benjamin Herrenschmidt
So I'm testing my virtual hub drivers. One problem I have is EP allocation. As I mentioned earlier, I have a shared pool of endpoints shared between multiple UDCs. I've added code to "allocate" those EPs from my own udc->match_ep callback. That works ok so far. When binding legacy mass storage,

UDC and oddball sysfs layout

2017-06-12 Thread Benjamin Herrenschmidt
Hi ! So the UDC cores creates a rather funny sysfs layout. If "foo@bar" is my platform device which I pass as "parent" to the gadget I pass to usb_add_gadget_udc_release(), that function creates a funny layout underneath that node: - A "gadget" directory which is gadget.dev and is always

Re: virtual hub and suspend/resume/reset questions

2017-06-11 Thread Benjamin Herrenschmidt
On Sun, 2017-06-11 at 10:09 -0400, Alan Stern wrote: > > Under a non-emulated hub, the wakeup() function would start sending the > wakeup signal upstream and then return.  The gadget's resume callback > would not be invoked until later, probably at the end of the wakeup > sequence (the API isn't

Re: virtual hub and suspend/resume/reset questions

2017-06-10 Thread Benjamin Herrenschmidt
On Sun, 2017-06-11 at 11:00 +1000, Benjamin Herrenschmidt wrote: > > > No, a reset sent to the vhub does not broadcast anything to the > > downstream ports.  It merely disables all of them and clears all their > > status bits (the connect and connect-change bits will then ge

Re: virtual hub and suspend/resume/reset questions

2017-06-10 Thread Benjamin Herrenschmidt
On Sat, 2017-06-10 at 12:58 -0400, Alan Stern wrote: > On Sat, 10 Jun 2017, Benjamin Herrenschmidt wrote: > > with the obvious resume case above I assume. A port reset > > would probably also "resume" though I would forward a reset to the > > gadget rather than

virtual hub and suspend/resume/reset questions

2017-06-10 Thread Benjamin Herrenschmidt
Hi ! The USB spec is twisting my brain sideways trying to figure out how to properly handle suspend/resume in the case of the aspeed vHub. Reminder: This is a combo-gadget HW that has 5 UDC "ports" (gadgets) and a virtual hub above them, so it looks to the host as a hub with 5 ports, the hub

Possible bug in usb_gadget_ep_match_desc()

2017-06-09 Thread Benjamin Herrenschmidt
Another one popped to my eyes. The following test in usb_gadget_ep_match_desc() (in udc core.c) /* "high bandwidth" works only at high speed */ if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp(desc) & (3<<11)) return 0; If you look at the definition of

Re: More dynamic EP allocation

2017-06-09 Thread Benjamin Herrenschmidt
On Fri, 2017-06-09 at 14:08 +0300, Felipe Balbi wrote: > > I was originally thinking of having some device-tree construct > > assigning fixed number of EPs from the pool to the various devices, but > > that sucks... > > > > I'm trying to figure out if I can do something more dynamic. > > > > My

Re: More dynamic EP allocation

2017-06-09 Thread Benjamin Herrenschmidt
On Fri, 2017-06-09 at 21:00 +1000, Benjamin Herrenschmidt wrote: > Hi ! > > So for the aspeed virtual hub, I'm in a situation where I have up to 5 > devices sharing a pool of 15 "generic" endpoints (not counting EP0's, > those have dedicated HW). > > I was ori

More dynamic EP allocation

2017-06-09 Thread Benjamin Herrenschmidt
Hi ! So for the aspeed virtual hub, I'm in a situation where I have up to 5 devices sharing a pool of 15 "generic" endpoints (not counting EP0's, those have dedicated HW). I was originally thinking of having some device-tree construct assigning fixed number of EPs from the pool to the various

Re: Gadget driver & virtual hub

2017-06-08 Thread Benjamin Herrenschmidt
On Thu, 2017-06-08 at 11:30 -0400, Alan Stern wrote: > On Thu, 8 Jun 2017, Benjamin Herrenschmidt wrote: > > > Another question ... > > > > Do i need to support dequeue() on EP0 ? > > Yes.  I don't know if any drivers ever dequeue requests from ep0, but >

  1   2   >