From: Dan Malek <dan@embeddededge.com>
To: Paul Mackerras <paulus@samba.org>
Cc: David Gibson <david@gibson.dropbear.id.au>,
linuxppc-embedded@lists.linuxppc.org
Subject: Re: First cut at large page support on 40x
Date: Wed, 12 Jun 2002 20:28:51 -0400 [thread overview]
Message-ID: <3D07E743.6090206@embeddededge.com> (raw)
In-Reply-To: 15623.56408.342901.245259@argo.ozlabs.ibm.com
Paul Mackerras wrote:
> This is an issue which is much wider than the question of what the PPC
> port should do. The linux-kernel@vger.kernel.org list is the
> appropriate place to discuss this sort of thing.
Yeah, right :-) I can't bear the signal to noise ratio out there :-)
> The PCI DMA API is designed so that drivers never need to translate
> between virtual and physical addresses themselves. Our API for local
> peripherals on embedded chips should do the same.
As far as I know, they do. Just call consistent_alloc() and keep track
of the addresses. At the time I implemented consistent_alloc(), I
updated all drivers I could test (and some that I couldn't :-) to do this.
At the time, there were PCI drivers on 4xx and 8xx that didn't do the
right thing with the pci_* functions, so I had to keep some kind of mapping
to make them work.
> "Well don't do that then" :) If you are calling pci_map_single on a
> vmalloc'd address you are living dangerously even if virt_to_* does
> use iopa, since vmalloc'd memory is not physically contiguous.
>
>
>>doing this or are they doing it correctly? I don't know, but I do know
>>if they call these functions we better return the right answer.
>
>
> Hitting a BUG() would be more appropriate in these cases.
I know, but the higher level functions are sufficiently disjoint that you
can't keep context across them to know if someone is doing something bad.
I guess we could just check for an address in the VMALLOC space and not
translate that, but then I'll get criticized for adding code into that
fast virt_to_* path :-) You also don't know, in the case of noncoherent
processors, that the virtual mapping you received is from a 'vmalloc'
space, even though it was done properly for DMA. It's one thing to call
vmalloc() and try to do DMA, and it's another to use an alternate mapping
to properly implement a feature under a standard interface.
So, just toss iopa(), use the macros in their standard way, and see how
long we run before the system crashes (SCSI drivers, eepro100,... :-)
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-06-13 0:28 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-31 4:21 First cut at large page support on 40x David Gibson
2002-05-31 4:31 ` David Gibson
2002-06-04 0:43 ` Dan Malek
2002-06-04 3:59 ` David Gibson
2002-06-04 17:42 ` Dan Malek
2002-06-05 0:10 ` David Gibson
2002-06-05 17:25 ` Dan Malek
2002-06-06 1:35 ` David Gibson
2002-06-06 4:57 ` Dan Malek
2002-06-05 22:29 ` Paul Mackerras
2002-06-06 4:48 ` Dan Malek
2002-06-06 5:44 ` Paul Mackerras
2002-06-06 7:58 ` Dan Malek
2002-06-06 8:17 ` David Gibson
2002-06-12 3:52 ` David Gibson
2002-06-12 6:15 ` Dan Malek
2002-06-12 6:43 ` David Gibson
2002-06-12 15:19 ` Tom Rini
2002-06-12 23:23 ` Dan Malek
2002-06-12 23:42 ` Paul Mackerras
2002-06-13 0:28 ` Dan Malek [this message]
2002-06-13 1:01 ` Paul Mackerras
2002-06-13 4:16 ` Dan Malek
2002-06-13 5:12 ` David Gibson
2002-06-13 7:26 ` Dan Malek
2002-06-13 1:38 ` Paul Mackerras
2002-06-13 4:47 ` Dan Malek
2002-06-13 18:13 ` Armin
2002-06-14 0:33 ` David Gibson
2002-06-12 23:49 ` Paul Mackerras
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=3D07E743.6090206@embeddededge.com \
--to=dan@embeddededge.com \
--cc=david@gibson.dropbear.id.au \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=paulus@samba.org \
/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;
as well as URLs for NNTP newsgroup(s).