From: Sasha Levin <sashal@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Alex Deucher <alexdeucher@gmail.com>,
Alex Deucher <alexander.deucher@amd.com>,
Ilya Shidlovskiy <shidlovskiyilya@gmail.com>,
Kenneth Feng <kenneth.feng@amd.com>,
Kevin Wang <kevin.wang@amd.com>,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-next@vger.kernel.org
Subject: [PATCH linux-next] drm/amd/pm: bring back od_uclk_changed dropped by the amdgpu merge
Date: Tue, 10 Nov 2026 21:40:32 -0500 [thread overview]
Message-ID: <20261111024032.760400-1-sashal@kernel.org> (raw)
In-Reply-To: <avNxxfHK_Zh2GN2o@sirena.org.uk>
The amdgpu tree adds od_uclk_changed to struct smu_table_context in
commit 62d932f72037 ("drm/amd/pm: smu13.0.0: refresh the UCLK DPM table
after an OD_MCLK change"). It sits right next to user_od_feature_mask,
which mainline added too, so amdgpu_smu.h conflicts, and the merge
dropped the new field.
After that, commit c62c2736d82f ("amdgpu: Merge merge merge cherry-pick
cherry-pick cherry-pick") made smu_od_uclk_changed() return false and
removed the code that sets the flag. So DC never re-reads the UCLK
levels after an overdrive change, which is the whole point of
commit b7483797b085 ("drm/amd: let DC re-read UCLK DPM levels after an
OD_MCLK change").
Keep both fields and put the removed code back.
Fixes: af8e519642bd ("Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux.git")
Link: https://lore.kernel.org/all/avNxxfHK_Zh2GN2o@sirena.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Mark, this is against next-20261110. Please fold it into the amdgpu merge;
it replaces the smu_od_uclk_changed() part of c62c2736d82f.
With this the three files are the same as in the amdgpu tree.
Found by comparing with our llminus-assisted integration tree. Build tested
only.
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++++++++-
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 ++
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index ff51ff875bfed..86e34e814fe6a 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -601,6 +601,9 @@ static void smu_restore_dpm_user_profile(struct smu_context *smu)
ret = smu->ppt_funcs->restore_user_od_settings(smu);
if (ret)
dev_err(smu->adev->dev, "Failed to upload customized OD settings\n");
+ else if (smu_od_uclk_changed(smu))
+ /* DC read the stock UCLK levels in its init_hw */
+ amdgpu_dm_update_memclk_states(smu->adev);
}
}
@@ -3701,7 +3704,11 @@ static int smu_baco_set_state(void *handle, int state)
*/
bool smu_od_uclk_changed(struct smu_context *smu)
{
- return false;
+ bool changed = smu->smu_table.od_uclk_changed;
+
+ smu->smu_table.od_uclk_changed = false;
+
+ return changed;
}
bool smu_mode1_reset_is_support(struct smu_context *smu)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
index 41d665591d62a..2a0cdc6e80596 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
@@ -434,6 +434,8 @@ struct smu_table_context {
void *user_overdrive_table;
uint32_t user_od_feature_mask;
+ /* Set when an OD commit/restore changed the UCLK levels */
+ bool od_uclk_changed;
struct smu_driver_table driver_tables[SMU_DRIVER_TABLE_COUNT];
};
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index 02bd2b15066cc..1a02ba70d3000 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -1306,6 +1306,8 @@ static void smu_v13_0_0_od_refresh_uclk_table(struct smu_context *smu)
dev_err(smu->adev->dev, "Failed to refresh UCLK dpm table!\n");
return;
}
+
+ smu->smu_table.od_uclk_changed = true;
}
static int smu_v13_0_0_emit_clk_levels(struct smu_context *smu,
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
--
2.53.0
prev parent reply other threads:[~2026-11-11 2:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 19:34 linux-next: manual merge of the amdgpu tree with the origin tree Mark Brown
2026-11-11 2:40 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261111024032.760400-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=broonie@kernel.org \
--cc=kenneth.feng@amd.com \
--cc=kevin.wang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=shidlovskiyilya@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®