PCI: Remove pci_enable_device_bars() from documentation

2008-02-01 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d48b5d3a50c06357c721e81fa9354598282b6549
Commit: d48b5d3a50c06357c721e81fa9354598282b6549
Parent: 7cbe5b6005f80de33a205d3052cdc89aacaac07c
Author: Grant Grundler <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 24 00:08:51 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 15:04:28 2008 -0800

    PCI: Remove pci_enable_device_bars() from documentation

Patch below removes pci_enable_device_bars() from Documentation/pci.txt .

Signed-off-by: Grant Grundler <[EMAIL PROTECTED]>
Acked-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 Documentation/pci.txt |   37 +
 1 files changed, 1 insertions(+), 36 deletions(-)

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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PCI: Remove pci_enable_device_bars()

2008-02-01 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7cbe5b6005f80de33a205d3052cdc89aacaac07c
Commit: 7cbe5b6005f80de33a205d3052cdc89aacaac07c
Parent: 0948391641918b95d8d96c15089eb5ac156850b3
Author: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 20 15:28:10 2007 +1100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 15:04:28 2008 -0800

    PCI: Remove pci_enable_device_bars()

Now that all in-tree users are gone, this removes pci_enable_device_bars()
completely.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/pci.c   |   24 
 include/linux/pci.h |1 -
 2 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5027e4d..35f78f1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -741,29 +741,6 @@ int pci_reenable_device(struct pci_dev *dev)
return 0;
 }
 
-/**
- * pci_enable_device_bars - Initialize some of a device for use
- * @dev: PCI device to be initialized
- * @bars: bitmask of BAR's that must be configured
- *
- *  Initialize device before it's used by a driver. Ask low-level code
- *  to enable selected I/O and memory resources. Wake up the device if it
- *  was suspended. Beware, this function can fail.
- */
-int
-pci_enable_device_bars(struct pci_dev *dev, int bars)
-{
-   int err;
-
-   if (atomic_add_return(1, &dev->enable_cnt) > 1)
-   return 0;   /* already enabled */
-
-   err = do_pci_enable_device(dev, bars);
-   if (err < 0)
-   atomic_dec(&dev->enable_cnt);
-   return err;
-}
-
 static int __pci_enable_device_flags(struct pci_dev *dev,
 resource_size_t flags)
 {
@@ -1695,7 +1672,6 @@ early_param("pci", pci_setup);
 device_initcall(pci_init);
 
 EXPORT_SYMBOL(pci_reenable_device);
-EXPORT_SYMBOL(pci_enable_device_bars);
 EXPORT_SYMBOL(pci_enable_device_io);
 EXPORT_SYMBOL(pci_enable_device_mem);
 EXPORT_SYMBOL(pci_enable_device);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index e4c1dac..13813b0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -543,7 +543,6 @@ static inline int pci_write_config_dword(struct pci_dev 
*dev, int where, u32 val
 }
 
 int __must_check pci_enable_device(struct pci_dev *dev);
-int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
 int __must_check pci_enable_device_io(struct pci_dev *dev);
 int __must_check pci_enable_device_mem(struct pci_dev *dev);
 int __must_check pci_reenable_device(struct pci_dev *);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html