From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] I/O Access Abstractions
Date: Tue, 3 Jul 2001 16:38:02 +0200 [thread overview]
Message-ID: <20010703143802.4361@smtp.adsl.oleane.com> (raw)
In-Reply-To: <E15HOtJ-0007cN-00@the-village.bc.nu>
In-Reply-To: <E15HOtJ-0007cN-00@the-village.bc.nu>
>> I'm more concerned about having all that space mapped permanently in
>> kernel virtual space. I'd prefer mapping on-demand, and that would
>> require a specific ioremap for IOs.
>
>I have no problem with the idea of a function to indicate which I/O maps you
>are and are not using. But passing resource structs around is way too heavy
Too heavy for inx/outx, I agree, but why too heavy to ioremap ? That would
make a clean abstract implementation, with a semantic like "prepare this
resource for use by the driver". A kind of generic ioremap for IOs, resources,
and whatever another bus type may want to define, returning a token that is
to be passed to readx/writex in all cases but PIO, where it's passed to
inx/outx. That souds to me like the most flexible mecanism, and the small
bit of overhead of passing the resource pointer is done _once_, usually
at driver init.
Something like
iomap_resource(struct resource *);
iounmap_resource(struct resource *);
Eventually, we can have it more fine grained in case where the driver don't
need the entire resource (maybe useful for framebuffers exporting very large
double-endian apertures where only one half is needed).
iomap_resource(struct resource *, unsigned long offset, unsigned long
size);
iounmap_resource(struct resource *, unsigned long offset, unsigned
long size);
The implementation would just call ioremap/iounmap for memory type resources,
and the identity for IO resources on x86. Other archs can then play whatever
tricks, like placing cookies in there.
One thing I have in mind here is the ability for things like embedded that
can have weird bus types, to have additional flags in the resources taken
into account by iomap/unmap to locate the proper bus, or build the proper
cookie that will be used by inx/outx, or define some access attributes
depending on other resource flags (write combine ?).
Ben.
next prev parent reply other threads:[~2001-07-03 14:37 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-28 13:13 [RFC] I/O Access Abstractions David Howells
2001-06-28 13:32 ` Alan Cox
2001-06-28 13:55 ` David Woodhouse
2001-06-28 16:02 ` Jes Sorensen
2001-06-29 8:31 ` David Howells
2001-06-29 21:02 ` Jes Sorensen
2001-07-02 14:22 ` David Woodhouse
2001-07-02 15:57 ` David Howells
2001-07-02 16:17 ` David Woodhouse
2001-07-02 16:20 ` Alan Cox
2001-07-02 16:41 ` David Woodhouse
2001-07-02 16:56 ` Alan Cox
2001-07-02 18:22 ` Russell King
2001-07-02 18:26 ` Jeff Garzik
2001-07-02 20:10 ` Alan Cox
2001-07-02 22:08 ` Benjamin Herrenschmidt
2001-07-02 22:15 ` Alan Cox
2001-07-02 23:54 ` Benjamin Herrenschmidt
2001-07-03 12:02 ` Alan Cox
2001-07-03 14:38 ` Benjamin Herrenschmidt [this message]
2001-07-03 2:06 ` Jeff Garzik
2001-07-03 8:38 ` David Howells
2001-07-07 11:27 ` Geert Uytterhoeven
2001-07-03 8:15 ` David Howells
2001-07-03 8:22 ` Jeff Garzik
2001-07-03 8:31 ` Jeff Garzik
2001-07-03 9:00 ` David Howells
2001-07-03 9:29 ` Jeff Garzik
2001-07-02 22:10 ` Benjamin Herrenschmidt
2001-07-03 8:04 ` David Howells
2001-07-03 7:55 ` David Howells
2001-07-03 8:00 ` Jeff Garzik
2001-07-03 8:07 ` David Howells
2001-07-03 11:53 ` Alan Cox
2001-07-07 11:26 ` Geert Uytterhoeven
[not found] <20010702191129.A29246@flint.arm.linux.org.uk>
2001-07-03 8:12 ` David Howells
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=20010703143802.4361@smtp.adsl.oleane.com \
--to=benh@kernel.crashing.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.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