From: Grant Grundler <grundler@parisc-linux.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-pci@atrey.karlin.mff.cuni.cz, Alan Cox <alan@redhat.com>,
Greg Kroah-Hartman <greg@kroah.com>,
jgarzik@pobox.com, Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
wingel@nano-system.com,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
james.smart@emulex.com, linux-driver@qlogic.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH 3/4] pci: Remove pci_enable_device_bars()
Date: Mon, 24 Dec 2007 00:08:51 -0700 [thread overview]
Message-ID: <20071224070850.GB3758@colo.lackof.org> (raw)
In-Reply-To: <20071217230126.B2D71DDE36@ozlabs.org>
On Tue, Dec 18, 2007 at 10:01:14AM +1100, Benjamin Herrenschmidt wrote:
> Now that all in-tree users are gone, this removes pci_enable_device_bars()
> completely.
Almost completely.
Patch below removes pci_enable_device_bars() from Documentation/pci.txt .
(And I'd be happy to review patches to pci.txt that add
pci_enable_device_io() and _mmio() as well. )
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
diff --git a/Documentation/pci.txt b/Documentation/pci.txt
index 7754f5a..72b20c6 100644
--- a/Documentation/pci.txt
+++ b/Documentation/pci.txt
@@ -274,8 +274,6 @@ the PCI device by calling pci_enable_device(). This will:
o allocate an IRQ (if BIOS did not).
NOTE: pci_enable_device() can fail! Check the return value.
-NOTE2: Also see pci_enable_device_bars() below. Drivers can
- attempt to enable only a subset of BARs they need.
[ OS BUG: we don't check resource allocations before enabling those
resources. The sequence would make more sense if we called
@@ -605,40 +603,7 @@ device lists. This is still possible but discouraged.
-10. pci_enable_device_bars() and Legacy I/O Port space
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Large servers may not be able to provide I/O port resources to all PCI
-devices. I/O Port space is only 64KB on Intel Architecture[1] and is
-likely also fragmented since the I/O base register of PCI-to-PCI
-bridge will usually be aligned to a 4KB boundary[2]. On such systems,
-pci_enable_device() and pci_request_region() will fail when
-attempting to enable I/O Port regions that don't have I/O Port
-resources assigned.
-
-Fortunately, many PCI devices which request I/O Port resources also
-provide access to the same registers via MMIO BARs. These devices can
-be handled without using I/O port space and the drivers typically
-offer a CONFIG_ option to only use MMIO regions
-(e.g. CONFIG_TULIP_MMIO). PCI devices typically provide I/O port
-interface for legacy OSes and will work when I/O port resources are not
-assigned. The "PCI Local Bus Specification Revision 3.0" discusses
-this on p.44, "IMPLEMENTATION NOTE".
-
-If your PCI device driver doesn't need I/O port resources assigned to
-I/O Port BARs, you should use pci_enable_device_bars() instead of
-pci_enable_device() in order not to enable I/O port regions for the
-corresponding devices. In addition, you should use
-pci_request_selected_regions() and pci_release_selected_regions()
-instead of pci_request_regions()/pci_release_regions() in order not to
-request/release I/O port regions for the corresponding devices.
-
-[1] Some systems support 64KB I/O port space per PCI segment.
-[2] Some PCI-to-PCI bridges support optional 1KB aligned I/O base.
-
-
-
-11. MMIO Space and "Write Posting"
+10. MMIO Space and "Write Posting"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Converting a driver from using I/O Port space to using MMIO space
next prev parent reply other threads:[~2007-12-24 7:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-17 23:01 [RFC/PATCH 1/4] pci: Add pci_enable_device_{io,mem} intefaces Benjamin Herrenschmidt
2007-12-17 23:01 ` [RFC/PATCH 2/4] pci: Remove users of pci_enable_device_bars() Benjamin Herrenschmidt
2007-12-18 0:07 ` Alan Cox
2007-12-18 0:26 ` Benjamin Herrenschmidt
2007-12-24 7:13 ` Grant Grundler
2007-12-17 23:01 ` [RFC/PATCH 3/4] pci: Remove pci_enable_device_bars() Benjamin Herrenschmidt
2007-12-24 7:08 ` Grant Grundler [this message]
2007-12-25 21:16 ` Benjamin Herrenschmidt
2007-12-17 23:01 ` [RFC/PATCH 4/4] [POWERPC] pci: Disable IO/Mem on a device when resources can't be allocated Benjamin Herrenschmidt
2007-12-18 9:56 ` Ivan Kokshaysky
2007-12-18 11:36 ` Benjamin Herrenschmidt
2007-12-24 7:23 ` Grant Grundler
2007-12-25 21:20 ` Benjamin Herrenschmidt
2007-12-25 21:26 ` Benjamin Herrenschmidt
2007-12-27 21:03 ` Grant Grundler
2007-12-17 23:49 ` [RFC/PATCH 1/4] pci: Add pci_enable_device_{io,mem} intefaces Johannes Weiner
2007-12-17 23:55 ` Benjamin Herrenschmidt
2007-12-18 0:02 ` Benjamin Herrenschmidt
2007-12-18 9:37 ` Ivan Kokshaysky
2007-12-18 9:43 ` Benjamin Herrenschmidt
2007-12-19 5:10 ` [RFC/PATCH]] x86: pci: Disable IO/Mem on a device when resources can't be allocated Benjamin Herrenschmidt
2007-12-19 13:43 ` Ivan Kokshaysky
2007-12-19 20:29 ` Benjamin Herrenschmidt
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=20071224070850.GB3758@colo.lackof.org \
--to=grundler@parisc-linux.org \
--cc=alan@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=bzolnier@gmail.com \
--cc=greg@kroah.com \
--cc=ink@jurassic.park.msu.ru \
--cc=james.smart@emulex.com \
--cc=jgarzik@pobox.com \
--cc=linux-driver@qlogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=wingel@nano-system.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