2020-07-25 06:10:11

by Yang Shen

[permalink] [raw]
Subject: [PATCH 0/4] crypto: hisilicon/zip - misc bugfix

This patchset fix some bug:
patch 1:clear the debug registers when remove driver
patch 2:intercept invalid input when using decompress
patch 3:replace the return value '-EBUSY' with '-EAGAIN' when
device is busy
patch 4:initialize the 'curr_qm_qp_num' when probe device

This patchset depends on:
https://patchwork.kernel.org/cover/11684785/

Hao Fang (1):
crypto: hisilicon/zip - fix the uncleared debug registers

Sihang Chen (1):
crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'

Yang Shen (1):
crypto: hisilicon/zip - fix the return value when device is busy

Zhou Wang (1):
crypto: hisilicon/zip - fix zero length input in GZIP decompress

drivers/crypto/hisilicon/zip/zip_crypto.c | 25 +++++++++++++++++++------
drivers/crypto/hisilicon/zip/zip_main.c | 19 +++++++++++++++++++
2 files changed, 38 insertions(+), 6 deletions(-)

--
2.7.4


2020-07-25 06:10:11

by Yang Shen

[permalink] [raw]
Subject: [PATCH 1/4] crypto: hisilicon/zip - fix the uncleared debug registers

From: Hao Fang <[email protected]>

ZIP debug registers aren't cleared even if its driver is removed,
so add a clearing operation when remove driver.

Signed-off-by: Hao Fang <[email protected]>
Signed-off-by: Yang Shen <[email protected]>
Reviewed-by: Zhou Wang <[email protected]>
---
drivers/crypto/hisilicon/zip/zip_main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index 8bbae28..cc4a829 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -91,6 +91,11 @@
#define HZIP_SQE_MASK_OFFSET 64
#define HZIP_SQE_MASK_LEN 48

+#define HZIP_CNT_CLR_CE_EN BIT(0)
+#define HZIP_RO_CNT_CLR_CE_EN BIT(2)
+#define HZIP_RD_CNT_CLR_CE_EN (HZIP_CNT_CLR_CE_EN | \
+ HZIP_RO_CNT_CLR_CE_EN)
+
static const char hisi_zip_name[] = "hisi_zip";
static struct dentry *hzip_debugfs_root;

@@ -606,10 +611,23 @@ static int hisi_zip_debugfs_init(struct hisi_qm *qm)
return ret;
}

+/* hisi_zip_debug_regs_clear() - clear the zip debug regs */
static void hisi_zip_debug_regs_clear(struct hisi_qm *qm)
{
+ int i, j;
+
+ /* clear current_qm */
writel(0x0, qm->io_base + QM_DFX_MB_CNT_VF);
writel(0x0, qm->io_base + QM_DFX_DB_CNT_VF);
+
+ /* enable register read_clear bit */
+ writel(HZIP_RD_CNT_CLR_CE_EN, qm->io_base + HZIP_SOFT_CTRL_CNT_CLR_CE);
+ for (i = 0; i < ARRAY_SIZE(core_offsets); i++)
+ for (j = 0; j < ARRAY_SIZE(hzip_dfx_regs); j++)
+ readl(qm->io_base + core_offsets[i] +
+ hzip_dfx_regs[j].offset);
+
+ /* disable register read_clear bit */
writel(0x0, qm->io_base + HZIP_SOFT_CTRL_CNT_CLR_CE);

hisi_qm_debug_regs_clear(qm);
--
2.7.4

2020-07-25 06:11:12

by Yang Shen

[permalink] [raw]
Subject: [PATCH 4/4] crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'

From: Sihang Chen <[email protected]>

The 'qm->curr_qm_qp_num' is not initialized, which will result in failure
to write the current_q file.

Signed-off-by: Sihang Chen <[email protected]>
Signed-off-by: Yang Shen <[email protected]>
Reviewed-by: Zhou Wang <[email protected]>
---
drivers/crypto/hisilicon/zip/zip_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index cc4a829..47efc2f 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -762,6 +762,7 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
if (qm->fun_type == QM_HW_PF) {
qm->qp_base = HZIP_PF_DEF_Q_BASE;
qm->qp_num = pf_q_num;
+ qm->debug.curr_qm_qp_num = pf_q_num;
qm->qm_list = &zip_devices;
} else if (qm->fun_type == QM_HW_VF && qm->ver == QM_HW_V1) {
/*
--
2.7.4

2020-07-31 08:29:43

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/4] crypto: hisilicon/zip - misc bugfix

On Sat, Jul 25, 2020 at 02:06:46PM +0800, Yang Shen wrote:
> This patchset fix some bug:
> patch 1:clear the debug registers when remove driver
> patch 2:intercept invalid input when using decompress
> patch 3:replace the return value '-EBUSY' with '-EAGAIN' when
> device is busy
> patch 4:initialize the 'curr_qm_qp_num' when probe device
>
> This patchset depends on:
> https://patchwork.kernel.org/cover/11684785/
>
> Hao Fang (1):
> crypto: hisilicon/zip - fix the uncleared debug registers
>
> Sihang Chen (1):
> crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'
>
> Yang Shen (1):
> crypto: hisilicon/zip - fix the return value when device is busy
>
> Zhou Wang (1):
> crypto: hisilicon/zip - fix zero length input in GZIP decompress
>
> drivers/crypto/hisilicon/zip/zip_crypto.c | 25 +++++++++++++++++++------
> drivers/crypto/hisilicon/zip/zip_main.c | 19 +++++++++++++++++++
> 2 files changed, 38 insertions(+), 6 deletions(-)

This patch series doesn't apply against cryptodev.

Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-07-31 08:48:33

by Yang Shen

[permalink] [raw]
Subject: Re: [PATCH 0/4] crypto: hisilicon/zip - misc bugfix



On 2020/7/31 16:28, Herbert Xu wrote:
> On Sat, Jul 25, 2020 at 02:06:46PM +0800, Yang Shen wrote:
>> This patchset fix some bug:
>> patch 1:clear the debug registers when remove driver
>> patch 2:intercept invalid input when using decompress
>> patch 3:replace the return value '-EBUSY' with '-EAGAIN' when
>> device is busy
>> patch 4:initialize the 'curr_qm_qp_num' when probe device
>>
>> This patchset depends on:
>> https://patchwork.kernel.org/cover/11684785/
>>
>> Hao Fang (1):
>> crypto: hisilicon/zip - fix the uncleared debug registers
>>
>> Sihang Chen (1):
>> crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'
>>
>> Yang Shen (1):
>> crypto: hisilicon/zip - fix the return value when device is busy
>>
>> Zhou Wang (1):
>> crypto: hisilicon/zip - fix zero length input in GZIP decompress
>>
>> drivers/crypto/hisilicon/zip/zip_crypto.c | 25 +++++++++++++++++++------
>> drivers/crypto/hisilicon/zip/zip_main.c | 19 +++++++++++++++++++
>> 2 files changed, 38 insertions(+), 6 deletions(-)
>
> This patch series doesn't apply against cryptodev.
>
> Cheers,
>

Sorry, this patchset depends on
https://patchwork.kernel.org/cover/11684785/
which cover letter is '[PATCH 00/10] crypto: hisilicon/zip - misc clean
up'

Sorry for troubling you again.

Thanks,