* [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len
@ 2019-10-26 2:57 Zhou Wang
2019-10-26 7:32 ` Ard Biesheuvel
2019-11-01 6:13 ` Herbert Xu
0 siblings, 2 replies; 4+ messages in thread
From: Zhou Wang @ 2019-10-26 2:57 UTC (permalink / raw)
To: Herbert Xu, David S. Miller; +Cc: linux-crypto, Zhou Wang
Use sgl API to get sgl dma addr and len, this will help to avoid compile
error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which
can only be selected by arch code.
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
---
drivers/crypto/hisilicon/Kconfig | 1 -
drivers/crypto/hisilicon/sgl.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
index a71f2bf..82fb810d 100644
--- a/drivers/crypto/hisilicon/Kconfig
+++ b/drivers/crypto/hisilicon/Kconfig
@@ -18,7 +18,6 @@ config CRYPTO_DEV_HISI_QM
tristate
depends on ARM64 || COMPILE_TEST
depends on PCI && PCI_MSI
- select NEED_SG_DMA_LENGTH
help
HiSilicon accelerator engines use a common queue management
interface. Specific engine driver may use this module.
diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
index bf72603..012023c 100644
--- a/drivers/crypto/hisilicon/sgl.c
+++ b/drivers/crypto/hisilicon/sgl.c
@@ -164,8 +164,8 @@ static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool,
static void sg_map_to_hw_sg(struct scatterlist *sgl,
struct acc_hw_sge *hw_sge)
{
- hw_sge->buf = sgl->dma_address;
- hw_sge->len = cpu_to_le32(sgl->dma_length);
+ hw_sge->buf = sg_dma_address(sgl);
+ hw_sge->len = cpu_to_le32(sg_dma_len(sgl));
}
static void inc_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl)
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len
2019-10-26 2:57 [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len Zhou Wang
@ 2019-10-26 7:32 ` Ard Biesheuvel
2019-11-01 6:13 ` Herbert Xu
1 sibling, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2019-10-26 7:32 UTC (permalink / raw)
To: Zhou Wang
Cc: Herbert Xu, David S. Miller,
open list:HARDWARE RANDOM NUMBER GENERATOR CORE
On Sat, 26 Oct 2019 at 05:01, Zhou Wang <wangzhou1@hisilicon.com> wrote:
>
> Use sgl API to get sgl dma addr and len, this will help to avoid compile
> error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which
> can only be selected by arch code.
>
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> drivers/crypto/hisilicon/Kconfig | 1 -
> drivers/crypto/hisilicon/sgl.c | 4 ++--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
> index a71f2bf..82fb810d 100644
> --- a/drivers/crypto/hisilicon/Kconfig
> +++ b/drivers/crypto/hisilicon/Kconfig
> @@ -18,7 +18,6 @@ config CRYPTO_DEV_HISI_QM
> tristate
> depends on ARM64 || COMPILE_TEST
> depends on PCI && PCI_MSI
> - select NEED_SG_DMA_LENGTH
> help
> HiSilicon accelerator engines use a common queue management
> interface. Specific engine driver may use this module.
> diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
> index bf72603..012023c 100644
> --- a/drivers/crypto/hisilicon/sgl.c
> +++ b/drivers/crypto/hisilicon/sgl.c
> @@ -164,8 +164,8 @@ static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool,
> static void sg_map_to_hw_sg(struct scatterlist *sgl,
> struct acc_hw_sge *hw_sge)
> {
> - hw_sge->buf = sgl->dma_address;
> - hw_sge->len = cpu_to_le32(sgl->dma_length);
> + hw_sge->buf = sg_dma_address(sgl);
> + hw_sge->len = cpu_to_le32(sg_dma_len(sgl));
> }
>
> static void inc_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl)
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len
2019-10-26 2:57 [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len Zhou Wang
2019-10-26 7:32 ` Ard Biesheuvel
@ 2019-11-01 6:13 ` Herbert Xu
2019-11-01 7:04 ` Zhou Wang
1 sibling, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2019-11-01 6:13 UTC (permalink / raw)
To: Zhou Wang; +Cc: David S. Miller, linux-crypto
On Sat, Oct 26, 2019 at 10:57:21AM +0800, Zhou Wang wrote:
> Use sgl API to get sgl dma addr and len, this will help to avoid compile
> error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which
> can only be selected by arch code.
>
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
> ---
> drivers/crypto/hisilicon/Kconfig | 1 -
> drivers/crypto/hisilicon/sgl.c | 4 ++--
> 2 files changed, 2 insertions(+), 3 deletions(-)
Patch 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
* Re: [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len
2019-11-01 6:13 ` Herbert Xu
@ 2019-11-01 7:04 ` Zhou Wang
0 siblings, 0 replies; 4+ messages in thread
From: Zhou Wang @ 2019-11-01 7:04 UTC (permalink / raw)
To: Herbert Xu; +Cc: David S. Miller, linux-crypto
On 2019/11/1 14:13, Herbert Xu wrote:
> On Sat, Oct 26, 2019 at 10:57:21AM +0800, Zhou Wang wrote:
>> Use sgl API to get sgl dma addr and len, this will help to avoid compile
>> error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which
>> can only be selected by arch code.
>>
>> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
>> Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
>> ---
>> drivers/crypto/hisilicon/Kconfig | 1 -
>> drivers/crypto/hisilicon/sgl.c | 4 ++--
>> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> Patch applied. Thanks.
Thanks.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-01 7:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-26 2:57 [PATCH] crypto: hisilicon - use sgl API to get sgl dma addr and len Zhou Wang
2019-10-26 7:32 ` Ard Biesheuvel
2019-11-01 6:13 ` Herbert Xu
2019-11-01 7:04 ` Zhou Wang
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).