diff options
| author | Dave Airlie <[email protected]> | 2010-08-02 10:05:18 +1000 | 
|---|---|---|
| committer | Dave Airlie <[email protected]> | 2010-08-02 10:05:24 +1000 | 
| commit | d656ae53f64cb0f01dac8a02c4d31453d64ef97c (patch) | |
| tree | cf641d4e5828b8f7c430b42657237c5daf9571fd /drivers/pci/setup-res.c | |
| parent | 167ffc44caaee68ea60dadf6931a4d195a4ed1f0 (diff) | |
| parent | b37fa16e78d6f9790462b3181602a26b5af36260 (diff) | |
Merge tag 'v2.6.35-rc6' into drm-radeon-next
Need this to avoid conflicts with future radeon fixes
Diffstat (limited to 'drivers/pci/setup-res.c')
| -rw-r--r-- | drivers/pci/setup-res.c | 32 | 
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 92379e2d37e7..2aaa13150de3 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -156,6 +156,38 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev,  					     pcibios_align_resource, dev);  	} +	if (ret < 0 && dev->fw_addr[resno]) { +		struct resource *root, *conflict; +		resource_size_t start, end; + +		/* +		 * If we failed to assign anything, let's try the address +		 * where firmware left it.  That at least has a chance of +		 * working, which is better than just leaving it disabled. +		 */ + +		if (res->flags & IORESOURCE_IO) +			root = &ioport_resource; +		else +			root = &iomem_resource; + +		start = res->start; +		end = res->end; +		res->start = dev->fw_addr[resno]; +		res->end = res->start + size - 1; +		dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", +			 resno, res); +		conflict = request_resource_conflict(root, res); +		if (conflict) { +			dev_info(&dev->dev, +				 "BAR %d: %pR conflicts with %s %pR\n", resno, +				 res, conflict->name, conflict); +			res->start = start; +			res->end = end; +		} else +			ret = 0; +	} +  	if (!ret) {  		res->flags &= ~IORESOURCE_STARTALIGN;  		dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res);  |