public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 03/04] videobuf: Add physically contiguous queue code V2
Date: Tue, 15 Jul 2008 03:48:50 +0000	[thread overview]
Message-ID: <20080715034850.GA3722@linux-sh.org> (raw)
In-Reply-To: <20080705025405.27137.16206.sendpatchset@rx1.opensource.se>

On Mon, Jul 14, 2008 at 12:51:55PM +0900, Magnus Damm wrote:
> Both (__pa(mem->vaddr) >> PAGE_SHIFT) and (mem->dma_handle >>
> PAGE_SHIFT) work well with the current dma_alloc_coherent()
> implementation on SuperH. I do however lean towards using
> __pa(mem->vaddr) over mem->dma_handle, since I suspect that
> mem->dma_handle doesn't have to be a physical address.
> 
> Paul, any thoughts about this? Can we assume that the dma_handle
> returned from dma_alloc_coherent() is a physical address, or is it
> better to use __pa() on the virtual address to get the pfn?
> 
It's a physical address as far as the dma_handle users are concerned, how
that actually translates across the bus is another matter. (The corner
cases end up being things like Cell that DMA in to virtual addresses via
IOMMU translations).

Documentation/DMA-API.txt simply states:

	This routine allocates a region of <size> bytes of consistent memory.
	It also returns a <dma_handle> which may be cast to an unsigned
	integer the same width as the bus and used as the physical address
	base of the region.

so as far as we are concerned, using dma_handle is saner than going the __pa()
route.

  parent reply	other threads:[~2008-07-15  3:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05  2:53 [PATCH 00/04] soc_camera: SuperH Mobile CEU support V2 Magnus Damm
2008-07-05  2:53 ` [PATCH 01/04] soc_camera: Move spinlocks Magnus Damm
2008-07-05  4:19   ` Guennadi Liakhovetski
2008-07-05  4:24     ` Magnus Damm
2008-07-05  2:53 ` [PATCH 02/04] soc_camera: Add 16-bit bus width support Magnus Damm
2008-07-05  2:54 ` [PATCH 03/04] videobuf: Add physically contiguous queue code V2 Magnus Damm
2008-07-08 14:33   ` [PATCH 03/04] videobuf: Add physically contiguous queue code Paulius Zaleckas
2008-07-08 14:42     ` [PATCH 03/04] videobuf: Add physically contiguous queue code V2 Laurent Pinchart
2008-07-09  8:33       ` Magnus Damm
2008-07-11 21:33     ` Guennadi Liakhovetski
2008-07-14  3:51       ` Magnus Damm
2008-07-14  9:25         ` [PATCH 03/04] videobuf: Add physically contiguous queue code Paulius Zaleckas
2008-07-11 13:38   ` [PATCH 03/04] videobuf: Add physically contiguous queue code V2 Karicheri, Muralidharan
2008-07-15  3:48   ` Paul Mundt [this message]
2008-07-15  8:28     ` Magnus Damm
2008-07-05  2:54 ` [PATCH 04/04] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver V2 Magnus Damm

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=20080715034850.GA3722@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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