From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: [PATCH] 6fire: fix URB transfer buffer for midi output Date: Thu, 08 Aug 2013 09:16:27 +0200 Message-ID: <520345CB.3030307@ladisch.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by alsa0.perex.cz (Postfix) with ESMTP id BEE5226564A for ; Thu, 8 Aug 2013 09:16:49 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Torsten Schenk , Alan Stern , linux-usb@vger.kernel.org List-Id: alsa-devel@alsa-project.org Takashi Iwai wrote: > Alan Stern wrote: >> A buffer _can_ be in the middle of a kmalloc'ed space, but the CPU must >> not access any of the fields around it that might occupy the same cache >> line while the buffer is being used for DMA. > > Hrm, but does the kmalloc buffer always guarantee such cache line > exclusiveness...? I thought a simple one like SLOB doesn't care. Documentation/DMA-API-HOWTO.txt says: | Architectures must ensure that kmalloc'ed buffer is | DMA-safe. Drivers and subsystems depend on it. If an architecture | isn't fully DMA-coherent (i.e. hardware doesn't ensure that data in | the CPU cache is identical to data in main memory), | ARCH_DMA_MINALIGN must be set so that the memory allocator | makes sure that kmalloc'ed buffer doesn't share a cache line with | the others. Regards, Clemens