drm/[radeon|amdgpu]: Add HAINAN clock adjustment
Subsystems (3)
PATCH 1/1 drm/[radeon|amdgpu]: Add HAINAN clock adjustment
Currently, the AMD Radeon R5 M420 GPU is unstable when operating at the default maximum 850MHz/1000MHz (core/memory) clock speeds. For example, a game may stop working within one minute after starting up. When using the amdgpu driver, the process stops with exitcode 6 and the following message is printed: "amdgpu: The CS has cancelled because the context is lost. This context is innocent."
From my testing, limiting the clock speeds to 800/950 MHz makes it work perfectly stably.
--- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 4 ++++ drivers/gpu/drm/radeon/si_dpm.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +4 -0
@@ -3468,6 +3468,10 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev, max_sclk =60000 ; max_mclk =80000 ; } +if (adev->pdev->device ==0x666f ) { + max_sclk =80000 ; + max_mclk =95000 ; + } }else if (adev->asic_type ==CHIP_OLAND ) { if ((adev->pdev->revision == 0xC7) || (adev->pdev->revision == 0x80) ||
drivers/gpu/drm/radeon/si_dpm.c +4 -0
@@ -2925,6 +2925,10 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, max_sclk =60000 ; max_mclk =80000 ; } +if (rdev->pdev->device ==0x666f ) { + max_sclk =80000 ; + max_mclk =95000 ; + } }else if (rdev->family ==CHIP_OLAND ) { if ((rdev->pdev->revision == 0xC7) || (rdev->pdev->revision == 0x80) ||
Signature · 1 line
2.43.0
Quoted 5 lines · On Sat, Jan 17, 2026 at 2:17 PM decce6 <[email protected]> wrote:
Currently, the AMD Radeon R5 M420 GPU is unstable when operating at the default maximum 850MHz/1000MHz (core/memory) clock speeds. For example, a game may stop working within one minute after starting up. When using the amdgpu driver, the process stops with exitcode 6 and the following message is printed: "amdgpu: The CS has cancelled because the context is lost. This context is innocent."
From my testing, limiting the clock speeds to 800/950 MHz makes it work perfectly stably.
Thanks for the patch. What revision is your chip? Can you add the revision check as well? Can you also split this into two patches, one for amdgpu and one for radeon?
Alex
Quoted 40 lines
Signed-off-by decce6 <[email protected]>--- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 4 ++++ drivers/gpu/drm/radeon/si_dpm.c | 4 ++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +4
-0@@ -3468,6 +3468,10 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev, max_sclk =60000 ; max_mclk =80000 ; } +if (adev->pdev->device ==0x666f ) { + max_sclk =80000 ; + max_mclk =95000 ; + } }else if (adev->asic_type ==CHIP_OLAND ) { if ((adev->pdev->revision == 0xC7) || (adev->pdev->revision == 0x80) ||drivers/gpu/drm/radeon/si_dpm.c +4
-1@@ -2925,6 +2925,10 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, max_sclk =60000 ; max_mclk =80000 ; } +if (rdev->pdev->device ==0x666f ) { + max_sclk =80000 ; + max_mclk =95000 ; + } }else if (rdev->family ==CHIP_OLAND ) { if ((rdev->pdev->revision == 0xC7) || (rdev->pdev->revision == 0x80) || --2.43.0
PATCH 1/1 drm/[radeon|amdgpu]: Add HAINAN clock adjustment
Thank you for the instructions. I can split the patches later. The revision is 0x00, is that correct? I did not check the revision seeing the adjustment for other cards only checked either the device or the revision. Should I change it to apply only when both device and revision match mine?
Quoted 3 lines · On Sun, Feb 1, 2026 at 6:12 AM decce6 <[email protected]> wrote:
Thank you for the instructions. I can split the patches later. The revision is
0x00, is that correct? I did not check the revision seeing the adjustment for other cards only checked either the device or the revision. Should I change it to apply only when both device and revision match mine?
Yes please match the revision as well. Thanks!
Alex