Re: [PATCH] crypto: hisilicon/sec2 - Use atomics instead of __sync

From: Herbert Xu
Date: Thu Jan 09 2020 - 00:16:00 EST


On Tue, Jan 07, 2020 at 09:08:58PM +0100, Arnd Bergmann wrote:
> The use of __sync functions for atomic memory access is not
> supported in the kernel, and can result in a link error depending
> on configuration:
>
> ERROR: "__tsan_atomic32_compare_exchange_strong" [drivers/crypto/hisilicon/sec2/hisi_sec2.ko] undefined!
> ERROR: "__tsan_atomic64_fetch_add" [drivers/crypto/hisilicon/sec2/hisi_sec2.ko] undefined!
>
> Use the kernel's own atomic interfaces instead. This way the
> debugfs interface actually reads the counter atomically.
>
> Fixes: 416d82204df4 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> drivers/crypto/hisilicon/sec2/sec.h | 6 +++---
> drivers/crypto/hisilicon/sec2/sec_crypto.c | 12 ++++++------
> drivers/crypto/hisilicon/sec2/sec_main.c | 14 ++++++++++++--
> 3 files changed, 21 insertions(+), 11 deletions(-)

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