Re: [PATCH v6 6/7] cpufreq: Skip inefficient frequencies
From: Vincent Donnefort <hidden>
Date: 2021-09-06 08:17:43
[...]
quoted
quoted
Moreover, if only efficient frequencies are to be used, RELATION_L needs to return min(policy->max, the closest efficient frequency equal to or above the target).You mean, never returning an inefficient frequency, unless there are no efficient ones in the range policy->min policy->max ?No, that's not what I mean. First note that the target here is clamped between the policy min and max. Also bear in mind that each of them is a frequency from the table, either efficient or inefficient. In the first step, search through the efficient frequencies only. That will return you something at or above the target. If it is at the target, you're done. If it is above the target, it may be either within or above the policy max. If it is within the policy max, you're done. If it is above the policy max, you need to search through the inefficient frequencies between the target and the policy max (and you know that there is at least one - the policy max itself). So what I said previously wasn't particularly precise, sorry about that.
I might have missed something but it seems equivalent to what's currently done: Find the appropriate frequency, if inefficient go to the efficient one, if above policy->max return the original inefficient frequency.