Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Tony Lindgren
Hi, * H. Nikolaus Schaller [160803 10:07]: > All this prevents detection of cable plugin-events and VBUS measurement > and setting OTG_EN before charging is attempted. So I gave this patch a try but it now blocks all deeper SoC idle states as the PHY stays active. I think the real fix is to make

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread H. Nikolaus Schaller
Hi Tony, > Am 04.08.2016 um 16:29 schrieb Tony Lindgren : > > Hi, > > * H. Nikolaus Schaller [160803 10:07]: >> All this prevents detection of cable plugin-events and VBUS measurement >> and setting OTG_EN before charging is attempted. > > So I gave this patch a try but it now blocks all deepe

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Tony Lindgren
* H. Nikolaus Schaller [160804 07:50]: > > Am 04.08.2016 um 16:29 schrieb Tony Lindgren : > > > > So I gave this patch a try but it now blocks all deeper SoC idle > > states as the PHY stays active. I think the real fix is to make > > sure the charger behaves independent of the USB PHY state. >

Re: [PATCH v5] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Wenyou Yang wrote: > The usb controller does not managed correctly the suspend mode for > the ehci. In echi mode, there is no way to have utmi_suspend_o_n[1] > suspend without any device connected to it. This is why this specific > control is added to fix this issue. The suspen

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Alan Stern
Viresh, I believe this bug report indicates we need to use the alternate approach instead of your "usb: hub: Fix unbalanced reference count and memory leak" patch. On Thu, 4 Aug 2016 mgau...@codeaurora.org wrote: > On 2015-12-17 00:02, Alan Stern wrote: > > Commit 8520f38099cc ("USB: change hub

Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

2016-08-04 Thread Felipe Balbi
Hi, Alan Stern writes: > On Wed, 3 Aug 2016, Felipe Balbi wrote: > >> >> --- a/drivers/usb/dwc3/core.c >> >> +++ b/drivers/usb/dwc3/core.c >> >> @@ -1192,6 +1192,7 @@ static int dwc3_runtime_resume(struct device *dev) >> >> } >> >> >> >> pm_runtime_mark_last_busy(dev); >> >> + pm_runtime_p

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
Hi, On Thu, 4 Aug 2016 07:29:19 -0700 Tony Lindgren wrote: > Hi, > > * H. Nikolaus Schaller [160803 10:07]: > > All this prevents detection of cable plugin-events and VBUS > > measurement and setting OTG_EN before charging is attempted. > > So I gave this patch a try but it now blocks all dee

Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Felipe Balbi wrote: > > What are you trying to accomplish? Is the problem that wakeup signals > > only cause the platform device to be runtime-resumed, but you also need > > the HCD to wake up? And conversely, whenever the HCD gets > > runtime-suspended you also want the plat

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
On Thu, 4 Aug 2016 18:31:29 +0200 Andreas Kemnade wrote: > Hi, > > On Thu, 4 Aug 2016 07:29:19 -0700 > Tony Lindgren wrote: > > > Hi, > > > > * H. Nikolaus Schaller [160803 10:07]: > > > All this prevents detection of cable plugin-events and VBUS > > > measurement and setting OTG_EN before c

Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

2016-08-04 Thread Felipe Balbi
Hi, Alan Stern writes: > On Thu, 4 Aug 2016, Felipe Balbi wrote: > >> > What are you trying to accomplish? Is the problem that wakeup signals >> > only cause the platform device to be runtime-resumed, but you also need >> > the HCD to wake up? And conversely, whenever the HCD gets >> > runtim

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-04 Thread Matwey V. Kornilov
I've just found that many packages in URBs have zero actual_length (It is a question why). Then the following end of frame criteria leads to `frame underflow' message: if (flen < pdev->vlast_packet_size) { /* Shorter packet... end of frame */

Re: [PATCH 1/1] Add driver for smsc usb251x i2c configuration

2016-08-04 Thread Rob Herring
On Tue, Aug 02, 2016 at 04:31:54PM +0200, Fabien Lahoudere wrote: > This driver copy the configuration of the controller EEPROM via i2c. > Configuration information is available in Documentation/usb/usb251x.txt > > Signed-off-by: Fabien Lahoudere > --- > Documentation/devicetree/bindings/usb/usb

Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Felipe Balbi wrote: > Hi, > > Alan Stern writes: > > > On Thu, 4 Aug 2016, Felipe Balbi wrote: > > > >> > What are you trying to accomplish? Is the problem that wakeup signals > >> > only cause the platform device to be runtime-resumed, but you also need > >> > the HCD to w

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 11:20, Alan Stern wrote: > Yes, it could lead to this deadlock. > > > Should we rather have device_trylock instead of device_lock > > No. > > > > @@ -1031,10 +1031,20 @@ static void hub_activate(struct usb_hub > > > unsigned delay; > > > > > > /* Continue a partial initializati

Re: [PACTH v1] cdc-wdm: Clear read pipeline in case of error

2016-08-04 Thread Robert Foss
On 2016-08-03 06:39 AM, Oliver Neukum wrote: On Tue, 2016-08-02 at 10:37 -0400, Robert Foss wrote: On 2016-08-02 09:59 AM, Oliver Neukum wrote: On Tue, 2016-08-02 at 09:54 -0400, Robert Foss wrote: On 2016-08-02 08:23 AM, Oliver Neukum wrote: On Thu, 2016-07-28 at 14:19 -0400, robert.f...

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Viresh Kumar wrote: > On 04-08-16, 11:20, Alan Stern wrote: > > Yes, it could lead to this deadlock. > > > > > Should we rather have device_trylock instead of device_lock > > > > No. > > > > > > @@ -1031,10 +1031,20 @@ static void hub_activate(struct usb_hub > > > >

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 14:47, Alan Stern wrote: > On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > On 04-08-16, 11:20, Alan Stern wrote: > > > Yes, it could lead to this deadlock. > > > > > > > Should we rather have device_trylock instead of device_lock > > > > > > No. > > > > > > > > @@ -1031,10 +1031,20 @

[PATCH] usb: musb: remove redundant stack buffers

2016-08-04 Thread Rasmus Villemoes
aDate is always the empty string, so entirely pointless. The aRevision formatting might as well be done as part of the pr_debug() call - that also avoids it altogether if pr_debug is compiled out. Signed-off-by: Rasmus Villemoes --- drivers/usb/musb/musb_core.c | 12 +--- 1 file changed,

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-04 Thread Matwey V. Kornilov
I've just found that dma->actual_len equals to zero in most cases at musb_host.c line 1946. And this produces zero-length packages. http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/usb/musb/musb_host.c#n1946 Any ideas why? 2016-08-04 19:57 GMT+03:00 Matwey V. Kornilov

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-04 Thread Matwey V. Kornilov
I've just found that in such cases, when DMA actual length is zero, both cppi41_channel->prog_len and txstate.residue equal 960 at musb_cppi41 line 225: http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/usb/musb/musb_cppi41.c#n225 2016-08-04 22:08 GMT+03:00 Matwey V. Ko

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-04 Thread Matwey V. Kornilov
When DMA is not used, I see the same behavior: lots of zero-length packages received. Can It be related to some kind of USB overflow due to long input data processing with disabled IRQ? When HCD_BC is used then part of processing is postponed and this can explain greater throughput due to better l

Re: usbtmc: vendor specific i/o

2016-08-04 Thread Ladislav Michl
On Thu, Aug 04, 2016 at 06:59:30AM +0200, Greg Kroah-Hartman wrote: > On Wed, Aug 03, 2016 at 09:06:25AM +0200, Ladislav Michl wrote: > > Yes, also was lacking proper description and signoff. So, I'm considering > > ioctls based approach okay, although that question (the only one I really > > had)

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > What about another patch on top of my patch to fix the deadlock? > > > > Or another patch in place of yours to fix both problems. Has your > > patch been merged yet? I don't see it in any of the branches in > > https://git.kernel.org/cgit/linux/kern

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Alan Stern
On Thu, 4 Aug 2016, Viresh Kumar wrote: > On 04-08-16, 11:49, Viresh Kumar wrote: > > On 04-08-16, 14:47, Alan Stern wrote: > > > On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > > > > > On 04-08-16, 11:20, Alan Stern wrote: > > > > > Yes, it could lead to this deadlock. > > > > > > > > > > > Shoul

[PATCH V2] usb: hub: Fix unbalanced reference count/memory leak/deadlocks

2016-08-04 Thread Viresh Kumar
Memory leak and unbalanced reference count: If the hub gets disconnected while the core is still activating it, this can result in leaking memory of few USB structures. This will happen if we have done a kref_get() from hub_activate() and scheduled a delayed work item for HUB_INIT2/3. Now if hub_

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 11:49, Viresh Kumar wrote: > On 04-08-16, 14:47, Alan Stern wrote: > > On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > > > On 04-08-16, 11:20, Alan Stern wrote: > > > > Yes, it could lead to this deadlock. > > > > > > > > > Should we rather have device_trylock instead of device_lock >

Re: [Letux-kernel] [PATCH v2] musb: omap2430: do not assume balanced enable()/disable()

2016-08-04 Thread Andreas Kemnade
On Thu, 4 Aug 2016 16:49:30 +0200 "H. Nikolaus Schaller" wrote: > > Rationale: > > > > The charger driver calls pm_runtime_get_sync(bci->transceiver->dev); > > which should indirectly call twl4030_usb_set_mode to set the > > POWER_CTRL_OTG_ENAB bit. This enables the prescaler hardware > > for AD

functionfs example

2016-08-04 Thread Patrick Doyle
So far, the Google hasn't helped me much, so I'd like to play "Ask the experts". Can anybody point me at an example of code using functionfs. I have legacy code that works with gadgetfs that I would like to convert to use functionfs, so a wiki page or presentation walking through that process wou

Re: functionfs example

2016-08-04 Thread Felipe Balbi
Hi, Patrick Doyle writes: > So far, the Google hasn't helped me much, so I'd like to play "Ask the > experts". > > Can anybody point me at an example of code using functionfs. > > I have legacy code that works with gadgetfs that I would like to > convert to use functionfs, so a wiki page or pres

RE: [PATCH v5] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-08-04 Thread Wenyou.Yang
Hi Alan, > -Original Message- > From: Alan Stern [mailto:st...@rowland.harvard.edu] > Sent: 2016年8月4日 23:02 > To: Wenyou Yang > Cc: Greg Kroah-Hartman ; Nicolas Ferre > ; Alexandre Belloni electrons.com>; linux-ker...@vger.kernel.org; linux-arm- > ker...@lists.infradead.org; linux-usb@vg