<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hwmon, branch v4.19.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-12-17T08:24:33+00:00</updated>
<entry>
<title>hwmon: (w83795) temp4_type has writable permission</title>
<updated>2018-12-17T08:24:33+00:00</updated>
<author>
<name>Huacai Chen</name>
<email>chenhc@lemote.com</email>
</author>
<published>2018-11-15T02:44:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3ff2ac4169ec3aa5777a3c1dbb03fb63080cb4a'/>
<id>urn:sha1:f3ff2ac4169ec3aa5777a3c1dbb03fb63080cb4a</id>
<content type='text'>
[ Upstream commit 09aaf6813cfca4c18034fda7a43e68763f34abb1 ]

Both datasheet and comments of store_temp_mode() tell us that temp1~4_type
is writable, so fix it.

Signed-off-by: Yao Wang &lt;wangyao@lemote.com&gt;
Signed-off-by: Huacai Chen &lt;chenhc@lemote.com&gt;
Fixes: 39deb6993e7c (" hwmon: (w83795) Simplify temperature sensor type handling")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (mlxreg-fan) Fix macros for tacho fault reading</title>
<updated>2018-12-17T08:24:32+00:00</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@mellanox.com</email>
</author>
<published>2018-11-16T13:47:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d4ff09997f32ea375b3e1bc512cd1c48c421756'/>
<id>urn:sha1:0d4ff09997f32ea375b3e1bc512cd1c48c421756</id>
<content type='text'>
[ Upstream commit 243cfe3fb8978c7eec24511aba7dac98819ed896 ]

Fix macros for tacometer fault reading.
This fix is relevant for three Mellanox systems MQMB7, MSN37, MSN34,
which are about to be released to the customers.
At the moment, none of them is at customers sites.

Fixes: 65afb4c8e7e4 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver")
Signed-off-by: Vadim Pasternak &lt;vadimp@mellanox.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (ina2xx) Fix current value calculation</title>
<updated>2018-12-17T08:24:32+00:00</updated>
<author>
<name>Nicolin Chen</name>
<email>nicoleotsuka@gmail.com</email>
</author>
<published>2018-11-14T03:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3ef0d19cd8156fe122041cb47b3f9fc50ad743b5'/>
<id>urn:sha1:3ef0d19cd8156fe122041cb47b3f9fc50ad743b5</id>
<content type='text'>
[ Upstream commit 38cd989ee38c16388cde89db5b734f9d55b905f9 ]

The current register (04h) has a sign bit at MSB. The comments
for this calculation also mention that it's a signed register.

However, the regval is unsigned type so result of calculation
turns out to be an incorrect value when current is negative.

This patch simply fixes this by adding a casting to s16.

Fixes: 5d389b125186c ("hwmon: (ina2xx) Make calibration register value fixed")
Signed-off-by: Nicolin Chen &lt;nicoleotsuka@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (raspberrypi) Fix initial notify</title>
<updated>2018-12-17T08:24:31+00:00</updated>
<author>
<name>Stefan Wahren</name>
<email>stefan.wahren@i2se.com</email>
</author>
<published>2018-11-11T12:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbc62bd3b05b772989de64421573f25552f5aead'/>
<id>urn:sha1:dbc62bd3b05b772989de64421573f25552f5aead</id>
<content type='text'>
[ Upstream commit 35fdc3902179366489a12cae4cb3ccc3b95f0afe ]

In case an under-voltage happens before probing the driver wont
write the critical warning into the kernel log. So don't init
of last_throttled during probe and fix this issue.

Fixes: 74d1e007915f ("hwmon: Add support for RPi voltage sensor")
Reported-by: "Noralf Trønnes" &lt;noralf@tronnes.org&gt;
Signed-off-by: Stefan Wahren &lt;stefan.wahren@i2se.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon (ina2xx) Fix NULL id pointer in probe()</title>
<updated>2018-12-17T08:24:31+00:00</updated>
<author>
<name>Nicolin Chen</name>
<email>nicoleotsuka@gmail.com</email>
</author>
<published>2018-11-10T00:42:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08cff35113e5ca6378b394a3566a4c7c86737bf2'/>
<id>urn:sha1:08cff35113e5ca6378b394a3566a4c7c86737bf2</id>
<content type='text'>
[ Upstream commit 70df9ebbd82c794ddfbb49d45b337f18d5588dc2 ]

When using DT configurations, the id pointer might turn out to
be NULL. Then the driver encounters NULL pointer access:

  Unable to handle kernel read from unreadable memory at vaddr 00000018
  [...]
  PC is at ina2xx_probe+0x114/0x200
  LR is at ina2xx_probe+0x10c/0x200
  [...]
  Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

The reason is that i2c core returns the id pointer by matching
id_table with client-&gt;name, while the client-&gt;name is actually
using the name from the first string in the DT compatible list,
not the best one. So i2c core would fail to match the id_table
if the best matched compatible string isn't the first one, and
then would return a NULL id pointer.

This probably should be fixed in i2c core. But it doesn't hurt
to make the driver robust. So this patch fixes it by using the
"chip" that's added to unify both DT and non-DT configurations.

Additionally, since id pointer could be null, so as id-&gt;name:
  ina2xx 10-0047: power monitor (null) (Rshunt = 1000 uOhm)
  ina2xx 10-0048: power monitor (null) (Rshunt = 10000 uOhm)

So this patch also fixes NULL name pointer, using client-&gt;name
to play safe and to align with hwmon-&gt;name.

Fixes: bd0ddd4d0883 ("hwmon: (ina2xx) Add OF device ID table")
Signed-off-by: Nicolin Chen &lt;nicoleotsuka@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (ibmpowernv) Remove bogus __init annotations</title>
<updated>2018-11-27T15:13:04+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2018-10-28T17:16:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1ea367bb99a0a31183bcf155974a33f6798dff13'/>
<id>urn:sha1:1ea367bb99a0a31183bcf155974a33f6798dff13</id>
<content type='text'>
[ Upstream commit e3e61f01d755188cb6c2dcf5a244b9c0937c258e ]

If gcc decides not to inline make_sensor_label():

    WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label()
    The function .create_device_attrs() references
    the function __init .make_sensor_label().
    This is often because .create_device_attrs lacks a __init
    annotation or the annotation of .make_sensor_label is wrong.

As .probe() can be called after freeing of __init memory, all __init
annotiations in the driver are bogus, and should be removed.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (core) Fix double-free in __hwmon_device_register()</title>
<updated>2018-11-21T08:19:19+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2018-10-24T19:37:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a63fffbd90f64d2e4981a440963a2c5aa0d77d83'/>
<id>urn:sha1:a63fffbd90f64d2e4981a440963a2c5aa0d77d83</id>
<content type='text'>
commit 74e3512731bd5c9673176425a76a7cc5efa8ddb6 upstream.

Fix double-free that happens when thermal zone setup fails, see KASAN log
below.

==================================================================
BUG: KASAN: double-free or invalid-free in __hwmon_device_register+0x5dc/0xa7c

CPU: 0 PID: 132 Comm: kworker/0:2 Tainted: G    B             4.19.0-rc8-next-20181016-00042-gb52cd80401e9-dirty #41
Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
Workqueue: events deferred_probe_work_func
Backtrace:
[&lt;c0110540&gt;] (dump_backtrace) from [&lt;c0110944&gt;] (show_stack+0x20/0x24)
[&lt;c0110924&gt;] (show_stack) from [&lt;c105cb08&gt;] (dump_stack+0x9c/0xb0)
[&lt;c105ca6c&gt;] (dump_stack) from [&lt;c02fdaec&gt;] (print_address_description+0x68/0x250)
[&lt;c02fda84&gt;] (print_address_description) from [&lt;c02fd4ac&gt;] (kasan_report_invalid_free+0x68/0x88)
[&lt;c02fd444&gt;] (kasan_report_invalid_free) from [&lt;c02fc85c&gt;] (__kasan_slab_free+0x1f4/0x200)
[&lt;c02fc668&gt;] (__kasan_slab_free) from [&lt;c02fd0c0&gt;] (kasan_slab_free+0x14/0x18)
[&lt;c02fd0ac&gt;] (kasan_slab_free) from [&lt;c02f9c6c&gt;] (kfree+0x90/0x294)
[&lt;c02f9bdc&gt;] (kfree) from [&lt;c0b41bbc&gt;] (__hwmon_device_register+0x5dc/0xa7c)
[&lt;c0b415e0&gt;] (__hwmon_device_register) from [&lt;c0b421e8&gt;] (hwmon_device_register_with_info+0xa0/0xa8)
[&lt;c0b42148&gt;] (hwmon_device_register_with_info) from [&lt;c0b42324&gt;] (devm_hwmon_device_register_with_info+0x74/0xb4)
[&lt;c0b422b0&gt;] (devm_hwmon_device_register_with_info) from [&lt;c0b4481c&gt;] (lm90_probe+0x414/0x578)
[&lt;c0b44408&gt;] (lm90_probe) from [&lt;c0aeeff4&gt;] (i2c_device_probe+0x35c/0x384)
[&lt;c0aeec98&gt;] (i2c_device_probe) from [&lt;c08776cc&gt;] (really_probe+0x290/0x3e4)
[&lt;c087743c&gt;] (really_probe) from [&lt;c0877a2c&gt;] (driver_probe_device+0x80/0x1c4)
[&lt;c08779ac&gt;] (driver_probe_device) from [&lt;c0877da8&gt;] (__device_attach_driver+0x104/0x11c)
[&lt;c0877ca4&gt;] (__device_attach_driver) from [&lt;c0874dd8&gt;] (bus_for_each_drv+0xa4/0xc8)
[&lt;c0874d34&gt;] (bus_for_each_drv) from [&lt;c08773b0&gt;] (__device_attach+0xf0/0x15c)
[&lt;c08772c0&gt;] (__device_attach) from [&lt;c0877e24&gt;] (device_initial_probe+0x1c/0x20)
[&lt;c0877e08&gt;] (device_initial_probe) from [&lt;c08762f4&gt;] (bus_probe_device+0xdc/0xec)
[&lt;c0876218&gt;] (bus_probe_device) from [&lt;c0876a08&gt;] (deferred_probe_work_func+0xa8/0xd4)
[&lt;c0876960&gt;] (deferred_probe_work_func) from [&lt;c01527c4&gt;] (process_one_work+0x3dc/0x96c)
[&lt;c01523e8&gt;] (process_one_work) from [&lt;c01541e0&gt;] (worker_thread+0x4ec/0x8bc)
[&lt;c0153cf4&gt;] (worker_thread) from [&lt;c015b238&gt;] (kthread+0x230/0x240)
[&lt;c015b008&gt;] (kthread) from [&lt;c01010bc&gt;] (ret_from_fork+0x14/0x38)
Exception stack(0xcf743fb0 to 0xcf743ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Allocated by task 132:
 kasan_kmalloc.part.1+0x58/0xf4
 kasan_kmalloc+0x90/0xa4
 kmem_cache_alloc_trace+0x90/0x2a0
 __hwmon_device_register+0xbc/0xa7c
 hwmon_device_register_with_info+0xa0/0xa8
 devm_hwmon_device_register_with_info+0x74/0xb4
 lm90_probe+0x414/0x578
 i2c_device_probe+0x35c/0x384
 really_probe+0x290/0x3e4
 driver_probe_device+0x80/0x1c4
 __device_attach_driver+0x104/0x11c
 bus_for_each_drv+0xa4/0xc8
 __device_attach+0xf0/0x15c
 device_initial_probe+0x1c/0x20
 bus_probe_device+0xdc/0xec
 deferred_probe_work_func+0xa8/0xd4
 process_one_work+0x3dc/0x96c
 worker_thread+0x4ec/0x8bc
 kthread+0x230/0x240
 ret_from_fork+0x14/0x38
   (null)

Freed by task 132:
 __kasan_slab_free+0x12c/0x200
 kasan_slab_free+0x14/0x18
 kfree+0x90/0x294
 hwmon_dev_release+0x1c/0x20
 device_release+0x4c/0xe8
 kobject_put+0xac/0x11c
 device_unregister+0x2c/0x30
 __hwmon_device_register+0xa58/0xa7c
 hwmon_device_register_with_info+0xa0/0xa8
 devm_hwmon_device_register_with_info+0x74/0xb4
 lm90_probe+0x414/0x578
 i2c_device_probe+0x35c/0x384
 really_probe+0x290/0x3e4
 driver_probe_device+0x80/0x1c4
 __device_attach_driver+0x104/0x11c
 bus_for_each_drv+0xa4/0xc8
 __device_attach+0xf0/0x15c
 device_initial_probe+0x1c/0x20
 bus_probe_device+0xdc/0xec
 deferred_probe_work_func+0xa8/0xd4
 process_one_work+0x3dc/0x96c
 worker_thread+0x4ec/0x8bc
 kthread+0x230/0x240
 ret_from_fork+0x14/0x38
   (null)

Cc: &lt;stable@vger.kernel.org&gt; # v4.15+
Fixes: 47c332deb8e8 ("hwmon: Deal with errors from the thermal subsystem")
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>hwmon: (pwm-fan) Set fan speed to 0 on suspend</title>
<updated>2018-11-13T19:08:21+00:00</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2018-09-21T10:10:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5764ffc8a643add918a977cee0e945d57bd0563d'/>
<id>urn:sha1:5764ffc8a643add918a977cee0e945d57bd0563d</id>
<content type='text'>
[ Upstream commit 95dcd64bc5a27080beaa344edfe5bdcca3d2e7dc ]

Technically this is not required because disabling the PWM should be
enough. However, when support for atomic operations was implemented in
the PWM subsystem, only actual changes to the PWM channel are applied
during pwm_config(), which means that during after resume from suspend
the old settings won't be applied.

One possible solution is for the PWM driver to implement its own PM
operations such that settings from before suspend get applied on resume.
This has the disadvantage of completely ignoring any particular ordering
requirements that PWM user drivers might have, so it is best to leave it
up to the user drivers to apply the settings that they want at the
appropriate time.

Another way to solve this would be to read back the current state of the
PWM at the time of resume. That way, in case the configuration was lost
during suspend, applying the old settings in PWM user drivers would
actually get them applied because they differ from the current settings.
However, not all PWM drivers support reading the hardware state, and not
all hardware may support it.

The best workaround at this point seems to be to let PWM user drivers
tell the PWM subsystem that the PWM is turned off by, in addition to
disabling it, also setting the duty cycle to 0. This causes the resume
operation to apply a configuration that is different from the current
configuration, resulting in the proper state from before suspend getting
restored.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (pmbus) Fix page count auto-detection.</title>
<updated>2018-11-13T19:08:16+00:00</updated>
<author>
<name>Dmitry Bazhenov</name>
<email>bazhenov.dn@gmail.com</email>
</author>
<published>2018-10-15T09:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43cba96d9505c5084db99531f28d4036698cfefe'/>
<id>urn:sha1:43cba96d9505c5084db99531f28d4036698cfefe</id>
<content type='text'>
commit e7c6a55606b5c46b449d76588968b4d8caae903f upstream.

Devices with compatible="pmbus" field have zero initial page count,
and pmbus_clear_faults() being called before the page count auto-
detection does not actually clear faults because it depends on the
page count. Non-cleared faults in its turn may fail the subsequent
page count auto-detection.

This patch fixes this problem by calling pmbus_clear_fault_page()
for currently set page and calling pmbus_clear_faults() after the
page count was detected.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Bazhenov &lt;bazhenov.dn@gmail.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux</title>
<updated>2018-10-11T17:10:30+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2018-10-11T17:10:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=834d3cd294abd9ad81c6cbaefdda28aa491ceb06'/>
<id>urn:sha1:834d3cd294abd9ad81c6cbaefdda28aa491ceb06</id>
<content type='text'>
Kees writes:
  "Fix open-coded multiplication arguments to allocators

   - Fixes several new open-coded multiplications added in the 4.19
     merge window."

* tag 'alloc-args-v4.19-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  treewide: Replace more open-coded allocation size multiplications
</content>
</entry>
</feed>
