dmanegine: idxd: check batch before init in __get_desc

commit f4735eec028420bcd5ff3e0f0b955aa84c8f502c Intel-BKC.

IAX does not have batch support. So don't attempt to init the batch
structure during descriptor allocation.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Chen Zhuo <sagazchen@tencent.com>
Signed-off-by: Xinghui Li <korantli@tencent.com>
This commit is contained in:
Dave Jiang 2022-03-22 17:09:19 -07:00 committed by Jianping Liu
parent ec3940b227
commit a09f48f5a2
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@ static struct idxd_desc *__get_desc(struct idxd_wq *wq, int idx, int cpu)
desc = wq->descs[idx];
memset(desc->hw, 0, sizeof(struct dsa_hw_desc));
memset(desc->completion, 0, idxd->data->compl_size);
desc->batch->num = 0;
if (desc->batch)
desc->batch->num = 0;
desc->cpu = cpu;
if (device_pasid_enabled(idxd))