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

[Xen-changelog] [linux-2.6.18-xen] dom0 linux: remove "reassign_resources" option.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1224241343 -3600
# Node ID a29df0e2bfe2b4bde83b10ad62d90781ee98cd83
# Parent  8fbf8e2fd08770446fd5f852da83edf0e6b82430
dom0 linux: remove "reassign_resources" option.

To reassign page-aligned resources to device, please add boot
parameters of dom0 linux as follows.

        reassigndev=00:1d.7,01:00.0

        reassigndev=    Specifies device to reassign page-aligned
                        resources.  PCI-PCI bridge can be specified,
                        if resource windows need to be expanded.

Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
---
 drivers/pci/pci.h       |    2 -
 drivers/pci/quirks.c    |   62 ++++++++++++++++++------------------------------
 drivers/pci/setup-bus.c |    2 -
 drivers/pci/setup-res.c |    4 +--
 4 files changed, 27 insertions(+), 43 deletions(-)

diff -r 8fbf8e2fd087 -r a29df0e2bfe2 drivers/pci/pci.h
--- a/drivers/pci/pci.h Fri Oct 17 12:01:56 2008 +0100
+++ b/drivers/pci/pci.h Fri Oct 17 12:02:23 2008 +0100
@@ -100,10 +100,8 @@ pci_match_one_device(const struct pci_de
 }
 
 #ifdef CONFIG_PCI_REASSIGN
-extern int reassign_resources;
 extern int is_reassigndev(struct pci_dev *dev);
 extern void pci_disable_bridge_window(struct pci_dev *dev);
 #else
-#define reassign_resources 0
 #define is_reassigndev(dev) 0
 #endif
diff -r 8fbf8e2fd087 -r a29df0e2bfe2 drivers/pci/quirks.c
--- a/drivers/pci/quirks.c      Fri Oct 17 12:01:56 2008 +0100
+++ b/drivers/pci/quirks.c      Fri Oct 17 12:02:23 2008 +0100
@@ -34,18 +34,6 @@ __setup("pci-mem-align", set_pci_mem_ali
 __setup("pci-mem-align", set_pci_mem_align);
 
 
-int reassign_resources = 0;
-
-static int __init set_reassign_resources(char *str)
-{
-       /* resources reassign on */
-       reassign_resources = 1;
-       printk(KERN_DEBUG "PCI: resource reassign ON.\n");
-
-       return 1;
-}
-__setup("reassign_resources", set_reassign_resources);
-
 /* This quirk function enables us to force all memory resources which are 
  * assigned to PCI devices, to be page-aligned.
  */
@@ -55,38 +43,36 @@ static void __devinit quirk_align_mem_re
        struct resource *r;
        resource_size_t old_start;
 
-       if (reassign_resources) {
+       if (is_reassigndev(dev)) {
                if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
                    (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
                        /* PCI Host Bridge isn't a target device */
                        return;
                }
-               if (is_reassigndev(dev)) {
-                       printk(KERN_INFO 
-                               "PCI: Disable device and release resources"
-                               " [%s].\n", pci_name(dev));
-                       pci_disable_device(dev);
-
-                       for (i=0; i < PCI_NUM_RESOURCES; i++) {
-                               r = &dev->resource[i];
-                               if (!(r->flags & IORESOURCE_MEM))
-                                       continue;
-
-                               r->end = r->end - r->start;
-                               r->start = 0;
-
-                               if (i < PCI_BRIDGE_RESOURCES) {
-                                       pci_update_resource(dev, r, i);
-                               }
+               printk(KERN_INFO 
+                       "PCI: Disable device and release resources [%s].\n",
+                       pci_name(dev));
+               pci_disable_device(dev);
+
+               for (i=0; i < PCI_NUM_RESOURCES; i++) {
+                       r = &dev->resource[i];
+                       if (!(r->flags & IORESOURCE_MEM))
+                               continue;
+
+                       r->end = r->end - r->start;
+                       r->start = 0;
+
+                       if (i < PCI_BRIDGE_RESOURCES) {
+                               pci_update_resource(dev, r, i);
                        }
-                       /* need to disable bridge's resource window,
-                        * to make kernel enable to reassign new resource
-                        * window later on.
-                        */
-                       if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
-                           (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
-                               pci_disable_bridge_window(dev);
-                       }
+               }
+               /* need to disable bridge's resource window,
+                * to make kernel enable to reassign new resource
+                * window later on.
+                */
+               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
+                   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
+                       pci_disable_bridge_window(dev);
                }
                return;
        }
diff -r 8fbf8e2fd087 -r a29df0e2bfe2 drivers/pci/setup-bus.c
--- a/drivers/pci/setup-bus.c   Fri Oct 17 12:01:56 2008 +0100
+++ b/drivers/pci/setup-bus.c   Fri Oct 17 12:02:23 2008 +0100
@@ -345,7 +345,7 @@ pbus_size_mem(struct pci_bus *bus, unsig
 
        list_for_each_entry(dev, &bus->devices, bus_list) {
                int i;
-               int reassign = reassign_resources ? is_reassigndev(dev) : 0;
+               int reassign = is_reassigndev(dev);
 
                for (i = 0; i < PCI_NUM_RESOURCES; i++) {
                        struct resource *r = &dev->resource[i];
diff -r 8fbf8e2fd087 -r a29df0e2bfe2 drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c   Fri Oct 17 12:01:56 2008 +0100
+++ b/drivers/pci/setup-res.c   Fri Oct 17 12:02:23 2008 +0100
@@ -138,7 +138,7 @@ int pci_assign_resource(struct pci_dev *
        struct resource *res = dev->resource + resno;
        resource_size_t size, min, align;
        int ret;
-       int reassigndev = reassign_resources ? is_reassigndev(dev) : 0;
+       int reassigndev = is_reassigndev(dev);
 
        size = res->end - res->start + 1;
        min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
@@ -178,7 +178,7 @@ int pci_assign_resource(struct pci_dev *
                        resno, (unsigned long long)size,
                        (unsigned long long)res->start, pci_name(dev));
        } else if (resno < PCI_BRIDGE_RESOURCES) {
-               if (reassign_resources && is_reassigndev(dev))
+               if (reassigndev)
                        printk(KERN_DEBUG "PCI: Assign resource(%d) on %s "
                                "%016llx - %016llx\n", resno, pci_name(dev),
                                 (unsigned long long)res->start,

_______________________________________________
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®.