summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-12-19 19:40:26 +0200
committerBjorn Helgaas <bhelgaas@google.com>2026-01-27 16:36:52 -0600
commit6a5e64c75e82953e4d6b52bba30e2e281532b386 (patch)
tree8a73ae5a815dd793fb8850a8abd48bdc5d25f697 /include
parentc10fe0c0e6977254e2b7d4fed18e71501c958d65 (diff)
PCI: Add pbus_mem_size_optional() to handle optional sizes
The resource loop in pbus_size_mem() handles optional resources that are either fully optional (SR-IOV and disabled Expansion ROMs) or bridge windows that may be optional only for a part. The logic is a little inconsistent when it comes to a bridge window that has only optional children resources as it would be more natural to treat it similar to any fully optional resource. As resource size should be zero in that case, it shouldn't cause any bugs but it still seems useful to address the inconsistency. Place the optional size related code of pbus_size_mem() into pbus_mem_size_optional() and add a check in pci_resource_is_optional() for entirely optional bridge windows. Reorder the logic inside pbus_mem_size_optional() such that fully optional resources are handled the same irrespective of whether the resource is a bridge window or not. Additional motivation for this are the upcoming changes that add complexity to the optional sizing logic due to Resizable BAR awareness. The extra logic would exceed any reasonable indentation level if the optional sizing code is kept within the loop body. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20251219174036.16738-14-ilpo.jarvinen@linux.intel.com
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions