All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: NepNep7601 <neptune@imm0nv1nhtv.is-a.dev>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/amd/display: skip receiver power control without AUX
Date: Wed, 26 Aug 2026 19:53:49 +0000	[thread overview]
Message-ID: <20260826195349.C383A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826193602.6441-1-neptune@imm0nv1nhtv.is-a.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The newly added early return in `dpcd_write_rx_power_ctrl()` incorrectly relies on `link->aux_mode` before it is initialized, causing the DP receiver power-up sequence to be skipped for all newly detected DP monitors and active dongles.
--

commit 6bcb07f6c6cfc4188f9856f76b47789a74cb855e
Author: NepNep7601 <neptune@imm0nv1nhtv.is-a.dev>

drm/amd/display: skip receiver power control without AUX
    
Passive DP to TMDS dongles do not provide a DP receiver and use native
GPIO I2C rather than AUX. dpcd_write_rx_power_ctrl() nevertheless tries
to write DP_SET_POWER, causing the DP helpers to retry a transaction
that cannot succeed 32 times before giving up. Skip receiver power
control when the link is not using AUX mode.

> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
> index 49521ac4b0e85..7991531f6ef44 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_phy.c
> @@ -50,6 +50,15 @@ void dpcd_write_rx_power_ctrl(struct dc_link *link, bool on)
>  	if (link->sync_lt_in_progress)
>  		return;
>  
> +	/*
> +	 * A passive DP to TMDS dongle presents no DP receiver, so there is
> +	 * nothing to power up or down. The write can only fail, and the DP
> +	 * helpers retry it 32 times before giving up, which adds tens of
> +	 * milliseconds to link bring up.
> +	 */
> +	if (!link->aux_mode)
> +		return;

[Severity: High]
Does this early return skip the DP receiver power-up sequence for all newly
detected DP monitors and active dongles?

During system boot or display hotplug, the dc_link struct is zero-allocated,
so link->aux_mode defaults to false. The detection sequence starts with
detect_link_and_local_sink(), which calls detect_dp() -> retrieve_link_cap()
-> dp_wa_power_up_0010FA(), eventually calling dpcd_write_rx_power_ctrl().

Since link->aux_mode is still false at this point, the early return triggers
and skips the DP_SET_POWER D0 write. This breaks detection for active dongles
(such as the 0010FA) that depend on being powered up before a DPCD read.

Looking at detect_link_and_local_sink() in link_detection.c, link->aux_mode
is actually initialized after detect_dp() has already executed and failed:

drivers/gpu/drm/amd/display/dc/link/link_detection.c:detect_link_and_local_sink() {
    ...
    if (!detect_dp(link, &sink_caps, reason)) {
    ...
    link->aux_mode =
            link_is_in_aux_transaction_mode(link->ddc);
    ...
}

Should we ensure link->aux_mode is initialized earlier in the detection flow,
or use a different condition to skip the power control write?

> +
>  	core_link_write_dpcd(link, DP_SET_POWER, &state,
>  						 sizeof(state));
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826193602.6441-1-neptune@imm0nv1nhtv.is-a.dev?part=1

  parent reply	other threads:[~2026-08-26 19:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260826170549.21985-1-neptune@imm0nv1nhtv.is-a.dev>
2026-08-26 17:21 ` [PATCH] drm/amd/display: fall back to software I2C on hardware engine failure sashiko-bot
2026-08-26 19:36 ` [PATCH 1/2] drm/amd/display: skip receiver power control without AUX NepNep7601
2026-08-26 19:36   ` [PATCH 2/2] drm/amd/display: close DDC on I2C engine setup failure NepNep7601
2026-08-26 19:48     ` sashiko-bot
2026-08-26 19:53   ` sashiko-bot [this message]
2026-08-26 20:44 ` [PATCH v2 1/2] drm/amd/display: skip receiver power control without AUX NepNep7601
2026-08-26 20:44   ` [PATCH v2 2/2] drm/amd/display: close DDC on I2C engine setup failure NepNep7601
2026-08-26 20:55     ` sashiko-bot
2026-09-11 11:55     ` NepNep7601

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=20260826195349.C383A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=neptune@imm0nv1nhtv.is-a.dev \
    --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.