diff options
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r-- | drivers/hwmon/coretemp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index b2e59b395ce4..bbb0b0d463f7 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -177,18 +177,19 @@ static ssize_t show_temp(struct device *dev, | |||
177 | /* Check whether the time interval has elapsed */ | 177 | /* Check whether the time interval has elapsed */ |
178 | if (!tdata->valid || time_after(jiffies, tdata->last_updated + HZ)) { | 178 | if (!tdata->valid || time_after(jiffies, tdata->last_updated + HZ)) { |
179 | rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); | 179 | rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); |
180 | tdata->valid = 0; | 180 | /* |
181 | /* Check whether the data is valid */ | 181 | * Ignore the valid bit. In all observed cases the register |
182 | if (eax & 0x80000000) { | 182 | * value is either low or zero if the valid bit is 0. |
183 | tdata->temp = tdata->tjmax - | 183 | * Return it instead of reporting an error which doesn't |
184 | ((eax >> 16) & 0x7f) * 1000; | 184 | * really help at all. |
185 | tdata->valid = 1; | 185 | */ |
186 | } | 186 | tdata->temp = tdata->tjmax - ((eax >> 16) & 0x7f) * 1000; |
187 | tdata->valid = 1; | ||
187 | tdata->last_updated = jiffies; | 188 | tdata->last_updated = jiffies; |
188 | } | 189 | } |
189 | 190 | ||
190 | mutex_unlock(&tdata->update_lock); | 191 | mutex_unlock(&tdata->update_lock); |
191 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; | 192 | return sprintf(buf, "%d\n", tdata->temp); |
192 | } | 193 | } |
193 | 194 | ||
194 | struct tjmax_pci { | 195 | struct tjmax_pci { |