Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: hisilicon/qm - add device status check when start fails

In function 'hisi_qm_resume', if the device fails to be started,
directly returning error code will cause the device to be unavailable.
However, the failure may be caused by device error, which will be
reported to the driver, and driver can reset and restart device.
Therefore, check device status instead of returning error code
directly. Returns 0 if device error has occurred, otherwise returns
error code.

Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Weili Qian and committed by
Herbert Xu
5f9c97a0 39013556

+8 -2
+8 -2
drivers/crypto/hisilicon/qm.c
··· 5468 5468 } 5469 5469 5470 5470 ret = hisi_qm_start(qm); 5471 - if (ret) 5472 - pci_err(pdev, "failed to start qm(%d)\n", ret); 5471 + if (ret) { 5472 + if (qm_check_dev_error(qm)) { 5473 + pci_info(pdev, "failed to start qm due to device error, device will be reset!\n"); 5474 + return 0; 5475 + } 5476 + 5477 + pci_err(pdev, "failed to start qm(%d)!\n", ret); 5478 + } 5473 5479 5474 5480 return ret; 5475 5481 }