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
This commit is contained in:
@@ -410,10 +410,16 @@ EXPORT_SYMBOL(pci_release_resource);
|
|||||||
int pci_resize_resource(struct pci_dev *dev, int resno, int size)
|
int pci_resize_resource(struct pci_dev *dev, int resno, int size)
|
||||||
{
|
{
|
||||||
struct resource *res = dev->resource + resno;
|
struct resource *res = dev->resource + resno;
|
||||||
|
struct pci_host_bridge *host;
|
||||||
int old, ret;
|
int old, ret;
|
||||||
u32 sizes;
|
u32 sizes;
|
||||||
u16 cmd;
|
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. */
|
/* Make sure the resource isn't assigned before resizing it. */
|
||||||
if (!(res->flags & IORESOURCE_UNSET))
|
if (!(res->flags & IORESOURCE_UNSET))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|||||||
Reference in New Issue
Block a user