mbox series

[v2,0/5] bug fix and clear coding style

Message ID 1617089946-48078-1-git-send-email-yekai13@huawei.com
Headers show
Series bug fix and clear coding style | expand

Message

yekai (A) March 30, 2021, 7:39 a.m. UTC
fixup coding style such as magic number and unneeded variable
initialization. Clear data operation in sg buf unmap, and other
misc fix.

Kai Ye (5):
  crypto: hisilicon/sgl - fixup coding style
  crypto: hisilicon/sgl - delete unneeded variable initialization
  crypto: hisilicon/sgl - add some dfx logs
  crypto: hisilicon/sgl - fix the soft sg map to hardware sg
  crypto: hisilicon/sgl - fix the sg buf unmap

 drivers/crypto/hisilicon/sgl.c | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

Comments

Joe Perches March 30, 2021, 7:56 a.m. UTC | #1
On Tue, 2021-03-30 at 15:39 +0800, Kai Ye wrote:
> Add some dfx logs in some abnormal exit situations.
[]
> diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
[]
> @@ -87,8 +87,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");

This doesn't seem useful as dma_alloc_coherent does a dump_stack
by default on OOM.
yekai (A) March 30, 2021, 9:24 a.m. UTC | #2
However, I think this log can be used to quickly locate the function or 
module if dma alloc failed.


On 2021/3/30 15:56, Joe Perches wrote:
> On Tue, 2021-03-30 at 15:39 +0800, Kai Ye wrote:
>> Add some dfx logs in some abnormal exit situations.
> []
>> diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
> []
>> @@ -87,8 +87,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");
> This doesn't seem useful as dma_alloc_coherent does a dump_stack
> by default on OOM.
>
>
> .
>