Skip to content

Commit

Permalink
hwmon: (it87) Invalidate cache on temperature sensor change
Browse files Browse the repository at this point in the history
When any temperature sensor type is changed, the corresponding
temperature value needs to be updated. The register caching mechanism
may delay this update, so we want to invalidate the cache to force an
immediate update.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Jean Delvare committed Apr 14, 2010
1 parent 8acf07c commit 2b3d1d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr,
mutex_lock(&data->update_lock);
data->sensor = reg;
it87_write_value(data, IT87_REG_TEMP_ENABLE, data->sensor);
data->valid = 0; /* Force cache refresh */
mutex_unlock(&data->update_lock);
return count;
}
Expand Down

0 comments on commit 2b3d1d8

Please sign in to comment.