[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
> Then why isn't there a call like pci_unmap_single()

<<< linux/include/asm-i386/pci.h:
/* Unmap a single streaming mode DMA translation. The dma_addr and size
* must match what was provided for in a previous pci_map_single call.
* other usages are undefined.
* After this call, reads by the cpu to the buffer are guarenteed to see
* whatever the device wrote there.
static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t
size_t size, int direction)

Please try to store both the dma address and the virtual address in your
driver and use pci_map_single().
I'm aware of one case where that's not possible: if your hardware builds
a linked list of finished commands, and that list is in DMA addresses,
not virtual addresses.
I think both sym53c8xx and one of the USB controllers (usb-ohci.c?) have
that problem, they use a hash table for the reverse dma address->linear
address mapping.

I hope that answers your question.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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