From: Linus Torvalds <torvalds@osdl.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: ralf@linux-mips.org,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>
Subject: Re: [RFC] Changing pci_iounmap to take 'bar' argument
Date: Thu, 26 May 2005 08:21:07 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0505260813510.2307@ppc970.osdl.org> (raw)
In-Reply-To: <1117083357.9076.49.camel@gaston>
On Thu, 26 May 2005, Benjamin Herrenschmidt wrote:
>
> foo = pci_iomap(dev, bar, pci_resource_len(dev, bar));
Btw, this kind of code should be just
foo = pci_iomap(dev, bar, 0);
because the third argument is _not_ a length, it's a _maximum_ length we
need to map, with zero meaning "everything" (as does ~0ul, of course, but
zero is obviously easier).
The only people who want to use non-zero are things like frame-buffers
that might have hundreds of megabytes of memory, but the kernel only needs
to map the actual thing visible on the screen.
> And in a completely different function, a simple
>
> pci_iounmap(dev, foo);
>
> It may be simpler indeed for me to actually only complicate the ppc &
> ppc64 pci_iounmap() implementation and have it compare the virtual
> address against known PCI IO spaces...
Yeah. It shouldn't be a problem on 64-bit architectures, and even on
32-bit ones the IO-port range really _should_ be fairly small, and a small
amount of special casing should hopefully fix it.
A lot of architectures end up having to separate PIO and MMIO anyway,
which is - together with hysterical raisins, of course - why the existing
interfaces just assumed that was possible.
Linus
next prev parent reply other threads:[~2005-05-26 15:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-26 4:07 Benjamin Herrenschmidt
2005-05-26 4:25 ` Linus Torvalds
2005-05-26 4:27 ` Benjamin Herrenschmidt
2005-05-26 4:30 ` Benjamin Herrenschmidt
2005-05-26 4:55 ` Benjamin Herrenschmidt
2005-05-26 15:21 ` Linus Torvalds [this message]
2005-05-28 20:08 ` Russell King
2005-05-26 22:53 ` Greg KH
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=Pine.LNX.4.58.0505260813510.2307@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.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
all inboxes | Powered by JetHome®