summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/pci/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/pci/bus.c')
-rw-r--r--kernel/drivers/pci/bus.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/drivers/pci/bus.c b/kernel/drivers/pci/bus.c
index 6fbd3f2b5..89b3befc7 100644
--- a/kernel/drivers/pci/bus.c
+++ b/kernel/drivers/pci/bus.c
@@ -140,6 +140,8 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
type_mask |= IORESOURCE_TYPE_BITS;
pci_bus_for_each_resource(bus, r, i) {
+ resource_size_t min_used = min;
+
if (!r)
continue;
@@ -163,12 +165,12 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
* overrides "min".
*/
if (avail.start)
- min = avail.start;
+ min_used = avail.start;
max = avail.end;
/* Ok, try it out.. */
- ret = allocate_resource(r, res, size, min, max,
+ ret = allocate_resource(r, res, size, min_used, max,
align, alignf, alignf_data);
if (ret == 0)
return 0;
@@ -256,6 +258,8 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx)
res->start = start;
res->end = end;
+ res->flags &= ~IORESOURCE_UNSET;
+ orig_res.flags &= ~IORESOURCE_UNSET;
dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n",
&orig_res, res);