Skip to contentSkip to conversation

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

PATCH Superseded [email protected] 2 participants 4 messages Nov 5, 2015

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/staging/rdma/hfi1/chip_registers.h | 11 +++++
 drivers/staging/rdma/hfi1/pcie.c           | 74 ++++++++++++++++++++++++++++--
 2 files changed, 81 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 +70 -4

87 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
#1 lore raw
Quoted 1 line · On Wed, Nov 04, 2015 at 09:06:08PM -0500, [email protected] wrote:

+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull

There is absolutely no point to having a variable name which is nine bajillion characters long since we are not able to use it and have to instead use macro majic to hide the first twelve zillion characters. If we can't even see the name when it is used, then why does it exist? Also macro magic breaks grep and cscope. Just think of a better name to begin with and get rid of the PC macro.

regards,
dan carpenter

author
#2 lore raw
Quoted 8 lines · Dan Carpenter
Quoted 1 line · On Wed, Nov 04, 2015 at 09:06:08PM -0500…

+#define CCE_PCIE_CTRL_XMT_MARGIN_GEN1_GEN2_OVERWRITE_ENABLE_MASK 0x1ull

There is absolutely no point to having a variable name which is nine bajillion characters long since we are not able to use it and have to instead use macro majic to hide the first twelve zillion characters.

The long names are directly from the hardware specification.

Quoted 5 lines

If
we can't even see the name when it is used, then why does it exist? Also macro magic breaks grep and cscope. Just think of a better name to begin with and get rid of the PC macro.

We did not want the PC macro but using the "real" names caused checkpatch failures. Indeed using the PC macro reduces the readability of the code in terms of following the hardware spec because we lose the "real" name.

Is this an example where we should ignore the line lengths of checkpatch to preserve the readability of the code?

Thanks,
Ira

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

#3 lore raw
Quoted 2 lines · ira.weiny

Is this an example where we should ignore the line lengths of checkpatch to preserve the readability of the code?

Honestly, you can't fight checkpatch, especially in staging. Rejecting patches is a drain on your emotions and your energy. We accept all checkpatch fixes if they are half way decent.

Maybe just put a comment in the header about the full hardware name?

This patch breaks cscope and we don't end up actually using the hardware name in the end...

regards,
dan carpenter