* [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
@ 2024-11-08 9:42 Andrea della Porta
2024-11-08 10:09 ` Herve Codina
2024-11-15 17:25 ` Bjorn Helgaas
0 siblings, 2 replies; 6+ messages in thread
From: Andrea della Porta @ 2024-11-08 9:42 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Herve Codina, Luca Ceresoli,
Thomas Petazzoni, Andrew Lunn
Cc: Andrea della Porta, stable
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@vger.kernel.org
Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Herve Codina <herve.codina@bootlin.com>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
2024-11-08 9:42 [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes Andrea della Porta
@ 2024-11-08 10:09 ` Herve Codina
2024-11-08 10:14 ` Andrea della Porta
2024-11-15 17:25 ` Bjorn Helgaas
1 sibling, 1 reply; 6+ messages in thread
From: Herve Codina @ 2024-11-08 10:09 UTC (permalink / raw)
To: Andrea della Porta
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Luca Ceresoli, Thomas Petazzoni,
Andrew Lunn, stable
Hi Andrea,
On Fri, 8 Nov 2024 10:42:56 +0100
Andrea della Porta <andrea.porta@suse.com> 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@vger.kernel.org
> Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Tested-by: Herve Codina <herve.codina@bootlin.com>
> ---
> 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.
Nothing to say for the patch itself.
Just here, you mentioned "see [1]" but you didn't provide the link.
IMHO, this is not blocking for applying the patch but, just for other people
looking at this email in the mailing list, can you reply providing the link?
Best regards,
Hervé
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
2024-11-08 10:09 ` Herve Codina
@ 2024-11-08 10:14 ` Andrea della Porta
2024-11-14 15:26 ` Andrea della Porta
0 siblings, 1 reply; 6+ messages in thread
From: Andrea della Porta @ 2024-11-08 10:14 UTC (permalink / raw)
To: Herve Codina
Cc: Andrea della Porta, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Luca Ceresoli, Thomas Petazzoni,
Andrew Lunn, stable
Hi herve,
On 11:09 Fri 08 Nov , Herve Codina wrote:
> Hi Andrea,
>
> On Fri, 8 Nov 2024 10:42:56 +0100
> Andrea della Porta <andrea.porta@suse.com> 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@vger.kernel.org
> > Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > Tested-by: Herve Codina <herve.codina@bootlin.com>
> > ---
> > 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.
>
> Nothing to say for the patch itself.
>
> Just here, you mentioned "see [1]" but you didn't provide the link.
>
> IMHO, this is not blocking for applying the patch but, just for other people
> looking at this email in the mailing list, can you reply providing the link?
Thanks for pointing that out, sorry about that. Here it is:
[1] - https://lore.kernel.org/all/f6b445b764312fd8ab96745fe4e97fb22f91ae4c.1730123575.git.andrea.porta@suse.com/
Many thanks,
Andrea
>
> Best regards,
> Hervé
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
2024-11-08 10:14 ` Andrea della Porta
@ 2024-11-14 15:26 ` Andrea della Porta
2024-11-14 15:45 ` Herve Codina
0 siblings, 1 reply; 6+ messages in thread
From: Andrea della Porta @ 2024-11-14 15:26 UTC (permalink / raw)
To: Andrea della Porta
Cc: Herve Codina, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Luca Ceresoli, Thomas Petazzoni,
Andrew Lunn, stable
Hi,
On 11:14 Fri 08 Nov , Andrea della Porta wrote:
> Hi herve,
>
> On 11:09 Fri 08 Nov , Herve Codina wrote:
> > Hi Andrea,
> >
> > On Fri, 8 Nov 2024 10:42:56 +0100
> > Andrea della Porta <andrea.porta@suse.com> 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@vger.kernel.org
> > > Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> > > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > > Tested-by: Herve Codina <herve.codina@bootlin.com>
> > > ---
> > > 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.
> >
> > Nothing to say for the patch itself.
> >
> > Just here, you mentioned "see [1]" but you didn't provide the link.
> >
> > IMHO, this is not blocking for applying the patch but, just for other people
> > looking at this email in the mailing list, can you reply providing the link?
>
> Thanks for pointing that out, sorry about that. Here it is:
>
> [1] - https://lore.kernel.org/all/f6b445b764312fd8ab96745fe4e97fb22f91ae4c.1730123575.git.andrea.porta@suse.com/
Do I have to resubmit the patch with the referenced url fixed or is it
ok as it is?
Thanks,
Andrea
>
> Many thanks,
> Andrea
>
> >
> > Best regards,
> > Hervé
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
2024-11-14 15:26 ` Andrea della Porta
@ 2024-11-14 15:45 ` Herve Codina
0 siblings, 0 replies; 6+ messages in thread
From: Herve Codina @ 2024-11-14 15:45 UTC (permalink / raw)
To: Andrea della Porta
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Luca Ceresoli, Thomas Petazzoni,
Andrew Lunn, stable
Hi Andrea,
On Thu, 14 Nov 2024 16:26:42 +0100
Andrea della Porta <andrea.porta@suse.com> wrote:
> Hi,
>
> On 11:14 Fri 08 Nov , Andrea della Porta wrote:
> > Hi herve,
> >
> > On 11:09 Fri 08 Nov , Herve Codina wrote:
> > > Hi Andrea,
> > >
> > > On Fri, 8 Nov 2024 10:42:56 +0100
> > > Andrea della Porta <andrea.porta@suse.com> 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@vger.kernel.org
> > > > Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> > > > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > > > Tested-by: Herve Codina <herve.codina@bootlin.com>
> > > > ---
> > > > 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.
> > >
> > > Nothing to say for the patch itself.
> > >
> > > Just here, you mentioned "see [1]" but you didn't provide the link.
> > >
> > > IMHO, this is not blocking for applying the patch but, just for other people
> > > looking at this email in the mailing list, can you reply providing the link?
> >
> > Thanks for pointing that out, sorry about that. Here it is:
> >
> > [1] - https://lore.kernel.org/all/f6b445b764312fd8ab96745fe4e97fb22f91ae4c.1730123575.git.andrea.porta@suse.com/
>
> Do I have to resubmit the patch with the referenced url fixed or is it
> ok as it is?
This reference is after the '---' marker line and so will not be present in
the changelog once the patch is applied.
For this reason, I don't think you have to resubmit the patch.
If you need to resubmit the patch for any other reasons (resent because
the patch was applied, modification needed, ...) resubmit it with the
referenced url fixed.
Best regards,
Hervé
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes
2024-11-08 9:42 [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes Andrea della Porta
2024-11-08 10:09 ` Herve Codina
@ 2024-11-15 17:25 ` Bjorn Helgaas
1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2024-11-15 17:25 UTC (permalink / raw)
To: Andrea della Porta, Rob Herring
Cc: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
Conor Dooley, Florian Fainelli,
Broadcom internal kernel review list, Lorenzo Pieralisi,
Krzysztof Wilczynski, Manivannan Sadhasivam, Bjorn Helgaas,
Linus Walleij, Catalin Marinas, Will Deacon, Bartosz Golaszewski,
Derek Kiernan, Dragan Cvetic, Arnd Bergmann, Greg Kroah-Hartman,
Saravana Kannan, linux-clk, devicetree, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-pci, linux-gpio,
Masahiro Yamada, Stefan Wahren, Herve Codina, Luca Ceresoli,
Thomas Petazzoni, Andrew Lunn, stable
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@vger.kernel.org
> Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Tested-by: Herve Codina <herve.codina@bootlin.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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-15 17:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 9:42 [PATCH] PCI: of_property: Assign PCI instead of CPU bus address to dynamic PCI nodes Andrea della Porta
2024-11-08 10:09 ` Herve Codina
2024-11-08 10:14 ` Andrea della Porta
2024-11-14 15:26 ` Andrea della Porta
2024-11-14 15:45 ` Herve Codina
2024-11-15 17:25 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).