linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix
@ 2021-05-21 10:02 Kai Ye
  2021-05-21 10:02 ` [PATCH v2 1/2] crypto: hisilicon/qm - add dfx log if not use hardware crypto algs Kai Ye
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kai Ye @ 2021-05-21 10:02 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, wangzhou1, yekai13

This patchset adds the dfx log and fixes an algorithm registration bug.

changes v1->v2:
modify the patchset commits

Kai Ye (2):
  crypto: hisilicon/qm - add dfx log if not use hardware crypto algs
  crypto: hisilicon/qm - fix the process of VF's list adding

 drivers/crypto/hisilicon/qm.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] crypto: hisilicon/qm - add dfx log if not use hardware crypto algs
  2021-05-21 10:02 [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Kai Ye
@ 2021-05-21 10:02 ` Kai Ye
  2021-05-21 10:02 ` [PATCH v2 2/2] crypto: hisilicon/qm - fix the process of VF's list adding Kai Ye
  2021-05-28  7:27 ` [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Ye @ 2021-05-21 10:02 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, wangzhou1, yekai13

Add print information necessary if not use hardware crypto algs.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/hisilicon/qm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 8f7ea50..deb104e 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -4252,11 +4252,14 @@ static void hisi_qm_controller_reset(struct work_struct *rst_work)
  */
 int hisi_qm_alg_register(struct hisi_qm *qm, struct hisi_qm_list *qm_list)
 {
+	struct device *dev = &qm->pdev->dev;
 	int flag = 0;
 	int ret = 0;
-	/* HW V2 not support both use uacce sva mode and hardware crypto algs */
-	if (qm->ver <= QM_HW_V2 && qm->use_sva)
+
+	if (qm->ver <= QM_HW_V2 && qm->use_sva) {
+		dev_info(dev, "HW V2 not both use uacce sva mode and hardware crypto algs.\n");
 		return 0;
+	}
 
 	mutex_lock(&qm_list->lock);
 	if (list_empty(&qm_list->list))
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] crypto: hisilicon/qm - fix the process of VF's list adding
  2021-05-21 10:02 [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Kai Ye
  2021-05-21 10:02 ` [PATCH v2 1/2] crypto: hisilicon/qm - add dfx log if not use hardware crypto algs Kai Ye
@ 2021-05-21 10:02 ` Kai Ye
  2021-05-28  7:27 ` [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Ye @ 2021-05-21 10:02 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel, wangzhou1, yekai13

If Kunpeng 920 enabled the sva mode, the "qm alg register" process will
return directly. So the list of VF wasn't added to QM list.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/hisilicon/qm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index deb104e..c671f94 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -4256,17 +4256,17 @@ int hisi_qm_alg_register(struct hisi_qm *qm, struct hisi_qm_list *qm_list)
 	int flag = 0;
 	int ret = 0;
 
-	if (qm->ver <= QM_HW_V2 && qm->use_sva) {
-		dev_info(dev, "HW V2 not both use uacce sva mode and hardware crypto algs.\n");
-		return 0;
-	}
-
 	mutex_lock(&qm_list->lock);
 	if (list_empty(&qm_list->list))
 		flag = 1;
 	list_add_tail(&qm->list, &qm_list->list);
 	mutex_unlock(&qm_list->lock);
 
+	if (qm->ver <= QM_HW_V2 && qm->use_sva) {
+		dev_info(dev, "HW V2 not both use uacce sva mode and hardware crypto algs.\n");
+		return 0;
+	}
+
 	if (flag) {
 		ret = qm_list->register_to_crypto(qm);
 		if (ret) {
@@ -4291,13 +4291,13 @@ EXPORT_SYMBOL_GPL(hisi_qm_alg_register);
  */
 void hisi_qm_alg_unregister(struct hisi_qm *qm, struct hisi_qm_list *qm_list)
 {
-	if (qm->ver <= QM_HW_V2 && qm->use_sva)
-		return;
-
 	mutex_lock(&qm_list->lock);
 	list_del(&qm->list);
 	mutex_unlock(&qm_list->lock);
 
+	if (qm->ver <= QM_HW_V2 && qm->use_sva)
+		return;
+
 	if (list_empty(&qm_list->list))
 		qm_list->unregister_from_crypto(qm);
 }
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix
  2021-05-21 10:02 [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Kai Ye
  2021-05-21 10:02 ` [PATCH v2 1/2] crypto: hisilicon/qm - add dfx log if not use hardware crypto algs Kai Ye
  2021-05-21 10:02 ` [PATCH v2 2/2] crypto: hisilicon/qm - fix the process of VF's list adding Kai Ye
@ 2021-05-28  7:27 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2021-05-28  7:27 UTC (permalink / raw)
  To: Kai Ye; +Cc: linux-crypto, linux-kernel, wangzhou1

On Fri, May 21, 2021 at 06:02:42PM +0800, Kai Ye wrote:
> This patchset adds the dfx log and fixes an algorithm registration bug.
> 
> changes v1->v2:
> modify the patchset commits
> 
> Kai Ye (2):
>   crypto: hisilicon/qm - add dfx log if not use hardware crypto algs
>   crypto: hisilicon/qm - fix the process of VF's list adding
> 
>  drivers/crypto/hisilicon/qm.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-28  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 10:02 [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Kai Ye
2021-05-21 10:02 ` [PATCH v2 1/2] crypto: hisilicon/qm - add dfx log if not use hardware crypto algs Kai Ye
2021-05-21 10:02 ` [PATCH v2 2/2] crypto: hisilicon/qm - fix the process of VF's list adding Kai Ye
2021-05-28  7:27 ` [PATCH v2 0/2] crypto: hisilicon/qm - add dfx log and a bugfix Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).