Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Johan Hovold
On Sat, May 24, 2014 at 12:59:07PM -0700, Greg Kroah-Hartman wrote: > On Sat, May 24, 2014 at 04:42:42PM +0200, Johan Hovold wrote: > > Could you please discard this one for now? I've found a couple of more > > PM related problems and I'll submit a slight update of this one as part > > of a

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Greg Kroah-Hartman
On Sat, May 24, 2014 at 04:42:42PM +0200, Johan Hovold wrote: > On Mon, Apr 14, 2014 at 09:58:12PM +0200, Johan Hovold wrote: > > The current ACM runtime-suspend implementation is broken in several > > ways: > > > > Firstly, it buffers only the first write request being made while > > suspended

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Johan Hovold
On Mon, Apr 14, 2014 at 09:58:12PM +0200, Johan Hovold wrote: > The current ACM runtime-suspend implementation is broken in several > ways: > > Firstly, it buffers only the first write request being made while > suspended -- any further writes are silently dropped. > > Secondly, writes being

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Johan Hovold
On Mon, Apr 14, 2014 at 09:58:12PM +0200, Johan Hovold wrote: The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any further writes are silently dropped. Secondly, writes being dropped

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Greg Kroah-Hartman
On Sat, May 24, 2014 at 04:42:42PM +0200, Johan Hovold wrote: On Mon, Apr 14, 2014 at 09:58:12PM +0200, Johan Hovold wrote: The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-05-24 Thread Johan Hovold
On Sat, May 24, 2014 at 12:59:07PM -0700, Greg Kroah-Hartman wrote: On Sat, May 24, 2014 at 04:42:42PM +0200, Johan Hovold wrote: Could you please discard this one for now? I've found a couple of more PM related problems and I'll submit a slight update of this one as part of a larger

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 11:13:17AM +0200, Johan Hovold wrote: > On Tue, Apr 15, 2014 at 10:35:19AM +0200, Oliver Neukum wrote: > > On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: > > > > > Fix this by implementing a delayed-write queue using urb anchors and > > > making sure to discard the

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 10:35:19AM +0200, Oliver Neukum wrote: > On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: > > > Fix this by implementing a delayed-write queue using urb anchors and > > making sure to discard the queue properly at shutdown. > > Looks very good, with one exception:

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 04:24:10PM +0800, Xiao Jin wrote: > On 04/15/2014 03:58 AM, Johan Hovold wrote: > > Jin, did you check what closing_wait setting your application is using? > > I check the closing_wait is 30s by default. Below is the trace we get > when reproduced problem. > >

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Oliver Neukum
On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: > Fix this by implementing a delayed-write queue using urb anchors and > making sure to discard the queue properly at shutdown. Looks very good, with one exception: acm_tty_close() must synchronously resume the device so that the anchor is

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Xiao Jin
Hi, Johan, On 04/15/2014 03:58 AM, Johan Hovold wrote: The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any further writes are silently dropped. Secondly, writes being dropped also leak

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Xiao Jin
Hi, Johan, On 04/15/2014 03:58 AM, Johan Hovold wrote: The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any further writes are silently dropped. Secondly, writes being dropped also leak

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Oliver Neukum
On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: Fix this by implementing a delayed-write queue using urb anchors and making sure to discard the queue properly at shutdown. Looks very good, with one exception: acm_tty_close() must synchronously resume the device so that the anchor is

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 04:24:10PM +0800, Xiao Jin wrote: On 04/15/2014 03:58 AM, Johan Hovold wrote: Jin, did you check what closing_wait setting your application is using? I check the closing_wait is 30s by default. Below is the trace we get when reproduced problem.

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 10:35:19AM +0200, Oliver Neukum wrote: On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: Fix this by implementing a delayed-write queue using urb anchors and making sure to discard the queue properly at shutdown. Looks very good, with one exception:

Re: [PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-15 Thread Johan Hovold
On Tue, Apr 15, 2014 at 11:13:17AM +0200, Johan Hovold wrote: On Tue, Apr 15, 2014 at 10:35:19AM +0200, Oliver Neukum wrote: On Mon, 2014-04-14 at 21:58 +0200, Johan Hovold wrote: Fix this by implementing a delayed-write queue using urb anchors and making sure to discard the queue

[PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-14 Thread Johan Hovold
The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any further writes are silently dropped. Secondly, writes being dropped also leak write urbs, which are never reclaimed (until the device is

[PATCH] USB: cdc-acm: fix broken runtime suspend

2014-04-14 Thread Johan Hovold
The current ACM runtime-suspend implementation is broken in several ways: Firstly, it buffers only the first write request being made while suspended -- any further writes are silently dropped. Secondly, writes being dropped also leak write urbs, which are never reclaimed (until the device is