Skip to content

Commit 21cae8d

Browse files
Yuan Canalexdeucher
authored andcommitted
drm/amdkfd: Fix wrong usage of INIT_WORK()
In kfd_procfs_show(), the sdma_activity_work_handler is a local variable and the sdma_activity_work_handler.sdma_activity_work should initialize with INIT_WORK_ONSTACK() instead of INIT_WORK(). Fixes: 32cb59f ("drm/amdkfd: Track SDMA utilization per process") Signed-off-by: Yuan Can <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 1b4ca85 commit 21cae8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_process.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,16 @@ static ssize_t kfd_procfs_show(struct kobject *kobj, struct attribute *attr,
341341
attr_sdma);
342342
struct kfd_sdma_activity_handler_workarea sdma_activity_work_handler;
343343

344-
INIT_WORK(&sdma_activity_work_handler.sdma_activity_work,
345-
kfd_sdma_activity_worker);
344+
INIT_WORK_ONSTACK(&sdma_activity_work_handler.sdma_activity_work,
345+
kfd_sdma_activity_worker);
346346

347347
sdma_activity_work_handler.pdd = pdd;
348348
sdma_activity_work_handler.sdma_activity_counter = 0;
349349

350350
schedule_work(&sdma_activity_work_handler.sdma_activity_work);
351351

352352
flush_work(&sdma_activity_work_handler.sdma_activity_work);
353+
destroy_work_on_stack(&sdma_activity_work_handler.sdma_activity_work);
353354

354355
return snprintf(buffer, PAGE_SIZE, "%llu\n",
355356
(sdma_activity_work_handler.sdma_activity_counter)/

0 commit comments

Comments
 (0)