Re: [PATCH 03/11] x86: use dma_map_range when allocating PCI DMAmemory

From: Thomas Gleixner
Date: Tue Jun 02 2009 - 18:13:55 EST


On Mon, 1 Jun 2009, Ian Campbell wrote:

> This function is intended to replaces is_buffer_dma_capable with a
> more generic interface.

-ENOPARSE

Which function ? What means "is intended to replaces" ? Is it intended
or does it replace something ? What is the "more generic interface" ?

dma_map_range() has been introduced in patch 2/11 so it would be nice
to have a reference to that change and take the existance of
dma_map_range() as granted. There is no intention. We replace function
A with function B and the blurb about intention and more generic
interface is useless and confusing.

Thanks,

tglx

> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
> Cc: x86@xxxxxxxxxx
> ---
> arch/x86/kernel/pci-dma.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
> index f4c1b03..458b7b5 100644
> --- a/arch/x86/kernel/pci-dma.c
> +++ b/arch/x86/kernel/pci-dma.c
> @@ -160,7 +160,6 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
> {
> unsigned long dma_mask;
> struct page *page;
> - dma_addr_t addr;
>
> dma_mask = dma_alloc_coherent_mask(dev, flag);
>
> @@ -170,8 +169,7 @@ again:
> if (!page)
> return NULL;
>
> - addr = page_to_phys(page);
> - if (!is_buffer_dma_capable(dma_mask, addr, size)) {
> + if (!dma_map_range(dev, dma_mask, page_to_phys(page), size, dma_addr)) {
> __free_pages(page, get_order(size));
>
> if (dma_mask < DMA_BIT_MASK(32) && !(flag & GFP_DMA)) {
> @@ -182,7 +180,6 @@ again:
> return NULL;
> }
>
> - *dma_addr = addr;
> return page_address(page);
> }
>
> --
> 1.5.6.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/