All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests
@ 2021-11-26  5:25 Lijo Lazar
  2021-11-26  6:06 ` Chen, Guchun
  2021-11-26  6:20 ` Wang, Yang(Kevin)
  0 siblings, 2 replies; 3+ messages in thread
From: Lijo Lazar @ 2021-11-26  5:25 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Mario.Limonciello, Hawking.Zhang

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>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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) {
 	/*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests
  2021-11-26  5:25 [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests Lijo Lazar
@ 2021-11-26  6:06 ` Chen, Guchun
  2021-11-26  6:20 ` Wang, Yang(Kevin)
  1 sibling, 0 replies; 3+ messages in thread
From: Chen, Guchun @ 2021-11-26  6:06 UTC (permalink / raw)
  To: Lazar, Lijo, amd-gfx
  Cc: Deucher, Alexander, Limonciello, Mario, Zhang, Hawking

[Public]

Reviewed-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Lijo Lazar
Sent: Friday, November 26, 2021 1:25 PM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH v2] 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>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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) {
 	/*
--
2.25.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests
  2021-11-26  5:25 [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests Lijo Lazar
  2021-11-26  6:06 ` Chen, Guchun
@ 2021-11-26  6:20 ` Wang, Yang(Kevin)
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Yang(Kevin) @ 2021-11-26  6:20 UTC (permalink / raw)
  To: Lazar, Lijo, amd-gfx
  Cc: Deucher, Alexander, Limonciello, Mario, Zhang, Hawking

[-- Attachment #1: Type: text/plain, Size: 1734 bytes --]

[AMD Official Use Only]


Reviewed-by: Kevin Yang <kevinyang.wang@amd.com>

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lijo Lazar <lijo.lazar@amd.com>
Sent: Friday, November 26, 2021 1:25 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH v2] 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>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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) {
         /*
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 3858 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-26  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  5:25 [PATCH v2] drm/amd/pm: Add warning for unexpected PG requests Lijo Lazar
2021-11-26  6:06 ` Chen, Guchun
2021-11-26  6:20 ` Wang, Yang(Kevin)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.