Searched hist:"78155888 b8f44478dd78b9af2f1e0eb255e7dfb4" (Results 1 – 1 of 1) sorted by relevance
| /optee_os/core/tee/ |
| H A D | tadb.c | 78155888b8f44478dd78b9af2f1e0eb255e7dfb4 Fri Sep 27 11:33:59 UTC 2019 Jerome Forissier <jerome@forissier.org> core: tadb.c: get rid of atomic reference counting
This commit changes the way the tadb_db global variable is protected against concurrent access on creation and deletion. Instead of using an atomic reference counter (struct refcount) and a mutex, only the mutex is used and taken unconditionally. The reference count becomes a global integer protected by the same mutex.
Using a struct refcount was apparently an optimization to avoid taking the lock unless actual creation or deletion of the tadb_db was needed. Unfortunately this implementation was causing occasional crashes of the TEE core (easily reproducible on HiKey running 'xtest 1013' in a loop). The new implementation is simpler and appears to be rock solid with no measurable difference in performance.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
|