summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2021-11-25 19:45:42 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-12-01 16:03:13 -0500
commit85c1b9bd13b0b298bbbf128e26a470ec54c4d0e3 (patch)
treeec759ee8519d8b1583c1f552e4f6292328431026
parent700de2c8aadcae459a4db19b943962e709df45f2 (diff)
downloadlinux-stable-85c1b9bd13b0b298bbbf128e26a470ec54c4d0e3.tar.gz
linux-stable-85c1b9bd13b0b298bbbf128e26a470ec54c4d0e3.tar.bz2
linux-stable-85c1b9bd13b0b298bbbf128e26a470ec54c4d0e3.zip
drm/amd/pm: Add warning for unexpected PG requests
v1: Ideally power gate/ungate requests shouldn't come when smu block is uninitialized. Add a WARN message to check the origins if such a thing ever happens. v2: Use dev_WARN to log device info (Felix/Guchun). Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Guchun Chen <guchun.chen@amd.com> Reviewed-by: Kevin Yang <kevinyang.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index e156add7b560..ea99afb38d2b 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -277,8 +277,12 @@ static int smu_dpm_set_power_gate(void *handle,
struct smu_context *smu = handle;
int ret = 0;
- if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
+ if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) {
+ dev_WARN(smu->adev->dev,
+ "SMU uninitialized but power %s requested for %u!\n",
+ gate ? "gate" : "ungate", block_type);
return -EOPNOTSUPP;
+ }
switch (block_type) {
/*