zephyr/drivers/sensor/fxos8700
Diego Sueiro ed4f0ff36e 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: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-13 09:05:07 -05:00
..
CMakeLists.txt drivers: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for driver files. 2018-05-15 17:48:18 +03:00
fxos8700_trigger.c drivers: sensor: Fixed include paths s/</"/ 2017-11-10 11:21:41 -05:00
fxos8700.c drivers/sensor/fxos8700: Fix race condition during initialization 2018-08-13 09:05:07 -05:00
fxos8700.h drivers: use K_THREAD_STACK_DEFINE macros 2017-06-09 18:53:28 -04:00
Kconfig drivers: sensor: Kconfig: Remove redundant 'default n' properties 2018-06-27 17:20:10 -05:00