public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Russell King <rmk@arm.linux.org.uk>,
	David Woodhouse <dwmw2@infradead.org>,
	David Howells <dhowells@redhat.com>,
	Jes Sorensen <jes@sunsite.dk>,
	linux-kernel@vger.kernel.org, arjanv@redhat.com,
	Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [RFC] I/O Access Abstractions
Date: Tue, 03 Jul 2001 09:38:49 +0100	[thread overview]
Message-ID: <3993.994149529@warthog.cambridge.redhat.com> (raw)
In-Reply-To: Message from Jeff Garzik <jgarzik@mandrakesoft.com>  of "Mon, 02 Jul 2001 22:06:29 EDT." <3B4128A5.636ED850@mandrakesoft.com>


Jeff Garzik <jgarzik@mandrakesoft.com> wrote:
> Alan Cox wrote:
> > 
> > > > >       You pass a single cookie to the readb code
> > > > >       Odd platforms decode it
> > > >
> > > > Last time I checked, ioremap didn't work for inb() and outb().
> > >
> > > It should :)
> > 
> > it doesnt need to.
> > 
> > pci_find_device returns the io address and can return a cookie, ditto
> > isapnp etc
> 
> Is the idea here to mitigate the amount of driver code changes, or
> something else?

A number of things:

 * It ought to be easier to deal with having a number of ways of accessing
   resources if you just had an ops table with each struct resource. This
   would allow the bus driver to provide each resource of each device on that
   bus with a set of operations for accessing registers within that resource,
   no matter what the actual mechanism for doing so. For example:

	* direct I/O port accesses
	* direct memory-mapped I/O accesses
	* address port/data port accesses (eg: pcnet32, PCI config, etc.)
	* hide sparse I/O port accesses (eg: non-adjacent 16550 registers)
	* small-window CPU->PCI bus mapping
	* emulation of I/O port range through memory window

   Note that any number of these things can exist on the same architecture, or
   even the same platform (the GEODE GX1 & SC1200 being excellent examples).

 * It should make drivers easier to write: they don't have to worry about
   whether a resource refers to memory or to I/O or to something more exotic.

 * It makes some drivers more flexible. For example, the ne2k-pci driver has
   to be set at _compile_ time to use _either_ I/O ports _or_ memory. It'd
   make Linux installation more better if _both_ were supported.

 * It'd allow some drivers to be massively cleaned up (serial.c).

 * Permit transparent byte-swapping.

There are some other minor benefits too, but they're far less important (such
as I/O access tracing).

> If you are sticking a cookie in there behind the scenes, why go ahead
> and use ioremap?
> 
> We -already- have a system which does remapping and returns cookies and
> such for PCI mem regions.  Why not use it for I/O regions too?

You can't remap I/O ports into memory space on the i386. You can't easily
remap PCI devices if the all PCI devices peer through a small sliding window
in the CPU address space.

David

  reply	other threads:[~2001-07-03  8:39 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
2001-07-03  2:06                           ` Jeff Garzik
2001-07-03  8:38                             ` David Howells [this message]
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=3993.994149529@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjanv@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=jes@sunsite.dk \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=torvalds@transmeta.com \
    /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