diff options
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r-- | drivers/pci/setup-res.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 5c060b152ce6..0474b0217fdf 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -263,6 +263,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
263 | resource_size_t align, size; | 263 | resource_size_t align, size; |
264 | int ret; | 264 | int ret; |
265 | 265 | ||
266 | res->flags |= IORESOURCE_UNSET; | ||
266 | align = pci_resource_alignment(dev, res); | 267 | align = pci_resource_alignment(dev, res); |
267 | if (!align) { | 268 | if (!align) { |
268 | dev_info(&dev->dev, "BAR %d: can't assign %pR " | 269 | dev_info(&dev->dev, "BAR %d: can't assign %pR " |
@@ -282,6 +283,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) | |||
282 | ret = pci_revert_fw_address(res, dev, resno, size); | 283 | ret = pci_revert_fw_address(res, dev, resno, size); |
283 | 284 | ||
284 | if (!ret) { | 285 | if (!ret) { |
286 | res->flags &= ~IORESOURCE_UNSET; | ||
285 | res->flags &= ~IORESOURCE_STARTALIGN; | 287 | res->flags &= ~IORESOURCE_STARTALIGN; |
286 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); | 288 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); |
287 | if (resno < PCI_BRIDGE_RESOURCES) | 289 | if (resno < PCI_BRIDGE_RESOURCES) |
@@ -297,6 +299,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz | |||
297 | resource_size_t new_size; | 299 | resource_size_t new_size; |
298 | int ret; | 300 | int ret; |
299 | 301 | ||
302 | res->flags |= IORESOURCE_UNSET; | ||
300 | if (!res->parent) { | 303 | if (!res->parent) { |
301 | dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR " | 304 | dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR " |
302 | "\n", resno, res); | 305 | "\n", resno, res); |
@@ -307,6 +310,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz | |||
307 | new_size = resource_size(res) + addsize; | 310 | new_size = resource_size(res) + addsize; |
308 | ret = _pci_assign_resource(dev, resno, new_size, min_align); | 311 | ret = _pci_assign_resource(dev, resno, new_size, min_align); |
309 | if (!ret) { | 312 | if (!ret) { |
313 | res->flags &= ~IORESOURCE_UNSET; | ||
310 | res->flags &= ~IORESOURCE_STARTALIGN; | 314 | res->flags &= ~IORESOURCE_STARTALIGN; |
311 | dev_info(&dev->dev, "BAR %d: reassigned %pR\n", resno, res); | 315 | dev_info(&dev->dev, "BAR %d: reassigned %pR\n", resno, res); |
312 | if (resno < PCI_BRIDGE_RESOURCES) | 316 | if (resno < PCI_BRIDGE_RESOURCES) |