Commit 21cae8de authored by Yuan Can's avatar Yuan Can Committed by Alex Deucher
Browse files

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: 32cb59f3 ("drm/amdkfd: Track SDMA utilization per process")
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Signed-off-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1b4ca854
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ static ssize_t kfd_procfs_show(struct kobject *kobj, struct attribute *attr,
							      attr_sdma);
		struct kfd_sdma_activity_handler_workarea sdma_activity_work_handler;

		INIT_WORK(&sdma_activity_work_handler.sdma_activity_work,
		INIT_WORK_ONSTACK(&sdma_activity_work_handler.sdma_activity_work,
				  kfd_sdma_activity_worker);

		sdma_activity_work_handler.pdd = pdd;
@@ -350,6 +350,7 @@ static ssize_t kfd_procfs_show(struct kobject *kobj, struct attribute *attr,
		schedule_work(&sdma_activity_work_handler.sdma_activity_work);

		flush_work(&sdma_activity_work_handler.sdma_activity_work);
		destroy_work_on_stack(&sdma_activity_work_handler.sdma_activity_work);

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