lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0906030000410.3419@localhost.localdomain>
Date:	Wed, 3 Jun 2009 00:07:17 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Ian Campbell <ian.campbell@...rix.com>
cc:	linux-kernel@...r.kernel.org,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Jeremy Fitzhardinge <jeremy@...p.org>, x86@...nel.org
Subject: Re: [PATCH 03/11] x86: use dma_map_range when allocating PCI DMA
 memory

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@...rix.com>
> Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
> Cc: Jeremy Fitzhardinge <jeremy@...p.org>
> Cc: x86@...nel.org
> ---
>  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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ