Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-22 Thread Alan Stern
On Thu, 21 Mar 2013, Soeren Moch wrote: > > Hi Alan, Soeren > > > > Could you word the description a bit better. If Alan did not get it > > without a bit of thought, few others are going to understand it > > without a better explanation. > > > > Thanks > > Andrew > > > > Alan, > > can you

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-22 Thread Alan Stern
On Thu, 21 Mar 2013, Soeren Moch wrote: Hi Alan, Soeren Could you word the description a bit better. If Alan did not get it without a bit of thought, few others are going to understand it without a better explanation. Thanks Andrew Alan, can you come up with a better

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 21.03.2013 22:20, Andrew Lunn wrote: On Thu, Mar 21, 2013 at 05:12:01PM -0400, Alan Stern wrote: On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 21.03.2013 20:10, Arnd Bergmann wrote: On Thursday 21 March 2013, Jason Cooper wrote: On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 03/21/13 22:12, Alan Stern wrote: On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The iTDs are added to sched->td_list.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Andrew Lunn
On Thu, Mar 21, 2013 at 05:12:01PM -0400, Alan Stern wrote: > On Thu, 21 Mar 2013, Alan Stern wrote: > > > On Thu, 21 Mar 2013, Soeren Moch wrote: > > > > > Now I found out what is going on here: > > > > > > In itd_urb_transaction() we allocate 9 iTDs for each URB with > > > number_of_packets

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Alan Stern
On Thu, 21 Mar 2013, Alan Stern wrote: > On Thu, 21 Mar 2013, Soeren Moch wrote: > > > Now I found out what is going on here: > > > > In itd_urb_transaction() we allocate 9 iTDs for each URB with > > number_of_packets == 64 in my case. The iTDs are added to > > sched->td_list. For a

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Alan Stern
On Thu, 21 Mar 2013, Soeren Moch wrote: > Now I found out what is going on here: > > In itd_urb_transaction() we allocate 9 iTDs for each URB with > number_of_packets == 64 in my case. The iTDs are added to > sched->td_list. For a frame-aligned scheduling we need 8 iTDs, the 9th > one is

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Michael Trimarchi
Hi On 21/03/13 20:10, Arnd Bergmann wrote: > On Thursday 21 March 2013, Jason Cooper wrote: >> On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: > >>> >>> Now I found out what is going on here: >>> >>> In itd_urb_transaction() we allocate 9 iTDs for each URB with >>> number_of_packets

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Arnd Bergmann
On Thursday 21 March 2013, Jason Cooper wrote: > On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: > > > > Now I found out what is going on here: > > > > In itd_urb_transaction() we allocate 9 iTDs for each URB with > > number_of_packets == 64 in my case. The iTDs are added to > >

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Jason Cooper
On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: > On 03/17/13 18:36, Alan Stern wrote: > >On Sun, 17 Mar 2013, Soeren Moch wrote: > > > >>For each device only one isochronous endpoint is used (EP IN4, 1x 940 > >>Bytes, Interval 1). > >>When the ENOMEM error occurs, a huge number of

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 03/17/13 18:36, Alan Stern wrote: On Sun, 17 Mar 2013, Soeren Moch wrote: For each device only one isochronous endpoint is used (EP IN4, 1x 940 Bytes, Interval 1). When the ENOMEM error occurs, a huge number of iTDs is in the free_list of one stream. This number is much higher than the 2*M

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 03/17/13 18:36, Alan Stern wrote: On Sun, 17 Mar 2013, Soeren Moch wrote: For each device only one isochronous endpoint is used (EP IN4, 1x 940 Bytes, Interval 1). When the ENOMEM error occurs, a huge number of iTDs is in the free_list of one stream. This number is much higher than the 2*M

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Jason Cooper
On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: On 03/17/13 18:36, Alan Stern wrote: On Sun, 17 Mar 2013, Soeren Moch wrote: For each device only one isochronous endpoint is used (EP IN4, 1x 940 Bytes, Interval 1). When the ENOMEM error occurs, a huge number of iTDs is in the

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Arnd Bergmann
On Thursday 21 March 2013, Jason Cooper wrote: On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The iTDs are added to sched-td_list.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Michael Trimarchi
Hi On 21/03/13 20:10, Arnd Bergmann wrote: On Thursday 21 March 2013, Jason Cooper wrote: On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Alan Stern
On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The iTDs are added to sched-td_list. For a frame-aligned scheduling we need 8 iTDs, the 9th one is released

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Alan Stern
On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The iTDs are added to sched-td_list. For a frame-aligned

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Andrew Lunn
On Thu, Mar 21, 2013 at 05:12:01PM -0400, Alan Stern wrote: On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 03/21/13 22:12, Alan Stern wrote: On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The iTDs are added to sched-td_list.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 21.03.2013 20:10, Arnd Bergmann wrote: On Thursday 21 March 2013, Jason Cooper wrote: On Thu, Mar 21, 2013 at 06:04:59PM +0100, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with number_of_packets == 64 in my case. The

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-21 Thread Soeren Moch
On 21.03.2013 22:20, Andrew Lunn wrote: On Thu, Mar 21, 2013 at 05:12:01PM -0400, Alan Stern wrote: On Thu, 21 Mar 2013, Alan Stern wrote: On Thu, 21 Mar 2013, Soeren Moch wrote: Now I found out what is going on here: In itd_urb_transaction() we allocate 9 iTDs for each URB with

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Alan Stern
On Sun, 17 Mar 2013, Alan Stern wrote: > On Sun, 17 Mar 2013, Soeren Moch wrote: > > > For each device only one isochronous endpoint is used (EP IN4, 1x 940 > > Bytes, Interval 1). > > When the ENOMEM error occurs, a huge number of iTDs is in the free_list > > of one stream. This number is

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Alan Stern
On Sun, 17 Mar 2013, Soeren Moch wrote: > For each device only one isochronous endpoint is used (EP IN4, 1x 940 > Bytes, Interval 1). > When the ENOMEM error occurs, a huge number of iTDs is in the free_list > of one stream. This number is much higher than the 2*M entries, which > should be

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Soeren Moch
On 16.03.2013 18:39, Alan Stern wrote: On Sat, 16 Mar 2013, Soeren Moch wrote: I implemented the counter. The max value is sampled at the beginning of end_free_itds(), the current counter value is sampled at the end of this function. Counter values w/o a max number are from the error path in

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Soeren Moch
On 16.03.2013 18:39, Alan Stern wrote: On Sat, 16 Mar 2013, Soeren Moch wrote: I implemented the counter. The max value is sampled at the beginning of end_free_itds(), the current counter value is sampled at the end of this function. Counter values w/o a max number are from the error path in

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Alan Stern
On Sun, 17 Mar 2013, Soeren Moch wrote: For each device only one isochronous endpoint is used (EP IN4, 1x 940 Bytes, Interval 1). When the ENOMEM error occurs, a huge number of iTDs is in the free_list of one stream. This number is much higher than the 2*M entries, which should be there

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-17 Thread Alan Stern
On Sun, 17 Mar 2013, Alan Stern wrote: On Sun, 17 Mar 2013, Soeren Moch wrote: For each device only one isochronous endpoint is used (EP IN4, 1x 940 Bytes, Interval 1). When the ENOMEM error occurs, a huge number of iTDs is in the free_list of one stream. This number is much higher

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-16 Thread Alan Stern
On Sat, 16 Mar 2013, Soeren Moch wrote: > I implemented the counter. The max value is sampled at the beginning of > end_free_itds(), the current counter value is sampled at the end of this > function. Counter values w/o a max number are from the error path in > itd_urb_transaction(). > The

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-16 Thread Alan Stern
On Sat, 16 Mar 2013, Soeren Moch wrote: I implemented the counter. The max value is sampled at the beginning of end_free_itds(), the current counter value is sampled at the end of this function. Counter values w/o a max number are from the error path in itd_urb_transaction(). The number

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-15 Thread Soeren Moch
On 14.03.2013 22:33, Alan Stern wrote: Maybe a better way to go about this is, instead of printing out every allocation and deallocation, to keep a running counter. You could have the driver print out the value of this counter every minute or so. Any time the device isn't in use, the counter

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-15 Thread Alan Stern
On Fri, 15 Mar 2013, Soeren Moch wrote: > > The log shows a 1-1 match between allocations and deallocations, except > > for three excess allocations about 45 lines before the end. I have no > > idea what's up with those. They may be an artifact arising from where > > you stopped copying the log

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-15 Thread Alan Stern
On Fri, 15 Mar 2013, Soeren Moch wrote: The log shows a 1-1 match between allocations and deallocations, except for three excess allocations about 45 lines before the end. I have no idea what's up with those. They may be an artifact arising from where you stopped copying the log data.

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-15 Thread Soeren Moch
On 14.03.2013 22:33, Alan Stern wrote: Maybe a better way to go about this is, instead of printing out every allocation and deallocation, to keep a running counter. You could have the driver print out the value of this counter every minute or so. Any time the device isn't in use, the counter

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 22:33, Alan Stern wrote: On Thu, 14 Mar 2013, Soeren Moch wrote: If the memory really is being leaked here in some sort of systematic way, we may be able to see it in your debugging output after a few seconds. OK, here are the first seconds of the log. But the buffer

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Alan Stern
On Thu, 14 Mar 2013, Soeren Moch wrote: > > If the memory really is being leaked here in some sort of systematic > > way, we may be able to see it in your debugging output after a few > > seconds. > > > > OK, here are the first seconds of the log. But the buffer exhaustion > usually occurs

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 21:32, Alan Stern wrote: On Thu, 14 Mar 2013, Soeren Moch wrote: I added a debug message to drivers/usb/host/ehci-sched.c:itd_urb_transaction() to log the allocation flags, see log below. But it looks like you didn't add a message to end_free_itds(), so we don't know when the

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Alan Stern
On Thu, 14 Mar 2013, Soeren Moch wrote: > >> I added a debug message to > >> drivers/usb/host/ehci-sched.c:itd_urb_transaction() to log the > >> allocation flags, see log below. > > > > But it looks like you didn't add a message to end_free_itds(), so we > > don't know when the memory gets

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 19:48, Soeren Moch wrote: On 10.03.2013 21:59, Alan Stern wrote: On Sun, 10 Mar 2013, Soeren Moch wrote: On Wed, 20 Feb 2013, Soeren Moch wrote: Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 10.03.2013 21:59, Alan Stern wrote: On Sun, 10 Mar 2013, Soeren Moch wrote: On Wed, 20 Feb 2013, Soeren Moch wrote: Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb sticks stream dvb data (digital TV)

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 10.03.2013 21:59, Alan Stern wrote: On Sun, 10 Mar 2013, Soeren Moch wrote: On Wed, 20 Feb 2013, Soeren Moch wrote: Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb sticks stream dvb data (digital TV)

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 19:48, Soeren Moch wrote: On 10.03.2013 21:59, Alan Stern wrote: On Sun, 10 Mar 2013, Soeren Moch wrote: On Wed, 20 Feb 2013, Soeren Moch wrote: Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Alan Stern
On Thu, 14 Mar 2013, Soeren Moch wrote: I added a debug message to drivers/usb/host/ehci-sched.c:itd_urb_transaction() to log the allocation flags, see log below. But it looks like you didn't add a message to end_free_itds(), so we don't know when the memory gets deallocated. And you

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 21:32, Alan Stern wrote: On Thu, 14 Mar 2013, Soeren Moch wrote: I added a debug message to drivers/usb/host/ehci-sched.c:itd_urb_transaction() to log the allocation flags, see log below. But it looks like you didn't add a message to end_free_itds(), so we don't know when the

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Alan Stern
On Thu, 14 Mar 2013, Soeren Moch wrote: If the memory really is being leaked here in some sort of systematic way, we may be able to see it in your debugging output after a few seconds. OK, here are the first seconds of the log. But the buffer exhaustion usually occurs after several

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-14 Thread Soeren Moch
On 14.03.2013 22:33, Alan Stern wrote: On Thu, 14 Mar 2013, Soeren Moch wrote: If the memory really is being leaked here in some sort of systematic way, we may be able to see it in your debugging output after a few seconds. OK, here are the first seconds of the log. But the buffer

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-10 Thread Alan Stern
On Sun, 10 Mar 2013, Soeren Moch wrote: > > On Wed, 20 Feb 2013, Soeren Moch wrote: > > > >> Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a > >> Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb sticks > >> stream dvb data (digital TV) employing isochronous usb

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-10 Thread Soeren Moch
On 21.02.2013 19:54, Alan Stern wrote: I trust you won't mind if I put this on the public mailing list. In general, problems of this sort should be discussed in public. In addition to creating a permanent record in the various mailing list archives, it also gives other people a chance to learn

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-10 Thread Soeren Moch
On 21.02.2013 19:54, Alan Stern wrote: I trust you won't mind if I put this on the public mailing list. In general, problems of this sort should be discussed in public. In addition to creating a permanent record in the various mailing list archives, it also gives other people a chance to learn

Re: [PATCH] USB: EHCI: fix for leaking isochronous data

2013-03-10 Thread Alan Stern
On Sun, 10 Mar 2013, Soeren Moch wrote: On Wed, 20 Feb 2013, Soeren Moch wrote: Ok. I use 2 em2840-based usb sticks (em28xx driver) attached to a Marvell Kirkwood-SoC with a orion-ehci usb controller. These usb sticks stream dvb data (digital TV) employing isochronous usb transfers