<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/thermal/devfreq_cooling.c, branch v5.15.208</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-04-10T14:19:37+00:00</updated>
<entry>
<title>thermal: devfreq_cooling: Fix perf state when calculate dfc res_util</title>
<updated>2024-04-10T14:19:37+00:00</updated>
<author>
<name>Ye Zhang</name>
<email>ye.zhang@rock-chips.com</email>
</author>
<published>2024-03-21T10:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a7c6a643b25bb48998ad2056092247c96298801b'/>
<id>urn:sha1:a7c6a643b25bb48998ad2056092247c96298801b</id>
<content type='text'>
commit a26de34b3c77ae3a969654d94be49e433c947e3b upstream.

The issue occurs when the devfreq cooling device uses the EM power model
and the get_real_power() callback is provided by the driver.

The EM power table is sorted ascending，can't index the table by cooling
device state，so convert cooling state to performance state by
dfc-&gt;max_state - dfc-&gt;capped_state.

Fixes: 615510fe13bd ("thermal: devfreq_cooling: remove old power model and use EM")
Cc: 5.11+ &lt;stable@vger.kernel.org&gt; # 5.11+
Signed-off-by: Ye Zhang &lt;ye.zhang@rock-chips.com&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>thermal: devfreq_cooling: use local ops instead of global ops</title>
<updated>2022-06-09T08:23:26+00:00</updated>
<author>
<name>Kant Fan</name>
<email>kant@allwinnertech.com</email>
</author>
<published>2022-03-25T07:30:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e354518f576307658d79847a3ec94025e42983f'/>
<id>urn:sha1:8e354518f576307658d79847a3ec94025e42983f</id>
<content type='text'>
commit b947769b8f778db130aad834257fcaca25df2edc upstream.

Fix access illegal address problem in following condition:

There are multiple devfreq cooling devices in system, some of them has
EM model but others do not. Energy model ops such as state2power will
append to global devfreq_cooling_ops when the cooling device with
EM model is registered. It makes the cooling device without EM model
also use devfreq_cooling_ops after appending when registered later by
of_devfreq_cooling_register_power() or of_devfreq_cooling_register().

The IPA governor regards the cooling devices without EM model as a power
actor, because they also have energy model ops, and will access illegal
address at dfc-&gt;em_pd when execute cdev-&gt;ops-&gt;get_requested_power,
cdev-&gt;ops-&gt;state2power or cdev-&gt;ops-&gt;power2state.

Fixes: 615510fe13bd2 ("thermal: devfreq_cooling: remove old power model and use EM")
Cc: 5.13+ &lt;stable@vger.kernel.org&gt; # 5.13+
Signed-off-by: Kant Fan &lt;kant@allwinnertech.com&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>thermal/drivers/devfreq_cooling: use HZ macros</title>
<updated>2021-09-08T18:50:25+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2021-09-08T02:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=73b718c617caae17f6e2964fba823e2c18a9b67c'/>
<id>urn:sha1:73b718c617caae17f6e2964fba823e2c18a9b67c</id>
<content type='text'>
HZ unit conversion macros are available in units.h, use them and remove
the duplicate definition.

The new macro uses a unsigned long type which is already the type in the
current code via the 'freq' variable.

Link: https://lkml.kernel.org/r/20210816114732.1834145-4-daniel.lezcano@linaro.org
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Christian Eggers &lt;ceggers@arri.de&gt;
Cc: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Jonathan Cameron &lt;jic23@kernel.org&gt;
Cc: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Cc: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Cc: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Cc: Maxime Coquelin &lt;mcoquelin.stm32@gmail.com&gt;
Cc: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Cc: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Cc: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>thermal: devfreq_cooling: Fix kernel-doc</title>
<updated>2021-07-04T16:28:04+00:00</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2021-06-09T07:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8b2ea897328c3e042ef7c3e80503c802db24a678'/>
<id>urn:sha1:8b2ea897328c3e042ef7c3e80503c802db24a678</id>
<content type='text'>
Fix function name in devfreq_cooling.c comment to remove a
warning found by kernel-doc.

drivers/thermal/devfreq_cooling.c:479: warning: expecting prototype for
devfreq_cooling_em_register_power(). Prototype was for
devfreq_cooling_em_register() instead.

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/1623223350-128104-1-git-send-email-yang.lee@linux.alibaba.com
</content>
</entry>
<entry>
<title>thermal/drivers/devfreq_cooling: Fix wrong return on error path</title>
<updated>2021-04-15T11:21:16+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2021-03-19T20:24:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9aa80ab2c0ba67ce3281aee604b543293f71390d'/>
<id>urn:sha1:9aa80ab2c0ba67ce3281aee604b543293f71390d</id>
<content type='text'>
The following error is reported by kbuild:

 smatch warnings:
 drivers/thermal/devfreq_cooling.c:433 of_devfreq_cooling_register_power() warn: passing zero to 'ERR_PTR'

Fix the error code by the setting the 'err' variable instead of 'cdev'.

Fixes: f8d354e821b2 ("thermal/drivers/devfreq_cooling: Use device name instead of auto-numbering")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20210319202424.890968-1-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal/drivers/devfreq_cooling: Use device name instead of auto-numbering</title>
<updated>2021-03-15T03:47:04+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2021-03-14T11:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8d354e821b268c23a6cd548b7154e55c3954496'/>
<id>urn:sha1:f8d354e821b268c23a6cd548b7154e55c3954496</id>
<content type='text'>
Currently the naming of a cooling device is just a cooling technique
followed by a number. When there are multiple cooling devices using
the same technique, it is impossible to clearly identify the related
device as this one is just a number.

For instance:

 thermal-devfreq-0
 thermal-devfreq-1
 etc ...

The 'thermal' prefix is redundant with the subsystem namespace. This
patch removes the 'thermal' prefix and changes the number by the device
name. So the naming above becomes:

 devfreq-5000000.gpu
 devfreq-1d84000.ufshc
 etc ...

Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Link: https://lore.kernel.org/r/20210314111333.16551-3-daniel.lezcano@linaro.org
</content>
</entry>
<entry>
<title>thermal/drivers/devfreq_cooling: Fix the build when !ENERGY_MODEL</title>
<updated>2020-12-15T16:03:56+00:00</updated>
<author>
<name>Lukasz Luba</name>
<email>lukasz.luba@arm.com</email>
</author>
<published>2020-12-15T15:42:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4401117bf7fc11dc738c0963fa0c94814abc8dcd'/>
<id>urn:sha1:4401117bf7fc11dc738c0963fa0c94814abc8dcd</id>
<content type='text'>
Prevent build failure if the option CONFIG_ENERGY_MODEL is not set. The
devfreq cooling is able to operate without the Energy Model.
Don't use dev-&gt;em_pd directly and use local pointer.

Fixes: 615510fe13bd2 ("thermal: devfreq_cooling: remove old power model and use EM")
Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20201215154221.8828-1-lukasz.luba@arm.com
</content>
</entry>
<entry>
<title>thermal: devfreq_cooling: remove old power model and use EM</title>
<updated>2020-12-11T13:10:44+00:00</updated>
<author>
<name>Lukasz Luba</name>
<email>lukasz.luba@arm.com</email>
</author>
<published>2020-12-10T14:30:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=615510fe13bd2434610193f1acab53027d5146d6'/>
<id>urn:sha1:615510fe13bd2434610193f1acab53027d5146d6</id>
<content type='text'>
Remove old power model and use new Energy Model to calculate the power
budget. It drops static + dynamic power calculations and power table
in order to use Energy Model performance domain data. This model
should be easy to use and could find more users. It is also less
complicated to setup the needed structures.

Reviewed-by: Ionela Voinescu &lt;ionela.voinescu@arm.com&gt;
Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20201210143014.24685-5-lukasz.luba@arm.com
</content>
</entry>
<entry>
<title>thermal: devfreq_cooling: add new registration functions with Energy Model</title>
<updated>2020-12-11T13:10:44+00:00</updated>
<author>
<name>Lukasz Luba</name>
<email>lukasz.luba@arm.com</email>
</author>
<published>2020-12-10T14:30:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84e0d87c9944eb36ae6037af5cb6905f67c074c5'/>
<id>urn:sha1:84e0d87c9944eb36ae6037af5cb6905f67c074c5</id>
<content type='text'>
The Energy Model (EM) framework supports devices such as Devfreq. Create
new registration function which automatically register EM for the thermal
devfreq_cooling devices. This patch prepares the code for coming changes
which are going to replace old power model with the new EM.

Reviewed-by: Ionela Voinescu &lt;ionela.voinescu@arm.com&gt;
Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20201210143014.24685-4-lukasz.luba@arm.com
</content>
</entry>
<entry>
<title>thermal: devfreq_cooling: use a copy of device status</title>
<updated>2020-12-11T13:10:44+00:00</updated>
<author>
<name>Lukasz Luba</name>
<email>lukasz.luba@arm.com</email>
</author>
<published>2020-12-10T14:30:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=229794eee27fddbedd03be5f8b20375a2637ff48'/>
<id>urn:sha1:229794eee27fddbedd03be5f8b20375a2637ff48</id>
<content type='text'>
Devfreq cooling needs to now the correct status of the device in order
to operate. Devfreq framework can change the device status in the
background. To mitigate issues make a copy of the status structure and use
it for internal calculations.

In addition this patch adds normalization function, which also makes sure
that whatever data comes from the device, the load will be in range from 1
to 1024.

Reviewed-by: Ionela Voinescu &lt;ionela.voinescu@arm.com&gt;
Signed-off-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: https://lore.kernel.org/r/20201210143014.24685-3-lukasz.luba@arm.com
</content>
</entry>
</feed>
