Skip to contentSkip to conversation

IB/hfi1: change PCI bar addr assignments to Linux API functions

PATCH In review Steven L. Roberts 3 participants 4 messages May 10, 2017 2 messages not in the archive

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

PATCH 1/1 IB/hfi1: change PCI bar addr assignments to Linux API functions

From: "Steven L. Roberts" <[email protected]>

The Ominpath adapter driver fails to load the ppc64le platform due to invalid PCI setup.

This patch makes the PCI configuration more robust and will fixes 64 bit addressing for ppc64le.

---
 drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/pcie.c +2 -2
index 93faf86..6a9f6f9 100644
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
 	/*
 	 * Save BARs and command to rewrite after device reset.
 	 */
-	dd->pcibar0 = addr;
-	dd->pcibar1 = addr >> 32;
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);
 	pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);
 	pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);
 	pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);
Signature · 6 lines
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive
Quoted 18 lines · Steven L. Roberts

From: "Steven L. Roberts" <[email protected]>

The Ominpath adapter driver fails to load the ppc64le platform due to invalid PCI setup.

This patch makes the PCI configuration more robust and will fixes 64 bit addressing for ppc64le.

---
 drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/pcie.c +0 -0
index 93faf86..6a9f6f9 100644

drivers/infiniband/hw/hfi1/pcie.c int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) · line 211

Quoted 7 lines
drivers/infiniband/hw/hfi1/pcie.c +2 -2
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
 	/*
 	 * Save BARs and command to rewrite after device reset.
 	 */
-	dd->pcibar0 = addr;
-	dd->pcibar1 = addr >> 32;
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);

Why do you even read / re-write them? Thjis isn't the drivers job. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to a message not in the archive
Quoted 14 lines · Christoph Hellwig
Quoted 13 lines · Steven L. Roberts

From: "Steven L. Roberts" <[email protected]>

The Ominpath adapter driver fails to load the ppc64le platform due to invalid PCI setup.

This patch makes the PCI configuration more robust and will fixes 64 bit addressing for ppc64le.

---
 drivers/infiniband/hw/hfi1/pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/infiniband/hw/hfi1/pcie.c int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) · line 211

Quoted 12 lines
drivers/infiniband/hw/hfi1/pcie.c +2 -2
index 93faf86..6a9f6f9 100644
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev)
 	/*
 	 * Save BARs and command to rewrite after device reset.
 	 */
-	dd->pcibar0 = addr;
-	dd->pcibar1 = addr >> 32;
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
+	pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);

Why do you even read / re-write them? Thjis isn't the drivers job.

We save them off so we can restore after a reset wipes them out. See restore_pci_variables().

The restore function already uses the PCI_BASE_ADDRESS_* values so the only change was needed here.

-Denny

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive
Quoted 4 lines · Steven L. Roberts

From: "Steven L. Roberts" <[email protected]>

The Ominpath adapter driver fails to load the ppc64le platform due to invalid PCI setup.

Omnipath -> Omni-Path

Quoted 2 lines

This patch makes the PCI configuration more robust and will fixes 64 bit addressing for ppc64le.

fixes -> fix

Quoted 1 line

Please touch up those two typos and add:

Thanks for the patch!

-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html