Skip to content
Commit 72cad66c authored by Diego Sueiro's avatar Diego Sueiro Committed by Maureen Helm
Browse files

drivers/sensor/fxas21002: Fix race condition during initialization



A race condition was identified during the initialization of the
driver when the trigger function is enabled. This exposed two issues:

1 - The fxas21002_handle_int is trying to acquire the semaphore before
    it gets initialized. To solve this we need to initialize the
    semaphore before calling the fxas21002_trigger_init function.

2 - During the fxas21002_trigger initialization the i2c bus is used
    (from fxas21002_handle_int function) at the same time as the
    fxas21002_set_power is being called. To fix this we need to
    initialize the semaphore with 0 and just release it after calling
    the fxas21002_set_power function in the fxas21002_int

Signed-off-by: default avatarDiego Sueiro <diego.sueiro@gmail.com>
parent ed4f0ff3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment