summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2026-01-27 16:10:40 +0100
committerManivannan Sadhasivam <mani@kernel.org>2026-02-05 18:23:19 +0530
commitb5dab9b38da0a05949458276dde9227c38aa1b39 (patch)
treee3ca1354104b5f0624e69b44609bac9aff49fba3 /include/linux
parent58fbf08935d9c4396417e5887df89a4e681fa7e3 (diff)
PCI: dwc: Clean up iATU index usage in dw_pcie_iatu_setup()
The current iATU index usage in dw_pcie_iatu_setup() is a mess. For outbound address translation the index is incremented before usage. For inbound address translation the index is incremented after usage. Incrementing the index after usage make much more sense, and make the index usage consistent for both outbound and inbound address translation. Most likely, the overly complicated logic for the outbound address translation is because the iATU at index 0 is reserved for CFG IOs (dw_pcie_other_conf_map_bus()), however, we should be able to use the exact same logic for the indexing of the outbound and inbound iATUs. (Only the starting index should be different.) Create two new variables ob_iatu_index and ib_iatu_index, which makes it more clear from the name itself that it is a zeroes based index, and only increment the index if the iATU configuration call succeeded. Since we always check if there is an index available immediately before programming the iATU, we can remove the useless "ranges exceed outbound iATU size" warnings, as the code is already unreachable. For the same reason, we can also remove the useless breaks outside of the while loops. No functional changes intended. Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Tested-by: Maciej W. Rozycki <macro@orcam.me.uk> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hans Zhang <zhanghuabing@ecosda.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260127151038.1484881-7-cassel@kernel.org
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions