From: Christopher Bednarz Date: Mon, 16 Oct 2017 20:46:03 +0000 (-0500) Subject: i40iw: Clear CQP Head/Tail during initialization X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=56b2f52310f9fdfc1ea7b99702f827f84ad16801;p=openwrt%2Fstaging%2Fblogic.git i40iw: Clear CQP Head/Tail during initialization 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 Signed-off-by: Shiraz Saleem Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c index 3b6d12176413..e5c8f579e67b 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c +++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c @@ -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,