diff mbox series

[1/2] crypto: hisilicon - select NEED_SG_DMA_LENGTH in qm Kconfig

Message ID 1570792690-74597-1-git-send-email-wangzhou1@hisilicon.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [1/2] crypto: hisilicon - select NEED_SG_DMA_LENGTH in qm Kconfig | expand

Commit Message

Zhou Wang Oct. 11, 2019, 11:18 a.m. UTC
To avoid compile error in some platforms, select NEED_SG_DMA_LENGTH in
qm Kconfig.

Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 drivers/crypto/hisilicon/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Zhou Wang Oct. 11, 2019, 11:25 a.m. UTC | #1
On 2019/10/11 19:18, Zhou Wang wrote:
> To avoid compile error in some platforms, select NEED_SG_DMA_LENGTH in
> qm Kconfig.
> 
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> Reported-by: kbuild test robot <lkp@intel.com>

sorry to make the head of this patch as 1/2, it should be "PATCH", there
is only one patch.

> ---
>  drivers/crypto/hisilicon/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
> index 82fb810d..a71f2bf 100644
> --- a/drivers/crypto/hisilicon/Kconfig
> +++ b/drivers/crypto/hisilicon/Kconfig
> @@ -18,6 +18,7 @@ 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.
>
Herbert Xu Oct. 18, 2019, 8:04 a.m. UTC | #2
On Fri, Oct 11, 2019 at 07:18:10PM +0800, Zhou Wang wrote:
> To avoid compile error in some platforms, select NEED_SG_DMA_LENGTH in
> qm Kconfig.
> 
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---
>  drivers/crypto/hisilicon/Kconfig | 1 +
>  1 file changed, 1 insertion(+)

Patch applied.  Thanks.
Zhou Wang Oct. 21, 2019, 3:53 a.m. UTC | #3
On 2019/10/18 16:04, Herbert Xu wrote:
> On Fri, Oct 11, 2019 at 07:18:10PM +0800, Zhou Wang wrote:
>> To avoid compile error in some platforms, select NEED_SG_DMA_LENGTH in
>> qm Kconfig.
>>
>> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
>> Reported-by: kbuild test robot <lkp@intel.com>
>> ---
>>  drivers/crypto/hisilicon/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
> 
> Patch applied.  Thanks.

Thanks :)

>
Ard Biesheuvel Oct. 24, 2019, 1:22 p.m. UTC | #4
On Fri, 11 Oct 2019 at 13:21, Zhou Wang <wangzhou1@hisilicon.com> wrote:
>
> To avoid compile error in some platforms, select NEED_SG_DMA_LENGTH in
> qm Kconfig.
>
> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---
>  drivers/crypto/hisilicon/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
> index 82fb810d..a71f2bf 100644
> --- a/drivers/crypto/hisilicon/Kconfig
> +++ b/drivers/crypto/hisilicon/Kconfig
> @@ -18,6 +18,7 @@ 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.

CONFIG_NEED_SG_DMA_LENGTH shouldn't be set by an arbitrary driver -
the arch code will set this if needed, and if it doesn't, the
additional dma_length field shouldn't be expected to have a meaning.

If you are fixing a COMPILE_TEST failure, just add NEED_SG_DMA_LENGTH
as a dependency, or drop the COMPILE_TEST altogether (why was that
added in the first place?)
Herbert Xu Oct. 24, 2019, 1:56 p.m. UTC | #5
On Thu, Oct 24, 2019 at 03:22:50PM +0200, Ard Biesheuvel wrote:
> 
> If you are fixing a COMPILE_TEST failure, just add NEED_SG_DMA_LENGTH
> as a dependency, or drop the COMPILE_TEST altogether (why was that
> added in the first place?)

Because we want to maximise compiler coverage so that build failures
can be caught at the earliest opportunity.

But a better fix would be to use

	sg_dma_len(sg)

instead of

	sg->dma_length

Cheers,
Zhou Wang Oct. 25, 2019, 1 a.m. UTC | #6
On 2019/10/24 21:56, Herbert Xu wrote:
> On Thu, Oct 24, 2019 at 03:22:50PM +0200, Ard Biesheuvel wrote:
>>
>> If you are fixing a COMPILE_TEST failure, just add NEED_SG_DMA_LENGTH
>> as a dependency, or drop the COMPILE_TEST altogether (why was that
>> added in the first place?)
> 
> Because we want to maximise compiler coverage so that build failures
> can be caught at the earliest opportunity.
> 
> But a better fix would be to use
> 
> 	sg_dma_len(sg)

OK, will do by this. Thanks!

Best,
Zhou

> 
> instead of
> 
> 	sg->dma_length
> 
> Cheers,
>
diff mbox series

Patch

diff --git a/drivers/crypto/hisilicon/Kconfig b/drivers/crypto/hisilicon/Kconfig
index 82fb810d..a71f2bf 100644
--- a/drivers/crypto/hisilicon/Kconfig
+++ b/drivers/crypto/hisilicon/Kconfig
@@ -18,6 +18,7 @@  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.