OSDN Git Service

staging/rdma/hfi1: Unexpected link up pkey values are not an error
authorDean Luick <dean.luick@intel.com>
Tue, 1 Dec 2015 20:38:21 +0000 (15:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 21:51:55 +0000 (13:51 -0800)
Only warn when link up pkeys are not what we expect.  Also, allow
for the pkey to already be initialized.

Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/hfi1/chip.c

index 3cf6fea..e201c80 100644 (file)
@@ -6716,10 +6716,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);
 }