IB/hfi1: Acquire QSFP cable information on loopback
authorJan Sokolowski <jan.sokolowski@intel.com>
Mon, 28 Aug 2017 18:23:21 +0000 (11:23 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 28 Aug 2017 23:12:26 +0000 (19:12 -0400)
Currently, QSFP information is not queried
in cases where loopback was set up and QSFP module is
present.

Acquire QSFP information in case of loopback.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/platform.c

index 8004f1da75485ba322a4bf3b66b01980941b4b13..a8af96d2b1b0ae0dc5e98ae08e3b5c9b5faa50e9 100644 (file)
@@ -944,6 +944,21 @@ void tune_serdes(struct hfi1_pportdata *ppd)
        if (loopback != LOOPBACK_NONE ||
            ppd->dd->icode == ICODE_FUNCTIONAL_SIMULATOR) {
                ppd->driver_link_ready = 1;
+
+               if (qsfp_mod_present(ppd)) {
+                       ret = acquire_chip_resource(ppd->dd,
+                                                   qsfp_resource(ppd->dd),
+                                                   QSFP_WAIT);
+                       if (ret) {
+                               dd_dev_err(ppd->dd, "%s: hfi%d: cannot lock i2c chain\n",
+                                          __func__, (int)ppd->dd->hfi1_id);
+                               goto bail;
+                       }
+
+                       refresh_qsfp_cache(ppd, &ppd->qsfp_info);
+                       release_chip_resource(ppd->dd, qsfp_resource(ppd->dd));
+               }
+
                return;
        }