sensor: als sensor tsl2583 timer protection
The mod_timer might be called the workqueue handler, and also
from the power_enable sys nodes, they might collide.
The fix is to protect again this collision.
Change-Id: Iae939ab1fe4dfdf9b1fb1c75d19ebfe146ae9dcd
Tracked-On: https://jira01.devtools.intel.com/browse/AW-3861
Signed-off-by: Hu Bingquan <[email protected]>
Reviewed-on: https://android.intel.com/563390
Reviewed-by: jenkins_ndg <[email protected]>
Reviewed-by: Nassiet, GaelleX <[email protected]>
Reviewed-by: Rouis, KhalifaX <[email protected]>
Reviewed-by: Dubray, SimonX <[email protected]>
Reviewed-by: Ledentec, AlexandreX <[email protected]>
Reviewed-by: Lachaud, EtienneX <[email protected]>
Reviewed-by: Tasayco Loarte, VictorX <[email protected]>
diff --git a/drivers/input/misc/tsl2583.c b/drivers/input/misc/tsl2583.c
index cbfc91d..ff9273f 100644
--- a/drivers/input/misc/tsl2583.c
+++ b/drivers/input/misc/tsl2583.c
@@ -696,9 +696,9 @@
/* Sync it up */
input_sync(chip->input);
}
- mutex_unlock(&chip->als_mutex);
mod_timer(&chip->timer,
jiffies + msecs_to_jiffies(chip->taos_settings.als_odr));
+ mutex_unlock(&chip->als_mutex);
}