<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/thermal, branch v4.8.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.8.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.8.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-12-02T08:10:32+00:00</updated>
<entry>
<title>thermal/powerclamp: add back module device table</title>
<updated>2016-12-02T08:10:32+00:00</updated>
<author>
<name>Jacob Pan</name>
<email>jacob.jun.pan@linux.intel.com</email>
</author>
<published>2016-11-14T19:08:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2f64572db2e97340c8b17c48a9b83fac84cec4f'/>
<id>urn:sha1:b2f64572db2e97340c8b17c48a9b83fac84cec4f</id>
<content type='text'>
commit ec638db8cb9ddd5ca08b23f2835b6c9c15eb616d upstream.

Commit 3105f234e0aba43e44e277c20f9b32ee8add43d4 replaced module
cpu id table with a cpu feature check, which is logically correct.
But we need the module device table to allow module auto loading.

Fixes:3105f234 thermal/powerclamp: correct cpu support check
Signed-off-by: Jacob Pan &lt;jacob.jun.pan@linux.intel.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>thermal/powerclamp: correct cpu support check</title>
<updated>2016-11-10T15:38:46+00:00</updated>
<author>
<name>Eric Ernst</name>
<email>eric.ernst@linux.intel.com</email>
</author>
<published>2016-10-06T15:56:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a38e6c551c471c1cd385721478743513ba8a899'/>
<id>urn:sha1:0a38e6c551c471c1cd385721478743513ba8a899</id>
<content type='text'>
commit 3105f234e0aba43e44e277c20f9b32ee8add43d4 upstream.

Initial logic for checking CPU match resulted in OR of CPU features
rather than the intended AND.

Updated to use boot_cpu_has macro rather than x86_match_cpu.

In addition, MWAIT is the only required CPU feature for idle
injection to work.  Drop other feature requirements since they are
only needed for optimal efficiency.

Signed-off-by: Eric Ernst &lt;eric.ernst@linux.intel.com&gt;
Acked-by: Jacob Pan &lt;jacob.jun.pan@linux.intel.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>thermal: rcar_thermal: Fix priv-&gt;zone error handling</title>
<updated>2016-09-06T12:46:06+00:00</updated>
<author>
<name>Dirk Behme</name>
<email>dirk.behme@de.bosch.com</email>
</author>
<published>2016-04-21T10:24:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=87260d3f7aecba9a5fadc6886c338b2a8fccfca9'/>
<id>urn:sha1:87260d3f7aecba9a5fadc6886c338b2a8fccfca9</id>
<content type='text'>
In case thermal_zone_xxx_register() returns an error, priv-&gt;zone
isn't NULL any more, but contains the error code.

This is passed to thermal_zone_device_unregister(), then. This checks
for priv-&gt;zone being NULL, but the error code is != NULL. So it works
with the error code as a pointer. Crashing immediately.

To fix this, reset priv-&gt;zone to NULL before entering
rcar_gen3_thermal_remove().

Signed-off-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: imx: fix a possible NULL dereference</title>
<updated>2016-08-19T13:34:08+00:00</updated>
<author>
<name>Corentin LABBE</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-16T08:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=829bc78aa7628e81a9de717316b85cbee3c5eb86'/>
<id>urn:sha1:829bc78aa7628e81a9de717316b85cbee3c5eb86</id>
<content type='text'>
of_match_device could return NULL, and so cause a NULL pointer
dereference later at line 472:
data-&gt;socdata = of_id-&gt;data;

For fixing this problem, we use of_device_get_match_data(), this will
simplify the code a little by using a standard function for
getting the match data.

Reported-by: coverity (CID 1324128)
Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>Thermal-INT3406: Delete owner assignment</title>
<updated>2016-08-19T13:32:48+00:00</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2016-08-15T09:22:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57027db00d1094d0abd5776899b00ca55d42d37c'/>
<id>urn:sha1:57027db00d1094d0abd5776899b00ca55d42d37c</id>
<content type='text'>
The field "owner" is set by core. Thus delete an extra initialisation.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: cpu_cooling: Fix NULL dereference in cpufreq_state2power</title>
<updated>2016-08-19T13:32:18+00:00</updated>
<author>
<name>Brendan Jackman</name>
<email>brendan.jackman@arm.com</email>
</author>
<published>2016-08-17T15:14:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a305a4387acb01cecadeeea5151c049a022a1bfc'/>
<id>urn:sha1:a305a4387acb01cecadeeea5151c049a022a1bfc</id>
<content type='text'>
Currently all CPU cooling devices share a
`struct thermal_cooling_device_ops` instance. The thermal core uses the
presence of functions in this struct to determine if a cooling device
has a power model (see cdev_is_power_actor). cpu_cooling.c adds the
power model functions to the shared struct when a device is registered
with a power model.

Therefore, if a CPU cooling device is registered using
[of_]cpufreq_power_cooling_register, _all_ devices will be determined to
have a power model, including any registered with
[of_]cpufreq_cooling_register. This can result in cpufreq_state2power
being called on a device where dyn_power_table is NULL.

With this commit, instead of having a shared thermal_cooling_device_ops
which is mutated, we have two versions: one with the power functions and
one without.

Signed-off-by: Brendan Jackman &lt;brendan.jackman@arm.com&gt;
Cc: Amit Daniel Kachhap &lt;amit.kachhap@gmail.com&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: Javi Merino &lt;javi.merino@arm.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Javi Merino &lt;javi.merino@arm.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'thermal-intel' and 'thermal-core' into next</title>
<updated>2016-08-08T02:59:35+00:00</updated>
<author>
<name>Zhang Rui</name>
<email>rui.zhang@intel.com</email>
</author>
<published>2016-08-08T02:59:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1577ddfac75ff9690ebd0d210bc7f1345c9d29ef'/>
<id>urn:sha1:1577ddfac75ff9690ebd0d210bc7f1345c9d29ef</id>
<content type='text'>
</content>
</entry>
<entry>
<title>thermal: clock_cooling: Fix missing mutex_init()</title>
<updated>2016-08-08T02:57:39+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyj.lk@gmail.com</email>
</author>
<published>2016-07-25T07:01:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=165989a5b667b90589f21c8affe496ad21f08591'/>
<id>urn:sha1:165989a5b667b90589f21c8affe496ad21f08591</id>
<content type='text'>
The driver allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun &lt;weiyj.lk@gmail.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: hwmon: EXPORT_SYMBOL_GPL for thermal hwmon sysfs</title>
<updated>2016-08-08T02:57:39+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2016-07-04T07:19:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f4c592439b144ef1de66eac764140643a54099eb'/>
<id>urn:sha1:f4c592439b144ef1de66eac764140643a54099eb</id>
<content type='text'>
thermal_add_hwmon_sysfs()/thermal_remove_hwmon_sysfs() need
EXPORT_SYMBOL_GPL(). Otherwise we will have ERROR

&gt;&gt; ERROR: "thermal_remove_hwmon_sysfs" [drivers/thermal/rcar_thermal.ko] undefined!
&gt;&gt; ERROR: "thermal_add_hwmon_sysfs" [drivers/thermal/rcar_thermal.ko] undefined!

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>thermal: fix race condition when updating cooling device</title>
<updated>2016-08-08T02:57:39+00:00</updated>
<author>
<name>Michele Di Giorgio</name>
<email>michele.digiorgio@arm.com</email>
</author>
<published>2016-06-02T14:25:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0b7306d203c82e7c04d6eb066ca4898f016ebdd'/>
<id>urn:sha1:d0b7306d203c82e7c04d6eb066ca4898f016ebdd</id>
<content type='text'>
When multiple thermal zones are bound to the same cooling device, multiple
kernel threads may want to update the cooling device state by calling
thermal_cdev_update(). Having cdev not protected by a mutex can lead to a race
condition. Consider the following situation with two kernel threads k1 and k2:

	    Thread k1				Thread k2
                                    ||
                                    ||  call thermal_cdev_update()
                                    ||      ...
                                    ||      set_cur_state(cdev, target);
    call power_actor_set_power()    ||
        ...                         ||
        instance-&gt;target = state;   ||
        cdev-&gt;updated = false;      ||
                                    ||      cdev-&gt;updated = true;
                                    ||      // completes execution
    call thermal_cdev_update()      ||
        // cdev-&gt;updated == true    ||
        return;                     ||
                                    \/
                                    time

k2 has already looped through the thermal instances looking for the deepest
cooling device state and is preempted right before setting cdev-&gt;updated to
true. Now, k1 runs, modifies the thermal instance state and sets cdev-&gt;updated
to false. Then, k1 is preempted and k2 continues the execution by setting
cdev-&gt;updated to true, therefore preventing k1 from performing the update.
Notice that this is not an issue if k2 looks at the instance-&gt;target modified by
k1 "after" it is assigned by k1. In fact, in this case the update will happen
anyway and k1 can safely return immediately from thermal_cdev_update().

This may lead to a situation where a thermal governor never updates the cooling
device. For example, this is the case for the step_wise governor: when calling
the function thermal_zone_trip_update(), the governor may always get a new state
equal to the old one (which, however, wasn't notified to the cooling device) and
will therefore skip the update.

CC: Zhang Rui &lt;rui.zhang@intel.com&gt;
CC: Eduardo Valentin &lt;edubezval@gmail.com&gt;
CC: Peter Feuerer &lt;peter@piie.net&gt;
Reported-by: Toby Huang &lt;toby.huang@arm.com&gt;
Signed-off-by: Michele Di Giorgio &lt;michele.digiorgio@arm.com&gt;
Reviewed-by: Javi Merino &lt;javi.merino@arm.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
</feed>
