IB/hfi1: Move iowait_init() to priv allocate
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 6 Sep 2016 11:36:53 +0000 (04:36 -0700)
committerDoug Ledford <dledford@redhat.com>
Sun, 2 Oct 2016 12:42:09 +0000 (08:42 -0400)
The call is misplaced in the reset calldown function
and causes issues with lockdep assertions that are to
be added.

Fixes: Commit a2c2d608957c ("staging/rdma/hfi1: Remove create_qp functionality")
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/qp.c

index 63f56a8bb33210cc3574b8e2193ddf38ae84863a..53ad10ce4f5009f25553cfce9d4ef5ba16a69950 100644 (file)
@@ -806,6 +806,13 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp,
                kfree(priv);
                return ERR_PTR(-ENOMEM);
        }
+       iowait_init(
+               &priv->s_iowait,
+               1,
+               _hfi1_do_send,
+               iowait_sleep,
+               iowait_wakeup,
+               iowait_sdma_drained);
        setup_timer(&priv->s_rnr_timer, hfi1_rc_rnr_retry, (unsigned long)qp);
        qp->s_timer.function = hfi1_rc_timeout;
        return priv;
@@ -871,13 +878,6 @@ void notify_qp_reset(struct rvt_qp *qp)
 {
        struct hfi1_qp_priv *priv = qp->priv;
 
-       iowait_init(
-               &priv->s_iowait,
-               1,
-               _hfi1_do_send,
-               iowait_sleep,
-               iowait_wakeup,
-               iowait_sdma_drained);
        priv->r_adefered = 0;
        clear_ahg(qp);
 }