From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Thu, 21 Mar 2013 19:10:31 +0000 Subject: [PATCH] USB: EHCI: fix for leaking isochronous data In-Reply-To: <20130321173324.GY13280@titan.lakedaemon.net> References: <514B3DBB.3060302@web.de> <20130321173324.GY13280@titan.lakedaemon.net> Message-ID: <201303211910.31473.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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. For a frame-aligned scheduling we need 8 iTDs, the > > 9th one is released back to the front of the streams free_list in > > iso_sched_free(). This iTD was cleared after allocation and has a > > frame number of 0 now. So for each allocation when now_frame == 0 we > > allocate from the dma_pool, not from the free_list. The attached > > patch invalidates the frame number in each iTD before it is sent to > > the scheduler. This fixes the problem without the need to iterate > > over a iTD list. > > > > Signed-off-by: Soeren Moch > > Wow! Great work Soeren! Talk about a long road to a small fix. Thanks > for keeping after it. +1 I hardly understand half of the description above, but that much sounds plausible. Is this a bug fix that should get backported to stable kernels? Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx150.postini.com [74.125.245.150]) by kanga.kvack.org (Postfix) with SMTP id 46FC96B0002 for ; Thu, 21 Mar 2013 15:11:22 -0400 (EDT) From: Arnd Bergmann Subject: Re: [PATCH] USB: EHCI: fix for leaking isochronous data Date: Thu, 21 Mar 2013 19:10:31 +0000 References: <514B3DBB.3060302@web.de> <20130321173324.GY13280@titan.lakedaemon.net> In-Reply-To: <20130321173324.GY13280@titan.lakedaemon.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201303211910.31473.arnd@arndb.de> Sender: owner-linux-mm@kvack.org List-ID: To: Jason Cooper Cc: Soeren Moch , Alan Stern , USB list , Andrew Lunn , Sebastian Hesselbarth , linux-mm@kvack.org, Kernel development list , linux-arm-kernel@lists.infradead.org, michael@amarulasolutions.com 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. For a frame-aligned scheduling we need 8 iTDs, the > > 9th one is released back to the front of the streams free_list in > > iso_sched_free(). This iTD was cleared after allocation and has a > > frame number of 0 now. So for each allocation when now_frame == 0 we > > allocate from the dma_pool, not from the free_list. The attached > > patch invalidates the frame number in each iTD before it is sent to > > the scheduler. This fixes the problem without the need to iterate > > over a iTD list. > > > > Signed-off-by: Soeren Moch > > Wow! Great work Soeren! Talk about a long road to a small fix. Thanks > for keeping after it. +1 I hardly understand half of the description above, but that much sounds plausible. Is this a bug fix that should get backported to stable kernels? Arnd -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219Ab3CUTLV (ORCPT ); Thu, 21 Mar 2013 15:11:21 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:56674 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283Ab3CUTLU (ORCPT ); Thu, 21 Mar 2013 15:11:20 -0400 From: Arnd Bergmann To: Jason Cooper Subject: Re: [PATCH] USB: EHCI: fix for leaking isochronous data Date: Thu, 21 Mar 2013 19:10:31 +0000 User-Agent: KMail/1.12.2 (Linux/3.8.0-13-generic; KDE/4.3.2; x86_64; ; ) Cc: Soeren Moch , Alan Stern , USB list , Andrew Lunn , Sebastian Hesselbarth , linux-mm@kvack.org, Kernel development list , linux-arm-kernel@lists.infradead.org, michael@amarulasolutions.com References: <514B3DBB.3060302@web.de> <20130321173324.GY13280@titan.lakedaemon.net> In-Reply-To: <20130321173324.GY13280@titan.lakedaemon.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201303211910.31473.arnd@arndb.de> X-Provags-ID: V02:K0:ygqnK0FUPxv9H6awUPb1LdKid1YYqiV6RDFuTU3P91W cw05nh0ISknUh/pYuNVPDW7XrYnbNSTqtCyx2gkuobk5yzSxsD R2kSvVLdk7oLDfuuUSEKdWO6JnOZQvUmNCBzj+ZYxlstcIg8ye ZDP2utbKFwHcctYnxRmf8qLZSEc1HoQZb47UiNfVQvE0h22FVX 1ywPQwm4lNH0egD4g1k4PknCvGzf2LcnCtHGjr17X3MyF8kWnU cLfTCyCaO4TuX+iWgX/fqLI3oIBa0/TQRB474knyD20tyoCoy+ 0dHuT93MIqK1W45uBo17PB1/OKi6mmRFycRb3uZcQiHA8OdyJi HHzxVsCEUqetL4tPd8SM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. For a frame-aligned scheduling we need 8 iTDs, the > > 9th one is released back to the front of the streams free_list in > > iso_sched_free(). This iTD was cleared after allocation and has a > > frame number of 0 now. So for each allocation when now_frame == 0 we > > allocate from the dma_pool, not from the free_list. The attached > > patch invalidates the frame number in each iTD before it is sent to > > the scheduler. This fixes the problem without the need to iterate > > over a iTD list. > > > > Signed-off-by: Soeren Moch > > Wow! Great work Soeren! Talk about a long road to a small fix. Thanks > for keeping after it. +1 I hardly understand half of the description above, but that much sounds plausible. Is this a bug fix that should get backported to stable kernels? Arnd