lkml.org 
[lkml]   [2001]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: how to get virtual address from dma address
Date
From
> Linux> All programmers I am relatively new to linux kernel. Please
> Linux> advise what is the safe way to get the original virtaul address
> Linux> from dma address e.g.,

> You have to store the address you pass to pci_map_single() somewhere
> in your data structures together with the dma address.

Yes, but speaking as someone who had to use a large hammer to convert his
driver from bus_to_virt et al., it does seem rather hard not to have the
equivalent for the new pci_dma paradigm. It does present an obstacle
persuading people to convert drivers, particularly if the hardware is going to
present a linked list of addresses (as SCSI hardware often does).

After all, whatever device maps between the io bus and the memory bus, it must
always map a given dma_addr_t to a known physical address. It can't be that
hard to provide an an API in the kernel which can compute this relationship
(although I can see it may be expensive to walk iommu page tables). I'm only
really asking for a dma_addr_t to virtual address by the way. I see that
mapping the other way would be problematic.

James Bottomley


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:04    [W:0.123 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site