i40iw: Clear CQP Head/Tail during initialization
authorChristopher Bednarz <christopher.n.bednarz@intel.com>
Mon, 16 Oct 2017 20:46:03 +0000 (15:46 -0500)
committerDoug Ledford <dledford@redhat.com>
Wed, 18 Oct 2017 17:28:46 +0000 (13:28 -0400)
Clear Control Queue Pair (CQP) Head/Tail on CQP
initialization as during an adapter reset, these
values are not reinitialized. Tail is cleared by
writing 0 to CQP's tail register. Head is cleared
by writing 0 to CQP's doorbell register.

Fixes: 86dbcd0f12e9 ("i40iw: add file to handle cqp calls")
Signed-off-by: Christopher Bednarz <christopher.n.bednarz@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 3b6d12176413e866943f39ed8287743eac2eaaf0..e5c8f579e67b5f37d27556316e563c7c5b26df3a 100644 (file)
@@ -483,6 +483,9 @@ static enum i40iw_status_code i40iw_sc_cqp_init(struct i40iw_sc_cqp *cqp,
        cqp->dev->cqp_cmd_stats[OP_REQUESTED_COMMANDS] = 0;
        cqp->dev->cqp_cmd_stats[OP_COMPLETED_COMMANDS] = 0;
 
+       i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPTAIL, 0);
+       i40iw_wr32(cqp->dev->hw, I40E_PFPE_CQPDB, 0);
+
        i40iw_debug(cqp->dev, I40IW_DEBUG_WQE,
                    "%s: sq_size[%04d] hw_sq_size[%04d] sq_base[%p] sq_pa[%llxh] cqp[%p] polarity[x%04X]\n",
                    __func__, cqp->sq_size, cqp->hw_sq_size,