public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-kernel@vger.kernel.org, tony.luck@intel.com,
	iommu@lists.linux-foundation.org, mingo@redhat.com,
	kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH 3/3] swiotlb: use GFP_DMA32 instead of GFP_DMA in swiotlb_alloc_coherent
Date: Wed, 3 Sep 2008 22:05:27 +0200	[thread overview]
Message-ID: <20080903200527.GD16706@8bytes.org> (raw)
In-Reply-To: <1220465065-10533-4-git-send-email-fujita.tomonori@lab.ntt.co.jp>

On Thu, Sep 04, 2008 at 03:04:25AM +0900, FUJITA Tomonori wrote:
> x86 sets up gfp flag propely so swiotlb_alloc_coherent doesn't need to
> use GFP_DMA unconditionally. It leads to allocation failures in some
> systems.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  lib/swiotlb.c |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> index 977edbd..b88d7c2 100644
> --- a/lib/swiotlb.c
> +++ b/lib/swiotlb.c
> @@ -467,12 +467,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
>  	void *ret;
>  	int order = get_order(size);
>  
> -	/*
> -	 * XXX fix me: the DMA API should pass us an explicit DMA mask
> -	 * instead, or use ZONE_DMA32 (ia64 overloads ZONE_DMA to be a ~32
> -	 * bit range instead of a 16MB one).
> -	 */
> -	flags |= GFP_DMA;
> +	flags |= GFP_DMA32;

No. This is exactly the place where the swiotlb iommu implementation
should handle the dma_mask of the specific device. Unconditionally use
DMA32 here is not the best possible handling.

Joerg


  reply	other threads:[~2008-09-03 20:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 15:03 [PATCH] swiotlb: fix dma_alloc_coherent allocation failures with swiotlb Joerg Roedel
2008-09-03 18:04 ` [PATCH 0/3] fix swiotlb allocation gfp flag FUJITA Tomonori
2008-09-03 18:04   ` [PATCH 1/3] x86: remove the NULL device hack in dma-mapping.h FUJITA Tomonori
2008-09-03 18:04     ` [PATCH 2/3] x86: set gfp flag properly for swiotlb_alloc_coherent FUJITA Tomonori
2008-09-03 18:04       ` [PATCH 3/3] swiotlb: use GFP_DMA32 instead of GFP_DMA in swiotlb_alloc_coherent FUJITA Tomonori
2008-09-03 20:05         ` Joerg Roedel [this message]
2008-09-04  4:11           ` FUJITA Tomonori
2008-09-03 18:54     ` [PATCH 1/3] x86: remove the NULL device hack in dma-mapping.h FUJITA Tomonori
2008-09-03 20:01     ` Joerg Roedel
2008-09-04  4:11       ` FUJITA Tomonori
2008-09-04 10:00         ` Joerg Roedel
2008-09-04 12:50           ` FUJITA Tomonori
2008-09-03 18:05 ` [PATCH] swiotlb: fix dma_alloc_coherent allocation failures with swiotlb FUJITA Tomonori
2008-09-03 19:54   ` Joerg Roedel
2008-09-03 20:11     ` Joerg Roedel
2008-09-04  4:11     ` FUJITA Tomonori
2008-09-03 22:09 ` Andi Kleen
2008-09-04  4:11   ` FUJITA Tomonori
2008-09-04  7:44     ` Andi Kleen
2008-09-04  7:58       ` FUJITA Tomonori
2008-09-04  8:05         ` Andi Kleen
2008-09-04  8:18           ` FUJITA Tomonori
2008-09-04  8:31             ` Andi Kleen
2008-09-04  9:49               ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080903200527.GD16706@8bytes.org \
    --to=joro@8bytes.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox