Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/5] crypto: hisilicon: Misc fixes
@ 2019-08-14  9:28 Zhou Wang
  2019-08-14  9:28 ` [PATCH 1/5] crypto: hisilicon - fix kbuild warnings Zhou Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Patch 1~3 are fixes about kbuild errors, patch 4,5 are tiny fixes about qm
and zip.

This series is based on cryptodev-2.6.

Zhou Wang (5):
  crypto: hisilicon - fix kbuild warnings
  crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP
  crypto: hisilicon - init curr_sgl_dma to fix compile warning
  crypto: hisilicon - add missing single_release
  crypto: hisilicon - fix error handle in hisi_zip_create_req_q

 drivers/crypto/hisilicon/Kconfig          | 1 +
 drivers/crypto/hisilicon/qm.c             | 7 ++++---
 drivers/crypto/hisilicon/sgl.c            | 2 +-
 drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++--
 4 files changed, 10 insertions(+), 6 deletions(-)

-- 
2.8.1


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

* [PATCH 1/5] crypto: hisilicon - fix kbuild warnings
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
@ 2019-08-14  9:28 ` Zhou Wang
  2019-08-14  9:28 ` [PATCH 2/5] crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP Zhou Wang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Fix to use proper type of argument for dma_addr_t and size_t.

Fixes: 263c9959c937 ("crypto: hisilicon - add queue management driver for HiSilicon QM module")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/crypto/hisilicon/qm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 363f71b..796fdbf 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -347,7 +347,7 @@ static int qm_mb(struct hisi_qm *qm, u8 cmd, dma_addr_t dma_addr, u16 queue,
 	struct qm_mailbox mailbox;
 	int ret = 0;
 
-	dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%llx\n", queue,
+	dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%pad\n", queue,
 		cmd, dma_addr);
 
 	mailbox.w0 = cmd |
@@ -1137,7 +1137,7 @@ struct hisi_qp *hisi_qm_create_qp(struct hisi_qm *qm, u8 alg_type)
 			goto err_clear_bit;
 		}
 
-		dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%lx)\n",
+		dev_dbg(dev, "allocate qp dma buf(va=%pK, dma=%pad, size=%zx)\n",
 			qp->qdma.va, &qp->qdma.dma, qp->qdma.size);
 	}
 
@@ -1714,7 +1714,7 @@ int hisi_qm_start(struct hisi_qm *qm)
 				QMC_ALIGN(sizeof(struct qm_cqc) * qm->qp_num);
 		qm->qdma.va = dma_alloc_coherent(dev, qm->qdma.size,
 						 &qm->qdma.dma, GFP_KERNEL);
-		dev_dbg(dev, "allocate qm dma buf(va=%pK, dma=%pad, size=%lx)\n",
+		dev_dbg(dev, "allocate qm dma buf(va=%pK, dma=%pad, size=%zx)\n",
 			qm->qdma.va, &qm->qdma.dma, qm->qdma.size);
 		if (!qm->qdma.va)
 			return -ENOMEM;
-- 
2.8.1


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

* [PATCH 2/5] crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
  2019-08-14  9:28 ` [PATCH 1/5] crypto: hisilicon - fix kbuild warnings Zhou Wang
@ 2019-08-14  9:28 ` Zhou Wang
  2019-08-14  9:28 ` [PATCH 3/5] crypto: hisilicon - init curr_sgl_dma to fix compile warning Zhou Wang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Add ARM64/PCI/PCI_MSI dependency for CRYPTO_DEV_HISI_ZIP.

Fixes: 62c455ca853e ("crypto: hisilicon - add HiSilicon ZIP accelerator support")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/crypto/hisilicon/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
index 1929317..fa8aa06 100644
--- a/drivers/crypto/hisilicon/Kconfig
+++ b/drivers/crypto/hisilicon/Kconfig
@@ -30,6 +30,7 @@ config CRYPTO_HISI_SGL
 
 config CRYPTO_DEV_HISI_ZIP
 	tristate "Support for HiSilicon ZIP accelerator"
+	depends on ARM64 && PCI && PCI_MSI
 	select CRYPTO_DEV_HISI_QM
 	select CRYPTO_HISI_SGL
 	select SG_SPLIT
-- 
2.8.1


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

* [PATCH 3/5] crypto: hisilicon - init curr_sgl_dma to fix compile warning
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
  2019-08-14  9:28 ` [PATCH 1/5] crypto: hisilicon - fix kbuild warnings Zhou Wang
  2019-08-14  9:28 ` [PATCH 2/5] crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP Zhou Wang
@ 2019-08-14  9:28 ` Zhou Wang
  2019-08-14  9:28 ` [PATCH 4/5] crypto: hisilicon - add missing single_release Zhou Wang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Just init curr_sgl_dma = 0 to avoid compile warning.

Fixes: dfed0098ab91 ("crypto: hisilicon - add hardware SGL support")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/crypto/hisilicon/sgl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
index 8ef7679..e083d17 100644
--- a/drivers/crypto/hisilicon/sgl.c
+++ b/drivers/crypto/hisilicon/sgl.c
@@ -150,7 +150,7 @@ hisi_acc_sg_buf_map_to_hw_sgl(struct device *dev,
 			      u32 index, dma_addr_t *hw_sgl_dma)
 {
 	struct hisi_acc_hw_sgl *curr_hw_sgl;
-	dma_addr_t curr_sgl_dma;
+	dma_addr_t curr_sgl_dma = 0;
 	struct acc_hw_sge *curr_hw_sge;
 	struct scatterlist *sg;
 	int sg_n = sg_nents(sgl);
-- 
2.8.1


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

* [PATCH 4/5] crypto: hisilicon - add missing single_release
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
                   ` (2 preceding siblings ...)
  2019-08-14  9:28 ` [PATCH 3/5] crypto: hisilicon - init curr_sgl_dma to fix compile warning Zhou Wang
@ 2019-08-14  9:28 ` Zhou Wang
  2019-08-14  9:28 ` [PATCH 5/5] crypto: hisilicon - fix error handle in hisi_zip_create_req_q Zhou Wang
  2019-08-15 12:08 ` [PATCH 0/5] crypto: hisilicon: Misc fixes Herbert Xu
  5 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Fix to add missing single_release in qm_regs_fops.

Fixes: 263c9959c937 ("crypto: hisilicon - add queue management driver for HiSilicon QM module")
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/crypto/hisilicon/qm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 796fdbf..d72e062 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -958,6 +958,7 @@ static const struct file_operations qm_regs_fops = {
 	.owner = THIS_MODULE,
 	.open = qm_regs_open,
 	.read = seq_read,
+	.release = single_release,
 };
 
 static int qm_create_debugfs_file(struct hisi_qm *qm, enum qm_debug_file index)
-- 
2.8.1


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

* [PATCH 5/5] crypto: hisilicon - fix error handle in hisi_zip_create_req_q
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
                   ` (3 preceding siblings ...)
  2019-08-14  9:28 ` [PATCH 4/5] crypto: hisilicon - add missing single_release Zhou Wang
@ 2019-08-14  9:28 ` Zhou Wang
  2019-08-15 12:08 ` [PATCH 0/5] crypto: hisilicon: Misc fixes Herbert Xu
  5 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-14  9:28 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, linuxarm, Zhou Wang

Directly return error in the first loop in hisi_zip_create_req_q.

Fixes: 62c455ca853e ("crypto: hisilicon - add HiSilicon ZIP accelerator support")
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c
index 3033513..5a3f84d 100644
--- a/drivers/crypto/hisilicon/zip/zip_crypto.c
+++ b/drivers/crypto/hisilicon/zip/zip_crypto.c
@@ -223,8 +223,10 @@ static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx)
 					    sizeof(long), GFP_KERNEL);
 		if (!req_q->req_bitmap) {
 			ret = -ENOMEM;
-			if (i == 1)
-				goto err_free_loop0;
+			if (i == 0)
+				return ret;
+
+			goto err_free_loop0;
 		}
 		rwlock_init(&req_q->req_lock);
 
-- 
2.8.1


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

* Re: [PATCH 0/5] crypto: hisilicon: Misc fixes
  2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
                   ` (4 preceding siblings ...)
  2019-08-14  9:28 ` [PATCH 5/5] crypto: hisilicon - fix error handle in hisi_zip_create_req_q Zhou Wang
@ 2019-08-15 12:08 ` Herbert Xu
  2019-08-15 14:00   ` Zhou Wang
  5 siblings, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2019-08-15 12:08 UTC (permalink / raw)
  To: Zhou Wang; +Cc: davem, linux-crypto, linux-kernel, linuxarm

On Wed, Aug 14, 2019 at 05:28:34PM +0800, Zhou Wang wrote:
> Patch 1~3 are fixes about kbuild errors, patch 4,5 are tiny fixes about qm
> and zip.
> 
> This series is based on cryptodev-2.6.
> 
> Zhou Wang (5):
>   crypto: hisilicon - fix kbuild warnings
>   crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP
>   crypto: hisilicon - init curr_sgl_dma to fix compile warning
>   crypto: hisilicon - add missing single_release
>   crypto: hisilicon - fix error handle in hisi_zip_create_req_q
> 
>  drivers/crypto/hisilicon/Kconfig          | 1 +
>  drivers/crypto/hisilicon/qm.c             | 7 ++++---
>  drivers/crypto/hisilicon/sgl.c            | 2 +-
>  drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++--
>  4 files changed, 10 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] 8+ messages in thread

* Re: [PATCH 0/5] crypto: hisilicon: Misc fixes
  2019-08-15 12:08 ` [PATCH 0/5] crypto: hisilicon: Misc fixes Herbert Xu
@ 2019-08-15 14:00   ` Zhou Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Zhou Wang @ 2019-08-15 14:00 UTC (permalink / raw)
  To: Herbert Xu; +Cc: davem, linux-crypto, linux-kernel, linuxarm

On 2019/8/15 20:08, Herbert Xu wrote:
> On Wed, Aug 14, 2019 at 05:28:34PM +0800, Zhou Wang wrote:
>> Patch 1~3 are fixes about kbuild errors, patch 4,5 are tiny fixes about qm
>> and zip.
>>
>> This series is based on cryptodev-2.6.
>>
>> Zhou Wang (5):
>>   crypto: hisilicon - fix kbuild warnings
>>   crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP
>>   crypto: hisilicon - init curr_sgl_dma to fix compile warning
>>   crypto: hisilicon - add missing single_release
>>   crypto: hisilicon - fix error handle in hisi_zip_create_req_q
>>
>>  drivers/crypto/hisilicon/Kconfig          | 1 +
>>  drivers/crypto/hisilicon/qm.c             | 7 ++++---
>>  drivers/crypto/hisilicon/sgl.c            | 2 +-
>>  drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++--
>>  4 files changed, 10 insertions(+), 6 deletions(-)
> 
> All applied.  Thanks.
> 

Thanks for taking this series!


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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14  9:28 [PATCH 0/5] crypto: hisilicon: Misc fixes Zhou Wang
2019-08-14  9:28 ` [PATCH 1/5] crypto: hisilicon - fix kbuild warnings Zhou Wang
2019-08-14  9:28 ` [PATCH 2/5] crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP Zhou Wang
2019-08-14  9:28 ` [PATCH 3/5] crypto: hisilicon - init curr_sgl_dma to fix compile warning Zhou Wang
2019-08-14  9:28 ` [PATCH 4/5] crypto: hisilicon - add missing single_release Zhou Wang
2019-08-14  9:28 ` [PATCH 5/5] crypto: hisilicon - fix error handle in hisi_zip_create_req_q Zhou Wang
2019-08-15 12:08 ` [PATCH 0/5] crypto: hisilicon: Misc fixes Herbert Xu
2019-08-15 14:00   ` Zhou Wang

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org linux-crypto@archiver.kernel.org
	public-inbox-index linux-crypto


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/ public-inbox