crypto: hisilicon/sgl - add some dfx logs
Add some dfx logs in some abnormal exit situations. Signed-off-by: Kai Ye <yekai13@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
c5f735bbf3
commit
197272b8f0
@ -90,8 +90,10 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev,
|
||||
block[i].sgl = dma_alloc_coherent(dev, block_size,
|
||||
&block[i].sgl_dma,
|
||||
GFP_KERNEL);
|
||||
if (!block[i].sgl)
|
||||
if (!block[i].sgl) {
|
||||
dev_err(dev, "Fail to allocate hw SG buffer!\n");
|
||||
goto err_free_mem;
|
||||
}
|
||||
|
||||
block[i].size = block_size;
|
||||
}
|
||||
@ -100,8 +102,10 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev,
|
||||
block[i].sgl = dma_alloc_coherent(dev, remain_sgl * sgl_size,
|
||||
&block[i].sgl_dma,
|
||||
GFP_KERNEL);
|
||||
if (!block[i].sgl)
|
||||
if (!block[i].sgl) {
|
||||
dev_err(dev, "Fail to allocate remained hw SG buffer!\n");
|
||||
goto err_free_mem;
|
||||
}
|
||||
|
||||
block[i].size = remain_sgl * sgl_size;
|
||||
}
|
||||
@ -216,16 +220,19 @@ hisi_acc_sg_buf_map_to_hw_sgl(struct device *dev,
|
||||
sg_n = sg_nents(sgl);
|
||||
|
||||
sg_n_mapped = dma_map_sg(dev, sgl, sg_n, DMA_BIDIRECTIONAL);
|
||||
if (!sg_n_mapped)
|
||||
if (!sg_n_mapped) {
|
||||
dev_err(dev, "DMA mapping for SG error!\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
if (sg_n_mapped > pool->sge_nr) {
|
||||
dma_unmap_sg(dev, sgl, sg_n, DMA_BIDIRECTIONAL);
|
||||
dev_err(dev, "the number of entries in input scatterlist is bigger than SGL pool setting.\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
curr_hw_sgl = acc_get_sgl(pool, index, &curr_sgl_dma);
|
||||
if (IS_ERR(curr_hw_sgl)) {
|
||||
dev_err(dev, "Get SGL error!\n");
|
||||
dma_unmap_sg(dev, sgl, sg_n, DMA_BIDIRECTIONAL);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user