public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Manfred Spraul" <manfred@colorfullife.com>
To: "Linux Bigot" <linuxopinion@yahoo.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: how to get virtual address from dma address
Date: Wed, 3 Oct 2001 23:30:57 +0200	[thread overview]
Message-ID: <000b01c14c52$b4de6eb0$010411ac@local> (raw)

> 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.
All
 * 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
dma_addr,
                                    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.

--
    Manfred


             reply	other threads:[~2001-10-03 21:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-03 21:30 Manfred Spraul [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-03 22:44 how to get virtual address from dma address James Bottomley
2001-10-04  0:24 ` David S. Miller
2001-10-04 10:11   ` BALBIR SINGH
2001-10-04 11:16     ` David S. Miller
2001-10-04 15:37   ` James Bottomley
2001-10-05 14:06 ` Jes Sorensen
2001-10-06  8:06   ` Paul Mackerras
2001-10-06  8:38     ` David S. Miller
2001-10-06 12:18       ` Paul Mackerras
2001-10-06 14:45         ` James Bottomley
2001-10-06 16:51           ` Gérard Roudier
2001-10-06 17:23         ` Jes Sorensen
2001-10-07  2:13           ` Paul Mackerras
2001-10-07 17:40             ` Jes Sorensen
2001-10-07  7:21           ` Gérard Roudier
2001-10-07 16:23             ` James Bottomley
2001-10-07 18:24               ` Gérard Roudier
2001-10-07 23:02                 ` James Bottomley
2001-10-08 21:06                   ` Gérard Roudier
     [not found]       ` <mailman.1002371041.9232.linux-kernel2news@redhat.com>
2001-10-06 18:19         ` Pete Zaitcev
     [not found]   ` <mailman.1002355920.6872.linux-kernel2news@redhat.com>
2001-10-06 18:04     ` Pete Zaitcev
     [not found] <Pine.LNX.4.21.0110031525370.14852-100000@pogo.esscom.com>
2001-10-03 21:48 ` Linux Bigot
2001-10-03 22:03   ` Ben Collins
2001-10-05 14:04   ` Jes Sorensen
2001-10-03 16:37 Linux Bigot
2001-10-03 19:32 ` Ben Collins
2001-10-03 21:11   ` Linux Bigot
2001-10-03 21:23     ` Ben Collins
2001-10-03 14:11 Linux Bigot
2001-10-03 15:25 ` Jes Sorensen

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='000b01c14c52$b4de6eb0$010411ac@local' \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxopinion@yahoo.com \
    /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