diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-12-16 19:56:30 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-02-18 15:40:54 -0600 |
commit | e89df6d2beae847e931d84a190b192dfac41eba7 (patch) | |
tree | 054cd391f633653a711a31a420819f667fa55ce9 /drivers/pci/setup-bus.c | |
parent | 8884b5637b794ae541e8d6fb72102b1d8dba2b8d (diff) |
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/20241216175632.4175-24-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 5bebfeb6c417..ef1c82d2e58e 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -271,7 +271,7 @@ static void reassign_resources_sorted(struct list_head *realloc_head, res_name = pci_resource_name(dev, idx); add_size = add_res->add_size; align = add_res->min_align; - if (!resource_size(res)) { + if (!res->parent) { resource_set_range(res, align, add_size); if (pci_assign_resource(dev, idx)) { pci_dbg(dev, |