Hi suryasaimadhu, kernel test robot noticed the following build warnings:
[auto build test WARNING on v6.18] [also build test WARNING on next-20251219] [cannot apply to drm-misc/drm-misc-next linus/master v6.19-rc1] [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/suryasaimadhu/drm-amdgpu-dm-Convert-IRQ-logging-to-drm_-helpers/20251218-144203 base: v6.18 patch link: https://lore.kernel.org/r/20251218063512.4572-1-suryasaimadhu369%40gmail.com patch subject: [PATCH] drm/amdgpu/dm: Convert IRQ logging to drm_* helpers config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20251221/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/[email protected]/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All warnings (new ones prefixed by >>): drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c: In function 'amdgpu_dm_irq_register_interrupt': >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:308:9: >> warning: this 'if' clause does not guard... [-Wmisleading-indentation] 308 | if (false == validate_irq_registration_params(int_params, ih)) | ^~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:310:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 310 | return DAL_INVALID_IRQ_HANDLER_IDX; | ^~~~~~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c: In function 'amdgpu_dm_irq_unregister_interrupt': drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:375:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation] 375 | if (false == validate_irq_unregistration_params(irq_source, ih)) | ^~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c:377:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 377 | return; | ^~~~~~ vim +/if +308 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_irq.c 4562236b3bc0a2 Harry Wentland 2017-09-12 258 d3a1c5548c1f21 suryasaimadhu 2025-12-18 259 static bool validate_irq_unregistration_params( d3a1c5548c1f21 suryasaimadhu 2025-12-18 260 enum dc_irq_source irq_source, 4562236b3bc0a2 Harry Wentland 2017-09-12 261 irq_handler_idx handler_idx) 4562236b3bc0a2 Harry Wentland 2017-09-12 262 { 2d0b69fc712c07 Srinivasan Shanmugam 2023-06-22 263 if (handler_idx == DAL_INVALID_IRQ_HANDLER_IDX) { 4562236b3bc0a2 Harry Wentland 2017-09-12 264 return false; 4562236b3bc0a2 Harry Wentland 2017-09-12 265 } 4562236b3bc0a2 Harry Wentland 2017-09-12 266 4562236b3bc0a2 Harry Wentland 2017-09-12 267 if (!DAL_VALID_IRQ_SRC_NUM(irq_source)) { 4562236b3bc0a2 Harry Wentland 2017-09-12 268 return false; 4562236b3bc0a2 Harry Wentland 2017-09-12 269 } 4562236b3bc0a2 Harry Wentland 2017-09-12 270 4562236b3bc0a2 Harry Wentland 2017-09-12 271 return true; 4562236b3bc0a2 Harry Wentland 2017-09-12 272 } 4562236b3bc0a2 Harry Wentland 2017-09-12 273 /****************************************************************************** 4562236b3bc0a2 Harry Wentland 2017-09-12 274 * Public functions. 4562236b3bc0a2 Harry Wentland 2017-09-12 275 * 4562236b3bc0a2 Harry Wentland 2017-09-12 276 * Note: caller is responsible for input validation. 4562236b3bc0a2 Harry Wentland 2017-09-12 277 *****************************************************************************/ 4562236b3bc0a2 Harry Wentland 2017-09-12 278 b8592b48450b99 Leo Li 2018-09-14 279 /** b8592b48450b99 Leo Li 2018-09-14 280 * amdgpu_dm_irq_register_interrupt() - Register a handler within DM. b8592b48450b99 Leo Li 2018-09-14 281 * @adev: The base driver device containing the DM device. b8592b48450b99 Leo Li 2018-09-14 282 * @int_params: Interrupt parameters containing the source, and handler context b8592b48450b99 Leo Li 2018-09-14 283 * @ih: Function pointer to the interrupt handler to register b8592b48450b99 Leo Li 2018-09-14 284 * @handler_args: Arguments passed to the handler when the interrupt occurs b8592b48450b99 Leo Li 2018-09-14 285 * b8592b48450b99 Leo Li 2018-09-14 286 * Register an interrupt handler for the given IRQ source, under the given b8592b48450b99 Leo Li 2018-09-14 287 * context. The context can either be high or low. High context handlers are b8592b48450b99 Leo Li 2018-09-14 288 * executed directly within ISR context, while low context is executed within a b8592b48450b99 Leo Li 2018-09-14 289 * workqueue, thereby allowing operations that sleep. b8592b48450b99 Leo Li 2018-09-14 290 * b8592b48450b99 Leo Li 2018-09-14 291 * Registered handlers are called in a FIFO manner, i.e. the most recently b8592b48450b99 Leo Li 2018-09-14 292 * registered handler will be called first. b8592b48450b99 Leo Li 2018-09-14 293 * b8592b48450b99 Leo Li 2018-09-14 294 * Return: Handler data &struct amdgpu_dm_irq_handler_data containing the IRQ b8592b48450b99 Leo Li 2018-09-14 295 * source, handler function, and args b8592b48450b99 Leo Li 2018-09-14 296 */ e637525659ed04 Alex Deucher 2017-10-11 297 void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev, 4562236b3bc0a2 Harry Wentland 2017-09-12 298 struct dc_interrupt_params *int_params, 4562236b3bc0a2 Harry Wentland 2017-09-12 299 void (*ih)(void *), 4562236b3bc0a2 Harry Wentland 2017-09-12 300 void *handler_args) 4562236b3bc0a2 Harry Wentland 2017-09-12 301 { d3a1c5548c1f21 suryasaimadhu 2025-12-18 302 struct drm_device *dev = adev_to_drm(adev); 4562236b3bc0a2 Harry Wentland 2017-09-12 303 struct list_head *hnd_list; 4562236b3bc0a2 Harry Wentland 2017-09-12 304 struct amdgpu_dm_irq_handler_data *handler_data; 4562236b3bc0a2 Harry Wentland 2017-09-12 305 unsigned long irq_table_flags; 4562236b3bc0a2 Harry Wentland 2017-09-12 306 enum dc_irq_source irq_source; 4562236b3bc0a2 Harry Wentland 2017-09-12 307 4562236b3bc0a2 Harry Wentland 2017-09-12 @308 if (false == validate_irq_registration_params(int_params, ih)) d3a1c5548c1f21 suryasaimadhu 2025-12-18 309 drm_err(dev, "DM_IRQ: invalid registration parameters\n"); 4562236b3bc0a2 Harry Wentland 2017-09-12 310 return DAL_INVALID_IRQ_HANDLER_IDX; 4562236b3bc0a2 Harry Wentland 2017-09-12 311 4562236b3bc0a2 Harry Wentland 2017-09-12 312 handler_data = kzalloc(sizeof(*handler_data), GFP_KERNEL); 4562236b3bc0a2 Harry Wentland 2017-09-12 313 if (!handler_data) { d3a1c5548c1f21 suryasaimadhu 2025-12-18 314 drm_err(dev, "DM_IRQ: failed to allocate irq handler!\n"); 4562236b3bc0a2 Harry Wentland 2017-09-12 315 return DAL_INVALID_IRQ_HANDLER_IDX; 4562236b3bc0a2 Harry Wentland 2017-09-12 316 } 4562236b3bc0a2 Harry Wentland 2017-09-12 317 a7fbf17aa8bfaa Leo Li 2018-09-18 318 init_handler_common_data(handler_data, ih, handler_args, &adev->dm); 4562236b3bc0a2 Harry Wentland 2017-09-12 319 4562236b3bc0a2 Harry Wentland 2017-09-12 320 irq_source = int_params->irq_source; 4562236b3bc0a2 Harry Wentland 2017-09-12 321 4562236b3bc0a2 Harry Wentland 2017-09-12 322 handler_data->irq_source = irq_source; 4562236b3bc0a2 Harry Wentland 2017-09-12 323 4562236b3bc0a2 Harry Wentland 2017-09-12 324 /* Lock the list, add the handler. */ 4562236b3bc0a2 Harry Wentland 2017-09-12 325 DM_IRQ_TABLE_LOCK(adev, irq_table_flags); 4562236b3bc0a2 Harry Wentland 2017-09-12 326 4562236b3bc0a2 Harry Wentland 2017-09-12 327 switch (int_params->int_context) { 4562236b3bc0a2 Harry Wentland 2017-09-12 328 case INTERRUPT_HIGH_IRQ_CONTEXT: 4562236b3bc0a2 Harry Wentland 2017-09-12 329 hnd_list = &adev->dm.irq_handler_list_high_tab[irq_source]; 4562236b3bc0a2 Harry Wentland 2017-09-12 330 break; 4562236b3bc0a2 Harry Wentland 2017-09-12 331 case INTERRUPT_LOW_IRQ_CONTEXT: 4562236b3bc0a2 Harry Wentland 2017-09-12 332 default: b6f91fc183f758 Xiaogang Chen 2021-02-25 333 hnd_list = &adev->dm.irq_handler_list_low_tab[irq_source]; b6f91fc183f758 Xiaogang Chen 2021-02-25 334 INIT_WORK(&handler_data->work, dm_irq_work_func); 4562236b3bc0a2 Harry Wentland 2017-09-12 335 break; 4562236b3bc0a2 Harry Wentland 2017-09-12 336 } 4562236b3bc0a2 Harry Wentland 2017-09-12 337 a7fbf17aa8bfaa Leo Li 2018-09-18 338 list_add_tail(&handler_data->list, hnd_list); 4562236b3bc0a2 Harry Wentland 2017-09-12 339 4562236b3bc0a2 Harry Wentland 2017-09-12 340 DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); 4562236b3bc0a2 Harry Wentland 2017-09-12 341 4562236b3bc0a2 Harry Wentland 2017-09-12 342 /* This pointer will be stored by code which requested interrupt 4562236b3bc0a2 Harry Wentland 2017-09-12 343 * registration. 4562236b3bc0a2 Harry Wentland 2017-09-12 344 * The same pointer will be needed in order to unregister the 2d0b69fc712c07 Srinivasan Shanmugam 2023-06-22 345 * interrupt. 2d0b69fc712c07 Srinivasan Shanmugam 2023-06-22 346 */ 4562236b3bc0a2 Harry Wentland 2017-09-12 347 4562236b3bc0a2 Harry Wentland 2017-09-12 348 DRM_DEBUG_KMS( 4562236b3bc0a2 Harry Wentland 2017-09-12 349 "DM_IRQ: added irq handler: %p for: dal_src=%d, irq context=%d\n", 4562236b3bc0a2 Harry Wentland 2017-09-12 350 handler_data, 4562236b3bc0a2 Harry Wentland 2017-09-12 351 irq_source, 4562236b3bc0a2 Harry Wentland 2017-09-12 352 int_params->int_context); 4562236b3bc0a2 Harry Wentland 2017-09-12 353 4562236b3bc0a2 Harry Wentland 2017-09-12 354 return handler_data; 4562236b3bc0a2 Harry Wentland 2017-09-12 355 } 4562236b3bc0a2 Harry Wentland 2017-09-12 356 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
