[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202305241341.gbrnvwNY-lkp@intel.com>
Date: Wed, 24 May 2023 13:42:37 +0800
From: kernel test robot <lkp@...el.com>
To: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
rafael@...nel.org, rui.zhang@...el.com, daniel.lezcano@...aro.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Subject: Re: [RESEND][PATCH] thermal: intel: int340x_thermal: New IOCTLs for
thermal
Hi Srinivas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/thermal]
[also build test WARNING on linus/master v6.4-rc3 next-20230523]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Srinivas-Pandruvada/thermal-intel-int340x_thermal-New-IOCTLs-for-thermal/20230524-062514
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
patch link: https://lore.kernel.org/r/20230523221339.2377625-1-srinivas.pandruvada%40linux.intel.com
patch subject: [RESEND][PATCH] thermal: intel: int340x_thermal: New IOCTLs for thermal
config: x86_64-randconfig-x083
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/d9cdbb3a7b52afac5dcbf0aaa2d1593964554c7c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Srinivas-Pandruvada/thermal-intel-int340x_thermal-New-IOCTLs-for-thermal/20230524-062514
git checkout d9cdbb3a7b52afac5dcbf0aaa2d1593964554c7c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/thermal/intel/int340x_thermal/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305241341.gbrnvwNY-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c:214:5: warning: no previous prototype for 'acpi_parse_psvt' [-Wmissing-prototypes]
214 | int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **psvtp)
| ^~~~~~~~~~~~~~~
vim +/acpi_parse_psvt +214 drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c
205
206 /*
207 * acpi_parse_psvt - Passive Table (PSVT) for passive cooling
208 *
209 * @handle: ACPI handle of the device which contains PSVT
210 * @psvt_count: the number of valid entries resulted from parsing PSVT
211 * @psvtp: pointer to array of psvt entries
212 *
213 */
> 214 int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **psvtp)
215 {
216 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
217 int nr_bad_entries = 0, revision;
218 union acpi_object *p;
219 acpi_status status;
220 int i, result = 0;
221 struct psvt *psvts;
222
223 if (!acpi_has_method(handle, "PSVT"))
224 return -ENODEV;
225
226 status = acpi_evaluate_object(handle, "PSVT", NULL, &buffer);
227 if (ACPI_FAILURE(status))
228 return -ENODEV;
229
230 p = buffer.pointer;
231 if (!p || (p->type != ACPI_TYPE_PACKAGE)) {
232 result = -EFAULT;
233 goto end;
234 }
235
236 /* first package is the revision number */
237 if (p->package.count > 0) {
238 union acpi_object *prev = &(p->package.elements[0]);
239
240 if (prev->type == ACPI_TYPE_INTEGER)
241 revision = (int)prev->integer.value;
242 } else {
243 result = -EFAULT;
244 goto end;
245 }
246
247 /* Support only version 2 */
248 if (revision != 2) {
249 result = -EFAULT;
250 goto end;
251 }
252
253 *psvt_count = p->package.count - 1;
254 if (!*psvt_count) {
255 result = -EFAULT;
256 goto end;
257 }
258
259 psvts = kcalloc(*psvt_count, sizeof(*psvts), GFP_KERNEL);
260 if (!psvts) {
261 result = -ENOMEM;
262 goto end;
263 }
264
265 /* Start index is 1 because the first package is the revision number */
266 for (i = 1; i < p->package.count; i++) {
267 struct acpi_buffer psvt_int_format = { sizeof("RRNNNNNNNNNN"), "RRNNNNNNNNNN" };
268 struct acpi_buffer psvt_str_format = { sizeof("RRNNNNNSNNNN"), "RRNNNNNSNNNN" };
269 union acpi_object *package = &(p->package.elements[i]);
270 struct psvt *psvt = &psvts[i - 1 - nr_bad_entries];
271 struct acpi_buffer *psvt_format = &psvt_int_format;
272 struct acpi_buffer element = { 0, NULL };
273 union acpi_object *knob;
274 struct acpi_device *res;
275 struct psvt *psvt_ptr;
276
277 element.length = ACPI_ALLOCATE_BUFFER;
278 element.pointer = NULL;
279
280 if (package->package.count >= ACPI_NR_PSVT_ELEMENTS) {
281 knob = &(package->package.elements[ACPI_PSVT_CONTROL_KNOB]);
282 } else {
283 nr_bad_entries++;
284 pr_info("PSVT package %d is invalid, ignored\n", i);
285 continue;
286 }
287
288 if (knob->type == ACPI_TYPE_STRING) {
289 psvt_format = &psvt_str_format;
290 if (knob->string.length > ACPI_LIMIT_STR_MAX_LEN) {
291 pr_info("PSVT package %d limit string len exceeds max\n", i);
292 knob->string.length = ACPI_LIMIT_STR_MAX_LEN;
293 }
294 }
295
296 status = acpi_extract_package(&(p->package.elements[i]), psvt_format, &element);
297 if (ACPI_FAILURE(status)) {
298 nr_bad_entries++;
299 pr_info("PSVT package %d is invalid, ignored\n", i);
300 continue;
301 }
302
303 psvt_ptr = (struct psvt *)element.pointer;
304
305 memcpy(psvt, psvt_ptr, sizeof(*psvt_ptr));
306
307 /* The limit element can be string or U64 */
308 psvt->control_knob_type = (u64)knob->type;
309
310 if (knob->type == ACPI_TYPE_STRING) {
311 memset(&psvt->limit, 0, sizeof(u64));
312 strncpy(psvt->limit.string, psvt_ptr->limit.str_ptr, knob->string.length);
313 } else {
314 psvt->limit.integer = psvt_ptr->limit.integer;
315 }
316
317 kfree(element.pointer);
318
319 res = acpi_fetch_acpi_dev(psvt->source);
320 if (!res) {
321 nr_bad_entries++;
322 pr_info("Failed to get source ACPI device\n");
323 continue;
324 }
325
326 res = acpi_fetch_acpi_dev(psvt->target);
327 if (!res) {
328 nr_bad_entries++;
329 pr_info("Failed to get target ACPI device\n");
330 continue;
331 }
332 }
333
334 /* don't count bad entries */
335 *psvt_count -= nr_bad_entries;
336
337 if (!*psvt_count) {
338 result = -EFAULT;
339 kfree(psvts);
340 goto end;
341 }
342
343 *psvtp = psvts;
344
345 return 0;
346
347 end:
348 kfree(buffer.pointer);
349 return result;
350 }
351
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
View attachment "config" of type "text/plain" (176029 bytes)
Powered by blists - more mailing lists