* [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port
@ 2025-03-11 7:24 Thippeswamy Havalige
2025-03-11 7:27 ` Krzysztof Wilczyński
0 siblings, 1 reply; 4+ messages in thread
From: Thippeswamy Havalige @ 2025-03-11 7:24 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kw, manivannan.sadhasivam, robh, krzk+dt,
conor+dt
Cc: linux-pci, devicetree, linux-kernel, michal.simek,
bharat.kumar.gogada, Thippeswamy Havalige
Fix an incorrect conditional check in xilinx_cpm_pcie_init_port().
The previous condition mistakenly skipped initialization for all
versions except CPM5NC_HOST. This is now corrected to ensure that only
the CPM5NC_HOST is skipped while other versions proceed with
initialization.
Signed-off-by: Thippeswamy Havalige <thippeswamy.havalige@amd.com>
Fixes: 3f62f3280275 ("PCI: xilinx-cpm: Add support for Versal Net CPM5NC
Root Port controller")
---
drivers/pci/controller/pcie-xilinx-cpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c
index c2dd6fda905f..d0ab187d917f 100644
--- a/drivers/pci/controller/pcie-xilinx-cpm.c
+++ b/drivers/pci/controller/pcie-xilinx-cpm.c
@@ -479,7 +479,7 @@ static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie *port)
{
const struct xilinx_cpm_variant *variant = port->variant;
- if (variant->version != CPM5NC_HOST)
+ if (variant->version == CPM5NC_HOST)
return;
if (cpm_pcie_link_up(port))
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port
2025-03-11 7:24 [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port Thippeswamy Havalige
@ 2025-03-11 7:27 ` Krzysztof Wilczyński
2025-03-11 9:58 ` Havalige, Thippeswamy
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Wilczyński @ 2025-03-11 7:27 UTC (permalink / raw)
To: Thippeswamy Havalige
Cc: bhelgaas, lpieralisi, manivannan.sadhasivam, robh, krzk+dt,
conor+dt, linux-pci, devicetree, linux-kernel, michal.simek,
bharat.kumar.gogada
Hello,
> Fix an incorrect conditional check in xilinx_cpm_pcie_init_port().
>
> The previous condition mistakenly skipped initialization for all
> versions except CPM5NC_HOST. This is now corrected to ensure that only
> the CPM5NC_HOST is skipped while other versions proceed with
> initialization.
[...]
> {
> const struct xilinx_cpm_variant *variant = port->variant;
>
> - if (variant->version != CPM5NC_HOST)
> + if (variant->version == CPM5NC_HOST)
> return;
>
> if (cpm_pcie_link_up(port))
Ouch! Nice catch.
I will pull and squash this against the existing code directly on the branch.
Thank you!
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port
2025-03-11 7:27 ` Krzysztof Wilczyński
@ 2025-03-11 9:58 ` Havalige, Thippeswamy
2025-03-11 14:50 ` Krzysztof Wilczyński
0 siblings, 1 reply; 4+ messages in thread
From: Havalige, Thippeswamy @ 2025-03-11 9:58 UTC (permalink / raw)
To: Krzysztof Wilczyński
Cc: bhelgaas@google.com, lpieralisi@kernel.org,
manivannan.sadhasivam@linaro.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Simek, Michal, Gogada, Bharat Kumar
[AMD Official Use Only - AMD Internal Distribution Only]
Hello,
Thank you.
Regards,
Thippeswamy H
> -----Original Message-----
> From: Krzysztof Wilczyński <kw@linux.com>
> Sent: Tuesday, March 11, 2025 12:58 PM
> To: Havalige, Thippeswamy <thippeswamy.havalige@amd.com>
> Cc: bhelgaas@google.com; lpieralisi@kernel.org;
> manivannan.sadhasivam@linaro.org; robh@kernel.org; krzk+dt@kernel.org;
> conor+dt@kernel.org; linux-pci@vger.kernel.org; devicetree@vger.kernel.org;
> linux-kernel@vger.kernel.org; Simek, Michal <michal.simek@amd.com>;
> Gogada, Bharat Kumar <bharat.kumar.gogada@amd.com>
> Subject: Re: [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port
>
> Hello,
>
> > Fix an incorrect conditional check in xilinx_cpm_pcie_init_port().
> >
> > The previous condition mistakenly skipped initialization for all
> > versions except CPM5NC_HOST. This is now corrected to ensure that only
> > the CPM5NC_HOST is skipped while other versions proceed with
> > initialization.
>
> [...]
> > {
> > const struct xilinx_cpm_variant *variant = port->variant;
> >
> > - if (variant->version != CPM5NC_HOST)
> > + if (variant->version == CPM5NC_HOST)
> > return;
> >
> > if (cpm_pcie_link_up(port))
>
> Ouch! Nice catch.
>
> I will pull and squash this against the existing code directly on the branch.
>
> Thank you!
>
> Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port
2025-03-11 9:58 ` Havalige, Thippeswamy
@ 2025-03-11 14:50 ` Krzysztof Wilczyński
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2025-03-11 14:50 UTC (permalink / raw)
To: Havalige, Thippeswamy
Cc: bhelgaas@google.com, lpieralisi@kernel.org,
manivannan.sadhasivam@linaro.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Simek, Michal, Gogada, Bharat Kumar
[...]
> Thank you.
Done. Have a look at:
https://web.git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/xilinx-cpm&id=ad3b7174d4d04b7e2ab81df5857c4da6b4bc1ade
Let me know if there is anything else that needs an update.
Also, if you have a moment, then check if the other special cases for
CPM5NC_HOST variant are correct. Would be nice to catch any issues
before the changes land in the upstream.
Thank you!
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-11 14:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 7:24 [PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port Thippeswamy Havalige
2025-03-11 7:27 ` Krzysztof Wilczyński
2025-03-11 9:58 ` Havalige, Thippeswamy
2025-03-11 14:50 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox