Return-path: Received: from bu3sch.de ([62.75.166.246]:40904 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754848AbZEIUVO (ORCPT ); Sat, 9 May 2009 16:21:14 -0400 From: Michael Buesch To: Greg KH Subject: Re: DMA debug trace pointing to rtl8187 Date: Sat, 9 May 2009 22:19:39 +0200 Cc: Larry Finger , Eric Valette , FUJITA Tomonori , "John W. Linville" , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Hin-Tak Leung References: <49FDB9F8.3080400@free.fr> <4A05BD77.9020003@lwfinger.net> <20090509192959.GA1842@kroah.com> In-Reply-To: <20090509192959.GA1842@kroah.com> MIME-Version: 1.0 Message-Id: <200905092219.40216.mb@bu3sch.de> Content-Type: text/plain; charset="iso-8859-1" Sender: linux-wireless-owner@vger.kernel.org List-ID: On Saturday 09 May 2009 21:29:59 Greg KH wrote: > On Sat, May 09, 2009 at 12:29:27PM -0500, Larry Finger wrote: > > I think there is a second problem that John's fix does not treat. Although the > > buffer is removed from the stack, there is no assurance that the buffer obtained > > with kmalloc() is reachable by DMA. This case will be triggered if the USB > > adapter does 32-bit DMA and the system has more than 4 GB RAM. In practice this does not hit, because such systems' kmalloc does not return memory above 4G (i386) _or_ the DMA mapping functions take care of bounce buffering or I/O-remapping (should be true for all other arches). So if the device is able to do DMA with addresses >=32bit it should be fine, provided it correctly sets the DMA mask. > Memory returned by kmalloc will always be able to be DMAable. If not, > we have lots of problems :) True for sane devices. False for devices like Broadcom HND-DMA, which should only be used to slap thy hw engineers. -- Greetings, Michael.