All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerply: fix power reading on Fiji
@ 2018-03-29 19:21 Eric Huang
       [not found] ` <1522351312-27566-1-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Huang @ 2018-03-29 19:21 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Eric Huang

Power value is wrong reported by customer. It is a regression by

commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
Author: Rex Zhu <Rex.Zhu@amd.com>
Date:   Mon Mar 27 15:32:59 2017 +0800

    drm/amd/powerplay: reduce sample period time

    for power readings.

    Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

The theoretical sampling period is from 50ms to 4sec, original 2sec
is long but correct, and 20ms is too short. change it to more
reasonable 200ms.

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index a03b7fe..7631d80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
 			"Failed to start pm status log!",
 			return -1);
 
-	msleep_interruptible(20);
+	/* Sampling period from 50ms to 4sec */
+	msleep_interruptible(200);
 
 	PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
 			PPSMC_MSG_PmStatusLogSample),
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found] ` <1522351312-27566-1-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-29 19:31   ` Deucher, Alexander
       [not found]     ` <BN6PR12MB18093357508F0377D97DCBFCF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Deucher, Alexander @ 2018-03-29 19:31 UTC (permalink / raw)
  To: Huang, JinHuiEric, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 2944 bytes --]

Do you know what the sampling period is on vega?  We should try and be consistent.  How about making this selectable via hwmon:

power[1-*]_average_interval     Power use averaging interval.  A poll
                                notification is sent to this file if the
                                hardware changes the averaging interval.
                                Unit: milliseconds
                                RW

power[1-*]_average_interval_max Maximum power use averaging interval
                                Unit: milliseconds
                                RO

power[1-*]_average_interval_min Minimum power use averaging interval
                                Unit: milliseconds
                                RO


Then the user can select the interval they want.


Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, March 29, 2018 3:21:52 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Huang, JinHuiEric
Subject: [PATCH] drm/amd/powerply: fix power reading on Fiji

Power value is wrong reported by customer. It is a regression by

commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Date:   Mon Mar 27 15:32:59 2017 +0800

    drm/amd/powerplay: reduce sample period time

    for power readings.

    Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
    Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
    Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

The theoretical sampling period is from 50ms to 4sec, original 2sec
is long but correct, and 20ms is too short. change it to more
reasonable 200ms.

Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index a03b7fe..7631d80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
                         "Failed to start pm status log!",
                         return -1);

-       msleep_interruptible(20);
+       /* Sampling period from 50ms to 4sec */
+       msleep_interruptible(200);

         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
                         PPSMC_MSG_PmStatusLogSample),
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 4664 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]     ` <BN6PR12MB18093357508F0377D97DCBFCF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-29 19:40       ` Eric Huang
       [not found]         ` <cb84765d-f9bd-f3d0-973f-13ff15f5b13d-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Huang @ 2018-03-29 19:40 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3322 bytes --]

This reading method is shared with AGT tool only on Fiji, because SMU FW 
doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since 
polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use 
PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. 
Driver will not care about it.


Eric


On 2018-03-29 03:31 PM, Deucher, Alexander wrote:
>
> Do you know what the sampling period is on vega?  We should try and be 
> consistent. How about making this selectable via hwmon:
>
> power[1-*]_average_interval	Power use averaging interval.  A poll
> 				notification is sent to this file if the
> 				hardware changes the averaging interval.
> 				Unit: milliseconds
> 				RW
>
> power[1-*]_average_interval_max	Maximum power use averaging interval
> 				Unit: milliseconds
> 				RO
>
> power[1-*]_average_interval_min	Minimum power use averaging interval
> 				Unit: milliseconds
> 				RO
>
>
> Then the user can select the interval they want.
>
>
> Alex
>
> ------------------------------------------------------------------------
> *From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of 
> Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
> *Sent:* Thursday, March 29, 2018 3:21:52 PM
> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *Cc:* Huang, JinHuiEric
> *Subject:* [PATCH] drm/amd/powerply: fix power reading on Fiji
> Power value is wrong reported by customer. It is a regression by
>
> commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
> Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
> Date:   Mon Mar 27 15:32:59 2017 +0800
>
>     drm/amd/powerplay: reduce sample period time
>
>     for power readings.
>
>     Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>     Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>     Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
> The theoretical sampling period is from 50ms to 4sec, original 2sec
> is long but correct, and 20ms is too short. change it to more
> reasonable 200ms.
>
> Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index a03b7fe..7631d80 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr 
> *hwmgr,
>                          "Failed to start pm status log!",
>                          return -1);
>
> -       msleep_interruptible(20);
> +       /* Sampling period from 50ms to 4sec */
> +       msleep_interruptible(200);
>
>          PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
>                          PPSMC_MSG_PmStatusLogSample),
> -- 
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 6739 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]         ` <cb84765d-f9bd-f3d0-973f-13ff15f5b13d-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-29 19:54           ` Deucher, Alexander
       [not found]             ` <BN6PR12MB18094AA1EA63372A78E03B17F7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Deucher, Alexander @ 2018-03-29 19:54 UTC (permalink / raw)
  To: Huang, JinHuiEric, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 4270 bytes --]

Thanks. Patch is:

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris boards so we don't have to worry about the delay on them?


Alex

________________________________
From: Huang, JinHuiEric
Sent: Thursday, March 29, 2018 3:40:22 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


This reading method is shared with AGT tool only on Fiji, because SMU FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. Driver will not care about it.


Eric

On 2018-03-29 03:31 PM, Deucher, Alexander wrote:

Do you know what the sampling period is on vega?  We should try and be consistent.  How about making this selectable via hwmon:

power[1-*]_average_interval     Power use averaging interval.  A poll
                                notification is sent to this file if the
                                hardware changes the averaging interval.
                                Unit: milliseconds
                                RW

power[1-*]_average_interval_max Maximum power use averaging interval
                                Unit: milliseconds
                                RO

power[1-*]_average_interval_min Minimum power use averaging interval
                                Unit: milliseconds
                                RO


Then the user can select the interval they want.


Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:amd-gfx-bounces@lists.freedesktop.org> on behalf of Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, March 29, 2018 3:21:52 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Huang, JinHuiEric
Subject: [PATCH] drm/amd/powerply: fix power reading on Fiji

Power value is wrong reported by customer. It is a regression by

commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Date:   Mon Mar 27 15:32:59 2017 +0800

    drm/amd/powerplay: reduce sample period time

    for power readings.

    Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
    Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
    Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>

The theoretical sampling period is from 50ms to 4sec, original 2sec
is long but correct, and 20ms is too short. change it to more
reasonable 200ms.

Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index a03b7fe..7631d80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
                         "Failed to start pm status log!",
                         return -1);

-       msleep_interruptible(20);
+       /* Sampling period from 50ms to 4sec */
+       msleep_interruptible(200);

         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
                         PPSMC_MSG_PmStatusLogSample),
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 7230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]             ` <BN6PR12MB18094AA1EA63372A78E03B17F7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-29 19:58               ` Eric Huang
       [not found]                 ` <d34a1d2c-7f3d-4722-8f80-1ae0cba18df0-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Huang @ 2018-03-29 19:58 UTC (permalink / raw)
  To: Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 4640 bytes --]

Right. This is only for Fiji. We should use PPSMC_MSG_GetCurrPkgPwr on 
poaris.


Thanks,

Eric


On 2018-03-29 03:54 PM, Deucher, Alexander wrote:
>
> Thanks. Patch is:
>
> Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
> Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris boards 
> so we don't have to worry about the delay on them?
>
>
> Alex
>
> ------------------------------------------------------------------------
> *From:* Huang, JinHuiEric
> *Sent:* Thursday, March 29, 2018 3:40:22 PM
> *To:* Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *Subject:* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
> This reading method is shared with AGT tool only on Fiji, because SMU 
> FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since 
> polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use 
> PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. 
> Driver will not care about it.
>
>
> Eric
>
>
> On 2018-03-29 03:31 PM, Deucher, Alexander wrote:
>>
>> Do you know what the sampling period is on vega?  We should try and 
>> be consistent.  How about making this selectable via hwmon:
>>
>> power[1-*]_average_interval	Power use averaging interval.  A poll
>> 				notification is sent to this file if the
>> 				hardware changes the averaging interval.
>> 				Unit: milliseconds
>> 				RW
>>
>> power[1-*]_average_interval_max	Maximum power use averaging interval
>> 				Unit: milliseconds
>> 				RO
>>
>> power[1-*]_average_interval_min	Minimum power use averaging interval
>> 				Unit: milliseconds
>> 				RO
>>
>>
>> Then the user can select the interval they want.
>>
>>
>> Alex
>>
>> ------------------------------------------------------------------------
>> *From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> 
>> <mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Eric 
>> Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org> <mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>> *Sent:* Thursday, March 29, 2018 3:21:52 PM
>> *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org 
>> <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>> *Cc:* Huang, JinHuiEric
>> *Subject:* [PATCH] drm/amd/powerply: fix power reading on Fiji
>> Power value is wrong reported by customer. It is a regression by
>>
>> commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
>> Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org> <mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>> Date:   Mon Mar 27 15:32:59 2017 +0800
>>
>>     drm/amd/powerplay: reduce sample period time
>>
>>     for power readings.
>>
>>     Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org> <mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>>     Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org> 
>> <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>>     Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org> 
>> <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>>
>> The theoretical sampling period is from 50ms to 4sec, original 2sec
>> is long but correct, and 20ms is too short. change it to more
>> reasonable 200ms.
>>
>> Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org> 
>> <mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>> ---
>>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c 
>> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>> index a03b7fe..7631d80 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>> @@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr 
>> *hwmgr,
>>                          "Failed to start pm status log!",
>>                          return -1);
>>
>> -       msleep_interruptible(20);
>> +       /* Sampling period from 50ms to 4sec */
>> +       msleep_interruptible(200);
>>
>> PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
>>                          PPSMC_MSG_PmStatusLogSample),
>> -- 
>> 2.7.4
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>


[-- Attachment #1.2: Type: text/html, Size: 9947 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]                 ` <d34a1d2c-7f3d-4722-8f80-1ae0cba18df0-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-29 20:00                   ` Deucher, Alexander
       [not found]                     ` <BN6PR12MB1809CD35DDC84D955B4C847DF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Deucher, Alexander @ 2018-03-29 20:00 UTC (permalink / raw)
  To: Huang, JinHuiEric, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 4850 bytes --]

Fiji and tonga I presume.  The current code seems to work fine on tonga at least.


Alex

________________________________
From: Huang, JinHuiEric
Sent: Thursday, March 29, 2018 3:58:42 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


Right. This is only for Fiji. We should use PPSMC_MSG_GetCurrPkgPwr on poaris.


Thanks,

Eric

On 2018-03-29 03:54 PM, Deucher, Alexander wrote:

Thanks. Patch is:

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher@amd.com>

Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris boards so we don't have to worry about the delay on them?


Alex

________________________________
From: Huang, JinHuiEric
Sent: Thursday, March 29, 2018 3:40:22 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


This reading method is shared with AGT tool only on Fiji, because SMU FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. Driver will not care about it.


Eric

On 2018-03-29 03:31 PM, Deucher, Alexander wrote:

Do you know what the sampling period is on vega?  We should try and be consistent.  How about making this selectable via hwmon:

power[1-*]_average_interval     Power use averaging interval.  A poll
                                notification is sent to this file if the
                                hardware changes the averaging interval.
                                Unit: milliseconds
                                RW

power[1-*]_average_interval_max Maximum power use averaging interval
                                Unit: milliseconds
                                RO

power[1-*]_average_interval_min Minimum power use averaging interval
                                Unit: milliseconds
                                RO


Then the user can select the interval they want.


Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:amd-gfx-bounces@lists.freedesktop.org> on behalf of Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, March 29, 2018 3:21:52 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Huang, JinHuiEric
Subject: [PATCH] drm/amd/powerply: fix power reading on Fiji

Power value is wrong reported by customer. It is a regression by

commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Date:   Mon Mar 27 15:32:59 2017 +0800

    drm/amd/powerplay: reduce sample period time

    for power readings.

    Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
    Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
    Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>

The theoretical sampling period is from 50ms to 4sec, original 2sec
is long but correct, and 20ms is too short. change it to more
reasonable 200ms.

Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index a03b7fe..7631d80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
                         "Failed to start pm status log!",
                         return -1);

-       msleep_interruptible(20);
+       /* Sampling period from 50ms to 4sec */
+       msleep_interruptible(200);

         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
                         PPSMC_MSG_PmStatusLogSample),
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[-- Attachment #1.2: Type: text/html, Size: 8750 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]                     ` <BN6PR12MB1809CD35DDC84D955B4C847DF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-29 20:30                       ` Alex Deucher
  2018-03-30  7:52                       ` Zhu, Rex
  1 sibling, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2018-03-29 20:30 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Huang, JinHuiEric, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Thu, Mar 29, 2018 at 4:00 PM, Deucher, Alexander
<Alexander.Deucher@amd.com> wrote:
> Fiji and tonga I presume.  The current code seems to work fine on tonga at
> least.

Actually I guess it works on all pre-polaris smu7 parts (tonga,
iceland, CI, etc.).

Alex

>
>
> Alex
>
> ________________________________
> From: Huang, JinHuiEric
> Sent: Thursday, March 29, 2018 3:58:42 PM
>
> To: Deucher, Alexander; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
>
> Right. This is only for Fiji. We should use PPSMC_MSG_GetCurrPkgPwr on
> poaris.
>
>
> Thanks,
>
> Eric
>
>
> On 2018-03-29 03:54 PM, Deucher, Alexander wrote:
>
> Thanks. Patch is:
>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>
> Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris boards so we
> don't have to worry about the delay on them?
>
>
> Alex
>
> ________________________________
> From: Huang, JinHuiEric
> Sent: Thursday, March 29, 2018 3:40:22 PM
> To: Deucher, Alexander; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
>
> This reading method is shared with AGT tool only on Fiji, because SMU FW
> doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since
> polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use
> PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. Driver
> will not care about it.
>
>
> Eric
>
>
> On 2018-03-29 03:31 PM, Deucher, Alexander wrote:
>
> Do you know what the sampling period is on vega?  We should try and be
> consistent.  How about making this selectable via hwmon:
>
> power[1-*]_average_interval Power use averaging interval.  A poll
> notification is sent to this file if the
> hardware changes the averaging interval.
> Unit: milliseconds
> RW
>
> power[1-*]_average_interval_max Maximum power use averaging interval
> Unit: milliseconds
> RO
>
> power[1-*]_average_interval_min Minimum power use averaging interval
> Unit: milliseconds
> RO
>
>
> Then the user can select the interval they want.
>
>
> Alex
>
> ________________________________
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Eric
> Huang <JinHuiEric.Huang@amd.com>
> Sent: Thursday, March 29, 2018 3:21:52 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, JinHuiEric
> Subject: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
> Power value is wrong reported by customer. It is a regression by
>
> commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
> Author: Rex Zhu <Rex.Zhu@amd.com>
> Date:   Mon Mar 27 15:32:59 2017 +0800
>
>     drm/amd/powerplay: reduce sample period time
>
>     for power readings.
>
>     Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
>     Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>
> The theoretical sampling period is from 50ms to 4sec, original 2sec
> is long but correct, and 20ms is too short. change it to more
> reasonable 200ms.
>
> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index a03b7fe..7631d80 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
>                          "Failed to start pm status log!",
>                          return -1);
>
> -       msleep_interruptible(20);
> +       /* Sampling period from 50ms to 4sec */
> +       msleep_interruptible(200);
>
>          PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
>                          PPSMC_MSG_PmStatusLogSample),
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]                     ` <BN6PR12MB1809CD35DDC84D955B4C847DF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2018-03-29 20:30                       ` Alex Deucher
@ 2018-03-30  7:52                       ` Zhu, Rex
       [not found]                         ` <CY4PR12MB1687D41D30442A05D1663E1FFBA10-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Zhu, Rex @ 2018-03-30  7:52 UTC (permalink / raw)
  To: Deucher, Alexander, Huang, JinHuiEric,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 5671 bytes --]

>> Power value is wrong reported by customer.

Hi Eric,

What is the wrong value customer reported?

In my end, there is no big difference between 20ms and 200ms or 2s. I tested on Fiji/Tonga when gpu idle or running fullscreen glxgears.

why need 50 ms?

How long does the SMU core take to complete one cycle of dpm tasks? I tested, it is less than 1 ms.

So when we delay 20 ms, The output is the average value of more than 20 sampling.

Best Regards
Rex


From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Deucher, Alexander
Sent: Friday, March 30, 2018 4:00 AM
To: Huang, JinHuiEric; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


Fiji and tonga I presume.  The current code seems to work fine on tonga at least.



Alex

________________________________
From: Huang, JinHuiEric
Sent: Thursday, March 29, 2018 3:58:42 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


Right. This is only for Fiji. We should use PPSMC_MSG_GetCurrPkgPwr on poaris.



Thanks,

Eric

On 2018-03-29 03:54 PM, Deucher, Alexander wrote:

Thanks. Patch is:

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher@amd.com>

Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris boards so we don't have to worry about the delay on them?



Alex

________________________________
From: Huang, JinHuiEric
Sent: Thursday, March 29, 2018 3:40:22 PM
To: Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amd/powerply: fix power reading on Fiji


This reading method is shared with AGT tool only on Fiji, because SMU FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji. But since polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported. We also use PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control sampling period. Driver will not care about it.



Eric

On 2018-03-29 03:31 PM, Deucher, Alexander wrote:

Do you know what the sampling period is on vega?  We should try and be consistent.  How about making this selectable via hwmon:

power[1-*]_average_interval       Power use averaging interval.  A poll

                          notification is sent to this file if the

                          hardware changes the averaging interval.

                          Unit: milliseconds

                          RW



power[1-*]_average_interval_max   Maximum power use averaging interval

                          Unit: milliseconds

                          RO



power[1-*]_average_interval_min   Minimum power use averaging interval

                          Unit: milliseconds

                          RO



Then the user can select the interval they want.



Alex

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:amd-gfx-bounces@lists.freedesktop.org> on behalf of Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
Sent: Thursday, March 29, 2018 3:21:52 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Huang, JinHuiEric
Subject: [PATCH] drm/amd/powerply: fix power reading on Fiji

Power value is wrong reported by customer. It is a regression by

commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Date:   Mon Mar 27 15:32:59 2017 +0800

    drm/amd/powerplay: reduce sample period time

    for power readings.

    Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org><mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
    Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
    Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org><mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>

The theoretical sampling period is from 50ms to 4sec, original 2sec
is long but correct, and 20ms is too short. change it to more
reasonable 200ms.

Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org><mailto:JinHuiEric.Huang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index a03b7fe..7631d80 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,
                         "Failed to start pm status log!",
                         return -1);

-       msleep_interruptible(20);
+       /* Sampling period from 50ms to 4sec */
+       msleep_interruptible(200);

         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
                         PPSMC_MSG_PmStatusLogSample),
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[-- Attachment #1.2: Type: text/html, Size: 19259 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
       [not found]                         ` <CY4PR12MB1687D41D30442A05D1663E1FFBA10-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-03-30 15:08                           ` Eric Huang
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Huang @ 2018-03-30 15:08 UTC (permalink / raw)
  To: Zhu, Rex, Deucher, Alexander, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 7780 bytes --]

I reproduced the issue reported by customer. When running a HSA test, 
repeating to read power via AGT and rocm-smi (driver). We set power 
limit of 175w to a Fiji. The results from AGT are all below 175w and the 
results from driver have a lot of value over 175, some are almost double 
of 175. So your test cases are not enough, you should run some OCL and 
HSA tests.

I have tested 100ms and 150ms, the results still have some wrong. 200ms 
is good. It seems more sampling more accurate.

The theoretical period is quoted from smu team and tools team. AGT is 
using more than 1sec of period. I don't know how long one cycle of dpm 
task is, but is sampling based on dpm task cycle? we should ask smu team 
to confirm.

Regards,
Eric


On 03/30/2018 03:52 AM, Zhu, Rex wrote:
>
> >> Power value is wrong reported by customer.
>
> Hi Eric,
>
> What is the wrong value customer reported?
>
> In my end, there is no big difference between 20ms and 200ms or 2s. I 
> tested on Fiji/Tonga when gpu idle or running fullscreen glxgears.
>
> why need 50 ms?
>
> How long does the SMU core take to complete one cycle of dpm tasks? I 
> tested, it is less than 1 ms.
>
>
> So when we delay 20 ms, The output is the average value of more than 
> 20 sampling.
>
> Best Regards
>
> Rex
>
> *From:*amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] *On 
> Behalf Of *Deucher, Alexander
> *Sent:* Friday, March 30, 2018 4:00 AM
> *To:* Huang, JinHuiEric; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *Subject:* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
> Fiji and tonga I presume.  The current code seems to work fine on 
> tonga at least.
>
> Alex
>
> ------------------------------------------------------------------------
>
> *From:*Huang, JinHuiEric
> *Sent:* Thursday, March 29, 2018 3:58:42 PM
> *To:* Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org 
> <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> *Subject:* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
> Right. This is only for Fiji. We should use PPSMC_MSG_GetCurrPkgPwr on 
> poaris.
>
> Thanks,
>
> Eric
>
> On 2018-03-29 03:54 PM, Deucher, Alexander wrote:
>
>     Thanks. Patch is:
>
>     Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>     <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
>     Care to make a patch to use PPSMC_MSG_GetCurrPkgPwr on polaris
>     boards so we don't have to worry about the delay on them?
>
>     Alex
>
>     ------------------------------------------------------------------------
>
>     *From:*Huang, JinHuiEric
>     *Sent:* Thursday, March 29, 2018 3:40:22 PM
>     *To:* Deucher, Alexander; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>     <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>     *Subject:* Re: [PATCH] drm/amd/powerply: fix power reading on Fiji
>
>     This reading method is shared with AGT tool only on Fiji, because
>     SMU FW doesn't support PPSMC_MSG_GetCurrPkgPwr message on Fiji.
>     But since polaris10, PPSMC_MSG_GetCurrPkgPwr has been supported.
>     We also use PPSMC_MSG_GetCurrPkgPwr on vega which SMU FW control
>     sampling period. Driver will not care about it.
>
>     Eric
>
>     On 2018-03-29 03:31 PM, Deucher, Alexander wrote:
>
>         Do you know what the sampling period is on vega?  We should
>         try and be consistent.  How about making this selectable via
>         hwmon:
>
>         power[1-*]_average_interval       Power use averaging
>         interval.  A poll
>
>                                   notification is sent to this file if the
>
>                                   hardware changes the averaging interval.
>
>                                   Unit: milliseconds
>
>                                   RW
>
>         power[1-*]_average_interval_max   Maximum power use averaging
>         interval
>
>                                   Unit: milliseconds
>
>                                   RO
>
>         power[1-*]_average_interval_min   Minimum power use averaging
>         interval
>
>                                   Unit: milliseconds
>
>                                   RO
>
>         Then the user can select the interval they want.
>
>         Alex
>
>         ------------------------------------------------------------------------
>
>         *From:*amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>         <mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of
>         Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>         <mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>         *Sent:* Thursday, March 29, 2018 3:21:52 PM
>         *To:* amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>         <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>         *Cc:* Huang, JinHuiEric
>         *Subject:* [PATCH] drm/amd/powerply: fix power reading on Fiji
>
>         Power value is wrong reported by customer. It is a regression by
>
>         commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254
>         Author: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org> <mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>         Date:   Mon Mar 27 15:32:59 2017 +0800
>
>             drm/amd/powerplay: reduce sample period time
>
>             for power readings.
>
>             Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>         <mailto:Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
>             Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>         <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>             Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>         <mailto:alexander.deucher-5C7GfCeVMHo@public.gmane.org>
>
>         The theoretical sampling period is from 50ms to 4sec, original
>         2sec
>         is long but correct, and 20ms is too short. change it to more
>         reasonable 200ms.
>
>         Signed-off-by: Eric Huang <JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>         <mailto:JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
>         ---
>          drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-
>          1 file changed, 2 insertions(+), 1 deletion(-)
>
>         diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>         b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>         index a03b7fe..7631d80 100644
>         --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>         +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
>         @@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct
>         pp_hwmgr *hwmgr,
>                                  "Failed to start pm status log!",
>                                  return -1);
>
>         -       msleep_interruptible(20);
>         +       /* Sampling period from 50ms to 4sec */
>         +       msleep_interruptible(200);
>
>         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
>         PPSMC_MSG_PmStatusLogSample),
>         -- 
>         2.7.4
>
>         _______________________________________________
>         amd-gfx mailing list
>         amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>         <mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
>         https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>


[-- Attachment #1.2: Type: text/html, Size: 23998 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2018-03-30 15:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 19:21 [PATCH] drm/amd/powerply: fix power reading on Fiji Eric Huang
     [not found] ` <1522351312-27566-1-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org>
2018-03-29 19:31   ` Deucher, Alexander
     [not found]     ` <BN6PR12MB18093357508F0377D97DCBFCF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-29 19:40       ` Eric Huang
     [not found]         ` <cb84765d-f9bd-f3d0-973f-13ff15f5b13d-5C7GfCeVMHo@public.gmane.org>
2018-03-29 19:54           ` Deucher, Alexander
     [not found]             ` <BN6PR12MB18094AA1EA63372A78E03B17F7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-29 19:58               ` Eric Huang
     [not found]                 ` <d34a1d2c-7f3d-4722-8f80-1ae0cba18df0-5C7GfCeVMHo@public.gmane.org>
2018-03-29 20:00                   ` Deucher, Alexander
     [not found]                     ` <BN6PR12MB1809CD35DDC84D955B4C847DF7A20-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-29 20:30                       ` Alex Deucher
2018-03-30  7:52                       ` Zhu, Rex
     [not found]                         ` <CY4PR12MB1687D41D30442A05D1663E1FFBA10-rpdhrqHFk06Y0SjTqZDccQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-03-30 15:08                           ` Eric Huang

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.