summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorJan Sokolowski2017-08-28 20:23:21 +0200
committerDoug Ledford2017-08-29 01:12:26 +0200
commitba81a427c35c827bb220f1a87231b3460e0bd879 (patch)
treead88df1085ee295f5f71512bbc7c6c5c3361a352 /drivers/infiniband/hw
parenti40iw: make some structures const (diff)
downloadkernel-qcow2-linux-ba81a427c35c827bb220f1a87231b3460e0bd879.tar.gz
kernel-qcow2-linux-ba81a427c35c827bb220f1a87231b3460e0bd879.tar.xz
kernel-qcow2-linux-ba81a427c35c827bb220f1a87231b3460e0bd879.zip
IB/hfi1: Acquire QSFP cable information on loopback
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>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/hfi1/platform.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/platform.c b/drivers/infiniband/hw/hfi1/platform.c
index 8004f1da7548..a8af96d2b1b0 100644
--- a/drivers/infiniband/hw/hfi1/platform.c
+++ b/drivers/infiniband/hw/hfi1/platform.c
@@ -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;
}