linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: virt_to_page/pci_map_page vs. pci_map_single
@ 2003-11-03 18:48 James Bottomley
  2003-11-03 22:03 ` Jamie Wellnitz
  2003-11-04  9:48 ` Jes Sorensen
  0 siblings, 2 replies; 17+ messages in thread
From: James Bottomley @ 2003-11-03 18:48 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Jamie Wellnitz, Linux Kernel



    Jamie> The Document/DMA-mapping.txt in 2.6.0-test9 says "To map a
    Jamie> single region, you do:" and then shows pci_map_single.  Is
    Jamie> DMA-mapping.txt in need of patching?
    
    Sounds like it needs an update.
    
Erm, I don't think so.  pci_map_single() covers a different use case
from pci_map_page().

The thing pci_map_single() can do that pci_map_page() can't is cope with
contiguous regions greater than PAGE_SIZE in length (which you get
either from kmalloc() or __get_free_pages()).  This feature is used in
the SCSI layer for instance.

There has been talk of deprecating dma_map_single() in favour of
dma_map_sg() (i.e. make all transfers use scatter/gather and eliminate
dma_map_single() in favour of a single sg entry table) but nothing has
been done about it (at least as far as I know).

James



^ permalink raw reply	[flat|nested] 17+ messages in thread
[parent not found: <NuZH.1a5.7@gated-at.bofh.it>]
* virt_to_page/pci_map_page vs. pci_map_single
@ 2003-11-02 18:12 Jamie Wellnitz
  2003-11-03  8:10 ` Jes Sorensen
  0 siblings, 1 reply; 17+ messages in thread
From: Jamie Wellnitz @ 2003-11-02 18:12 UTC (permalink / raw)
  To: linux-kernel

I see code similar to the following in a few drivers (qlogicfc,
sym53c8xx, acenic does something similar):

page = virt_to_page(buffer);
offset = ((unsigned long)buffer & ~PAGE_MASK);
busaddr = pci_map_page(pci_dev, page, offset, len, direction);

How is this preferable to:

pci_map_single( pci_dev, buffer, len, direction);

?

pci_map_single can't handle highmem pages (because they don't have a
kernel virtual address) but doesn't virt_to_page suffer from the same
limitation?  Is there some benefit on architectures that don't have
highmem?

Thanks,
Jamie Wellnitz
Jamie.Wellnitz@emulex.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2003-11-06  8:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-03 18:48 virt_to_page/pci_map_page vs. pci_map_single James Bottomley
2003-11-03 22:03 ` Jamie Wellnitz
2003-11-04  9:48 ` Jes Sorensen
2003-11-04 16:35   ` Matt Porter
2003-11-04 16:47     ` James Bottomley
2003-11-04 17:11       ` Matt Porter
2003-11-04 16:43   ` James Bottomley
2003-11-05 16:23     ` Anton Blanchard
2003-11-06  8:28     ` Jes Sorensen
     [not found] <NuZH.1a5.7@gated-at.bofh.it>
     [not found] ` <NI6s.1MM.3@gated-at.bofh.it>
     [not found]   ` <NMtC.7Vs.21@gated-at.bofh.it>
     [not found]     ` <NNSy.1Cd.1@gated-at.bofh.it>
     [not found]       ` <NV3O.5w7.19@gated-at.bofh.it>
     [not found]         ` <NWCA.7Qv.19@gated-at.bofh.it>
2003-11-04  8:41           ` Ihar 'Philips' Filipau
  -- strict thread matches above, loose matches on Subject: below --
2003-11-02 18:12 Jamie Wellnitz
2003-11-03  8:10 ` Jes Sorensen
2003-11-03 12:52   ` Jamie Wellnitz
2003-11-03 14:17     ` Jes Sorensen
2003-11-03 22:02       ` David Mosberger
2003-11-04  0:41         ` David S. Miller
2003-11-04  9:44         ` Jes Sorensen

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).