diff options
author | Linqiang Pu <dpu@nvidia.com> | 2012-06-13 10:09:10 +0800 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-07-09 03:14:36 -0700 |
commit | ef805bf8a6f66b71559e33ff6d85c2ae12fb94d1 (patch) | |
tree | ba3ebbaa3ae1a5c03ffd08bd9a1999d375f81ca7 | |
parent | 26d0cb1bae979bbc59dfb413da3fd336d07a5ce7 (diff) |
hwmon: tsensor: fix system hang in 0C.
Changed the low temp to 0C since 20C is very easy to trigger thermal
alert under -15C to 15C environment temperature. And the thermal alert
will run into endless alert from tsensor_work_func.
Also revised suspend and resume routine to cancel the work when suspending
and disable/enable irq.
Bug 999175
Signed-off-by: Linqiang Pu <dpu@nvidia.com>
(cherry picked from commit 6a909bfa690991438be298d4933946a92e4929c4)
Change-Id: Icafc6d5f0164204cc0cb7bea64bef2fadadbfbfd
Reviewed-on: http://git-master/r/111550
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r-- | drivers/hwmon/tegra-tsensor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/tegra-tsensor.c b/drivers/hwmon/tegra-tsensor.c index 6318c7a25ae4..6cd43be93cf9 100644 --- a/drivers/hwmon/tegra-tsensor.c +++ b/drivers/hwmon/tegra-tsensor.c @@ -654,7 +654,7 @@ int tsensor_thermal_get_temp_low(struct tegra_tsensor_data *data, long *milli_temp) { /* temp to counter below 20C seems to be inaccurate */ - *milli_temp = 20000; + *milli_temp = 0; return 0; } @@ -2015,6 +2015,8 @@ static int tsensor_suspend(struct platform_device *pdev, struct tegra_tsensor_data *data = platform_get_drvdata(pdev); unsigned int config0; + disable_irq(data->irq); + cancel_delayed_work_sync(&data->work); /* set STOP bit, else OVERFLOW interrupt seen in LP1 */ config0 = tsensor_readl(data, ((data->instance << 16) | SENSOR_CFG0)); config0 |= (1 << SENSOR_CFG0_STOP_SHIFT); @@ -2045,6 +2047,7 @@ static int tsensor_resume(struct platform_device *pdev) if (data->is_edp_supported) schedule_delayed_work(&data->work, 0); + enable_irq(data->irq); return 0; } #endif |