提交 01635695 编写于 作者: Y Yangyang Li 提交者: Xie XiuQi

RDMA/hns: Ensure that the flush work is completed before qp release

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Ensure that the flush work is completed before qp release.

Feature or Bugfix:Bugfix
Signed-off-by: NYangyang Li <liyangyang20@huawei.com>
Signed-off-by: Nliyangyang (M) <liyangyang20@huawei.com>
Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3a873683
......@@ -60,6 +60,8 @@ static void flush_work_handle(struct work_struct *work)
dev_err(dev, "Modify qp to err for flush cqe fail(%d)\n", ret);
kfree(flush_work);
if (atomic_dec_and_test(&hr_qp->refcount))
complete(&hr_qp->free);
}
void init_flush_work(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
......@@ -73,6 +75,7 @@ void init_flush_work(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
flush_work->hr_dev = hr_dev;
flush_work->hr_qp = hr_qp;
INIT_WORK(&flush_work->work, flush_work_handle);
atomic_inc(&hr_qp->refcount);
queue_work(hr_dev->flush_workq, &flush_work->work);
}
EXPORT_SYMBOL_GPL(init_flush_work);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册