[PATCH 6.18 117/752] drm/amd/display: Guard FAMS2 configuration updates

Sasha Levin
2026-02-28T17:49:47Z

From: Dillon Varone <Dillon.Varone@amd.com>

[ Upstream commit 7dedb906cdfec100061daf41f8e54266e975987d ]

[WHY&HOW]
If DMCUB is not initialized or FAMS2 is not supported, the
interface should not be called.

Reviewed-by: Sridevi Arvindekar <sridevi.arvindekar@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index 77cdd02a41bdd..bbfefc9edd1f1 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -1628,7 +1628,8 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx,
void dcn401_hardware_release(struct dc *dc)
{
if (!dc->debug.disable_force_pstate_allow_on_hw_release) {
- dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
+ if (dc->ctx->dmub_srv && dc->debug.fams2_config.bits.enable)
+ dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);

/* If pstate unsupported, or still supported
* by firmware, force it supported by dcn
@@ -1648,7 +1649,9 @@ void dcn401_hardware_release(struct dc *dc)
dc->clk_mgr->clks.p_state_change_support = false;
dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, dc->current_state, true);
}
- dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
+
+ if (dc->ctx->dmub_srv && dc->debug.fams2_config.bits.enable)
+ dc_dmub_srv_fams2_update_config(dc, dc->current_state, false);
}
}

--
2.51.0