Skip to content

Commit e89df6d

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Use res->parent to check if resource is assigned
reassign_resources_sorted() uses resource_size() to select between pci_assign_resource() and pci_reassign_resource(). Due to twisted way bridge window sizing in pbus_size_mem() sets resource sizes to 0, it works to match into IOV resources but that is going to be changed by an upcoming change. Replace resource_size() check with res->parent check that is the true dividing line in between whether assign or reassign function should be used for the resource. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Xiaochun Lee <[email protected]>
1 parent 8884b56 commit e89df6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/setup-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
271271
res_name = pci_resource_name(dev, idx);
272272
add_size = add_res->add_size;
273273
align = add_res->min_align;
274-
if (!resource_size(res)) {
274+
if (!res->parent) {
275275
resource_set_range(res, align, add_size);
276276
if (pci_assign_resource(dev, idx)) {
277277
pci_dbg(dev,

0 commit comments

Comments
 (0)