]> git.baikalelectronics.ru Git - kernel.git/commit
PM / devfreq: Fix kernel panic with cpu based scaling to passive gov
authorChristian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Tue, 14 Jun 2022 11:06:59 +0000 (13:06 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 29 Jun 2022 20:11:17 +0000 (05:11 +0900)
commit1fe3f9073a8208694b95e86a836d25aea6ff86f6
treea91b93798e013ff7c8c95739a43148aae7318a1a
parent4f64cb9d4742408196e508a683a5f394c26fe503
PM / devfreq: Fix kernel panic with cpu based scaling to passive gov

The cpufreq passive register notifier can PROBE_DEFER and the devfreq
struct is freed and then reallocaed on probe retry.
The current logic assume that the code can't PROBE_DEFER so the devfreq
struct in the this variable in devfreq_passive_data is assumed to be
(if already set) always correct.
This cause kernel panic as the code try to access the wrong address.
To correctly handle this, update the this variable in
devfreq_passive_data to the devfreq reallocated struct.

Fixes: 560910085917 ("PM / devfreq: Add cpu based scaling support to passive governor")
Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/governor_passive.c