Skip to contentSkip to conversation

drm/amd/pm: Add fine grained flag to SMU v13.0.6

PATCH In review Lijo Lazar 3 participants 8 messages Apr 27

Subsystems (3)
lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13 SOCs")
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -0
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
 	/* gfxclk dpm table setup */
 	dpm_table = &dpm_context->dpm_tables.gfx_table;
 	dpm_table->clk_type = SMU_GFXCLK;
+	dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
 	if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
 		/* In the case of gfxclk, only fine-grained dpm is honored.
 		 * Get min/max values from FW.
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13 SOCs")
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -0
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
        /* gfxclk dpm table setup */
        dpm_table = &dpm_context->dpm_tables.gfx_table;
        dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
        if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                /* In the case of gfxclk, only fine-grained dpm is honored.
                 * Get min/max values from FW.

--
2.49.0

#2 lore raw
Quoted 5 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

Thanks,
Lijo

Quoted 39 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13 SOCs")
---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
         /* gfxclk dpm table setup */
         dpm_table = &dpm_context->dpm_tables.gfx_table;
         dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
         if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                 /* In the case of gfxclk, only fine-grained dpm is honored.
                  * Get min/max values from FW.
--

2.49.0

#3 lore raw

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 15:56
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 5 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

[kevin]:
No, this should be an independent issue, and you need to maintain consistent code logic with other SMU functions. e.g: all locations where the smu_v13_0_set_single_dpm_table() function is invoked.

Best Regards,
Kevin

Thanks,
Lijo

Quoted 43 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13

SOCs")

---
  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
         /* gfxclk dpm table setup */
         dpm_table = &dpm_context->dpm_tables.gfx_table;
         dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
         if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                 /* In the case of gfxclk, only fine-grained dpm is honored.
                  * Get min/max values from FW.
--

2.49.0

#4 lore raw
Quoted 16 lines · Yang(Kevin)

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 15:56
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 4 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

Quoted 8 lines
Quoted 1 line

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

[kevin]:
No, this should be an independent issue, and you need to maintain consistent code logic with other SMU functions. e.g: all locations where the smu_v13_0_set_single_dpm_table() function is invoked.

The issue is because smu_cmn_print_dpm_clk_levels is hardcoding number of levels to 2 for fine grained regardless of dpm enablement status. I think the fix should be there rather than at other places. If the count is only 1, it shouldn't keep the hardcoded value as 2.

Thanks,
Lijo

Quoted 50 lines

Best Regards,
Kevin

Thanks,
Lijo

Quoted 43 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13

SOCs")

---
   drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
   1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
          /* gfxclk dpm table setup */
          dpm_table = &dpm_context->dpm_tables.gfx_table;
          dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
          if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                  /* In the case of gfxclk, only fine-grained dpm is honored.
                   * Get min/max values from FW.
--

2.49.0

Reviewed-by
#5 lore raw

AMD General

With follow up patch already sent to update smu_cmn_print_dpm_clk_levels logic, there is no more update needed here

Thanks & Regards
Asad

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 2:45 PM
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 18 lines · Yang(Kevin)

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 15:56
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 4 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

Quoted 8 lines
Quoted 1 line

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

[kevin]:
No, this should be an independent issue, and you need to maintain consistent code logic with other SMU functions. e.g: all locations where the smu_v13_0_set_single_dpm_table() function is invoked.

The issue is because smu_cmn_print_dpm_clk_levels is hardcoding number of levels to 2 for fine grained regardless of dpm enablement status. I think the fix should be there rather than at other places. If the count is only 1, it shouldn't keep the hardcoded value as 2.

Thanks,
Lijo

Quoted 50 lines

Best Regards,
Kevin

Thanks,
Lijo

Quoted 43 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13

SOCs")

---
   drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
   1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
          /* gfxclk dpm table setup */
          dpm_table = &dpm_context->dpm_tables.gfx_table;
          dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
          if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                  /* In the case of gfxclk, only fine-grained dpm is honored.
                   * Get min/max values from FW.
--

2.49.0

Reviewed-by Asad Kamal
#6 lore raw

AMD General

Sorry, I need to revoke my Reviewed-by.
I object to adding this custom workaround for SMU v13.0.6 in the SMU common layer.
The concern is that this stems from an incorrect this patch, then adding an additional workaround to compensate for that incorrect change is not appropriate.

Best Regards,
Kevin

-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Monday, April 27, 2026 20:00
To: Lazar, Lijo <[email protected]>; Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Subject: RE: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

AMD General

With follow up patch already sent to update smu_cmn_print_dpm_clk_levels logic, there is no more update needed here

Thanks & Regards
Asad

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 2:45 PM
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 18 lines · Yang(Kevin)

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 15:56
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 4 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

Quoted 8 lines
Quoted 1 line

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

[kevin]:
No, this should be an independent issue, and you need to maintain consistent code logic with other SMU functions. e.g: all locations where the smu_v13_0_set_single_dpm_table() function is invoked.

The issue is because smu_cmn_print_dpm_clk_levels is hardcoding number of levels to 2 for fine grained regardless of dpm enablement status. I think the fix should be there rather than at other places. If the count is only 1, it shouldn't keep the hardcoded value as 2.

Thanks,
Lijo

Quoted 50 lines

Best Regards,
Kevin

Thanks,
Lijo

Quoted 43 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13

SOCs")

---
   drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
   1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
          /* gfxclk dpm table setup */
          dpm_table = &dpm_context->dpm_tables.gfx_table;
          dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
          if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                  /* In the case of gfxclk, only fine-grained dpm is honored.
                   * Get min/max values from FW.
--

2.49.0

#7 lore raw
Quoted 6 lines · Yang(Kevin)

AMD General

Sorry, I need to revoke my Reviewed-by.
I object to adding this custom workaround for SMU v13.0.6 in the SMU common layer.
The concern is that this stems from an incorrect this patch, then adding an additional workaround to compensate for that incorrect change is not appropriate.

This is not a custom workaround, but rather an issue with common implementation. Flags is a property of the clock table. In older SMU13 SOCs, fine grained status query also required DPM to be enabled for that clock; hence there is a dependency on DPM enablement.

In newer SOCs, there is no such concept, rather the property is set in the clock table for the clock type. Thus DPM enablement is not a mandatory requirement for the clock table property.

The current common logic assumes that table for fine grained clock type always will have 2 levels enabled regardless of DPM enablement. That is not the case when DPM is not enabled for that particular clock.

Thanks,
Lijo

Quoted 115 lines

Best Regards,
Kevin

-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Monday, April 27, 2026 20:00
To: Lazar, Lijo <[email protected]>; Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Subject: RE: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

AMD General

With follow up patch already sent to update smu_cmn_print_dpm_clk_levels logic, there is no more update needed here

Thanks & Regards
Asad

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 2:45 PM
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 18 lines · Yang(Kevin)

AMD General

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, April 27, 2026 15:56
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Quoted 4 lines · Yang(Kevin)

AMD General

+ dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;

Quoted 8 lines
Quoted 1 line

You need to move this line of code under smu_feature_is_enabled() to prevent subsequent smu_cmn_print_dpm_clk_levels() errors.

I think it's better to fix the smu_cmn_print_dpm_clk_levels() logic for that - to keep a separate path for dpm_table->count == 1.

[kevin]:
No, this should be an independent issue, and you need to maintain consistent code logic with other SMU functions. e.g: all locations where the smu_v13_0_set_single_dpm_table() function is invoked.

The issue is because smu_cmn_print_dpm_clk_levels is hardcoding number of levels to 2 for fine grained regardless of dpm enablement status. I think the fix should be there rather than at other places. If the count is only 1, it shouldn't keep the hardcoded value as 2.

Thanks,
Lijo

Quoted 50 lines

Best Regards,
Kevin

Thanks,
Lijo

Quoted 43 lines

With that fixed, the patch is

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Lijo Lazar
Sent: Monday, April 27, 2026 15:31
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] drm/amd/pm: Add fine grained flag to SMU v13.0.6

Gfx clock is fine grained on SMU v13.0.6/12 SOCs. Add the flag to report clock frequencies correctly.

Fixes 7380228401c4 ("drm/amd/pm: Use generic dpm table for SMUv13

SOCs")

---
    drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 +
    1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -1
index 40f0d8a685bf..8d04f6e73fd7 100644
@@ -1133,6 +1133,7 @@ static int smu_v13_0_6_set_default_dpm_table(struct smu_context *smu)
           /* gfxclk dpm table setup */
           dpm_table = &dpm_context->dpm_tables.gfx_table;
           dpm_table->clk_type = SMU_GFXCLK;
+       dpm_table->flags = SMU_DPM_TABLE_FINE_GRAINED;
           if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
                   /* In the case of gfxclk, only fine-grained dpm is honored.
                    * Get min/max values from FW.
--

2.49.0