diff options
author | Sai Gurrappadi <sgurrappadi@nvidia.com> | 2017-08-09 13:35:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-11 18:46:09 -0400 |
commit | 0e81ecf0210ac1770855664753e7afa2280fd3fb (patch) | |
tree | 6caeaf7a6640df54a5ae4216fb2ad201cf7e081e | |
parent | 5248d6b4b5f74a5dca492d7666e80a819734f8da (diff) |
gpu: nvgpu: gk20a: Fix up qos/sysfs limits
Userspace sysfs limits devfreq->{min|max}_freq and pmqos min/max limits
are treated as the same priority. In case these two ranges don't intersect
prefer the max_freq clamp over the min_freq clamp.
This is done in order to ensure any thermal throttling isn't bypassed by a
userspace sysfs write. MaxQ/MaxP configurations only care about the Fmax
limit and not necessarily Fmin, so preferring max_freq over min_freq is
consistent with what is required.
Bug 1933216
Change-Id: Ie8685306f10dee0f8d340c4b8e0eae533dbfc6ac
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1535937
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Aaron Huang <aaronh@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index 6f4f7dc9..3e6fead6 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -160,19 +160,13 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, | |||
160 | * To get cap (max) freq, we select MIN of max frequencies | 160 | * To get cap (max) freq, we select MIN of max frequencies |
161 | * | 161 | * |
162 | * In case we have conflict (min_freq > max_freq) after above | 162 | * In case we have conflict (min_freq > max_freq) after above |
163 | * steps, we ensure that devfreq->min_freq wins over | 163 | * steps, we ensure that max_freq wins over min_freq |
164 | * qos_max_freq | ||
165 | */ | 164 | */ |
166 | min_freq = max_t(u32, devfreq->min_freq, profile->qos_min_freq); | 165 | min_freq = max_t(u32, devfreq->min_freq, profile->qos_min_freq); |
167 | max_freq = min_t(u32, devfreq->max_freq, profile->qos_max_freq); | 166 | max_freq = min_t(u32, devfreq->max_freq, profile->qos_max_freq); |
168 | 167 | ||
169 | if (min_freq > max_freq) { | 168 | if (min_freq > max_freq) |
170 | if (min_freq == devfreq->min_freq && | ||
171 | max_freq != devfreq->max_freq) { | ||
172 | max_freq = min_t(u32, min_freq, devfreq->max_freq); | ||
173 | } | ||
174 | min_freq = max_freq; | 169 | min_freq = max_freq; |
175 | } | ||
176 | 170 | ||
177 | /* Clip requested frequency */ | 171 | /* Clip requested frequency */ |
178 | if (local_freq < min_freq) | 172 | if (local_freq < min_freq) |