[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241115172534.GA2044163@bhelgaas>
Date: Fri, 15 Nov 2024 11:25:34 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Andrea della Porta <andrea.porta@...e.com>,
Rob Herring <robh@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczynski <kw@...ux.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Linus Walleij <linus.walleij@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Bartosz Golaszewski <brgl@...ev.pl>,
Derek Kiernan <derek.kiernan@....com>,
Dragan Cvetic <dragan.cvetic@....com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Saravana Kannan <saravanak@...gle.com>, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-gpio@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Stefan Wahren <wahrenst@....net>,
Herve Codina <herve.codina@...tlin.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>, stable@...r.kernel.org
Subject: Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address
to dynamic PCI nodes
On Fri, Nov 08, 2024 at 10:42:56AM +0100, Andrea della Porta wrote:
> When populating "ranges" property for a PCI bridge or endpoint,
> of_pci_prop_ranges() incorrectly use the CPU bus 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.
>
> Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
> Cc: stable@...r.kernel.org
> Signed-off-by: Andrea della Porta <andrea.porta@...e.com>
> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
> Tested-by: Herve Codina <herve.codina@...tlin.com>
I picked this up on pci/of for v6.13, thanks! Rob, let me know if
you'd prefer to take it or ack/review it.
> ---
> This patch, originally preparatory for a bigger patchset (see [1]), has
> been splitted in a standalone one for better management and because it
> contains a bugfix which is probably of interest to stable branch.
>
> drivers/pci/of_property.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/of_property.c b/drivers/pci/of_property.c
> index 5a0b98e69795..886c236e5de6 100644
> --- a/drivers/pci/of_property.c
> +++ b/drivers/pci/of_property.c
> @@ -126,7 +126,7 @@ static int of_pci_prop_ranges(struct pci_dev *pdev, struct of_changeset *ocs,
> if (of_pci_get_addr_flags(&res[j], &flags))
> continue;
>
> - val64 = res[j].start;
> + val64 = pci_bus_address(pdev, &res[j] - pdev->resource);
> of_pci_set_address(pdev, rp[i].parent_addr, val64, 0, flags,
> false);
> if (pci_is_bridge(pdev)) {
> --
> 2.35.3
>
Powered by blists - more mailing lists