From: Dean Luick <[email protected]>

Only warn when link up pkeys are not what we expect.  Also, allow
for the pkey to already be initialized.

Reviewed-by: Arthur Kepner <[email protected]>
Signed-off-by: Dean Luick <[email protected]>
Signed-off-by: Jubin John <[email protected]>
---
 drivers/staging/rdma/hfi1/chip.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index c83f360..a62a538 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -6725,10 +6725,10 @@ static void add_full_mgmt_pkey(struct hfi1_pportdata 
*ppd)
 {
        struct hfi1_devdata *dd = ppd->dd;
 
-       /* Sanity check - ppd->pkeys[2] should be 0 */
-       if (ppd->pkeys[2] != 0)
-               dd_dev_err(dd, "%s pkey[2] already set to 0x%x, resetting it to 
0x%x\n",
-                          __func__, ppd->pkeys[2], FULL_MGMT_P_KEY);
+       /* Sanity check - ppd->pkeys[2] should be 0, or already initalized */
+       if (!((ppd->pkeys[2] == 0) || (ppd->pkeys[2] == FULL_MGMT_P_KEY)))
+               dd_dev_warn(dd, "%s pkey[2] already set to 0x%x, resetting it 
to 0x%x\n",
+                           __func__, ppd->pkeys[2], FULL_MGMT_P_KEY);
        ppd->pkeys[2] = FULL_MGMT_P_KEY;
        (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
 }
-- 
1.7.0.7

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to