Skip to contentSkip to conversation

drm/amdkfd: Ignored various return code

PATCH Superseded Andrew Martin 1 participant 1 message Nov 12, 2025

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amdkfd: Ignored various return code

The return code of a non void function should not be ignored. In cases where we do not care, the code needs to suppress it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c          | 13 ++++++++-----
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c            | 10 ++++++----
 drivers/gpu/drm/amd/amdkfd/kfd_debug.c              |  9 +++++----
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c   |  6 ++++--
 4 files changed, 23 insertions(+), 15 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +8 -5
index 652389d0d4e6..ab701590c5e2 100644
@@ -288,8 +288,10 @@ int amdgpu_amdkfd_post_reset(struct amdgpu_device *adev)
 void amdgpu_amdkfd_gpu_reset(struct amdgpu_device *adev)
 {
 	if (amdgpu_device_should_recover_gpu(adev))
-		amdgpu_reset_domain_schedule(adev->reset_domain,
-					     &adev->kfd.reset_work);
+		WARN_ONCE(!amdgpu_reset_domain_schedule(adev->reset_domain,
+							&adev->kfd.reset_work),
+							"Failed to queue work! at %s",
+							 __func__);
 }
 
 int amdgpu_amdkfd_alloc_gtt_mem(struct amdgpu_device *adev, size_t size,
@@ -690,9 +692,10 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
 		if (gfx_block != NULL)
 			gfx_block->version->funcs->set_powergating_state((void *)gfx_block, state);
 	}
-	amdgpu_dpm_switch_power_profile(adev,
-					PP_SMC_POWER_PROFILE_COMPUTE,
-					!idle);
+	WARN_ONCE(!amdgpu_dpm_switch_power_profile(adev, PP_SMC_POWER_PROFILE_COMPUTE, !idle),
+		  "(%s) failed to disable video power profile mode",
+		  __func__);
+
 }
 
 bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +6 -4
index a2149afa5803..a54321ba7cb7 100644
@@ -2782,7 +2782,8 @@ static int runtime_enable(struct kfd_process *p, uint64_t r_debug,
 		 * saved in MES.
 		 */
 		if (pdd->dev->kfd->shared_resources.enable_mes)
-			kfd_dbg_set_mes_debug_mode(pdd, !kfd_dbg_has_cwsr_workaround(pdd->dev));
+			(void)kfd_dbg_set_mes_debug_mode(pdd,
+							 !kfd_dbg_has_cwsr_workaround(pdd->dev));
 	}
 
 	p->runtime_info.runtime_state = DEBUG_RUNTIME_STATE_ENABLED;
@@ -2874,10 +2875,11 @@ static int runtime_disable(struct kfd_process *p)
 					pdd->dev->vm_info.last_vmid_kfd);
 
 			if (!pdd->dev->kfd->shared_resources.enable_mes)
-				debug_refresh_runlist(pdd->dev->dqm);
+				(void)debug_refresh_runlist(pdd->dev->dqm);
 			else
-				kfd_dbg_set_mes_debug_mode(pdd,
-							   !kfd_dbg_has_cwsr_workaround(pdd->dev));
+				(void)kfd_dbg_set_mes_debug_mode(
+					pdd,
+					!kfd_dbg_has_cwsr_workaround(pdd->dev));
 		}
 	}
 
drivers/gpu/drm/amd/amdkfd/kfd_debug.c +5 -4
index ba99e0f258ae..cfa3f0d1888a 100644
@@ -565,9 +565,9 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
 				continue;
 
 			if (!pdd->dev->kfd->shared_resources.enable_mes)
-				debug_refresh_runlist(pdd->dev->dqm);
+				(void)debug_refresh_runlist(pdd->dev->dqm);
 			else
-				kfd_dbg_set_mes_debug_mode(pdd, true);
+				(void)kfd_dbg_set_mes_debug_mode(pdd, true);
 		}
 	}
 
@@ -627,9 +627,10 @@ void kfd_dbg_trap_deactivate(struct kfd_process *target, bool unwind, int unwind
 			pr_err("Failed to release debug vmid on [%i]\n", pdd->dev->id);
 
 		if (!pdd->dev->kfd->shared_resources.enable_mes)
-			debug_refresh_runlist(pdd->dev->dqm);
+			(void)debug_refresh_runlist(pdd->dev->dqm);
 		else
-			kfd_dbg_set_mes_debug_mode(pdd, !kfd_dbg_has_cwsr_workaround(pdd->dev));
+			(void)kfd_dbg_set_mes_debug_mode(pdd,
+							 !kfd_dbg_has_cwsr_workaround(pdd->dev));
 	}
 
 	kfd_dbg_set_workaround(target, false);
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -2
index 76359c6a3f3a..dbcb64501cfa 100644
@@ -1891,9 +1891,11 @@ static int stop_cpsch(struct device_queue_manager *dqm)
 	}
 
 	if (!dqm->dev->kfd->shared_resources.enable_mes)
-		unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0, USE_DEFAULT_GRACE_PERIOD, false);
+		(void)unmap_queues_cpsch(dqm,
+					 KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES,
+					 0, USE_DEFAULT_GRACE_PERIOD, false);
 	else
-		remove_all_kfd_queues_mes(dqm);
+		(void)remove_all_kfd_queues_mes(dqm);
 
 	dqm->sched_running = false;
 
Signature · 1 line
2.43.0