From 9fdcd51c80f1aa6f80c188979609a429fe4fb422 Mon Sep 17 00:00:00 2001 From: Bian Jin chen Date: Sat, 24 Aug 2024 15:46:13 +0800 Subject: [PATCH] input: sensors: accel: mxc6655xa: add missing sync events. If there is no mutex lock between run and active in aidl, closing the sensor when reporting an event will cause an address exception. After we added the mutex lock, we found that the reading process would be blocked probabilistically when waking up from deep sleep, and activating the sensor at this time would cause a deadlock. Adding a sync event fixed this issue. Type: Fix Redmine ID: 472806 Associated modifications: https://10.10.10.29/c/android/rk/hardware/rk29/sensor/+/232874 Test: Deep sleep test Signed-off-by: Bian Jin chen Change-Id: I5275af261be189ef70a30a8b544fcbd0c356ff41 --- drivers/input/sensors/accel/mxc6655xa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/sensors/accel/mxc6655xa.c b/drivers/input/sensors/accel/mxc6655xa.c index 89bff0c54e32..3d64ccac3dc7 100644 --- a/drivers/input/sensors/accel/mxc6655xa.c +++ b/drivers/input/sensors/accel/mxc6655xa.c @@ -140,6 +140,7 @@ static int gsensor_report_value(struct i2c_client *client, input_report_abs(sensor->input_dev, ABS_X, axis->x); input_report_abs(sensor->input_dev, ABS_Y, axis->y); input_report_abs(sensor->input_dev, ABS_Z, axis->z); + input_sync(sensor->input_dev); } return 0;