2022-09-24 10:35:13

by Weili Qian

[permalink] [raw]
Subject: [PATCH] crypto: hisilicon/qm - fix incorrect parameters usage

In qm_get_xqc_depth(), parameters low_bits and high_bits save
the values of the corresponding bits. However, the values saved by the
two parameters are opposite. As a result, the values returned to the
callers are incorrect.

Fixes: 129a9f340172 ("crypto: hisilicon/qm - get qp num and depth from hardware registers")
Signed-off-by: Weili Qian <[email protected]>
---
drivers/crypto/hisilicon/qm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 8b387de69d22..c7e7fc49ec06 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -909,8 +909,8 @@ static void qm_get_xqc_depth(struct hisi_qm *qm, u16 *low_bits,
u32 depth;

depth = hisi_qm_get_hw_info(qm, qm_basic_info, type, qm->cap_ver);
- *high_bits = depth & QM_XQ_DEPTH_MASK;
- *low_bits = (depth >> QM_XQ_DEPTH_SHIFT) & QM_XQ_DEPTH_MASK;
+ *low_bits = depth & QM_XQ_DEPTH_MASK;
+ *high_bits = (depth >> QM_XQ_DEPTH_SHIFT) & QM_XQ_DEPTH_MASK;
}

static u32 qm_get_irq_num(struct hisi_qm *qm)
--
2.33.0


2022-10-21 11:36:40

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: hisilicon/qm - fix incorrect parameters usage

On Sat, Sep 24, 2022 at 06:14:42PM +0800, Weili Qian wrote:
> In qm_get_xqc_depth(), parameters low_bits and high_bits save
> the values of the corresponding bits. However, the values saved by the
> two parameters are opposite. As a result, the values returned to the
> callers are incorrect.
>
> Fixes: 129a9f340172 ("crypto: hisilicon/qm - get qp num and depth from hardware registers")
> Signed-off-by: Weili Qian <[email protected]>
> ---
> drivers/crypto/hisilicon/qm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

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