]> git.hungrycats.org Git - linux/commit
PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
authorAndrea della Porta <andrea.porta@suse.com>
Fri, 8 Nov 2024 09:42:56 +0000 (10:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:33:08 +0000 (10:33 +0100)
commit8b404b08be92abc33c50f78813470740fc5adca4
treeeebcbe93e2d61a8984f33eb7e353fd894c92513d
parent6f433923d3b641b9e45d380c3c49b0db9e4fb1a2
PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes

commit 5e316d34b53039346e252d0019e2f4167af2c0ef upstream.

When populating "ranges" property for a PCI bridge or endpoint,
of_pci_prop_ranges() incorrectly uses the CPU address of the resource.  In
such PCI nodes, the window should instead be in PCI address space. Call
pci_bus_address() on the resource in order to obtain the PCI bus address.

[Previous discussion at:
https://lore.kernel.org/all/8b4fa91380fc4754ea80f47330c613e4f6b6592c.1724159867.git.andrea.porta@suse.com/]

Link: https://lore.kernel.org/r/20241108094256.28933-1-andrea.porta@suse.com
Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
Tested-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/of_property.c