Skip to contentSkip to conversation

PCI: qcom: Fix incorrect register offset in pcie init

PATCH In review Prasad Malisetty 3 participants 4 messages Oct 14, 2021 – Oct 21, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: qcom: Fix incorrect register offset in pcie init

In pcie_init_2_7_0 one of the register writes using incorrect offset as per the platform register definitions (PCIE_PARF_AXI_MSTR_WR_ADDR_HALT offset value should be 0x1A8 instead 0x178).
Update the correct offset value for SDM845 platform.

Fixes ed8cc3b1 ("PCI: qcom: Add support for SDM845 PCIe controller")
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +2 -2
index 8a7a300..5bce152 100644
@@ -1230,9 +1230,9 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 	writel(val, pcie->parf + PCIE20_PARF_MHI_CLOCK_RESET_CTRL);
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 		val |= BIT(31);
-		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 	}
 
 	return 0;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

This looks specific to SDM845, so the subject line should mention SDM845, e.g.,

PCI: qcom: Fix SDM845 incorrect register offset

Quoted 4 lines · Prasad Malisetty

In pcie_init_2_7_0 one of the register writes using incorrect offset as per the platform register definitions (PCIE_PARF_AXI_MSTR_WR_ADDR_HALT offset value should be 0x1A8 instead 0x178).
Update the correct offset value for SDM845 platform.

Add "()" after function name. Add blank line between paragraphs.

It'd be nice to have a clue about what fails because of the incorrect register offset. ed8cc3b1fc84 is almost two years old, so I guess it's not an obvious issue.

Quoted 1 line
Fixes ed8cc3b1 ("PCI: qcom: Add support for SDM845 PCIe controller")

Capitalize "Fixes:", use 12-char SHA1, remove blank line after. Look at previous git history and copy the style there.

Quoted 2 lines

It looks like ed8cc3b1fc84 appeared in v5.6, so this should probably have a "Cc: [email protected]" tag as well.

Quoted 24 lines
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +2 -2
index 8a7a300..5bce152 100644
@@ -1230,9 +1230,9 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 	writel(val, pcie->parf + PCIE20_PARF_MHI_CLOCK_RESET_CTRL);
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 		val |= BIT(31);
-		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 	}
 
 	return 0;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v1 1/1
#2 lore raw
In reply to Prasad Malisetty
Quoted 8 lines · Prasad Malisetty

In pcie_init_2_7_0 one of the register writes using incorrect offset as per the platform register definitions (PCIE_PARF_AXI_MSTR_WR_ADDR_HALT offset value should be 0x1A8 instead 0x178).
Update the correct offset value for SDM845 platform.

Fixes ed8cc3b1 ("PCI: qcom: Add support for SDM845 PCIe controller")

After incorporating the reviews from Bjorn H,

Thanks,
Mani

Quoted 24 lines
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +2 -2
index 8a7a300..5bce152 100644
@@ -1230,9 +1230,9 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 	writel(val, pcie->parf + PCIE20_PARF_MHI_CLOCK_RESET_CTRL);
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 		val |= BIT(31);
-		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 	}
 
 	return 0;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#3 lore raw
Quoted 8 lines · Manivannan Sadhasivam
Quoted 7 lines · Prasad Malisetty

In pcie_init_2_7_0 one of the register writes using incorrect offset as per the platform register definitions (PCIE_PARF_AXI_MSTR_WR_ADDR_HALT offset value should be 0x1A8 instead 0x178).
Update the correct offset value for SDM845 platform.

Fixes ed8cc3b1 ("PCI: qcom: Add support for SDM845 PCIe controller")
Quoted 9 lines
Quoted 1 line

After incorporating the reviews from Bjorn H,

Thanks,
Mani

Thanks Mani for the review. I will incorporate the changes as suggested by Bjorn H in next patch version.

-Prasad

Quoted 25 lines
Quoted 25 lines
---
 drivers/pci/controller/dwc/pcie-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +2 -2
index 8a7a300..5bce152 100644
@@ -1230,9 +1230,9 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie 
 *pcie)
 	writel(val, pcie->parf + PCIE20_PARF_MHI_CLOCK_RESET_CTRL);
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 		val |= BIT(31);
-		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
+		writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 	}
 

return 0;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project