]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: dwc: ep: Ensure proper iteration over outbound map windows
authorFrank Li <Frank.Li@nxp.com>
Sat, 15 Mar 2025 20:15:46 +0000 (15:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:04 +0000 (14:40 +0200)
commit1325473aba000c99ad08d14dd9c13514f776ca5d
treef21850af000fccb9f6e216cdc2401f6626c59751
parent1fdd7255d5b2e79302f17f4c0f3f03df13f94c7d
PCI: dwc: ep: Ensure proper iteration over outbound map windows

[ Upstream commit f3e1dccba0a0833fc9a05fb838ebeb6ea4ca0e1a ]

Most systems' PCIe outbound map windows have non-zero physical addresses,
but the possibility of encountering zero increased after following commit
("PCI: dwc: Use parent_bus_offset").

'ep->outbound_addr[n]', representing 'parent_bus_address', might be 0 on
some hardware, which trims high address bits through bus fabric before
sending to the PCIe controller.

Replace the iteration logic with 'for_each_set_bit()' to ensure only
allocated map windows are iterated when determining the ATU index from a
given address.

Link: https://lore.kernel.org/r/20250315201548.858189-12-helgaas@kernel.org
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-designware-ep.c