linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: linux-kernel@vger.kernel.org
Subject: Memory mapped IO vs Port IO
Date: Thu, 11 Sep 2003 17:01:16 +0100	[thread overview]
Message-ID: <20030911160116.GI21596@parcelfarce.linux.theplanet.co.uk> (raw)


There's a lot of drivers in the tree that allow you to access the device
either via IO port space or IO mem space.  Here's some examples:

config SCSI_SYM53C8XX_IOMAPPED
        bool "use normal IO"
        depends on SCSI_SYM53C8XX_2
        help
          If you say Y here, the driver will preferently use normal IO
	  rather than memory mapped IO.

config 8139TOO_PIO
        bool "Use PIO instead of MMIO"
        depends on 8139TOO
        help
          This instructs the driver to use programmed I/O ports (PIO) instead
          of PCI shared memory (MMIO).  This can possibly solve some problems
          in case your mainboard has memory consistency issues.  If unsure,
          say N.

config TULIP_MMIO
        bool "Use PCI shared mem for NIC registers"
        depends on TULIP
        help
          Use PCI shared memory for the NIC registers, rather than going through
          the Tulip's PIO (programmed I/O ports).  Faster, but could produce
          obscure bugs if your mainboard has memory controller timing issues.
          If in doubt, say N.

As you can see, everybody asks the question differently, and sometimes
you should answer Y and sometimes N to get MMIO.  There are other drivers
which don't ask the question at all and you have to edit the .c file to
turn it on or off.  I'll also note the acronym `PIO' is ambiguous --
sometimes it refers to Port IO and sometimes to Programmed IO (which
can be a memory access).

Personally, when I'm configuring a new kernel for a machine, I don't
want to learn about the suboptions for each device -- I've got dozens of
other things to configure right.  My favourite solution to this problem
wuld be to ask the question once only and have it apply to all devices:

config MMIO
	bool "Prefer Memory-mapped I/O accesses over Port I/O"
	help
	  Many devices are accessible via both memory mapped I/O and
	  port I/O.  Say Y here to access them via the slightly faster
	  memory mapped I/O method.  If you experience problems, you may
	  wish to say N here.

If that's not acceptable, can I suggest that we at least ask a standard
question?

config WWWW_MMIO
	bool "Use Memory mapped I/O in preference to Port I/O"
	depends on WWWW
	help
	  This device's registers can be accessed by either memory
	  mapped I/O or port I/O.  Memory mapped I/O is faster, so you
	  are advised to say Y here.

(yes, we could wordsmith these questions into the ground; the key point
of this mail is whether we ask one question at the start of configuration
or whether we ask one question per device.)

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

             reply	other threads:[~2003-09-11 16:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-11 16:01 Matthew Wilcox [this message]
2003-09-11 16:14 ` Memory mapped IO vs Port IO Måns Rullgård
2003-09-11 16:14 ` Jesse Barnes
     [not found] <20030911160116.GI21596@parcelfarce.linux.theplanet.co.uk.suse.lists.linux.kernel>
2003-09-11 16:17 ` Andi Kleen
2003-09-11 16:25   ` Matthew Wilcox
2003-09-11 16:31     ` Andi Kleen
2003-09-11 16:42       ` Matthew Wilcox
2003-09-11 17:12       ` Jamie Lokier
2003-09-11 17:25         ` Andi Kleen
2003-09-12  1:39           ` jw schultz
2003-09-12 16:10           ` Anthony Dominic Truong
2003-09-12 16:22             ` Jamie Lokier
2003-09-12 16:27             ` Jesse Barnes
2003-09-12 17:48               ` Jesse Barnes
2003-09-11 17:13   ` Jamie Lokier
     [not found] ` <20030911161450.GA23536@sgi.com.suse.lists.linux.kernel>
2003-09-11 16:20   ` Andi Kleen
2003-09-12 16:41 John Bradford
2003-09-12 21:52 ` Mike Fedyk
2003-09-13  4:01   ` Mike Fedyk
     [not found] <20030911192550.7dfaf08c.ak@suse.de.suse.lists.linux.kernel>
     [not found] ` <1063308053.4430.37.camel@huykhoi.suse.lists.linux.kernel>
     [not found]   ` <20030912162713.GA4852@sgi.com.suse.lists.linux.kernel>
     [not found]     ` <20030912174807.GA629@sgi.com.suse.lists.linux.kernel>
2003-09-12 18:00       ` Andi Kleen
2003-09-12 18:04         ` Jesse Barnes
2003-09-12 18:09           ` Andi Kleen
2003-09-12 18:11         ` Tim Hockin
2003-09-12 18:24           ` Jesse Barnes
2003-09-12 18:29             ` Andi Kleen
2003-09-12 18:58             ` Martin J. Bligh
2003-09-12 19:51               ` Jesse Barnes

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=20030911160116.GI21596@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --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;
as well as URLs for NNTP newsgroup(s).