PM: QoS: Restore support for default value on frequency QoS
authorChungkai Yang <Chung-kai.Yang@mediatek.com>
Wed, 5 Jul 2023 08:59:07 +0000 (16:59 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Jul 2023 18:09:57 +0000 (20:09 +0200)
commit3a8395b565b5b4f019b3dc182be4c4541eb35ac8
treeda7eeb18c4523de0724bd1670c23f02b672916fc
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
PM: QoS: Restore support for default value on frequency QoS

Commit 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is
non-negative") makes sure CPU freq is non-negative to avoid negative
value converting to unsigned data type. However, when the value is
PM_QOS_DEFAULT_VALUE, pm_qos_update_target specifically uses
c->default_value which is set to FREQ_QOS_MIN/MAX_DEFAULT_VALUE when
cpufreq_policy_alloc is executed, for this case handling.

Adding check for PM_QOS_DEFAULT_VALUE to let default setting work will
fix this problem.

Fixes: 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is non-negative")
Link: https://lore.kernel.org/lkml/20230626035144.19717-1-Chung-kai.Yang@mediatek.com/
Link: https://lore.kernel.org/lkml/20230627071727.16646-1-Chung-kai.Yang@mediatek.com/
Link: https://lore.kernel.org/lkml/CAJZ5v0gxNOWhC58PHeUhW_tgf6d1fGJVZ1x91zkDdht11yUv-A@mail.gmail.com/
Signed-off-by: Chungkai Yang <Chung-kai.Yang@mediatek.com>
Cc: 6.0+ <stable@vger.kernel.org> # 6.0+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/qos.c