mirror of
https://github.com/apache/nuttx.git
synced 2026-09-21 13:25:12 +08:00
drivers/devfreq: fix qos_get_value returning wrong min/max aggregation
QOS_REQ_MIN should return the highest value among all min requests (most restrictive lower bound), but plist_first returns the lowest. QOS_REQ_MAX should return the lowest value among all max requests (most restrictive upper bound), but plist_last returns the highest. This caused qos constraints to be ineffective. For example, two requests (32, 208000) and (104000, 104000) would merge to (32, 208000) instead of the correct (104000, 104000). Fix by using plist_last for QOS_REQ_MIN and plist_first for QOS_REQ_MAX. Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
This commit is contained in:
@@ -191,12 +191,12 @@ uint32_t qos_get_value(FAR struct qos_constraints_s *constraints,
|
||||
{
|
||||
case QOS_REQ_MIN:
|
||||
{
|
||||
return plist_first(&constraints->min_requests)->prio;
|
||||
return plist_last(&constraints->min_requests)->prio;
|
||||
}
|
||||
|
||||
case QOS_REQ_MAX:
|
||||
{
|
||||
return plist_last(&constraints->max_requests)->prio;
|
||||
return plist_first(&constraints->max_requests)->prio;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user