Skip to contentSkip to conversation

staging/rdma/hfi1: set Gen 3 half-swing for integrated devices.

PATCH In review [email protected] 4 participants 6 messages Dec 1, 2015 – Dec 21, 2015 2 messages not in the archive

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

v4 cover staging/rdma/hfi1: set Gen 3 half-swing for integrated devices.

From: Ira Weiny <[email protected]>

This was a single patch before. The change to dev_dbg required a precursor patch to add the dd_dev_dbg which is consistent with the other dev_* macros which automatically use struct hfi1_devdata.

Dean Luick (1):
staging/rdma/hfi1: set Gen3 half-swing for integrated devices

Ira Weiny (1):
staging/rdma/hf1: add dd_dev_dbg

 drivers/staging/rdma/hfi1/chip_registers.h | 11 ++++
 drivers/staging/rdma/hfi1/hfi.h            |  4 ++
 drivers/staging/rdma/hfi1/pcie.c           | 82 ++++++++++++++++++++++++++++--
 3 files changed, 93 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.2
#1 lore raw

PATCH v4 1/2 staging/rdma/hf1: add dd_dev_dbg

From: Ira Weiny <[email protected]>

To be used in future patches add dd_dev_dbg. dd_* functions properly decode the hfi1_devdata structure used throughout the driver

---
 drivers/staging/rdma/hfi1/hfi.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/rdma/hfi1/hfi.h +4 -0
index 54ed6b36c1a7..f33167c2d1f7 100644
@@ -1758,6 +1758,10 @@ static inline u64 hfi1_pkt_base_sdma_integrity(struct hfi1_devdata *dd)
 	dev_info(&(dd)->pcidev->dev, "%s: " fmt, \
 			get_unit_name((dd)->unit), ##__VA_ARGS__)
 
+#define dd_dev_dbg(dd, fmt, ...) \
+	dev_dbg(&(dd)->pcidev->dev, "%s: " fmt, \
+		get_unit_name((dd)->unit), ##__VA_ARGS__)
+
 #define hfi1_dev_porterr(dd, port, fmt, ...) \
 	dev_err(&(dd)->pcidev->dev, "%s: IB%u:%u " fmt, \
 			get_unit_name((dd)->unit), (dd)->unit, (port), \
Signature · 1 line
1.8.2
#3 lore raw

PATCH v4 2/2 staging/rdma/hfi1: set Gen3 half-swing for integrated devices

In reply to a message not in the archive

From: Dean Luick <[email protected]>

Correctly set half-swing for integrated devices. A0 needs all fields set for CcePcieCtrl. B0 and later only need a few fields set.

---
Changes from V1:
Add comments concerning the very long names.

Changes from V2:
Remove PC Macro and define short names to be used in the code.

Changes from V3:
Use newly defined dd_dev_dbg rather than dd_dev_info

 drivers/staging/rdma/hfi1/chip_registers.h | 11 ++++
 drivers/staging/rdma/hfi1/pcie.c           | 82 ++++++++++++++++++++++++++++--
 2 files changed, 89 insertions(+), 4 deletions(-)
drivers/staging/rdma/hfi1/chip_registers.h +11 -0
index bf45de29d8bd..d0deb2278635 100644
@@ -549,6 +549,17 @@
 #define CCE_MSIX_TABLE_UPPER (CCE + 0x000000100008)
 #define CCE_MSIX_TABLE_UPPER_RESETCSR 0x0000000100000000ull
 #define CCE_MSIX_VEC_CLR_WITHOUT_INT (CCE + 0x000000110400)
+#define CCE_PCIE_CTRL (CCE + 0x0000000000C0)
+#define CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_MASK 0x3ull
+#define CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_SHIFT 0
+#define CCE_PCIE_CTRL_PCIE_LANE_DELAY_MASK 0xFull
+#define CCE_PCIE_CTRL_PCIE_LANE_DELAY_SHIFT 2
+#define CCE_PCIE_CTRL_XMT_MARGIN_OVERWRITE_ENABLE_SHIFT 8
+#define CCE_PCIE_CTRL_XMT_MARGIN_SHIFT 9
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_SHIFT 12
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_MASK 0x7ull
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_SHIFT 13
 #define CCE_REVISION (CCE + 0x000000000000)
 #define CCE_REVISION2 (CCE + 0x000000000008)
 #define CCE_REVISION2_HFI_ID_MASK 0x1ull
drivers/staging/rdma/hfi1/pcie.c +78 -4

95 lines not on this page · raw message

Signature · 6 lines
1.8.2

--
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
#6 lore raw
In reply to a message not in the archive

Any further feedback on this series?

Ira

Quoted 9 lines · On Tue, Dec 01, 2015 at 02:47:55PM -0500…

From: Ira Weiny <[email protected]>

This was a single patch before. The change to dev_dbg required a precursor patch to add the dd_dev_dbg which is consistent with the other dev_* macros which automatically use struct hfi1_devdata.

Dean Luick (1):
staging/rdma/hfi1: set Gen3 half-swing for integrated devices

Quoted 11 lines

Ira Weiny (1):
staging/rdma/hf1: add dd_dev_dbg

 drivers/staging/rdma/hfi1/chip_registers.h | 11 ++++
 drivers/staging/rdma/hfi1/hfi.h            |  4 ++
 drivers/staging/rdma/hfi1/pcie.c           | 82 ++++++++++++++++++++++++++++--
 3 files changed, 93 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.2

--
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

maintainer
#7 lore raw
Quoted 1 line · ira.weiny

Any further feedback on this series?

I'm way behind on staging patches right now (1000+ patches behind...), hopefully will catch up on them this week.

thanks,

greg k-h

#5 lore raw

Re: [PATCH v4 2/2] staging/rdma/hfi1: set Gen3 half-swing for integrated devices

In reply to a message not in the archive
Quoted 94 lines · On Tue, Dec 01, 2015 at 02:47:57PM -0500…

From: Dean Luick <[email protected]>

Correctly set half-swing for integrated devices. A0 needs all fields set for CcePcieCtrl. B0 and later only need a few fields set.

---
Changes from V1:
Add comments concerning the very long names.

Changes from V2:
Remove PC Macro and define short names to be used in the code.

Changes from V3:
Use newly defined dd_dev_dbg rather than dd_dev_info

 drivers/staging/rdma/hfi1/chip_registers.h | 11 ++++
 drivers/staging/rdma/hfi1/pcie.c           | 82 ++++++++++++++++++++++++++++--
 2 files changed, 89 insertions(+), 4 deletions(-)
drivers/staging/rdma/hfi1/chip_registers.h +11 -0
index bf45de29d8bd..d0deb2278635 100644
@@ -549,6 +549,17 @@
 #define CCE_MSIX_TABLE_UPPER (CCE + 0x000000100008)
 #define CCE_MSIX_TABLE_UPPER_RESETCSR 0x0000000100000000ull
 #define CCE_MSIX_VEC_CLR_WITHOUT_INT (CCE + 0x000000110400)
+#define CCE_PCIE_CTRL (CCE + 0x0000000000C0)
+#define CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_MASK 0x3ull
+#define CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_SHIFT 0
+#define CCE_PCIE_CTRL_PCIE_LANE_DELAY_MASK 0xFull
+#define CCE_PCIE_CTRL_PCIE_LANE_DELAY_SHIFT 2
+#define CCE_PCIE_CTRL_XMT_MARGIN_OVERWRITE_ENABLE_SHIFT 8
+#define CCE_PCIE_CTRL_XMT_MARGIN_SHIFT 9
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_SHIFT 12
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_MASK 0x7ull
+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_SHIFT 13
 #define CCE_REVISION (CCE + 0x000000000000)
 #define CCE_REVISION2 (CCE + 0x000000000008)
 #define CCE_REVISION2_HFI_ID_MASK 0x1ull
drivers/staging/rdma/hfi1/pcie.c +41 -0
index 0b7eafb0fc70..eb3e2159ad41 100644
@@ -867,6 +867,83 @@ static void arm_gasket_logic(struct hfi1_devdata *dd)
 }
 
 /*
+ * CCE_PCIE_CTRL long name helpers
+ * We redefine these shorter macros to use in the code while leaving
+ * chip_registers.h to be autogenerated from the hardware spec.
+ */
+#define LANE_BUNDLE_MASK              CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_MASK
+#define LANE_BUNDLE_SHIFT             CCE_PCIE_CTRL_PCIE_LANE_BUNDLE_SHIFT
+#define LANE_DELAY_MASK               CCE_PCIE_CTRL_PCIE_LANE_DELAY_MASK
+#define LANE_DELAY_SHIFT              CCE_PCIE_CTRL_PCIE_LANE_DELAY_SHIFT
+#define MARGIN_OVERWRITE_ENABLE_SHIFT CCE_PCIE_CTRL_XMT_MARGIN_OVERWRITE_ENABLE_SHIFT
+#define MARGIN_SHIFT                  CCE_PCIE_CTRL_XMT_MARGIN_SHIFT
+#define MARGIN_G1_G2_OVERWRITE_MASK   CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK
+#define MARGIN_G1_G2_OVERWRITE_SHIFT  CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_SHIFT
+#define MARGIN_GEN1_GEN2_MASK         CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_MASK
+#define MARGIN_GEN1_GEN2_SHIFT        CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_SHIFT
+
+ /*
+  * Write xmt_margin for full-swing (WFR-B) or half-swing (WFR-C).
+  */
+static void write_xmt_margin(struct hfi1_devdata *dd, const char *fname)
+{
+	u64 pcie_ctrl;
+	u64 xmt_margin;
+	u64 xmt_margin_oe;
+	u64 lane_delay;
+	u64 lane_bundle;
+
+	pcie_ctrl = read_csr(dd, CCE_PCIE_CTRL);
+
+	/*
+	 * For Discrete, use full-swing.
+	 *  - PCIe TX defaults to full-swing.
+	 *    Leave this register as default.
+	 * For Integrated, use half-swing
+	 *  - Copy xmt_margin and xmt_margin_oe
+	 *    from Gen1/Gen2 to Gen3.
+	 */
+	if (dd->pcidev->device == PCI_DEVICE_ID_INTEL1) { /* integrated */
+		/* extract initial fields */
+		xmt_margin = (pcie_ctrl >> MARGIN_GEN1_GEN2_SHIFT)
+			      & MARGIN_GEN1_GEN2_MASK;
+		xmt_margin_oe = (pcie_ctrl >> MARGIN_G1_G2_OVERWRITE_SHIFT)

drivers/staging/rdma/hfi1/pcie.c static void arm_gasket_logic(struct hfi1_devdata *dd) · line 920

Quoted 10 lines
drivers/staging/rdma/hfi1/pcie.c +10 -0
+				 & MARGIN_G1_G2_OVERWRITE_MASK;
+		lane_delay = (pcie_ctrl >> LANE_DELAY_SHIFT) & LANE_DELAY_MASK;
+		lane_bundle = (pcie_ctrl >> LANE_BUNDLE_SHIFT)
+			       & LANE_BUNDLE_MASK;
+
+		/*
+		 * For A0, EFUSE values are not set.  Override with the
+		 * correct values.
+		 */
+		if (is_a0(dd)) {

This line causes a build error, please be more careful and test your patches before you send them out :(

--
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