diff options
author | Niklas Cassel <cassel@kernel.org> | 2024-12-13 17:33:06 +0300 |
---|---|---|
committer | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2024-12-19 00:52:09 +0300 |
commit | f015b53d634a10fbceba545de70c3e109665c379 (patch) | |
tree | 029feeb245d8c98efd768084e0022f79600ec2d2 /tools/perf/scripts/python/syscall-counts.py | |
parent | b61fef0813cb9a87733c46a48b98b5652494eea4 (diff) | |
download | linux-f015b53d634a10fbceba545de70c3e109665c379.tar.xz |
PCI: endpoint: Add size check for fixed size BARs in pci_epc_set_bar()
A BAR of type BAR_FIXED has a fixed BAR size (the size cannot be changed).
When using pci_epf_alloc_space() to allocate backing memory for a BAR,
pci_epf_alloc_space() will always set the size to the fixed BAR size if
the BAR type is BAR_FIXED (and will give an error if you the requested size
is larger than the fixed BAR size).
However, some drivers might not call pci_epf_alloc_space() before calling
pci_epc_set_bar(), so add a check in pci_epc_set_bar() to ensure that an
EPF driver cannot set a size different from the fixed BAR size, if the BAR
type is BAR_FIXED.
The pci_epc_function_is_valid() check is removed because this check is now
done by pci_epc_get_features().
Link: https://lore.kernel.org/r/20241213143301.4158431-13-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions