Re: [PATCH] usb: Add driver for Altus Metrum ChaosKey device

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

 



On Thu, 2015-03-19 at 20:25 -0700, Keith Packard wrote:
> > That is a violation of the DMA rules on non-coherent architectures.
> > The buffer must be allocated separately.
> 
> Ok, I'm not sure I understand the reasoning given that both come from
> kmalloc, but that's easy to do.


That happens on non-coherent architectures.
Suppose you do DMA into a buffer. The data will go into RAM and only
into RAM (by definition). So if you evaluate the buffer you must read
from RAM, not the cache. To assure that we write out and invalidate
the cache line. If, however, you read or write into the same cache line
the CPU will cache the buffer again. And if the line is laundered after
the DMA, the old content is written back.

kmalloc() on those architectures guarantees that separate allocations
don't share a cache line.

	Regards
		Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux