]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hisilicon/sec2 - Use atomics instead of __sync
authorArnd Bergmann <arnd@arndb.de>
Tue, 7 Jan 2020 20:08:58 +0000 (21:08 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Jan 2020 03:28:08 +0000 (11:28 +0800)
commit75beb27235a3aab8912c8a88d48fc6c4d8ec82a3
treeb0598ab85730bdb269f7a127991211bdb1fb956f
parent00418b6b10e622173eb9889f0abecb7bf6bfc26f
crypto: hisilicon/sec2 - Use atomics instead of __sync

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: 29185717a874 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/sec2/sec.h
drivers/crypto/hisilicon/sec2/sec_crypto.c
drivers/crypto/hisilicon/sec2/sec_main.c