[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] dom0: remove "pci-mem-align" option



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224672884 -3600
# Node ID f7a2c0985f9933ac37ce5ec81e33352ff3813006
# Parent  c87adc9760134abb7275728718e44af3dacc515b
dom0: remove "pci-mem-align" option

Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
---
 drivers/pci/bus.c    |    7 -------
 drivers/pci/quirks.c |   41 ++++++++++-------------------------------
 2 files changed, 10 insertions(+), 38 deletions(-)

diff -r c87adc976013 -r f7a2c0985f99 drivers/pci/bus.c
--- a/drivers/pci/bus.c Mon Oct 20 15:29:07 2008 +0100
+++ b/drivers/pci/bus.c Wed Oct 22 11:54:44 2008 +0100
@@ -16,8 +16,6 @@
 #include <linux/init.h>
 
 #include "pci.h"
-
-extern int pci_mem_align;
 
 /**
  * pci_bus_alloc_resource - allocate a resource from a parent bus
@@ -45,11 +43,6 @@ pci_bus_alloc_resource(struct pci_bus *b
        int i, ret = -ENOMEM;
 
        type_mask |= IORESOURCE_IO | IORESOURCE_MEM;
-
-       /* If the boot parameter 'pci-mem-align' was specified then we need to 
-          align the memory addresses, at page size alignment. */
-       if (pci_mem_align && (align < (PAGE_SIZE-1)))
-               align = PAGE_SIZE - 1;
 
        for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
                struct resource *r = bus->resource[i];
diff -r c87adc976013 -r f7a2c0985f99 drivers/pci/quirks.c
--- a/drivers/pci/quirks.c      Mon Oct 20 15:29:07 2008 +0100
+++ b/drivers/pci/quirks.c      Wed Oct 22 11:54:44 2008 +0100
@@ -23,25 +23,17 @@
 #include <linux/acpi.h>
 #include "pci.h"
 
-/* A global flag which signals if we should page-align PCI mem windows. */
-int pci_mem_align = 0;
-
-static int __init set_pci_mem_align(char *str)
-{
-       pci_mem_align = 1;
-       return 1;
-}
-__setup("pci-mem-align", set_pci_mem_align);
-
-
-/* This quirk function enables us to force all memory resources which are 
- * assigned to PCI devices, to be page-aligned.
- */
-static void __devinit quirk_align_mem_resources(struct pci_dev *dev)
+
+/*
+ * This quirk function disables the device and releases resources
+ * which is specified by kernel's boot parameter 'reassigndev'.
+ * Later on, kernel will assign page-aligned memory resource back
+ * to that device.
+ */
+static void __devinit quirk_release_resources(struct pci_dev *dev)
 {
        int i;
        struct resource *r;
-       resource_size_t old_start;
 
        if (is_reassigndev(dev)) {
                if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
@@ -76,21 +68,8 @@ static void __devinit quirk_align_mem_re
                }
                return;
        }
-
-       if (!pci_mem_align)
-               return;
-
-       for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
-               r = &dev->resource[i];
-               if ((r == NULL) || !(r->flags & IORESOURCE_MEM))
-                       continue;
-
-               old_start = r->start;
-               r->start = (r->start + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
-               r->end = r->end - (old_start - r->start);
-       }
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_align_mem_resources);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_release_resources);
 
 /* The Mellanox Tavor device gives false positive parity errors
  * Mark this device with a broken_parity_status, to allow

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.