]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: dwc: Use resource start as ioremap() input in dw_pcie_pme_turn_off()
authorFrank Li <Frank.Li@nxp.com>
Sat, 15 Mar 2025 20:15:36 +0000 (15:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:39 +0000 (11:12 +0200)
[ Upstream commit 8f4a489b370e6612700aa16b9e4373b2d85d7503 ]

The msg_res region translates writes into PCIe Message TLPs. Previously we
mapped this region using atu.cpu_addr, the input address programmed into
the ATU.

"cpu_addr" is a misnomer because when a bus fabric translates addresses
between the CPU and the ATU, the ATU input address is different from the
CPU address.  A future patch will rename "cpu_addr" and correct the value
to be the ATU input address instead of the CPU physical address.

Map the msg_res region before writing to it using the msg_res resource
start, a CPU physical address.

Link: https://lore.kernel.org/r/20250315201548.858189-2-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-host.c

index ffaded8f2df7bcddfbc3fcc488019e42fdf829cc..ae3fd2a5dbf85d0a11a627c06c2666e09c07977b 100644 (file)
@@ -908,7 +908,7 @@ static int dw_pcie_pme_turn_off(struct dw_pcie *pci)
        if (ret)
                return ret;
 
-       mem = ioremap(atu.cpu_addr, pci->region_align);
+       mem = ioremap(pci->pp.msg_res->start, pci->region_align);
        if (!mem)
                return -ENOMEM;