Commit 6bc4db5f authored by Jean Delvare's avatar Jean Delvare Committed by Luis Henriques

tg3: Fix temperature reporting

commit d3d11fe0 upstream.

The temperature registers appear to report values in degrees Celsius
while the hwmon API mandates values to be exposed in millidegrees
Celsius. Do the conversion so that the values reported by "sensors"
are correct.

Fixes: aed93e0b ("tg3: Add hwmon support for temperature")
Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
Cc: Prashant Sreedharan <prashant@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 5ea66dab
...@@ -10750,7 +10750,7 @@ static ssize_t tg3_show_temp(struct device *dev, ...@@ -10750,7 +10750,7 @@ static ssize_t tg3_show_temp(struct device *dev,
tg3_ape_scratchpad_read(tp, &temperature, attr->index, tg3_ape_scratchpad_read(tp, &temperature, attr->index,
sizeof(temperature)); sizeof(temperature));
spin_unlock_bh(&tp->lock); spin_unlock_bh(&tp->lock);
return sprintf(buf, "%u\n", temperature); return sprintf(buf, "%u\n", temperature * 1000);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment