<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/thermal/thermal_core.c, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-09-04T09:52:54Z</updated>
<entry>
<title>thermal: core: Fix use-after-free in thermal_zone_device_unregister()</title>
<updated>2020-09-04T09:52:54Z</updated>
<author>
<name>Dmitry Osipenko</name>
</author>
<published>2020-08-17T23:58:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5f785ce608cafc444cdf047d1791d5ad97943ba'/>
<id>urn:sha1:a5f785ce608cafc444cdf047d1791d5ad97943ba</id>
<content type='text'>
The user-after-free bug in thermal_zone_device_unregister() is reported by
KASAN. It happens because struct thermal_zone_device is released during of
device_unregister() invocation, and hence the "tz" variable shouldn't be
touched by thermal_notify_tz_delete(tz-&gt;id).

Fixes: 55cdf0a283b8 ("thermal: core: Add notifications call in the framework")
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20200817235854.26816-1-digetx@gmail.com
</content>
</entry>
<entry>
<title>thermal: core: Add thermal zone enable/disable notification</title>
<updated>2020-07-29T08:21:48Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-27T23:10:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25be77e588a63b064e8d9c1b59975e6882abc2f9'/>
<id>urn:sha1:25be77e588a63b064e8d9c1b59975e6882abc2f9</id>
<content type='text'>
Now the calls to enable/disable a thermal zone are centralized in a
call to a function, we can add in these the corresponding netlink
notifications.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Link: https://lore.kernel.org/r/20200727231033.26512-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: core: Fix thermal zone lookup by ID</title>
<updated>2020-07-24T17:11:47Z</updated>
<author>
<name>Thierry Reding</name>
</author>
<published>2020-07-24T17:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82aa68afa16819d9f05b899a5fcf174c2f1fb889'/>
<id>urn:sha1:82aa68afa16819d9f05b899a5fcf174c2f1fb889</id>
<content type='text'>
When a thermal zone is looked up by an ID and no zone is found matching
that ID, the thermal_zone_get_by_id() function will return a pointer to
the thermal zone list head which isn't actually a valid thermal zone.

This can lead to a subsequent crash because a valid pointer is returned
to the called, but dereferencing that pointer as struct thermal_zone is
not safe.

Fixes: 329b064fbd13 ("thermal: core: Get thermal zone by id")
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20200724170105.2705467-1-thierry.reding@gmail.com
</content>
</entry>
<entry>
<title>thermal: core: Move initialization after core initcall</title>
<updated>2020-07-21T08:40:08Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-17T16:42:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f5a2cbe0f5c54adcada54a6a0567690241e7b3a'/>
<id>urn:sha1:3f5a2cbe0f5c54adcada54a6a0567690241e7b3a</id>
<content type='text'>
The generic netlink is initialized at subsys_initcall, so far after
the thermal init routine and the thermal generic netlink family
initialization.

On ŝome platforms, that leads to a memory corruption.

The fix was sent to netdev@ to move the genetlink framework
initialization at core_initcall.

Move the thermal core initialization to postcore level which is very
close to core level.

Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Link: https://lore.kernel.org/r/20200717164217.18819-2-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: netlink: Improve the initcall ordering</title>
<updated>2020-07-21T08:40:08Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-17T16:42:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2a89b52839597c70746d9f46a21b1aab0a26c02'/>
<id>urn:sha1:d2a89b52839597c70746d9f46a21b1aab0a26c02</id>
<content type='text'>
The initcalls like to play joke. In our case, the thermal-netlink
initcall is called after the thermal-core initcall but this one sends
a notification before the former is initialized. No issue was spotted,
but it could lead to a memory corruption, so instead of relying on the
core_initcall for the thermal-netlink, let's initialize directly from
the thermal-core init routine, so we have full control of the init
ordering.

Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Link: https://lore.kernel.org/r/20200717164217.18819-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: core: Add notifications call in the framework</title>
<updated>2020-07-07T13:55:22Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-06T10:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55cdf0a283b876050f0c502685adc346180d7a2f'/>
<id>urn:sha1:55cdf0a283b876050f0c502685adc346180d7a2f</id>
<content type='text'>
The generic netlink protocol is implemented but the different
notification functions are not yet connected to the core code.

These changes add the notification calls in the different
corresponding places.

Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Link: https://lore.kernel.org/r/20200706105538.2159-4-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: core: Get thermal zone by id</title>
<updated>2020-07-07T13:55:21Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-06T10:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=329b064fbd13d6526fdc35d4a220adedeadf0816'/>
<id>urn:sha1:329b064fbd13d6526fdc35d4a220adedeadf0816</id>
<content type='text'>
The next patch will introduce the generic netlink protocol to handle
events, sampling and command from the thermal framework. In order to
deal with the thermal zone, it uses its unique identifier to
characterize it in the message. Passing an integer is more efficient
than passing an entire string.

This change provides a function returning back a thermal zone pointer
corresponding to the identifier passed as parameter.

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Acked-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Link: https://lore.kernel.org/r/20200706105538.2159-2-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: core: Add helpers to browse the cdev, tz and governor list</title>
<updated>2020-07-07T13:55:20Z</updated>
<author>
<name>Daniel Lezcano</name>
</author>
<published>2020-07-06T10:55:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d44a509c1dafb75adfe218f022ad216885c135e'/>
<id>urn:sha1:3d44a509c1dafb75adfe218f022ad216885c135e</id>
<content type='text'>
The cdev, tz and governor list, as well as their respective locks are
statically defined in the thermal_core.c file.

In order to give a sane access to these list, like browsing all the
thermal zones or all the cooling devices, let's define a set of
helpers where we pass a callback as a parameter to be called for each
thermal entity.

We keep the self-encapsulation and ensure the locks are correctly
taken when looking at the list.

Acked-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20200706105538.2159-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal: Make thermal_zone_device_is_enabled() available to core only</title>
<updated>2020-07-06T23:26:07Z</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
</author>
<published>2020-07-03T10:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=514acd00f957afa9b2a1fd521b2f180a950ee5e3'/>
<id>urn:sha1:514acd00f957afa9b2a1fd521b2f180a950ee5e3</id>
<content type='text'>
This function is not needed by drivers.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@collabora.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20200703104354.19657-4-andrzej.p@collabora.com
</content>
</entry>
<entry>
<title>thermal: Rename set_mode() to change_mode()</title>
<updated>2020-06-29T18:26:39Z</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
</author>
<published>2020-06-29T12:29:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5e50bf4d3ef0aba4d5414c9ed51fa4a02e2ed12'/>
<id>urn:sha1:f5e50bf4d3ef0aba4d5414c9ed51fa4a02e2ed12</id>
<content type='text'>
set_mode() is only called when tzd's mode is about to change. Actual
setting is performed in thermal_core, in thermal_zone_device_set_mode().
The meaning of set_mode() callback is actually to notify the driver about
the mode being changed and giving the driver a chance to oppose such
change.

To better reflect the purpose of the method rename it to change_mode()

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@collabora.com&gt;
[for acerhdf]
Acked-by: Peter Kaestle &lt;peter@piie.net&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Reviewed-by: Amit Kucheria &lt;amit.kucheria@linaro.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20200629122925.21729-12-andrzej.p@collabora.com
</content>
</entry>
</feed>
