Message ID | 20220103155838.616580-1-sudeep.holla@arm.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | [v2] ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype | expand |
Hi Sudeep, I love your patch! Yet something to improve: [auto build test ERROR on rafael-pm/linux-next] [also build test ERROR on linux/master linus/master v5.16-rc8 next-20211224] [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] url: https://github.com/0day-ci/linux/commits/Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220104/202201041539.feAV0l27-lkp@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/1dbcdc47eadc8c55659410fc03d067f3438a386a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003 git checkout 1dbcdc47eadc8c55659410fc03d067f3438a386a # save the config file to linux build tree mkdir build_dir make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): In file included from include/acpi/acpi.h:29, from include/linux/acpi.h:22, from drivers/acpi/acpi_pcc.c:19: drivers/acpi/acpi_pcc.c: In function 'acpi_pcc_address_space_setup': >> include/acpi/acoutput.h:398:19: error: implicit declaration of function 'acpi_ut_status_exit'; did you mean 'acpi_irq_stats_init'? [-Werror=implicit-function-declaration] 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:53:3: note: in expansion of macro 'return_ACPI_STATUS' 53 | return_ACPI_STATUS(AE_NO_MEMORY); | ^~~~~~~~~~~~~~~~~~ >> include/acpi/acoutput.h:258:36: error: '_acpi_module_name' undeclared (first use in this function); did you mean 'acpi_dev_name'? 258 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ^~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:375:13: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS' 375 | function (ACPI_DEBUG_PARAMETERS, _param); \ | ^~~~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:53:3: note: in expansion of macro 'return_ACPI_STATUS' 53 | return_ACPI_STATUS(AE_NO_MEMORY); | ^~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:258:36: note: each undeclared identifier is reported only once for each function it appears in 258 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ^~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:375:13: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS' 375 | function (ACPI_DEBUG_PARAMETERS, _param); \ | ^~~~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:53:3: note: in expansion of macro 'return_ACPI_STATUS' 53 | return_ACPI_STATUS(AE_NO_MEMORY); | ^~~~~~~~~~~~~~~~~~ >> include/acpi/acoutput.h:258:55: error: '_COMPONENT' undeclared (first use in this function) 258 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ^~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:375:13: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS' 375 | function (ACPI_DEBUG_PARAMETERS, _param); \ | ^~~~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:53:3: note: in expansion of macro 'return_ACPI_STATUS' 53 | return_ACPI_STATUS(AE_NO_MEMORY); | ^~~~~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c: In function 'acpi_pcc_address_space_handler': >> include/acpi/acoutput.h:258:36: error: '_acpi_module_name' undeclared (first use in this function); did you mean 'acpi_dev_name'? 258 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ^~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:375:13: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS' 375 | function (ACPI_DEBUG_PARAMETERS, _param); \ | ^~~~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:97:3: note: in expansion of macro 'return_ACPI_STATUS' 97 | return_ACPI_STATUS(AE_ERROR); | ^~~~~~~~~~~~~~~~~~ >> include/acpi/acoutput.h:258:55: error: '_COMPONENT' undeclared (first use in this function) 258 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ^~~~~~~~~~ include/acpi/acoutput.h:281:44: note: in definition of macro 'ACPI_DO_WHILE0' 281 | #define ACPI_DO_WHILE0(a) do a while(0) | ^ include/acpi/acoutput.h:375:13: note: in expansion of macro 'ACPI_DEBUG_PARAMETERS' 375 | function (ACPI_DEBUG_PARAMETERS, _param); \ | ^~~~~~~~~~~~~~~~~~~~~ include/acpi/acoutput.h:398:2: note: in expansion of macro 'ACPI_TRACE_EXIT' 398 | ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) | ^~~~~~~~~~~~~~~ drivers/acpi/acpi_pcc.c:97:3: note: in expansion of macro 'return_ACPI_STATUS' 97 | return_ACPI_STATUS(AE_ERROR); | ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +398 include/acpi/acoutput.h 50df4d8b0f6e19 Bob Moore 2008-12-31 252 50df4d8b0f6e19 Bob Moore 2008-12-31 253 /* 50df4d8b0f6e19 Bob Moore 2008-12-31 254 * Common parameters used for debug output functions: 50df4d8b0f6e19 Bob Moore 2008-12-31 255 * line number, function name, module(file) name, component ID 50df4d8b0f6e19 Bob Moore 2008-12-31 256 */ ad5a06f2969763 Bob Moore 2012-12-31 257 #define ACPI_DEBUG_PARAMETERS \ ad5a06f2969763 Bob Moore 2012-12-31 @258 __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT 50df4d8b0f6e19 Bob Moore 2008-12-31 259 e81a52b8b642aa Bob Moore 2012-12-31 260 /* Check if debug output is currently dynamically enabled */ e81a52b8b642aa Bob Moore 2012-12-31 261 e81a52b8b642aa Bob Moore 2012-12-31 262 #define ACPI_IS_DEBUG_ENABLED(level, component) \ e81a52b8b642aa Bob Moore 2012-12-31 263 ((level & acpi_dbg_level) && (component & acpi_dbg_layer)) e81a52b8b642aa Bob Moore 2012-12-31 264 50df4d8b0f6e19 Bob Moore 2008-12-31 265 /* 50df4d8b0f6e19 Bob Moore 2008-12-31 266 * Master debug print macros 50df4d8b0f6e19 Bob Moore 2008-12-31 267 * Print message if and only if: 50df4d8b0f6e19 Bob Moore 2008-12-31 268 * 1) Debug print for the current component is enabled 50df4d8b0f6e19 Bob Moore 2008-12-31 269 * 2) Debug error level or trace level for the print statement is enabled ad5a06f2969763 Bob Moore 2012-12-31 270 * ad5a06f2969763 Bob Moore 2012-12-31 271 * November 2012: Moved the runtime check for whether to actually emit the ad5a06f2969763 Bob Moore 2012-12-31 272 * debug message outside of the print function itself. This improves overall ad5a06f2969763 Bob Moore 2012-12-31 273 * performance at a relatively small code cost. Implementation involves the ad5a06f2969763 Bob Moore 2012-12-31 274 * use of variadic macros supported by C99. 6e1888fdcaad17 Bob Moore 2013-01-08 275 * 6e1888fdcaad17 Bob Moore 2013-01-08 276 * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from 6e1888fdcaad17 Bob Moore 2013-01-08 277 * complaining about these constructs. On other compilers the do...while 6e1888fdcaad17 Bob Moore 2013-01-08 278 * adds some extra code, so this feature is optional. 50df4d8b0f6e19 Bob Moore 2008-12-31 279 */ 6e1888fdcaad17 Bob Moore 2013-01-08 280 #ifdef ACPI_USE_DO_WHILE_0 6e1888fdcaad17 Bob Moore 2013-01-08 281 #define ACPI_DO_WHILE0(a) do a while(0) 6e1888fdcaad17 Bob Moore 2013-01-08 282 #else 6e1888fdcaad17 Bob Moore 2013-01-08 283 #define ACPI_DO_WHILE0(a) a 6e1888fdcaad17 Bob Moore 2013-01-08 284 #endif ad5a06f2969763 Bob Moore 2012-12-31 285 ad5a06f2969763 Bob Moore 2012-12-31 286 /* DEBUG_PRINT functions */ ad5a06f2969763 Bob Moore 2012-12-31 287 7b09d8fdede65e Lv Zheng 2015-07-01 288 #ifndef COMPILER_VA_MACRO 7b09d8fdede65e Lv Zheng 2015-07-01 289 7b09d8fdede65e Lv Zheng 2015-07-01 290 #define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist 7b09d8fdede65e Lv Zheng 2015-07-01 291 #define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist 7b09d8fdede65e Lv Zheng 2015-07-01 292 7b09d8fdede65e Lv Zheng 2015-07-01 293 #else ad5a06f2969763 Bob Moore 2012-12-31 294 ad5a06f2969763 Bob Moore 2012-12-31 295 /* Helper macros for DEBUG_PRINT */ ad5a06f2969763 Bob Moore 2012-12-31 296 6e1888fdcaad17 Bob Moore 2013-01-08 297 #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \ 6e1888fdcaad17 Bob Moore 2013-01-08 298 ACPI_DO_WHILE0 ({ \ ad5a06f2969763 Bob Moore 2012-12-31 299 if (ACPI_IS_DEBUG_ENABLED (level, component)) \ ad5a06f2969763 Bob Moore 2012-12-31 300 { \ ad5a06f2969763 Bob Moore 2012-12-31 301 function (level, line, filename, modulename, component, __VA_ARGS__); \ 6e1888fdcaad17 Bob Moore 2013-01-08 302 } \ 6e1888fdcaad17 Bob Moore 2013-01-08 303 }) ad5a06f2969763 Bob Moore 2012-12-31 304 ad5a06f2969763 Bob Moore 2012-12-31 305 #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ 6e1888fdcaad17 Bob Moore 2013-01-08 306 ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \ 6e1888fdcaad17 Bob Moore 2013-01-08 307 filename, modulename, component, __VA_ARGS__) ad5a06f2969763 Bob Moore 2012-12-31 308 ad5a06f2969763 Bob Moore 2012-12-31 309 #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ 6e1888fdcaad17 Bob Moore 2013-01-08 310 ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \ 6e1888fdcaad17 Bob Moore 2013-01-08 311 filename, modulename, component, __VA_ARGS__) 50df4d8b0f6e19 Bob Moore 2008-12-31 312 7b09d8fdede65e Lv Zheng 2015-07-01 313 #define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist 7b09d8fdede65e Lv Zheng 2015-07-01 314 #define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist 7b09d8fdede65e Lv Zheng 2015-07-01 315 7b09d8fdede65e Lv Zheng 2015-07-01 316 #endif 7b09d8fdede65e Lv Zheng 2015-07-01 317 0377b5acba2f25 Bob Moore 2012-12-31 318 /* 0377b5acba2f25 Bob Moore 2012-12-31 319 * Function entry tracing 0377b5acba2f25 Bob Moore 2012-12-31 320 * 0377b5acba2f25 Bob Moore 2012-12-31 321 * The name of the function is emitted as a local variable that is 0377b5acba2f25 Bob Moore 2012-12-31 322 * intended to be used by both the entry trace and the exit trace. 0377b5acba2f25 Bob Moore 2012-12-31 323 */ 0377b5acba2f25 Bob Moore 2012-12-31 324 0377b5acba2f25 Bob Moore 2012-12-31 325 /* Helper macro */ 0377b5acba2f25 Bob Moore 2012-12-31 326 fd1af7126fb626 Bob Moore 2013-03-08 327 #define ACPI_TRACE_ENTRY(name, function, type, param) \ 0377b5acba2f25 Bob Moore 2012-12-31 328 ACPI_FUNCTION_NAME (name) \ fd1af7126fb626 Bob Moore 2013-03-08 329 function (ACPI_DEBUG_PARAMETERS, (type) (param)) 0377b5acba2f25 Bob Moore 2012-12-31 330 0377b5acba2f25 Bob Moore 2012-12-31 331 /* The actual entry trace macros */ 0377b5acba2f25 Bob Moore 2012-12-31 332 0377b5acba2f25 Bob Moore 2012-12-31 333 #define ACPI_FUNCTION_TRACE(name) \ 0377b5acba2f25 Bob Moore 2012-12-31 334 ACPI_FUNCTION_NAME(name) \ 0377b5acba2f25 Bob Moore 2012-12-31 335 acpi_ut_trace (ACPI_DEBUG_PARAMETERS) 0377b5acba2f25 Bob Moore 2012-12-31 336 0377b5acba2f25 Bob Moore 2012-12-31 337 #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \ fd1af7126fb626 Bob Moore 2013-03-08 338 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, void *, pointer) 0377b5acba2f25 Bob Moore 2012-12-31 339 0377b5acba2f25 Bob Moore 2012-12-31 340 #define ACPI_FUNCTION_TRACE_U32(name, value) \ fd1af7126fb626 Bob Moore 2013-03-08 341 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value) 0377b5acba2f25 Bob Moore 2012-12-31 342 0377b5acba2f25 Bob Moore 2012-12-31 343 #define ACPI_FUNCTION_TRACE_STR(name, string) \ 4857a94de17a3c Jung-uk Kim 2016-08-04 344 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, const char *, string) 0377b5acba2f25 Bob Moore 2012-12-31 345 0377b5acba2f25 Bob Moore 2012-12-31 346 #define ACPI_FUNCTION_ENTRY() \ 0377b5acba2f25 Bob Moore 2012-12-31 347 acpi_ut_track_stack_ptr() 0377b5acba2f25 Bob Moore 2012-12-31 348 0377b5acba2f25 Bob Moore 2012-12-31 349 /* 0377b5acba2f25 Bob Moore 2012-12-31 350 * Function exit tracing 0377b5acba2f25 Bob Moore 2012-12-31 351 * 0377b5acba2f25 Bob Moore 2012-12-31 352 * These macros include a return statement. This is usually considered 0377b5acba2f25 Bob Moore 2012-12-31 353 * bad form, but having a separate exit macro before the actual return 0377b5acba2f25 Bob Moore 2012-12-31 354 * is very ugly and difficult to maintain. 0377b5acba2f25 Bob Moore 2012-12-31 355 * 0377b5acba2f25 Bob Moore 2012-12-31 356 * One of the FUNCTION_TRACE macros above must be used in conjunction 0377b5acba2f25 Bob Moore 2012-12-31 357 * with these macros so that "_AcpiFunctionName" is defined. fd1af7126fb626 Bob Moore 2013-03-08 358 * fd1af7126fb626 Bob Moore 2013-03-08 359 * There are two versions of most of the return macros. The default version is fd1af7126fb626 Bob Moore 2013-03-08 360 * safer, since it avoids side-effects by guaranteeing that the argument will fd1af7126fb626 Bob Moore 2013-03-08 361 * not be evaluated twice. fd1af7126fb626 Bob Moore 2013-03-08 362 * fd1af7126fb626 Bob Moore 2013-03-08 363 * A less-safe version of the macros is provided for optional use if the fd1af7126fb626 Bob Moore 2013-03-08 364 * compiler uses excessive CPU stack (for example, this may happen in the e527db8f39d4c7 Colin Ian King 2021-04-06 365 * debug case if code optimization is disabled.) 0377b5acba2f25 Bob Moore 2012-12-31 366 */ 0377b5acba2f25 Bob Moore 2012-12-31 367 0377b5acba2f25 Bob Moore 2012-12-31 368 /* Exit trace helper macro */ 0377b5acba2f25 Bob Moore 2012-12-31 369 fd1af7126fb626 Bob Moore 2013-03-08 370 #ifndef ACPI_SIMPLE_RETURN_MACROS fd1af7126fb626 Bob Moore 2013-03-08 371 fd1af7126fb626 Bob Moore 2013-03-08 372 #define ACPI_TRACE_EXIT(function, type, param) \ fd1af7126fb626 Bob Moore 2013-03-08 373 ACPI_DO_WHILE0 ({ \ fd1af7126fb626 Bob Moore 2013-03-08 374 register type _param = (type) (param); \ fd1af7126fb626 Bob Moore 2013-03-08 375 function (ACPI_DEBUG_PARAMETERS, _param); \ fd1af7126fb626 Bob Moore 2013-03-08 376 return (_param); \ fd1af7126fb626 Bob Moore 2013-03-08 377 }) fd1af7126fb626 Bob Moore 2013-03-08 378 fd1af7126fb626 Bob Moore 2013-03-08 379 #else /* Use original less-safe macros */ fd1af7126fb626 Bob Moore 2013-03-08 380 fd1af7126fb626 Bob Moore 2013-03-08 381 #define ACPI_TRACE_EXIT(function, type, param) \ 0377b5acba2f25 Bob Moore 2012-12-31 382 ACPI_DO_WHILE0 ({ \ fd1af7126fb626 Bob Moore 2013-03-08 383 function (ACPI_DEBUG_PARAMETERS, (type) (param)); \ fd1af7126fb626 Bob Moore 2013-03-08 384 return (param); \ 0377b5acba2f25 Bob Moore 2012-12-31 385 }) 0377b5acba2f25 Bob Moore 2012-12-31 386 fd1af7126fb626 Bob Moore 2013-03-08 387 #endif /* ACPI_SIMPLE_RETURN_MACROS */ fd1af7126fb626 Bob Moore 2013-03-08 388 0377b5acba2f25 Bob Moore 2012-12-31 389 /* The actual exit macros */ 0377b5acba2f25 Bob Moore 2012-12-31 390 0377b5acba2f25 Bob Moore 2012-12-31 391 #define return_VOID \ 0377b5acba2f25 Bob Moore 2012-12-31 392 ACPI_DO_WHILE0 ({ \ 0377b5acba2f25 Bob Moore 2012-12-31 393 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ 0377b5acba2f25 Bob Moore 2012-12-31 394 return; \ 0377b5acba2f25 Bob Moore 2012-12-31 395 }) 0377b5acba2f25 Bob Moore 2012-12-31 396 0377b5acba2f25 Bob Moore 2012-12-31 397 #define return_ACPI_STATUS(status) \ fd1af7126fb626 Bob Moore 2013-03-08 @398 ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) 0377b5acba2f25 Bob Moore 2012-12-31 399 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hi Sudeep,
I love your patch! Perhaps something to improve:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on next-20220105]
[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]
url: https://github.com/0day-ci/linux/commits/Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220106/202201060154.xBYcdXiV-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/1dbcdc47eadc8c55659410fc03d067f3438a386a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003
git checkout 1dbcdc47eadc8c55659410fc03d067f3438a386a
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/acpi/acpi_pcc.c:34:22: sparse: sparse: symbol 'pcc_ctx' was not declared. Should it be static?
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hi Sudeep, I love your patch! Yet something to improve: [auto build test ERROR on rafael-pm/linux-next] [also build test ERROR on linux/master linus/master v5.16-rc8 next-20220105] [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] url: https://github.com/0day-ci/linux/commits/Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next config: x86_64-randconfig-a012-20220105 (https://download.01.org/0day-ci/archive/20220106/202201060524.QF2PbOn8-lkp@intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/1dbcdc47eadc8c55659410fc03d067f3438a386a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Sudeep-Holla/ACPI-PCC-Implement-OperationRegion-handler-for-the-PCC-Type-3-subtype/20220104-000003 git checkout 1dbcdc47eadc8c55659410fc03d067f3438a386a # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/acpi/acpi_pcc.c:53:3: error: implicit declaration of function 'acpi_ut_status_exit' [-Werror,-Wimplicit-function-declaration] return_ACPI_STATUS(AE_NO_MEMORY); ^ include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ drivers/acpi/acpi_pcc.c:53:3: note: did you mean 'acpi_irq_stats_init'? include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/linux/acpi.h:320:6: note: 'acpi_irq_stats_init' declared here void acpi_irq_stats_init(void); ^ >> drivers/acpi/acpi_pcc.c:53:3: error: use of undeclared identifier '_acpi_module_name' return_ACPI_STATUS(AE_NO_MEMORY); ^ include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:36: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ >> drivers/acpi/acpi_pcc.c:53:3: error: use of undeclared identifier '_COMPONENT' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:55: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:66:3: error: implicit declaration of function 'acpi_ut_status_exit' [-Werror,-Wimplicit-function-declaration] return_ACPI_STATUS(AE_NOT_FOUND); ^ include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ drivers/acpi/acpi_pcc.c:66:3: error: use of undeclared identifier '_acpi_module_name' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:36: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:66:3: error: use of undeclared identifier '_COMPONENT' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:55: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:75:3: error: implicit declaration of function 'acpi_ut_status_exit' [-Werror,-Wimplicit-function-declaration] return_ACPI_STATUS(AE_NO_MEMORY); ^ include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ drivers/acpi/acpi_pcc.c:75:3: error: use of undeclared identifier '_acpi_module_name' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:36: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:75:3: error: use of undeclared identifier '_COMPONENT' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:55: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:79:2: error: implicit declaration of function 'acpi_ut_status_exit' [-Werror,-Wimplicit-function-declaration] return_ACPI_STATUS(AE_OK); ^ include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ drivers/acpi/acpi_pcc.c:79:2: error: use of undeclared identifier '_acpi_module_name' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:36: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:79:2: error: use of undeclared identifier '_COMPONENT' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ include/acpi/acoutput.h:258:55: note: expanded from macro 'ACPI_DEBUG_PARAMETERS' __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT ^ drivers/acpi/acpi_pcc.c:97:3: error: implicit declaration of function 'acpi_ut_status_exit' [-Werror,-Wimplicit-function-declaration] return_ACPI_STATUS(AE_ERROR); ^ include/acpi/acoutput.h:398:19: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ drivers/acpi/acpi_pcc.c:97:3: error: use of undeclared identifier '_acpi_module_name' include/acpi/acoutput.h:398:2: note: expanded from macro 'return_ACPI_STATUS' ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status) ^ include/acpi/acoutput.h:375:13: note: expanded from macro 'ACPI_TRACE_EXIT' function (ACPI_DEBUG_PARAMETERS, _param); \ ^ vim +/acpi_ut_status_exit +53 drivers/acpi/acpi_pcc.c 42 43 static acpi_status 44 acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, 45 void *handler_context, void **region_context) 46 { 47 struct pcc_data *data; 48 struct acpi_pcc_info *ctx = handler_context; 49 struct pcc_mbox_chan *pcc_chan; 50 51 data = kzalloc(sizeof(*data), GFP_KERNEL); 52 if (!data) > 53 return_ACPI_STATUS(AE_NO_MEMORY); 54 55 data->cl.rx_callback = pcc_rx_callback; 56 data->cl.knows_txdone = true; 57 data->ctx.length = ctx->length; 58 data->ctx.subspace_id = ctx->subspace_id; 59 data->ctx.internal_buffer = ctx->internal_buffer; 60 61 init_completion(&data->done); 62 data->pcc_chan = pcc_mbox_request_channel(&data->cl, ctx->subspace_id); 63 if (IS_ERR(data->pcc_chan)) { 64 pr_err("Failed to find PCC channel for subspace %d\n", 65 ctx->subspace_id); 66 return_ACPI_STATUS(AE_NOT_FOUND); 67 } 68 69 pcc_chan = data->pcc_chan; 70 data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr, 71 pcc_chan->shmem_size); 72 if (!data->pcc_comm_addr) { 73 pr_err("Failed to ioremap PCC comm region mem for %d\n", 74 ctx->subspace_id); 75 return_ACPI_STATUS(AE_NO_MEMORY); 76 } 77 78 *region_context = data; 79 return_ACPI_STATUS(AE_OK); 80 } 81 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Hi, On Thu, Jan 06, 2022 at 01:45:56AM +0800, kernel test robot wrote: > drivers/acpi/acpi_pcc.c:34:22: warning: symbol 'pcc_ctx' was not declared. Should it be static? > > Reported-by: kernel test robot <lkp@intel.com> Thanks for the fix and sorry for not noticing this before it was merged. Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
On Thu, Jan 6, 2022 at 3:12 PM Sudeep Holla <sudeep.holla@arm.com> wrote: > > Hi, > > On Thu, Jan 06, 2022 at 01:45:56AM +0800, kernel test robot wrote: > > drivers/acpi/acpi_pcc.c:34:22: warning: symbol 'pcc_ctx' was not declared. Should it be static? > > > > Reported-by: kernel test robot <lkp@intel.com> > > Thanks for the fix and sorry for not noticing this before it was merged. > > Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Applied, thanks!
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 91f1da16934d..8cdc7860b6e6 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -546,6 +546,23 @@ config ACPI_PPTT bool endif +config ACPI_PCC + bool "ACPI PCC Address Space" + depends on PCC + default y + help + The PCC Address Space also referred as PCC Operation Region pertains + to the region of PCC subspace that succeeds the PCC signature. + + The PCC Operation Region works in conjunction with the PCC Table + (Platform Communications Channel Table). PCC subspaces that are + marked for use as PCC Operation Regions must not be used as PCC + subspaces for the standard ACPI features such as CPPC, RASF, PDTT and + MPST. These standard features must always use the PCC Table instead. + + Enable this feature if you want to set up and install the PCC Address + Space handler to handle PCC OpRegion in the firmware. + source "drivers/acpi/pmic/Kconfig" config ACPI_VIOT diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index d3dc79298ce3..f47032769f69 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -67,6 +67,7 @@ acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o acpi-$(CONFIG_ACPI_WATCHDOG) += acpi_watchdog.o acpi-$(CONFIG_ACPI_PRMT) += prmt.o +acpi-$(CONFIG_ACPI_PCC) += acpi_pcc.o # Address translation acpi-$(CONFIG_ACPI_ADXL) += acpi_adxl.o diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c new file mode 100644 index 000000000000..64552fdb7347 --- /dev/null +++ b/drivers/acpi/acpi_pcc.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Author: Sudeep Holla <sudeep.holla@arm.com> + * Copyright 2021 Arm Limited + * + * The PCC Address Space also referred as PCC Operation Region pertains to the + * region of PCC subspace that succeeds the PCC signature. The PCC Operation + * Region works in conjunction with the PCC Table(Platform Communications + * Channel Table). PCC subspaces that are marked for use as PCC Operation + * Regions must not be used as PCC subspaces for the standard ACPI features + * such as CPPC, RASF, PDTT and MPST. These standard features must always use + * the PCC Table instead. + * + * This driver sets up the PCC Address Space and installs an handler to enable + * handling of PCC OpRegion in the firmware. + * + */ +#include <linux/kernel.h> +#include <linux/acpi.h> +#include <linux/completion.h> +#include <linux/idr.h> +#include <linux/io.h> + +#include <acpi/pcc.h> + +struct pcc_data { + struct pcc_mbox_chan *pcc_chan; + void __iomem *pcc_comm_addr; + struct completion done; + struct mbox_client cl; + struct acpi_pcc_info ctx; +}; + +struct acpi_pcc_info pcc_ctx; + +static void pcc_rx_callback(struct mbox_client *cl, void *m) +{ + struct pcc_data *data = container_of(cl, struct pcc_data, cl); + + complete(&data->done); +} + +static acpi_status +acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, + void *handler_context, void **region_context) +{ + struct pcc_data *data; + struct acpi_pcc_info *ctx = handler_context; + struct pcc_mbox_chan *pcc_chan; + + data = kzalloc(sizeof(*data), GFP_KERNEL); + if (!data) + return_ACPI_STATUS(AE_NO_MEMORY); + + data->cl.rx_callback = pcc_rx_callback; + data->cl.knows_txdone = true; + data->ctx.length = ctx->length; + data->ctx.subspace_id = ctx->subspace_id; + data->ctx.internal_buffer = ctx->internal_buffer; + + init_completion(&data->done); + data->pcc_chan = pcc_mbox_request_channel(&data->cl, ctx->subspace_id); + if (IS_ERR(data->pcc_chan)) { + pr_err("Failed to find PCC channel for subspace %d\n", + ctx->subspace_id); + return_ACPI_STATUS(AE_NOT_FOUND); + } + + pcc_chan = data->pcc_chan; + data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr, + pcc_chan->shmem_size); + if (!data->pcc_comm_addr) { + pr_err("Failed to ioremap PCC comm region mem for %d\n", + ctx->subspace_id); + return_ACPI_STATUS(AE_NO_MEMORY); + } + + *region_context = data; + return_ACPI_STATUS(AE_OK); +} + +static acpi_status +acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, + u32 bits, acpi_integer *value, + void *handler_context, void *region_context) +{ + int ret; + struct pcc_data *data = region_context; + + reinit_completion(&data->done); + + /* Write to Shared Memory */ + memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length); + + ret = mbox_send_message(data->pcc_chan->mchan, NULL); + if (ret < 0) + return_ACPI_STATUS(AE_ERROR); + + if (data->pcc_chan->mchan->mbox->txdone_irq) + wait_for_completion(&data->done); + + mbox_client_txdone(data->pcc_chan->mchan, ret); + + memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length); + + return_ACPI_STATUS(AE_OK); +} + +void __init acpi_init_pcc(void) +{ + acpi_status status; + + status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, + ACPI_ADR_SPACE_PLATFORM_COMM, + &acpi_pcc_address_space_handler, + &acpi_pcc_address_space_setup, + &pcc_ctx); + if (ACPI_FAILURE(status)) + pr_alert("OperationRegion handler could not be installed\n"); +} diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index dd535b4b9a16..75a61626eddd 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -1320,6 +1320,7 @@ static int __init acpi_init(void) pr_debug("%s: kset create error\n", __func__); init_prmt(); + acpi_init_pcc(); result = acpi_bus_init(); if (result) { kobject_put(acpi_kobj); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6c0798db6bde..eaeb4b9255bc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1389,6 +1389,12 @@ static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level) } #endif +#ifdef CONFIG_ACPI_PCC +void acpi_init_pcc(void); +#else +static inline void acpi_init_pcc(void) { } +#endif + #ifdef CONFIG_ACPI extern void acpi_device_notify(struct device *dev); extern void acpi_device_notify_remove(struct device *dev);
PCC OpRegion provides a mechanism to communicate with the platform directly from the AML. PCCT provides the list of PCC channel available in the platform, a subset or all of them can be used in PCC Opregion. This patch registers the PCC OpRegion handler before ACPI tables are loaded. This relies on the special context data passed to identify and set up the PCC channel before the OpRegion handler is executed for the first time. Typical PCC Opregion declaration looks like this: OperationRegion (PFRM, PCC, 2, 0x74) Field (PFRM, ByteAcc, NoLock, Preserve) { SIGN, 32, FLGS, 32, LEN, 32, CMD, 32, DATA, 800 } It contains four named double words followed by 100 bytes of buffer names DATA. ASL can fill out the buffer something like: /* Create global or local buffer */ Name (BUFF, Buffer (0x0C){}) /* Create double word fields over the buffer */ CreateDWordField (BUFF, 0x0, WD0) CreateDWordField (BUFF, 0x04, WD1) CreateDWordField (BUFF, 0x08, WD2) /* Fill the named fields */ WD0 = 0x50434300 SIGN = BUFF WD0 = 1 FLGS = BUFF WD0 = 0x10 LEN = BUFF /* Fill the payload in the DATA buffer */ WD0 = 0 WD1 = 0x08 WD2 = 0 DATA = BUFF /* Write to CMD field to trigger handler */ WD0 = 0x4404 CMD = BUFF This buffer is received by acpi_pcc_opregion_space_handler. This handler will fetch the complete buffer via internal_pcc_buffer. The setup handler will receive the special PCC context data which will contain the PCC channel index which used to set up the channel. The buffer pointer and length is saved in region context which is then used in the handler. Cc: Rafael J. Wysocki <rafael@kernel.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> --- drivers/acpi/Kconfig | 17 ++++++ drivers/acpi/Makefile | 1 + drivers/acpi/acpi_pcc.c | 120 ++++++++++++++++++++++++++++++++++++++++ drivers/acpi/bus.c | 1 + include/linux/acpi.h | 6 ++ 5 files changed, 145 insertions(+) create mode 100644 drivers/acpi/acpi_pcc.c v1[0]-v2: - Addressed all the comments from Rafael[1] [0] https://lore.kernel.org/r/20211222190919.137550-1-sudeep.holla@arm.com/ [1] https://lore.kernel.org/r/CAJZ5v0jWJVSFS3KTavfCTzxWq-Q361nGDCWf+VLXRu-9Z4MJsQ@mail.gmail.com -- 2.25.1