ia64/linux-2.6.18-xen.hg

changeset 703:a29df0e2bfe2

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@necst.nec.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Oct 17 12:02:23 2008 +0100 (2008-10-17)
parents 8fbf8e2fd087
children 240657899772
files drivers/pci/pci.h drivers/pci/quirks.c drivers/pci/setup-bus.c drivers/pci/setup-res.c
line diff
     1.1 --- a/drivers/pci/pci.h	Fri Oct 17 12:01:56 2008 +0100
     1.2 +++ b/drivers/pci/pci.h	Fri Oct 17 12:02:23 2008 +0100
     1.3 @@ -100,10 +100,8 @@ pci_match_one_device(const struct pci_de
     1.4  }
     1.5  
     1.6  #ifdef CONFIG_PCI_REASSIGN
     1.7 -extern int reassign_resources;
     1.8  extern int is_reassigndev(struct pci_dev *dev);
     1.9  extern void pci_disable_bridge_window(struct pci_dev *dev);
    1.10  #else
    1.11 -#define reassign_resources 0
    1.12  #define is_reassigndev(dev) 0
    1.13  #endif
     2.1 --- a/drivers/pci/quirks.c	Fri Oct 17 12:01:56 2008 +0100
     2.2 +++ b/drivers/pci/quirks.c	Fri Oct 17 12:02:23 2008 +0100
     2.3 @@ -34,18 +34,6 @@ static int __init set_pci_mem_align(char
     2.4  __setup("pci-mem-align", set_pci_mem_align);
     2.5  
     2.6  
     2.7 -int reassign_resources = 0;
     2.8 -
     2.9 -static int __init set_reassign_resources(char *str)
    2.10 -{
    2.11 -	/* resources reassign on */
    2.12 -	reassign_resources = 1;
    2.13 -	printk(KERN_DEBUG "PCI: resource reassign ON.\n");
    2.14 -
    2.15 -	return 1;
    2.16 -}
    2.17 -__setup("reassign_resources", set_reassign_resources);
    2.18 -
    2.19  /* This quirk function enables us to force all memory resources which are 
    2.20   * assigned to PCI devices, to be page-aligned.
    2.21   */
    2.22 @@ -55,38 +43,36 @@ static void __devinit quirk_align_mem_re
    2.23  	struct resource *r;
    2.24  	resource_size_t old_start;
    2.25  
    2.26 -	if (reassign_resources) {
    2.27 +	if (is_reassigndev(dev)) {
    2.28  		if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
    2.29  		    (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
    2.30  			/* PCI Host Bridge isn't a target device */
    2.31  			return;
    2.32  		}
    2.33 -		if (is_reassigndev(dev)) {
    2.34 -			printk(KERN_INFO 
    2.35 -				"PCI: Disable device and release resources"
    2.36 -				" [%s].\n", pci_name(dev));
    2.37 -			pci_disable_device(dev);
    2.38 -
    2.39 -			for (i=0; i < PCI_NUM_RESOURCES; i++) {
    2.40 -				r = &dev->resource[i];
    2.41 -				if (!(r->flags & IORESOURCE_MEM))
    2.42 -					continue;
    2.43 +		printk(KERN_INFO 
    2.44 +			"PCI: Disable device and release resources [%s].\n",
    2.45 +			pci_name(dev));
    2.46 +		pci_disable_device(dev);
    2.47  
    2.48 -				r->end = r->end - r->start;
    2.49 -				r->start = 0;
    2.50 +		for (i=0; i < PCI_NUM_RESOURCES; i++) {
    2.51 +			r = &dev->resource[i];
    2.52 +			if (!(r->flags & IORESOURCE_MEM))
    2.53 +				continue;
    2.54  
    2.55 -				if (i < PCI_BRIDGE_RESOURCES) {
    2.56 -					pci_update_resource(dev, r, i);
    2.57 -				}
    2.58 +			r->end = r->end - r->start;
    2.59 +			r->start = 0;
    2.60 +
    2.61 +			if (i < PCI_BRIDGE_RESOURCES) {
    2.62 +				pci_update_resource(dev, r, i);
    2.63  			}
    2.64 -			/* need to disable bridge's resource window,
    2.65 -			 * to make kernel enable to reassign new resource
    2.66 -			 * window later on.
    2.67 -			 */
    2.68 -			if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
    2.69 -			    (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
    2.70 -				pci_disable_bridge_window(dev);
    2.71 -			}
    2.72 +		}
    2.73 +		/* need to disable bridge's resource window,
    2.74 +		 * to make kernel enable to reassign new resource
    2.75 +		 * window later on.
    2.76 +		 */
    2.77 +		if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE &&
    2.78 +		    (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
    2.79 +			pci_disable_bridge_window(dev);
    2.80  		}
    2.81  		return;
    2.82  	}
     3.1 --- a/drivers/pci/setup-bus.c	Fri Oct 17 12:01:56 2008 +0100
     3.2 +++ b/drivers/pci/setup-bus.c	Fri Oct 17 12:02:23 2008 +0100
     3.3 @@ -345,7 +345,7 @@ pbus_size_mem(struct pci_bus *bus, unsig
     3.4  
     3.5  	list_for_each_entry(dev, &bus->devices, bus_list) {
     3.6  		int i;
     3.7 -		int reassign = reassign_resources ? is_reassigndev(dev) : 0;
     3.8 +		int reassign = is_reassigndev(dev);
     3.9  
    3.10  		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
    3.11  			struct resource *r = &dev->resource[i];
     4.1 --- a/drivers/pci/setup-res.c	Fri Oct 17 12:01:56 2008 +0100
     4.2 +++ b/drivers/pci/setup-res.c	Fri Oct 17 12:02:23 2008 +0100
     4.3 @@ -138,7 +138,7 @@ int pci_assign_resource(struct pci_dev *
     4.4  	struct resource *res = dev->resource + resno;
     4.5  	resource_size_t size, min, align;
     4.6  	int ret;
     4.7 -	int reassigndev = reassign_resources ? is_reassigndev(dev) : 0;
     4.8 +	int reassigndev = is_reassigndev(dev);
     4.9  
    4.10  	size = res->end - res->start + 1;
    4.11  	min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
    4.12 @@ -178,7 +178,7 @@ int pci_assign_resource(struct pci_dev *
    4.13  			resno, (unsigned long long)size,
    4.14  			(unsigned long long)res->start, pci_name(dev));
    4.15  	} else if (resno < PCI_BRIDGE_RESOURCES) {
    4.16 -		if (reassign_resources && is_reassigndev(dev))
    4.17 +		if (reassigndev)
    4.18  			printk(KERN_DEBUG "PCI: Assign resource(%d) on %s "
    4.19  				"%016llx - %016llx\n", resno, pci_name(dev),
    4.20  				 (unsigned long long)res->start,