linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: Dan Carpenter
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: RDMA/cxgb4: Support on-chip SQs
Date: Wed, 30 Jan 2013 15:18:40 -0700	[thread overview]
Message-ID: <20130130221840.GA6928@obsidianresearch.com> (raw)
In-Reply-To: <510995DC.4020602-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

On Wed, Jan 30, 2013 at 03:51:24PM -0600, Steve Wise wrote:
> On 1/30/2013 3:44 PM, Jason Gunthorpe wrote:
> >On Wed, Jan 30, 2013 at 03:36:48PM -0600, Steve Wise wrote:
> >>I wonder, then, what the correct service is to get the cpu physical
> >>address from a kernel virtual address returned from
> >>dma_alloc_coherent()?  I think this is correct as-is, since I think
> >>dma_alloc_coherent() falls under the "directly mapped" addresses in
> >>the virt_to_phys() prototype comment.
> >DMA-API.txt says:
> >
> >  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 instead of virt_to_phys you should use dma_addr??
> 
> I don't think so.  The result of virt_to_phys() is used in
> remap_pfn_range() to map this memory into user space...  The
> dma_addr is give to HW for DMA operations.

Oh now I see what this is for.. I've looked at this kind of question
before and I didn't find a satisfactory answer either :(

Just a quick perusal around, it looks like the DRM code (drm_vm) is
using virt_to_page/page_to_pfn/remap_pfn_range for its consistent
mappings.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-01-30 22:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 21:00 RDMA/cxgb4: Support on-chip SQs Dan Carpenter
     [not found] ` <20130130210006.GA22134-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-01-30 21:36   ` Steve Wise
     [not found]     ` <51099270.5070406-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-01-30 21:44       ` Jason Gunthorpe
     [not found]         ` <20130130214425.GA5674-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-01-30 21:51           ` Steve Wise
     [not found]             ` <510995DC.4020602-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-01-30 22:18               ` Jason Gunthorpe [this message]
2013-01-30 22:34           ` Roland Dreier
     [not found]             ` <CAL1RGDXQW44TTaCZ0rzBAXG1oK3EsiKJXj5+cA1jUJHb85VFNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-30 22:49               ` Steve Wise
2013-01-30 21:45       ` Dan Carpenter
2013-01-30 21:52         ` Steve Wise
     [not found]           ` <51099622.40505-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-01-30 22:17             ` Steve Wise
2013-03-23 21:30       ` Dan Carpenter
2013-03-23 22:54         ` Steve Wise
2013-03-25 16:14         ` Roland Dreier

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=20130130221840.GA6928@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.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;
as well as URLs for NNTP newsgroup(s).