Skip to content

Commit cebd78a

Browse files
Matthew Wilcoxtorvalds
authored andcommitted
Fix pci_claim_resource
Instead of starting from the iomem or ioport roots, start from the parent bus' resources. This fixes a bug where child resources would appear above their parents resources if they had the same size. Signed-off-by: Matthew Wilcox <[email protected]> Tested-by: Andrew Patterson <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7cc4766 commit cebd78a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/setup-res.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ void pci_update_resource(struct pci_dev *dev, int resno)
9999
int pci_claim_resource(struct pci_dev *dev, int resource)
100100
{
101101
struct resource *res = &dev->resource[resource];
102-
struct resource *root = NULL;
102+
struct resource *root;
103103
char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
104104
int err;
105105

106-
root = pcibios_select_root(dev, res);
106+
root = pci_find_parent_resource(dev, res);
107107

108108
err = -EINVAL;
109109
if (root != NULL)

0 commit comments

Comments
 (0)