All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: jt@hpl.hp.com
Cc: Jaroslav Kysela <perex@suse.cz>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.5.5] Conversion of hp100 to new PCI interface
Date: Tue, 26 Feb 2002 22:03:08 -0500	[thread overview]
Message-ID: <3C7C4C6C.6921F967@mandrakesoft.com> (raw)
In-Reply-To: <20020226174657.A18197@bougret.hpl.hp.com> <20020226175353.B18197@bougret.hpl.hp.com> <3C7C4043.893429A9@mandrakesoft.com> <20020226182405.A18274@bougret.hpl.hp.com>

Jean Tourrilhes wrote:
> 
> On Tue, Feb 26, 2002 at 09:11:15PM -0500, Jeff Garzik wrote:
> > >
> > > +       /* Conversion to new PCI API :
> > > +        * The memory block we use, lp->page_vaddr, was DMA allocated via
> > > +        * pci_alloc_consistent(), so we just need to "retreive" the
> > > +        * original mapping to bus/phys address - Jean II */
> > >         ringptr->pdl = pdlptr + 1;
> > > -       ringptr->pdl_paddr = virt_to_bus(pdlptr + 1);
> > > +       ringptr->pdl_paddr = virt_to_phys(pdlptr + 1);
> >
> > Nope..  You need to use the mapping value obtained from
> > pci_alloc_consistent...
> 
>         I don't understand the objection. The memory has been declared
> as DMA and the system already manages it as such. What's the catch ?
>         If I can't use virt_to_phys(), can I have a function that does
> exactly the same ? The new API is heavy enough, and if drivers can't
> have something like this it's just messy...

It's not portable, and there's no reason to keep recalculating the value
on those platforms where it does work.  You need to store the mapping
value for later use.

Read the section "Optimizing Unmap State Space Consumption" in
Documentation/DMA-mapping.txt for some examples and information WRT
pci_map_xxx/pci_unmap_xxx too.

	Jeff



-- 
Jeff Garzik      | "UNIX enhancements aren't."
Building 1024    |           -- says /usr/games/fortune
MandrakeSoft     |

  reply	other threads:[~2002-02-27  3:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27  1:46 [PATCH 2.5.5] Conversion of hp100 to new PCI interface Jean Tourrilhes
2002-02-27  1:53 ` Jean Tourrilhes
2002-02-27  2:11   ` Jeff Garzik
2002-02-27  2:24     ` Jean Tourrilhes
2002-02-27  3:03       ` Jeff Garzik [this message]
     [not found]       ` <3C7D87AD.A9A25027@mandrakesoft.com>
2002-03-04 20:06         ` Jean Tourrilhes

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=3C7C4C6C.6921F967@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.