All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status
@ 2021-09-16 12:41 Sanket Goswami
  2021-09-16 12:59 ` Shyam Sundar S K
  2021-09-16 13:29 ` Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Sanket Goswami @ 2021-09-16 12:41 UTC (permalink / raw)
  To: Shyam-sundar.S-k, hdegoede, mgross
  Cc: platform-driver-x86, linux-kernel, Sanket Goswami

As the PM firmware returns the status of the last s0i3 in the smu_metrics
structure, the existing name "s0i3_cyclecount" seems to be a misnomer.
Change it accordingly to "s0i3_last_entry_status".

Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
---
 drivers/platform/x86/amd-pmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 0c970f613e09..91c1f1c6c929 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -141,7 +141,7 @@ static inline void amd_pmc_reg_write(struct amd_pmc_dev *dev, int reg_offset, u3
 struct smu_metrics {
 	u32 table_version;
 	u32 hint_count;
-	u32 s0i3_cyclecount;
+	u32 s0i3_last_entry_status;
 	u32 timein_s0i2;
 	u64 timeentering_s0i3_lastcapture;
 	u64 timeentering_s0i3_totaltime;
@@ -170,7 +170,8 @@ static int smu_fw_info_show(struct seq_file *s, void *unused)
 	seq_puts(s, "\n=== SMU Statistics ===\n");
 	seq_printf(s, "Table Version: %d\n", table.table_version);
 	seq_printf(s, "Hint Count: %d\n", table.hint_count);
-	seq_printf(s, "S0i3 Cycle Count: %d\n", table.s0i3_cyclecount);
+	seq_printf(s, "Last S0i3 Status: %s\n", table.s0i3_last_entry_status ? "Success" :
+		   "Unknown/Fail");
 	seq_printf(s, "Time (in us) to S0i3: %lld\n", table.timeentering_s0i3_lastcapture);
 	seq_printf(s, "Time (in us) in S0i3: %lld\n", table.timein_s0i3_lastcapture);
 
-- 
2.25.1


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

* Re: [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status
  2021-09-16 12:41 [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status Sanket Goswami
@ 2021-09-16 12:59 ` Shyam Sundar S K
  2021-09-16 13:29 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Shyam Sundar S K @ 2021-09-16 12:59 UTC (permalink / raw)
  To: Sanket Goswami, hdegoede, mgross; +Cc: platform-driver-x86, linux-kernel



On 9/16/2021 6:11 PM, Sanket Goswami wrote:
> As the PM firmware returns the status of the last s0i3 in the smu_metrics
> structure, the existing name "s0i3_cyclecount" seems to be a misnomer.
> Change it accordingly to "s0i3_last_entry_status".
> 
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
> ---
>  drivers/platform/x86/amd-pmc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
> index 0c970f613e09..91c1f1c6c929 100644
> --- a/drivers/platform/x86/amd-pmc.c
> +++ b/drivers/platform/x86/amd-pmc.c
> @@ -141,7 +141,7 @@ static inline void amd_pmc_reg_write(struct amd_pmc_dev *dev, int reg_offset, u3
>  struct smu_metrics {
>  	u32 table_version;
>  	u32 hint_count;
> -	u32 s0i3_cyclecount;
> +	u32 s0i3_last_entry_status;
>  	u32 timein_s0i2;
>  	u64 timeentering_s0i3_lastcapture;
>  	u64 timeentering_s0i3_totaltime;
> @@ -170,7 +170,8 @@ static int smu_fw_info_show(struct seq_file *s, void *unused)
>  	seq_puts(s, "\n=== SMU Statistics ===\n");
>  	seq_printf(s, "Table Version: %d\n", table.table_version);
>  	seq_printf(s, "Hint Count: %d\n", table.hint_count);
> -	seq_printf(s, "S0i3 Cycle Count: %d\n", table.s0i3_cyclecount);
> +	seq_printf(s, "Last S0i3 Status: %s\n", table.s0i3_last_entry_status ? "Success" :
> +		   "Unknown/Fail");
>  	seq_printf(s, "Time (in us) to S0i3: %lld\n", table.timeentering_s0i3_lastcapture);
>  	seq_printf(s, "Time (in us) in S0i3: %lld\n", table.timein_s0i3_lastcapture);
>  
> 

Looks good to me.

Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>

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

* Re: [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status
  2021-09-16 12:41 [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status Sanket Goswami
  2021-09-16 12:59 ` Shyam Sundar S K
@ 2021-09-16 13:29 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2021-09-16 13:29 UTC (permalink / raw)
  To: Sanket Goswami, Shyam-sundar.S-k, mgross
  Cc: platform-driver-x86, linux-kernel

Hi,

On 9/16/21 2:41 PM, Sanket Goswami wrote:
> As the PM firmware returns the status of the last s0i3 in the smu_metrics
> structure, the existing name "s0i3_cyclecount" seems to be a misnomer.
> Change it accordingly to "s0i3_last_entry_status".
> 
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans


> ---
>  drivers/platform/x86/amd-pmc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
> index 0c970f613e09..91c1f1c6c929 100644
> --- a/drivers/platform/x86/amd-pmc.c
> +++ b/drivers/platform/x86/amd-pmc.c
> @@ -141,7 +141,7 @@ static inline void amd_pmc_reg_write(struct amd_pmc_dev *dev, int reg_offset, u3
>  struct smu_metrics {
>  	u32 table_version;
>  	u32 hint_count;
> -	u32 s0i3_cyclecount;
> +	u32 s0i3_last_entry_status;
>  	u32 timein_s0i2;
>  	u64 timeentering_s0i3_lastcapture;
>  	u64 timeentering_s0i3_totaltime;
> @@ -170,7 +170,8 @@ static int smu_fw_info_show(struct seq_file *s, void *unused)
>  	seq_puts(s, "\n=== SMU Statistics ===\n");
>  	seq_printf(s, "Table Version: %d\n", table.table_version);
>  	seq_printf(s, "Hint Count: %d\n", table.hint_count);
> -	seq_printf(s, "S0i3 Cycle Count: %d\n", table.s0i3_cyclecount);
> +	seq_printf(s, "Last S0i3 Status: %s\n", table.s0i3_last_entry_status ? "Success" :
> +		   "Unknown/Fail");
>  	seq_printf(s, "Time (in us) to S0i3: %lld\n", table.timeentering_s0i3_lastcapture);
>  	seq_printf(s, "Time (in us) in S0i3: %lld\n", table.timein_s0i3_lastcapture);
>  
> 


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

end of thread, other threads:[~2021-09-16 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 12:41 [PATCH] platform/x86: amd-pmc: Check s0i3 cycle status Sanket Goswami
2021-09-16 12:59 ` Shyam Sundar S K
2021-09-16 13:29 ` Hans de Goede

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.