From: sashiko-bot@kernel.org
To: "Dave Airlie" <airlied@redhat.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 15/19] drm/amd/display: Add dc_force_max_dramclk for the DP compliance workaround
Date: Thu, 12 Nov 2026 02:02:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-210138@kernel.org> (raw)
In-Reply-To: <20261112-amdgpu-dc-cleanup-v1-15-0fae41718ad2@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amd/display: NULL pointer dereference in
dc_force_max_dramclk()
--
commit b8f4fd55c6e73f430098a070c075751210c4007a
Author: Dave Airlie <airlied@redhat.com>
drm/amd/display: Add dc_force_max_dramclk for the DP compliance workaround
This commit moves the DP compliance test pattern memory clock workaround from
dm_helpers_dp_handle_test_pattern_request() into a new dc_force_max_dramclk()
helper in DC and removes the dc_get_clk_mgr() accessor.
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 8344d821d2e87..15379b186a91f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -7357,6 +7357,29 @@ void dc_set_edp_power(const struct dc *dc, struct dc_link *edp_link,
> edp_link->dc->link_srv->edp_set_panel_power(edp_link, powerOn);
> }
>
> +/**
> + * dc_force_max_dramclk() - raise the memory clock for DP compliance tests
> + * @dc: Current DC state
> + * @context: The state whose clocks are programmed
> + *
> + * Temporary workaround for DP compliance test failures: disallow p-state
> + * switching for the given state, raise the memory clock to the maximum
> + * supported level and apply the resulting clocks immediately.
> + */
> +void dc_force_max_dramclk(struct dc *dc, struct dc_state *context)
> +{
> + context->bw_ctx.bw.dcn.clk.p_state_change_support = false;
> + context->bw_ctx.bw.dcn.clk.dramclk_khz =
> + dc->clk_mgr->dc_mode_softmax_enabled ?
> + dc->clk_mgr->bw_params->dc_mode_softmax_memclk :
> + dc->clk_mgr->bw_params->max_memclk_mhz;
> + context->bw_ctx.bw.dcn.clk.idle_dramclk_khz =
> + context->bw_ctx.bw.dcn.clk.dramclk_khz;
> +
> + if (dc->clk_mgr && dc->clk_mgr->funcs->update_clocks)
> + dc->clk_mgr->funcs->update_clocks(dc->clk_mgr, context, false);
> +}
[Severity: High]
Can this dereference a NULL dc->clk_mgr or dc->clk_mgr->bw_params?
dc->clk_mgr is dereferenced before the NULL check on dc->clk_mgr below, and
dc->clk_mgr->bw_params is not checked at all. In dc_clk_mgr_create(),
bw_params is only populated on DCN 2.1 and DCN 3.0+ and remains NULL on DCE,
DCN 1.0, and DCN 2.0/2.01 (which is why dc_refresh_memclk_states() in this
file checks both !dc->clk_mgr and !dc->clk_mgr->bw_params). A DP link test
pattern request via dm_helpers_dp_handle_test_pattern_request() on those
ASICs will crash with a NULL pointer dereference.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-amdgpu-dc-cleanup-v1-0-0fae41718ad2@redhat.com?part=15
next prev parent reply other threads:[~2026-11-12 2:02 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 1:43 [PATCH 00/19] drm/amd/display: refactor DC interfaces to abstract it better Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 01/19] drm/amd/display: Drop the dead vmid module Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 02/19] drm/amd/display: Add DC accessors as the first step to opaque struct dc Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 03/19] drm/amd/display: Take struct dc in public DSC compute helpers Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 04/19] drm/amd/display/amdgpu_dm: Use DC accessors in audio/color/backlight paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:50 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 05/19] drm/amd/display/amdgpu_dm: Use DC accessors in psr/replay/dmub/hdcp/irq paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 2:07 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 06/19] drm/amd/display/amdgpu_dm: Use DC accessors in plane/crtc/helpers paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:58 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 07/19] drm/amd/display/amdgpu_dm: Use DC accessors in connector paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 08/19] drm/amd/display: Use DC accessors in DAL modules Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 09/19] drm/amd/display/amdgpu_dm: Use DC accessors in debugfs paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:53 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 10/19] drm/amd/display/amdgpu_dm: Use DC accessors in the DM core paths Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 11/19] drm/amd/display/amdgpu_dm: Finish DC accessor migration for non-test code Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:53 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 12/19] drm/amd/display: Migrate amdgpu_dm KUnit tests off struct dc internals Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:59 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 13/19] drm/amd/display: Move struct dc out of the public dc.h Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 14/19] drm/amd/display: Restrict the dc directory root to DC-internal builds Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 2:08 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 15/19] drm/amd/display: Add dc_force_max_dramclk for the DP compliance workaround Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 2:02 ` sashiko-bot [this message]
2026-11-12 1:43 ` [PATCH 16/19] drm/amd/display: Add DC primitives for ABM hardware programming Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 2:01 ` sashiko-bot
2026-11-12 1:43 ` [PATCH 17/19] drm/amd/display: Replace the dc_get_res_pool accessor with purpose APIs Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 1:43 ` [PATCH 18/19] drm/amd/display: Replace dc_get_config with per-option config reads Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 20:31 ` Harry Wentland
2026-11-12 1:43 ` [PATCH 19/19] drm/amd/display: Replace dc_get_caps with purpose-built capability queries Dave Airlie
2026-11-12 1:43 ` Dave Airlie via B4 Relay
2026-11-12 2:14 ` sashiko-bot
2026-11-12 19:41 ` Harry Wentland
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=sashiko-outbox-210138@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=airlied@redhat.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.