.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2016-2018, 2020-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2016-2018, 2020-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
34 | 34 | #include "mali_kbase_ipa_simple.h" |
---|
35 | 35 | #include "mali_kbase_ipa_debugfs.h" |
---|
36 | 36 | |
---|
| 37 | +#if MALI_USE_CSF |
---|
| 38 | + |
---|
37 | 39 | /* This is used if the dynamic power for top-level is estimated separately |
---|
38 | 40 | * through the counter model. To roughly match the contribution of top-level |
---|
39 | 41 | * power in the total dynamic power, when calculated through counter model, |
---|
.. | .. |
---|
43 | 45 | * core power and then averaging it across all samples. |
---|
44 | 46 | */ |
---|
45 | 47 | #define TOP_LEVEL_DYN_COEFF_SCALER (3) |
---|
| 48 | + |
---|
| 49 | +#endif /* MALI_USE_CSF */ |
---|
46 | 50 | |
---|
47 | 51 | #if MALI_UNIT_TEST |
---|
48 | 52 | |
---|
.. | .. |
---|
232 | 236 | (struct kbase_ipa_model_simple_data *)model->model_data; |
---|
233 | 237 | |
---|
234 | 238 | err = kbase_ipa_model_add_param_s32(model, "static-coefficient", |
---|
235 | | - &model_data->static_coefficient, |
---|
236 | | - 1, true); |
---|
| 239 | + (s32 *)&model_data->static_coefficient, 1, true); |
---|
237 | 240 | if (err) |
---|
238 | 241 | goto end; |
---|
239 | 242 | |
---|
240 | 243 | err = kbase_ipa_model_add_param_s32(model, "dynamic-coefficient", |
---|
241 | | - &model_data->dynamic_coefficient, |
---|
242 | | - 1, true); |
---|
| 244 | + (s32 *)&model_data->dynamic_coefficient, 1, true); |
---|
243 | 245 | if (err) |
---|
244 | 246 | goto end; |
---|
245 | 247 | |
---|
.. | .. |
---|
307 | 309 | model_data->gpu_tz = NULL; |
---|
308 | 310 | } else { |
---|
309 | 311 | char tz_name[THERMAL_NAME_LENGTH]; |
---|
| 312 | + u32 string_len = strscpy(tz_name, model_data->tz_name, sizeof(tz_name)); |
---|
310 | 313 | |
---|
311 | | - strlcpy(tz_name, model_data->tz_name, sizeof(tz_name)); |
---|
| 314 | + string_len += sizeof(char); |
---|
| 315 | + /* Make sure that the source string fit into the buffer. */ |
---|
| 316 | + KBASE_DEBUG_ASSERT(string_len <= sizeof(tz_name)); |
---|
| 317 | + CSTD_UNUSED(string_len); |
---|
312 | 318 | |
---|
313 | 319 | /* Release ipa.lock so that thermal_list_lock is not acquired |
---|
314 | 320 | * with ipa.lock held, thereby avoid lock ordering violation |
---|
.. | .. |
---|
322 | 328 | mutex_lock(&model->kbdev->ipa.lock); |
---|
323 | 329 | |
---|
324 | 330 | if (IS_ERR_OR_NULL(tz)) { |
---|
325 | | - pr_warn_ratelimited("Error %ld getting thermal zone \'%s\', not yet ready?\n", |
---|
326 | | - PTR_ERR(tz), tz_name); |
---|
| 331 | + pr_warn_ratelimited( |
---|
| 332 | + "Error %d getting thermal zone \'%s\', not yet ready?\n", |
---|
| 333 | + PTR_ERR_OR_ZERO(tz), tz_name); |
---|
327 | 334 | return -EPROBE_DEFER; |
---|
328 | 335 | } |
---|
329 | 336 | |
---|