WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] dom0 linux: remove "reassign_resources" option.

To: Keir Fraser <keir.fraser@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH] dom0 linux: remove "reassign_resources" option.
From: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Date: Fri, 17 Oct 2008 17:58:47 +0900
Cc:
Delivery-date: Fri, 17 Oct 2008 01:59:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This patch removes "reassign_resources" option from dom0 linux.

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.

Thanks,
--
Yuji Shimada

Signed-off-by: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>


diff -r c57acb662c09 drivers/pci/pci.h
--- a/drivers/pci/pci.h Fri Oct 17 14:15:40 2008 +0900
+++ b/drivers/pci/pci.h Fri Oct 17 14:32:02 2008 +0900
@@ -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 c57acb662c09 drivers/pci/quirks.c
--- a/drivers/pci/quirks.c      Fri Oct 17 14:15:40 2008 +0900
+++ b/drivers/pci/quirks.c      Fri Oct 17 14:32:02 2008 +0900
@@ -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);
+               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;
+               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;
+                       r->end = r->end - r->start;
+                       r->start = 0;
 
-                               if (i < PCI_BRIDGE_RESOURCES) {
-                                       pci_update_resource(dev, r, i);
-                               }
+                       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 c57acb662c09 drivers/pci/setup-bus.c
--- a/drivers/pci/setup-bus.c   Fri Oct 17 14:15:40 2008 +0900
+++ b/drivers/pci/setup-bus.c   Fri Oct 17 14:32:02 2008 +0900
@@ -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 c57acb662c09 drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c   Fri Oct 17 14:15:40 2008 +0900
+++ b/drivers/pci/setup-res.c   Fri Oct 17 14:32:02 2008 +0900
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] dom0 linux: remove "reassign_resources" option., Yuji Shimada <=