public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	muli@il.ibm.com
Subject: Re: [PATCH 1/8] x86: add alloc_coherent dma_ops callback to GART driver
Date: Thu, 21 Aug 2008 17:17:24 +0200	[thread overview]
Message-ID: <20080821151724.GB3189@amd.com> (raw)
In-Reply-To: <20080821225038E.fujita.tomonori@lab.ntt.co.jp>

On Thu, Aug 21, 2008 at 11:16:49PM +0900, FUJITA Tomonori wrote:
> On Tue, 19 Aug 2008 16:32:39 +0200
> Joerg Roedel <joerg.roedel@amd.com> wrote:
> 
> > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> > ---
> >  arch/x86/kernel/pci-gart_64.c |   21 +++++++++++++++++++++
> >  1 files changed, 21 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
> > index 4d8efb0..44a75a6 100644
> > --- a/arch/x86/kernel/pci-gart_64.c
> > +++ b/arch/x86/kernel/pci-gart_64.c
> > @@ -506,6 +506,26 @@ error:
> >  	return 0;
> >  }
> >  
> > +/* allocate and map a coherent mapping */
> > +static void *
> > +gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
> > +		    gfp_t flag)
> > +{
> > +	void *vaddr;
> > +
> > +	vaddr = (void *)__get_free_pages(flag, get_order(size));
> > +	if (!vaddr)
> > +		return NULL;
> > +
> > +	*dma_addr = gart_map_single(dev, __pa(vaddr), size, DMA_BIDIRECTIONAL);
> > +	if (*dma_addr != bad_dma_address)
> > +		return vaddr;
> 
> I'm not sure a rule is documented or not, but I think that IOMMUs
> return zeroed memory wrt dma_alloc_coherent. The current pci-dma.c
> does, so I think that it would be better to keep the current behavior.

Ok, true. I will send and update patch to add this. Thanks.

Joerg

-- 
           |           AMD Saxony Limited Liability Company & Co. KG
 Operating |         Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 System    |                  Register Court Dresden: HRA 4896
 Research  |              General Partner authorized to represent:
 Center    |             AMD Saxony LLC (Wilmington, Delaware, US)
           | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy


  reply	other threads:[~2008-08-21 15:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-19 14:32 [PATCH 0/8] x86 dma_*_coherent rework patchset v2 Joerg Roedel
2008-08-19 14:32 ` [PATCH 1/8] x86: add alloc_coherent dma_ops callback to GART driver Joerg Roedel
2008-08-21 14:16   ` FUJITA Tomonori
2008-08-21 15:17     ` Joerg Roedel [this message]
2008-08-21 17:28     ` [PATCH] x86: make gart_alloc_coherent return zeroed memory Joerg Roedel
2008-08-21 23:19       ` FUJITA Tomonori
2008-08-22  6:35         ` Joerg Roedel
2008-08-22  6:41           ` Ingo Molnar
2008-08-22  6:55             ` Joerg Roedel
2008-08-22  6:36         ` Ingo Molnar
2008-08-19 14:32 ` [PATCH 2/8] x86: add free_coherent dma_ops callback to GART driver Joerg Roedel
2008-08-19 14:32 ` [PATCH 3/8] x86: add free_coherent dma_ops callback to Calgary IOMMU driver Joerg Roedel
2008-08-19 14:32 ` [PATCH 4/8] x86: add alloc_coherent dma_ops callback to NOMMU driver Joerg Roedel
2008-08-19 14:32 ` [PATCH 5/8] x86: add free_coherent " Joerg Roedel
2008-08-19 14:32 ` [PATCH 6/8] x86: cleanup dma_*_coherent functions Joerg Roedel
2008-08-19 14:32 ` [PATCH 7/8] x86: move dma_*_coherent functions to include file Joerg Roedel
2008-08-19 14:32 ` [PATCH 8/8] x86, AMD IOMMU: remove obsolete FIXME comment Joerg Roedel
2008-08-20  9:46 ` [PATCH 0/8] x86 dma_*_coherent rework patchset v2 Ingo Molnar
2008-08-20 10:18   ` [PATCH] dma-coherent: export dma_[alloc|release]_from_coherent methods Ingo Molnar
2008-08-20 11:28     ` Joerg Roedel
2008-08-20 17:39   ` [PATCH 0/8] x86 dma_*_coherent rework patchset v2 Jesse Barnes
2008-08-21 12:00     ` Ingo Molnar
2008-08-21 14:16       ` FUJITA Tomonori
2008-08-21 15:07         ` Jesse Barnes
2008-08-22  7:09           ` Ingo Molnar
2008-08-21 15:20         ` Joerg Roedel
2008-08-21 14:16   ` FUJITA Tomonori
2008-08-21 15:12     ` FUJITA Tomonori
2008-08-22  6:44       ` Ingo Molnar
2008-08-22  6:57         ` FUJITA Tomonori
2008-08-22  7:04           ` Ingo Molnar
2008-08-22  7:29             ` FUJITA Tomonori
2008-08-22  8:23               ` Ingo Molnar

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=20080821151724.GB3189@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hpa@zytor.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=muli@il.ibm.com \
    --cc=tglx@linutronix.de \
    /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