[lkml]   [2001]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectkmalloc(..., GFP_ATOMIC) buffers contiguous - hence suitable for PCI DMA?
Hi folks!

(I have looked up in the archive the linux-kernel threads for kwds
"DMA, contiguous, address" before writing this mail, and read the
corresponding threads.)

I am trying to port some driver to Linux2.4/i386. I have just read
the "Linux device drivers" book by A.Rubini, and this is what he
says there in Ch.13 "Mmap & DMA", on the GFP_DMA allocator flag:

"The kernel guarantees that DMA-capable buffers have 2 features.
1st, the phys. addrs must be conseccutive when get_free_page()
returns > 1 page (but this is always true, indep. of GFP_DMA,
because the kernel arranges free memory in clusters of consecutive pages).
And second, when GFP_DMA is set, the kernel guarantees that only addrs lower
than MAX_DMA_ADDRESS are returned. The macro MAX_DMA_ADDRESS is set to 16MB
on the PC, to deal with the
ISA [...].

As far as PCI is concerned, there's no MAX_DMA_ADDRESS limit,
and a PCI dev. driver should avoid setting GFP_DMA when
allocating its buffers."

Is this really still true at kernels 2.2 and on? (The book
refers to 2.1.43 as to the most modern version as of the time
of its writing) I.e., can I just assume a buffer which I know
to have been successfully allocated with just a
kmalloc(..., GFP_ATOMIC)
will be physically contiguous and hence suitable for PCI DMA?

I tried to understand the corresponding code path in mm/slab.c,
but failed to come up with a 100%-assuring opinion out of it.

The driver and the device at present are not oriented for
doing scatter-gather.

TIA for any possible help,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.029 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site