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

drivers/sensor/fxos8700: 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 fxos8700_handle_int is trying to acquire the semaphore before
    it gets initialized. To solve this we need to initialize the
    semaphore before calling the fxos8700_trigger_init function.

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

These two scenarios was reproducible in the WaRP7 board with i.MX7 SoC.

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