mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: jt@hpl.hp.com, 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 18:24:05 -0800	[thread overview]
Message-ID: <20020226182405.A18274@bougret.hpl.hp.com> (raw)
In-Reply-To: <20020226174657.A18197@bougret.hpl.hp.com> <20020226175353.B18197@bougret.hpl.hp.com> <3C7C4043.893429A9@mandrakesoft.com>
In-Reply-To: <3C7C4043.893429A9@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Tue, Feb 26, 2002 at 09:11:15PM -0500

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...
	Just define something like :
------------------------------------------
static inline dma_addr_t pci_map_alloc(struct pci_dev *hwdev, void *ptr)
{
	ret virt_to_phys(ptr);
}
------------------------------------------

> Note for ISA (and EISA and VLB) devices, you also call
> pci_alloc_consistent.  You pass NULL for the pci device.

	That's what I do. But I don't claim it's tested.
	By the way, it seems weird to prefix all those functions with
"pci_" where in fact they are only loosely related to PCI stuff.
	Also, on the inconsistent side, most functions handle pci_dev
== NULL, but not all, and it's not well documented. For example, if
you pass NULL to pci_set_dma_mask(), it will kaboom !

> 	Jeff

	Jean

  reply	other threads:[~2002-02-27  2:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27  1:46 Jean Tourrilhes
2002-02-27  1:53 ` Jean Tourrilhes
2002-02-27  2:11   ` Jeff Garzik
2002-02-27  2:24     ` Jean Tourrilhes [this message]
2002-02-27  3:03       ` Jeff Garzik
     [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=20020226182405.A18274@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®