AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/pm/si: Check AMD_IS_MOBILITY flag for PPSMC_SYSTEMFLAG_GPIO_DC
@ 2026-09-23 12:03 Timur Kristóf
  2026-09-23 19:59 ` Mario Limonciello
  0 siblings, 1 reply; 3+ messages in thread
From: Timur Kristóf @ 2026-09-23 12:03 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher, Natalie Vock, Melissa Wen,
	Mario Limonciello, Tvrtko Ursulin
  Cc: Timur Kristóf

Unfortunately, some desktop boards eg. the FirePro D500
have the HARDWAREDC platform flag set and also have
a battery power state configured in their VBIOS.
This makes no sense for a desktop GPU and results in
incorrect behaviour: the clocks are stuck at lowest.

We observed that the kernel driver can work around
the issue in two possible ways:
1. Set PPSMC_SWSTATE_FLAG_DC on all power states
2. Clear PPSMC_SYSTEMFLAG_GPIO_DC

We think that the PPSMC_SYSTEMFLAG_GPIO_DC flag
makes the SMC assume it's running on battery even
though this is a desktop machine with no battery,
and that's why it doesn't do DPM on power states
without PPSMC_SYSTEMFLAG_GPIO_DC.

Issue was uncovered by "Fix updating clock limits from
power states" because previously the limits for the
battery state were not tracked separately. However,
battery power state has lower frequencies and voltages,
so the kernel doesn't set the DC flag on the current
power state anymore. That causes the SMC to be stuck
on the lowest clocks.

Let's clear PPSMC_SYSTEMFLAG_GPIO_DC on desktop GPUs.
We can use the AMD_IS_MOBILITY flag to determine that.

Fixes: e6c5d36756e7 ("drm/amd/pm/si: Fix updating clock limits from power states")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/16352
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 6cc414a8a4de..d090dcada1b4 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -5263,7 +5263,8 @@ static int si_init_smc_table(struct amdgpu_device *adev)
 		break;
 	}
 
-	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC)
+	if ((adev->flags & AMD_IS_MOBILITY) &&
+	    (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC))
 		table->systemFlags |= PPSMC_SYSTEMFLAG_GPIO_DC;
 
 	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REGULATOR_HOT) {
-- 
2.55.0


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

* Re: [PATCH 1/2] drm/amd/pm/si: Check AMD_IS_MOBILITY flag for PPSMC_SYSTEMFLAG_GPIO_DC
  2026-09-23 12:03 Timur Kristóf
@ 2026-09-23 19:59 ` Mario Limonciello
  0 siblings, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2026-09-23 19:59 UTC (permalink / raw)
  To: Timur Kristóf, amd-gfx, Alexander.Deucher, Natalie Vock,
	Melissa Wen, Tvrtko Ursulin



On 9/23/26 07:03, Timur Kristóf wrote:
> Unfortunately, some desktop boards eg. the FirePro D500
> have the HARDWAREDC platform flag set and also have
> a battery power state configured in their VBIOS.
> This makes no sense for a desktop GPU and results in
> incorrect behaviour: the clocks are stuck at lowest.
> 
> We observed that the kernel driver can work around
> the issue in two possible ways:
> 1. Set PPSMC_SWSTATE_FLAG_DC on all power states
> 2. Clear PPSMC_SYSTEMFLAG_GPIO_DC
> 
> We think that the PPSMC_SYSTEMFLAG_GPIO_DC flag
> makes the SMC assume it's running on battery even
> though this is a desktop machine with no battery,
> and that's why it doesn't do DPM on power states
> without PPSMC_SYSTEMFLAG_GPIO_DC.
> 
> Issue was uncovered by "Fix updating clock limits from
> power states" because previously the limits for the
> battery state were not tracked separately. However,
> battery power state has lower frequencies and voltages,
> so the kernel doesn't set the DC flag on the current
> power state anymore. That causes the SMC to be stuck
> on the lowest clocks.
> 
> Let's clear PPSMC_SYSTEMFLAG_GPIO_DC on desktop GPUs.
> We can use the AMD_IS_MOBILITY flag to determine that.
> 
> Fixes: e6c5d36756e7 ("drm/amd/pm/si: Fix updating clock limits from power states")
> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/16352
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> ---
>   drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> index 6cc414a8a4de..d090dcada1b4 100644
> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> @@ -5263,7 +5263,8 @@ static int si_init_smc_table(struct amdgpu_device *adev)
>   		break;
>   	}
>   
> -	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC)
> +	if ((adev->flags & AMD_IS_MOBILITY) &&
> +	    (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_HARDWAREDC))
>   		table->systemFlags |= PPSMC_SYSTEMFLAG_GPIO_DC;
>   
>   	if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_REGULATOR_HOT) {

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
I'll queue this up.

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

* [PATCH 1/2] drm/amd/pm/si: Check AMD_IS_MOBILITY flag for PPSMC_SYSTEMFLAG_GPIO_DC
@ 2026-09-27  0:48 contact
  0 siblings, 0 replies; 3+ messages in thread
From: contact @ 2026-09-27  0:48 UTC (permalink / raw)
  To: timur.kristof; +Cc: amd-gfx

I tested this patch on a Late 2013 Mac Pro (MacPro6,1) with dual Apple FirePro D700 (Tahiti XT, 6 GB), and can confirm that it fixes the DPM issue on the D700 as well.

Test environment:
Arch Linux
Kernel: 6.18.54-1-lts + this patch
Mesa/RADV: 26.2.3
GPU: 2x FirePro D700 (Tahiti XT, 6 GB)
Params: radeon.si_support=0 amdgpu.si_support=1

Without the patch, both D700s remained at 300 MHz SCLK / 150 MHz MCLK under Vulkan compute load.
I checked the D700 VBIOS as well: ATOM_PP_PLATFORM_CAP_HARDWAREDC is set, and it contains a battery state at 300/150 MHz.
With the patch applied to the same kernel, each D700 correctly transitions from 300/150 MHz at idle to 850/1370 MHz under load. I tested both GPUs individually and simultaneously.
As a real-world test, Ollama/Qwen3-8B fully offloaded across both GPUs sustained approximately 18.3-18.7 tokens/s, compared with ~2.34 tokens/s before the patch. One API run generated 1517 tokens in 81.24 seconds.   
I observed no amdgpu VM faults, GPU timeouts or resets during the tests.
Tested-by: Mikael Pelle contact@mikaelpelle.com


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

end of thread, other threads:[~2026-09-27 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-27  0:48 [PATCH 1/2] drm/amd/pm/si: Check AMD_IS_MOBILITY flag for PPSMC_SYSTEMFLAG_GPIO_DC contact
  -- strict thread matches above, loose matches on Subject: below --
2026-09-23 12:03 Timur Kristóf
2026-09-23 19:59 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox