Re: [PATCH v3] ad7877: keep dma rx buffers in seperate cache lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 11, 2010 at 16:21, Christoph Lameter wrote:
> On Tue, 11 May 2010, Mike Frysinger wrote:
>> and like i said, that doesnt sound like a reasonable solution when
>> every single SPI driver (over 100 atm) out there is affected
>
> If you are on an embedded arch then you can of course set the default
> kmalloc alignment.
>
> The requirement for kmalloc is that it returns memory that can be used for
> DMA. If the arch can only DMA into cacheline aligned objects then the
> correct method is to force kmalloc alignment to cacheline size.

these are SPI drivers and are usable on any arch that supports a SPI
bus (which is pretty much every arch).  forget about "embedded"
arches.

the issue here is simple: a SPI driver (AD7877) needs to do a receive
SPI transfer into a DMA safe buffer.  what is the exact API to
dynamically allocate memory for the structure with this buffer
embedded in it such that the start of the structure is cached aligned
?  creating a dedicated kmem cache may work, but it isnt a scalable
solution if every SPI driver needs to create its own cache.

On Tue, May 11, 2010 at 16:22, Pekka Enberg wrote:
> Why do you need to do it in every driver? Why not create a cache of
> size cache_line_size()*2 or something in the SPI stack and add a
> helper function spi_alloc_whatever_this_is_about() for the drivers to
> use?

that is a question for David/Grant.  i'm not the SPI core maintainer,
i'm merely watching over some SPI drivers.  however, this answer also
doesnt sound like it's thinking big enough because what you're
proposing isnt specific to the SPI bus -- any time a DMA safe buffer
is needed dynamically, this function could be used.
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux