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 <bingquan.hu@intel.com>
Reviewed-on: https://android.intel.com/563390
Reviewed-by: jenkins_ndg <jenkins_ndg@intel.com>
Reviewed-by: Nassiet, GaelleX <gaellex.nassiet@intel.com>
Reviewed-by: Rouis, KhalifaX <khalifax.rouis@intel.com>
Reviewed-by: Dubray, SimonX <simonx.dubray@intel.com>
Reviewed-by: Ledentec, AlexandreX <alexandrex.ledentec@intel.com>
Reviewed-by: Lachaud, EtienneX <etiennex.lachaud@intel.com>
Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com>
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);
}