OSDN Git Service

PM: QoS: Add check to make sure CPU latency is non-negative
authorClive Lin <clive.lin@mediatek.com>
Mon, 31 Jul 2023 06:03:54 +0000 (14:03 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Aug 2023 19:37:29 +0000 (21:37 +0200)
commit5f55836ab41671e005038255fdd60482718d2ca2
treebbe60899d0d135eba0c3e6e9f88b8472ea69beb9
parent706a741595047797872e669b3101429ab8d378ef
PM: QoS: Add check to make sure CPU latency is non-negative

CPU latency should never be negative, which will be incorrectly high
when converted to unsigned data type.

Commit 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is
non-negative") makes sure CPU frequency is non-negative to fix incorrect
behavior in freqency QoS.

Add an analogous check to make sure CPU latency is non-negative so as to
prevent this problem from happening in CPU latency QoS.

Signed-off-by: Clive Lin <clive.lin@mediatek.com>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/qos.c