|
@@ -263,6 +263,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
|
|
|
resource_size_t align, size;
|
|
|
int ret;
|
|
|
|
|
|
+ res->flags |= IORESOURCE_UNSET;
|
|
|
align = pci_resource_alignment(dev, res);
|
|
|
if (!align) {
|
|
|
dev_info(&dev->dev, "BAR %d: can't assign %pR "
|
|
@@ -282,6 +283,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
|
|
|
ret = pci_revert_fw_address(res, dev, resno, size);
|
|
|
|
|
|
if (!ret) {
|
|
|
+ res->flags &= ~IORESOURCE_UNSET;
|
|
|
res->flags &= ~IORESOURCE_STARTALIGN;
|
|
|
dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res);
|
|
|
if (resno < PCI_BRIDGE_RESOURCES)
|
|
@@ -297,6 +299,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
|
|
|
resource_size_t new_size;
|
|
|
int ret;
|
|
|
|
|
|
+ res->flags |= IORESOURCE_UNSET;
|
|
|
if (!res->parent) {
|
|
|
dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR "
|
|
|
"\n", resno, res);
|
|
@@ -307,6 +310,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
|
|
|
new_size = resource_size(res) + addsize;
|
|
|
ret = _pci_assign_resource(dev, resno, new_size, min_align);
|
|
|
if (!ret) {
|
|
|
+ res->flags &= ~IORESOURCE_UNSET;
|
|
|
res->flags &= ~IORESOURCE_STARTALIGN;
|
|
|
dev_info(&dev->dev, "BAR %d: reassigned %pR\n", resno, res);
|
|
|
if (resno < PCI_BRIDGE_RESOURCES)
|