i40iw: Move cqp_cmd_head init to CQP initialization
authorBob Sharp <Robert.O.Sharp@intel.com>
Mon, 16 Oct 2017 20:46:05 +0000 (15:46 -0500)
committerDoug Ledford <dledford@redhat.com>
Wed, 18 Oct 2017 17:28:46 +0000 (13:28 -0400)
Control QP (CQP) command backlog list is initialized at
device initialization time.  It is not reinitialized in
the reset flow.  Move the initialization to CQP creation
time so the list can be initialized correctly for reset as well.

Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls")
Signed-off-by: Bob Sharp <Robert.O.Sharp@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_ctrl.c

index c8a40b3fbc3113c4b3101e1aadef53948799ab2f..d88c6cf47cf275565ea98aba66f9638387db702c 100644 (file)
@@ -482,6 +482,7 @@ static enum i40iw_status_code i40iw_sc_cqp_init(struct i40iw_sc_cqp *cqp,
        I40IW_RING_INIT(cqp->sq_ring, cqp->sq_size);
        cqp->dev->cqp_cmd_stats[OP_REQUESTED_COMMANDS] = 0;
        cqp->dev->cqp_cmd_stats[OP_COMPLETED_COMMANDS] = 0;
+       INIT_LIST_HEAD(&cqp->dev->cqp_cmd_head);               /* for the cqp commands backlog. */
 
        i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPTAIL, 0);
        i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPDB, 0);
@@ -5067,7 +5068,6 @@ enum i40iw_status_code i40iw_device_init(struct i40iw_sc_dev *dev,
        u8 db_size;
 
        spin_lock_init(&dev->cqp_lock);
-       INIT_LIST_HEAD(&dev->cqp_cmd_head);             /* for the cqp commands backlog. */
 
        i40iw_device_init_uk(&dev->dev_uk);