Skip to contentSkip to conversation

drm/amd/pp: Clean register first to avoid read original value

PATCH In review Rex Zhu 3 participants 6 messages Mar 30, 2018 – Mar 31, 2018 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Rex Zhu

author
#0 lore raw

PATCH 1/1 drm/amd/pp: Clean register first to avoid read original value

---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +13 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
 			"Failed to start pm status log!",
 			return -1);
 
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_40, 0);
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_49, 0);
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_94, 0);
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_95, 0);
+
 	/* Sampling period from 50ms to 4sec */
 	msleep_interruptible(200);
 
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1522395206-5860-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Rex Zhu <[email protected]>
Sent: Friday, March 30, 2018 3:33:26 AM
To: [email protected]
Cc: Zhu, Rex
Subject: [PATCH] drm/amd/pp: Clean register first to avoid read original value

---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +13 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
                         "Failed to start pm status log!",
                         return -1);
 
+       cgs_write_ind_register(hwmgr->device,
+                       CGS_IND_REG__SMC,
+                       ixSMU_PM_STATUS_40, 0);
+       cgs_write_ind_register(hwmgr->device,
+                       CGS_IND_REG__SMC,
+                       ixSMU_PM_STATUS_49, 0);
+       cgs_write_ind_register(hwmgr->device,
+                       CGS_IND_REG__SMC,
+                       ixSMU_PM_STATUS_94, 0);
+       cgs_write_ind_register(hwmgr->device,
+                       CGS_IND_REG__SMC,
+                       ixSMU_PM_STATUS_95, 0);
+
         /* Sampling period from 50ms to 4sec */
         msleep_interruptible(200);
 

--
1.9.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive

It is not necessary to do that. The register will reset to 0 after reading.

Eric

Quoted 19 lines · Rex Zhu
---
  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
  			"Failed to start pm status log!",
  			return -1);
 
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_40, 0);
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_49, 0);

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, · line 3386

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +7 -0
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_94, 0);
+	cgs_write_ind_register(hwmgr->device,
+			CGS_IND_REG__SMC,
+			ixSMU_PM_STATUS_95, 0);
+
  	/* Sampling period from 50ms to 4sec */
  	msleep_interruptible(200);
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): c42b3004-8b75-60d2-0f2b-45e1e9a2f1f6-5C7GfCeVMHo@public.gmane.org

#5 lore raw
Quoted 1 line · Eric Huang

It is not necessary to do that. The register will reset to 0 after reading.

The register is not reset after reading. Actually after PPSMC_MSG_PmStatusLogSample sent, the register will be updated. So it is still not necessary to do that.

Eric

Quoted 25 lines

Eric

Quoted 20 lines · Rex Zhu

---
  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++

  1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr 
 *hwmgr,
               "Failed to start pm status log!",
               return -1);
   +    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_40, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_49, 0);
+    cgs_write_ind_register(hwmgr->device,
Quoted 9 lines

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, · line 3385

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_94, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_95, 0);
+
       /* Sampling period from 50ms to 4sec */
       msleep_interruptible(200);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 9bac98b9-4add-6214-f461-bfd91d5636ad-5C7GfCeVMHo@public.gmane.org

author
#7 lore raw

when PPSMC_MSG_PmStatusLogSample sent, firmware will clean the temp sampling date, and add the sample task to dpm loop.

but firmware not clean the registers. if firmware not update the registers, we will read out the original value.

Best Regards

Rex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Eric Huang <[email protected]>
Sent: Friday, March 30, 2018 11:22 PM
To: [email protected]
Subject: Re: [PATCH] drm/amd/pp: Clean register first to avoid read original value

Quoted 2 lines · Eric Huang

It is not necessary to do that. The register will reset to 0 after reading.

The register is not reset after reading. Actually after PPSMC_MSG_PmStatusLogSample sent, the register will be updated. So it is still not necessary to do that.

Eric

Quoted 26 lines

Eric

Quoted 21 lines · Rex Zhu
---
  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr
 *hwmgr,
              "Failed to start pm status log!",
              return -1);
  +    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_40, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_49, 0);
+    cgs_write_ind_register(hwmgr->device,
Quoted 9 lines

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, · line 3385

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_94, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_95, 0);
+
      /* Sampling period from 50ms to 4sec */
      msleep_interruptible(200);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB16872AF3D8207BF4ACBC023FFBA00-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#9 lore raw

Please confirm this with SMU team about your assumption.

Regards,

Eric

Quoted 63 lines · Rex

when PPSMC_MSG_PmStatusLogSample sent, firmware will clean the temp sampling date, and add the sample task to dpm loop.

but firmware not  clean the registers.  if firmware not update the registers, we will read out the original value.

Best Regards

Rex

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Eric Huang <[email protected]> *Sent:* Friday, March 30, 2018 11:22 PM
*To:* [email protected]
*Subject:* Re: [PATCH] drm/amd/pp: Clean register first to avoid read original value

Quoted 2 lines · Eric Huang

It is not necessary to do that. The register will reset to 0 after reading.

The register is not reset after reading. Actually after PPSMC_MSG_PmStatusLogSample sent, the register will be updated. So it is still not necessary to do that.

Eric

Quoted 26 lines

Eric

Quoted 21 lines · Rex Zhu

---
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 13 +++++++++++++

  1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
index aaa9f5b..38cf3a1 100644
@@ -3368,6 +3368,19 @@ static int smu7_get_gpu_power(struct pp_hwmgr
 *hwmgr,
               "Failed to start pm status log!",
               return -1);
   + cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_40, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_49, 0);
+    cgs_write_ind_register(hwmgr->device,
Quoted 9 lines

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c static int smu7_get_gpu_power(struct pp_hwmgr · line 3385

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +6 -0
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_94, 0);
+    cgs_write_ind_register(hwmgr->device,
+            CGS_IND_REG__SMC,
+            ixSMU_PM_STATUS_95, 0);
+
       /* Sampling period from 50ms to 4sec */
       msleep_interruptible(200);
Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org <https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of Conduct.

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx