<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/hwmon, branch v4.4.129</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>hwmon: (ina2xx) Fix access to uninitialized mutex</title>
<updated>2018-04-24T07:32:04+00:00</updated>
<author>
<name>Marek Szyprowski</name>
<email>m.szyprowski@samsung.com</email>
</author>
<published>2018-01-15T13:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=09293a7b610f7a2a145c4dc7bf4315886457d0da'/>
<id>09293a7b610f7a2a145c4dc7bf4315886457d0da</id>
<content type='text'>
commit 0c4c5860e9983eb3da7a3d73ca987643c3ed034b upstream.

Initialize data-&gt;config_lock mutex before it is used by the driver code.

This fixes following warning on Odroid XU3 boards:

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 5 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc7-next-20180115-00001-gb75575dee3f2 #107
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c0111504&gt;] (unwind_backtrace) from [&lt;c010dbec&gt;] (show_stack+0x10/0x14)
[&lt;c010dbec&gt;] (show_stack) from [&lt;c09b3f74&gt;] (dump_stack+0x90/0xc8)
[&lt;c09b3f74&gt;] (dump_stack) from [&lt;c0179528&gt;] (register_lock_class+0x1c0/0x59c)
[&lt;c0179528&gt;] (register_lock_class) from [&lt;c017bd1c&gt;] (__lock_acquire+0x78/0x1850)
[&lt;c017bd1c&gt;] (__lock_acquire) from [&lt;c017de30&gt;] (lock_acquire+0xc8/0x2b8)
[&lt;c017de30&gt;] (lock_acquire) from [&lt;c09ca59c&gt;] (__mutex_lock+0x60/0xa0c)
[&lt;c09ca59c&gt;] (__mutex_lock) from [&lt;c09cafd0&gt;] (mutex_lock_nested+0x1c/0x24)
[&lt;c09cafd0&gt;] (mutex_lock_nested) from [&lt;c068b0d0&gt;] (ina2xx_set_shunt+0x70/0xb0)
[&lt;c068b0d0&gt;] (ina2xx_set_shunt) from [&lt;c068b218&gt;] (ina2xx_probe+0x88/0x1b0)
[&lt;c068b218&gt;] (ina2xx_probe) from [&lt;c0673d90&gt;] (i2c_device_probe+0x1e0/0x2d0)
[&lt;c0673d90&gt;] (i2c_device_probe) from [&lt;c053a268&gt;] (driver_probe_device+0x2b8/0x4a0)
[&lt;c053a268&gt;] (driver_probe_device) from [&lt;c053a54c&gt;] (__driver_attach+0xfc/0x120)
[&lt;c053a54c&gt;] (__driver_attach) from [&lt;c05384cc&gt;] (bus_for_each_dev+0x58/0x7c)
[&lt;c05384cc&gt;] (bus_for_each_dev) from [&lt;c0539590&gt;] (bus_add_driver+0x174/0x250)
[&lt;c0539590&gt;] (bus_add_driver) from [&lt;c053b5e0&gt;] (driver_register+0x78/0xf4)
[&lt;c053b5e0&gt;] (driver_register) from [&lt;c0675ef0&gt;] (i2c_register_driver+0x38/0xa8)
[&lt;c0675ef0&gt;] (i2c_register_driver) from [&lt;c0102b40&gt;] (do_one_initcall+0x48/0x18c)
[&lt;c0102b40&gt;] (do_one_initcall) from [&lt;c0e00df0&gt;] (kernel_init_freeable+0x110/0x1d4)
[&lt;c0e00df0&gt;] (kernel_init_freeable) from [&lt;c09c8120&gt;] (kernel_init+0x8/0x114)
[&lt;c09c8120&gt;] (kernel_init) from [&lt;c01010b4&gt;] (ret_from_fork+0x14/0x20)

Fixes: 5d389b125186 ("hwmon: (ina2xx) Make calibration register value fixed")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
[backport to v4.4.y/v4.9.y: context changes]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0c4c5860e9983eb3da7a3d73ca987643c3ed034b upstream.

Initialize data-&gt;config_lock mutex before it is used by the driver code.

This fixes following warning on Odroid XU3 boards:

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 5 PID: 1 Comm: swapper/0 Not tainted 4.15.0-rc7-next-20180115-00001-gb75575dee3f2 #107
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c0111504&gt;] (unwind_backtrace) from [&lt;c010dbec&gt;] (show_stack+0x10/0x14)
[&lt;c010dbec&gt;] (show_stack) from [&lt;c09b3f74&gt;] (dump_stack+0x90/0xc8)
[&lt;c09b3f74&gt;] (dump_stack) from [&lt;c0179528&gt;] (register_lock_class+0x1c0/0x59c)
[&lt;c0179528&gt;] (register_lock_class) from [&lt;c017bd1c&gt;] (__lock_acquire+0x78/0x1850)
[&lt;c017bd1c&gt;] (__lock_acquire) from [&lt;c017de30&gt;] (lock_acquire+0xc8/0x2b8)
[&lt;c017de30&gt;] (lock_acquire) from [&lt;c09ca59c&gt;] (__mutex_lock+0x60/0xa0c)
[&lt;c09ca59c&gt;] (__mutex_lock) from [&lt;c09cafd0&gt;] (mutex_lock_nested+0x1c/0x24)
[&lt;c09cafd0&gt;] (mutex_lock_nested) from [&lt;c068b0d0&gt;] (ina2xx_set_shunt+0x70/0xb0)
[&lt;c068b0d0&gt;] (ina2xx_set_shunt) from [&lt;c068b218&gt;] (ina2xx_probe+0x88/0x1b0)
[&lt;c068b218&gt;] (ina2xx_probe) from [&lt;c0673d90&gt;] (i2c_device_probe+0x1e0/0x2d0)
[&lt;c0673d90&gt;] (i2c_device_probe) from [&lt;c053a268&gt;] (driver_probe_device+0x2b8/0x4a0)
[&lt;c053a268&gt;] (driver_probe_device) from [&lt;c053a54c&gt;] (__driver_attach+0xfc/0x120)
[&lt;c053a54c&gt;] (__driver_attach) from [&lt;c05384cc&gt;] (bus_for_each_dev+0x58/0x7c)
[&lt;c05384cc&gt;] (bus_for_each_dev) from [&lt;c0539590&gt;] (bus_add_driver+0x174/0x250)
[&lt;c0539590&gt;] (bus_add_driver) from [&lt;c053b5e0&gt;] (driver_register+0x78/0xf4)
[&lt;c053b5e0&gt;] (driver_register) from [&lt;c0675ef0&gt;] (i2c_register_driver+0x38/0xa8)
[&lt;c0675ef0&gt;] (i2c_register_driver) from [&lt;c0102b40&gt;] (do_one_initcall+0x48/0x18c)
[&lt;c0102b40&gt;] (do_one_initcall) from [&lt;c0e00df0&gt;] (kernel_init_freeable+0x110/0x1d4)
[&lt;c0e00df0&gt;] (kernel_init_freeable) from [&lt;c09c8120&gt;] (kernel_init+0x8/0x114)
[&lt;c09c8120&gt;] (kernel_init) from [&lt;c01010b4&gt;] (ret_from_fork+0x14/0x20)

Fixes: 5d389b125186 ("hwmon: (ina2xx) Make calibration register value fixed")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
[backport to v4.4.y/v4.9.y: context changes]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (ina2xx) Make calibration register value fixed</title>
<updated>2018-04-13T17:50:13+00:00</updated>
<author>
<name>Maciej Purski</name>
<email>m.purski@samsung.com</email>
</author>
<published>2017-11-22T15:32:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b11e68ac5c259368fb34a8ac56354cddf3cc2603'/>
<id>b11e68ac5c259368fb34a8ac56354cddf3cc2603</id>
<content type='text'>
[ Upstream commit 5d389b125186cf254ad5b8015763ac07c151aea4 ]

Calibration register is used for calculating current register in
hardware according to datasheet:
current = shunt_volt * calib_register / 2048 (ina 226)
current = shunt_volt * calib_register / 4096 (ina 219)

Fix calib_register value to 2048 for ina226 and 4096 for ina 219 in
order to avoid truncation error and provide best precision allowed
by shunt_voltage measurement. Make current scale value follow changes
of shunt_resistor from sysfs as calib_register value is now fixed.

Power_lsb value should also follow shunt_resistor changes as stated in
datasheet:
power_lsb = 25 * current_lsb (ina 226)
power_lsb = 20 * current_lsb (ina 219)

Signed-off-by: Maciej Purski &lt;m.purski@samsung.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 5d389b125186cf254ad5b8015763ac07c151aea4 ]

Calibration register is used for calculating current register in
hardware according to datasheet:
current = shunt_volt * calib_register / 2048 (ina 226)
current = shunt_volt * calib_register / 4096 (ina 219)

Fix calib_register value to 2048 for ina226 and 4096 for ina 219 in
order to avoid truncation error and provide best precision allowed
by shunt_voltage measurement. Make current scale value follow changes
of shunt_resistor from sysfs as calib_register value is now fixed.

Power_lsb value should also follow shunt_resistor changes as stated in
datasheet:
power_lsb = 25 * current_lsb (ina 226)
power_lsb = 20 * current_lsb (ina 219)

Signed-off-by: Maciej Purski &lt;m.purski@samsung.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver: (adm1275) set the m,b and R coefficients correctly for power</title>
<updated>2018-03-22T08:23:22+00:00</updated>
<author>
<name>Shikhar Dogra</name>
<email>shidogra@cisco.com</email>
</author>
<published>2017-03-27T23:16:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c3b33bdd9b85d9faad9b99158e05d481b3f5cb88'/>
<id>c3b33bdd9b85d9faad9b99158e05d481b3f5cb88</id>
<content type='text'>
[ Upstream commit 6faecba0b3da7b617bf72bef422bf0d3bb6dfe7d ]

Seems like coefficient values for m, b and R under power have been
put in the wrong order. Rearranging them properly to get correct
values of coefficients for power.

For specs, please refer to table 7 (page 35) on
http://www.analog.com/media/en/technical-documentation/data-sheets/ADM1075.pdf

Fixes: 904b296f308d ("hwmon: (adm1275) Introduce configuration data structure for coeffcients")
Signed-off-by: Shikhar Dogra &lt;shidogra@cisco.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 6faecba0b3da7b617bf72bef422bf0d3bb6dfe7d ]

Seems like coefficient values for m, b and R under power have been
put in the wrong order. Rearranging them properly to get correct
values of coefficients for power.

For specs, please refer to table 7 (page 35) on
http://www.analog.com/media/en/technical-documentation/data-sheets/ADM1075.pdf

Fixes: 904b296f308d ("hwmon: (adm1275) Introduce configuration data structure for coeffcients")
Signed-off-by: Shikhar Dogra &lt;shidogra@cisco.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (pmbus) Use 64bit math for DIRECT format values</title>
<updated>2018-02-03T16:04:28+00:00</updated>
<author>
<name>Robert Lippert</name>
<email>roblip@gmail.com</email>
</author>
<published>2017-11-27T23:51:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8de0ae8c8bc37e51e2e46ec13145bc8b3f1efe8f'/>
<id>8de0ae8c8bc37e51e2e46ec13145bc8b3f1efe8f</id>
<content type='text'>
[ Upstream commit bd467e4eababe4c04272c1e646f066db02734c79 ]

Power values in the 100s of watt range can easily blow past
32bit math limits when processing everything in microwatts.

Use 64bit math instead to avoid these issues on common 32bit ARM
BMC platforms.

Fixes: 442aba78728e ("hwmon: PMBus device driver")
Signed-off-by: Robert Lippert &lt;rlippert@google.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit bd467e4eababe4c04272c1e646f066db02734c79 ]

Power values in the 100s of watt range can easily blow past
32bit math limits when processing everything in microwatts.

Use 64bit math instead to avoid these issues on common 32bit ARM
BMC platforms.

Fixes: 442aba78728e ("hwmon: PMBus device driver")
Signed-off-by: Robert Lippert &lt;rlippert@google.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (asus_atk0110) fix uninitialized data access</title>
<updated>2017-12-25T13:22:12+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2017-03-23T15:03:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ebfb08395800fa655b03cfdd76232aef0497b430'/>
<id>ebfb08395800fa655b03cfdd76232aef0497b430</id>
<content type='text'>
[ Upstream commit a2125d02443e9a4e68bcfd9f8004fa23239e8329 ]

The latest gcc-7 snapshot adds a warning to point out that when
atk_read_value_old or atk_read_value_new fails, we copy
uninitialized data into sensor-&gt;cached_value:

drivers/hwmon/asus_atk0110.c: In function 'atk_input_show':
drivers/hwmon/asus_atk0110.c:651:26: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Adding an error check avoids this. All versions of the driver
are affected.

Fixes: 2c03d07ad54d ("hwmon: Add Asus ATK0110 support")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Luca Tettamanti &lt;kronos.it@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a2125d02443e9a4e68bcfd9f8004fa23239e8329 ]

The latest gcc-7 snapshot adds a warning to point out that when
atk_read_value_old or atk_read_value_new fails, we copy
uninitialized data into sensor-&gt;cached_value:

drivers/hwmon/asus_atk0110.c: In function 'atk_input_show':
drivers/hwmon/asus_atk0110.c:651:26: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Adding an error check avoids this. All versions of the driver
are affected.

Fixes: 2c03d07ad54d ("hwmon: Add Asus ATK0110 support")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Luca Tettamanti &lt;kronos.it@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes</title>
<updated>2017-10-08T08:14:17+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-12-27T22:15:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=297b8b01ec278ceadf55cc7f243797700a250a1c'/>
<id>297b8b01ec278ceadf55cc7f243797700a250a1c</id>
<content type='text'>
[ Upstream commit 87cdfa9d60f4f40e6d71b04b10b36d9df3c89282 ]

Writes into limit attributes can overflow due to multplications and
additions with unbound input values. Writing into fan limit attributes
can result in a crash with a division by zero if very large values are
written and the fan divider is larger than 1.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 87cdfa9d60f4f40e6d71b04b10b36d9df3c89282 ]

Writes into limit attributes can overflow due to multplications and
additions with unbound input values. Writing into fan limit attributes
can result in a crash with a division by zero if very large values are
written and the fan divider is larger than 1.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (g762) Fix overflows and crash seen when writing limit attributes</title>
<updated>2017-01-12T10:22:48+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-12-11T21:27:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=92e993abb928915026e4b3369ce34ce9f4ef600a'/>
<id>92e993abb928915026e4b3369ce34ce9f4ef600a</id>
<content type='text'>
commit 4fccd4a1e8944033bcd7693ea4e8fb478cd2059a upstream.

Fix overflows seen when writing into fan speed limit attributes.
Also fix crash due to division by zero, seen when certain very
large values (such as 2147483648, or 0x80000000) are written
into fan speed limit attributes.

Fixes: 594fbe713bf60 ("Add support for GMT G762/G763 PWM fan controllers")
Cc: Arnaud Ebalard &lt;arno@natisbad.org&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4fccd4a1e8944033bcd7693ea4e8fb478cd2059a upstream.

Fix overflows seen when writing into fan speed limit attributes.
Also fix crash due to division by zero, seen when certain very
large values (such as 2147483648, or 0x80000000) are written
into fan speed limit attributes.

Fixes: 594fbe713bf60 ("Add support for GMT G762/G763 PWM fan controllers")
Cc: Arnaud Ebalard &lt;arno@natisbad.org&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (nct7802) Fix overflows seen when writing into limit attributes</title>
<updated>2017-01-12T10:22:48+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-12-05T02:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fd504f52916025708a19c214d65f8d96036f53e1'/>
<id>fd504f52916025708a19c214d65f8d96036f53e1</id>
<content type='text'>
commit c0d04e9112ad59d73f23f3b0f6726c5e798dfcbf upstream.

Fix overflows seen when writing voltage and temperature limit attributes.

The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the
value parameter passed to nct7802_write_fan_min() is an unsigned long.

Also, writing values larger than 2700000 into a fan limit attribute results
in writing 0 into the chip's limit registers. The exact behavior when
writing this value is unspecified. For consistency, report a limit of
1350000 if the chip register reads 0. This may be wrong, and the chip
behavior should be verified with the actual chip, but it is better than
reporting a value of 0 (which, when written, results in writing a value
of 0x1fff into the chip register).

Fixes: 3434f3783580 ("hwmon: Driver for Nuvoton NCT7802Y")
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c0d04e9112ad59d73f23f3b0f6726c5e798dfcbf upstream.

Fix overflows seen when writing voltage and temperature limit attributes.

The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the
value parameter passed to nct7802_write_fan_min() is an unsigned long.

Also, writing values larger than 2700000 into a fan limit attribute results
in writing 0 into the chip's limit registers. The exact behavior when
writing this value is unspecified. For consistency, report a limit of
1350000 if the chip register reads 0. This may be wrong, and the chip
behavior should be verified with the actual chip, but it is better than
reporting a value of 0 (which, when written, results in writing a value
of 0x1fff into the chip register).

Fixes: 3434f3783580 ("hwmon: Driver for Nuvoton NCT7802Y")
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (ds620) Fix overflows seen when writing temperature limits</title>
<updated>2017-01-12T10:22:48+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-11-20T18:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e351caeaa96f1eafb527b4606535745fcce6577'/>
<id>5e351caeaa96f1eafb527b4606535745fcce6577</id>
<content type='text'>
commit e36ce99ee0815d7919a7b589bfb66f3de50b6bc7 upstream.

Module test reports:

temp1_max: Suspected overflow: [160000 vs. 0]
temp1_min: Suspected overflow: [160000 vs. 0]

This is seen because the values passed when writing temperature limits
are unbound.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 6099469805c2 ("hwmon: Support for Dallas Semiconductor DS620")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e36ce99ee0815d7919a7b589bfb66f3de50b6bc7 upstream.

Module test reports:

temp1_max: Suspected overflow: [160000 vs. 0]
temp1_min: Suspected overflow: [160000 vs. 0]

This is seen because the values passed when writing temperature limits
are unbound.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 6099469805c2 ("hwmon: Support for Dallas Semiconductor DS620")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (amc6821) sign extension temperature</title>
<updated>2017-01-12T10:22:48+00:00</updated>
<author>
<name>Jared Bents</name>
<email>jared.bents@rockwellcollins.com</email>
</author>
<published>2016-11-19T04:20:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fbab1832e7e824fe8b588de68914641ac1d61b40'/>
<id>fbab1832e7e824fe8b588de68914641ac1d61b40</id>
<content type='text'>
commit 4538bfbf2d9f1fc48c07ac0cc0ee58716fe7fe96 upstream.

Converts the unsigned temperature values from the i2c read
to be sign extended as defined in the datasheet so that
negative temperatures are properly read.

Fixes: 28e6274d8fa67 ("hwmon: (amc6821) Avoid forward declaration")
Signed-off-by: Jared Bents &lt;jared.bents@rockwellcollins.com&gt;
Signed-off-by: Matt Weber &lt;matthew.weber@rockwellcollins.com&gt;
[groeck: Dropped unnecessary continuation line]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4538bfbf2d9f1fc48c07ac0cc0ee58716fe7fe96 upstream.

Converts the unsigned temperature values from the i2c read
to be sign extended as defined in the datasheet so that
negative temperatures are properly read.

Fixes: 28e6274d8fa67 ("hwmon: (amc6821) Avoid forward declaration")
Signed-off-by: Jared Bents &lt;jared.bents@rockwellcollins.com&gt;
Signed-off-by: Matt Weber &lt;matthew.weber@rockwellcollins.com&gt;
[groeck: Dropped unnecessary continuation line]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
