Commit da8eb3fe authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/resource'

- Decline requests to resize BARs if platform requires us to preserve
  resource assignments (Ard Biesheuvel)

* pci/resource:
  PCI: Decline to resize resources if boot config must be preserved
parents 215fc27d 729e3a66
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -410,10 +410,16 @@ EXPORT_SYMBOL(pci_release_resource);
int pci_resize_resource(struct pci_dev *dev, int resno, int size)
{
	struct resource *res = dev->resource + resno;
	struct pci_host_bridge *host;
	int old, ret;
	u32 sizes;
	u16 cmd;

	/* Check if we must preserve the firmware's resource assignment */
	host = pci_find_host_bridge(dev->bus);
	if (host->preserve_config)
		return -ENOTSUPP;

	/* Make sure the resource isn't assigned before resizing it. */
	if (!(res->flags & IORESOURCE_UNSET))
		return -EBUSY;