All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Robert Ijtsma" <robertijtsma@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/msm/dp: clear AUX_TRANS_CTRL on reset and enable HPD_REFTIMER
Date: Wed, 25 Nov 2026 11:56:04 +0000	[thread overview]
Message-ID: <sashiko-outbox-233304@kernel.org> (raw)
In-Reply-To: <20261125-drm-msm-dp-aux-resume-v1-1-17f5a40b9a61@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/msm/dp: msm_dp_aux_reset() gated on internal HPD and
  skipped on timeout
- [Medium] drm/msm/dp: msm_dp_aux_hpd_disable() disables reftimer while
  AUX is active
--

commit 348e835311cd64ac96d86e0a747eaee01eb395a2
Author: Robert Ijtsma <robertijtsma@gmail.com>

drm/msm/dp: clear AUX_TRANS_CTRL on reset and enable HPD_REFTIMER

This commit clears REG_DP_AUX_TRANS_CTRL in msm_dp_aux_reset() and enables
DP_DP_HPD_REFTIMER_ENABLE in msm_dp_aux_enable() so AUX transactions work
on boards that do not use internal HPD.

> diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
> index b52393dcc0670..2584dbf960431 100644
> --- a/drivers/gpu/drm/msm/dp/dp_aux.c
> +++ b/drivers/gpu/drm/msm/dp/dp_aux.c
> @@ -76,6 +76,8 @@ static void msm_dp_aux_reset(struct msm_dp_aux_private *aux)
>  {
>  	u32 aux_ctrl;
>  
> +	msm_dp_write_aux(aux, REG_DP_AUX_TRANS_CTRL, 0);

[Severity: Medium]
Is msm_dp_aux_reset() ever reached when internal HPD is disabled?

The only active caller is msm_dp_aux_transfer(), which gates the reset on
msm_dp_aux_is_link_connected():

drivers/gpu/drm/msm/dp/dp_aux.c:msm_dp_aux_transfer() {
    ...
	if (ret < 0) {
		if (aux->native) {
			aux->retry_cnt++;
			if (!(aux->retry_cnt % MAX_AUX_RETRIES))
				phy_calibrate(aux->phy);
		}
		/* reset aux if link is in connected state */
		if (msm_dp_aux_is_link_connected(msm_dp_aux))
			msm_dp_aux_reset(aux);
	} else {
    ...
}

msm_dp_aux_is_link_connected() reads the internal HPD state machine status
bits from REG_DP_DP_HPD_INT_STATUS, which stay 0 when internal HPD_CTRL is
never enabled, so msm_dp_aux_reset() is skipped on external-HPD boards.

In addition, once DP_DP_HPD_REFTIMER_ENABLE is set, hardware AUX timeouts
raise DP_INTR_TIMEOUT in msm_dp_aux_isr(), which sets aux->aux_error_num =
DP_AUX_ERR_TOUT and completes aux->comp.  msm_dp_aux_cmd_fifo_tx() then
returns a non-negative value and msm_dp_aux_transfer() takes the else
branch, returning -ETIMEDOUT without calling msm_dp_aux_reset() or clearing
REG_DP_AUX_TRANS_CTRL.

> +
>  	aux_ctrl = msm_dp_read_aux(aux, REG_DP_AUX_CTRL);
>  
>  	aux_ctrl |= DP_AUX_CTRL_RESET;
> @@ -88,7 +90,12 @@ static void msm_dp_aux_reset(struct msm_dp_aux_private *aux)
>  
>  static void msm_dp_aux_enable(struct msm_dp_aux_private *aux)
>  {
> -	u32 aux_ctrl;
> +	u32 aux_ctrl, reftimer;
> +
> +	/* Keep the 1us AUX/HPD reference timer running without internal HPD. */
> +	reftimer = msm_dp_read_aux(aux, REG_DP_DP_HPD_REFTIMER);
> +	reftimer |= DP_DP_HPD_REFTIMER_ENABLE;
> +	msm_dp_write_aux(aux, REG_DP_DP_HPD_REFTIMER, reftimer);

[Severity: Medium]
Will msm_dp_aux_hpd_disable() turn off DP_DP_HPD_REFTIMER_ENABLE while the
AUX controller is still active?

msm_dp_aux_hpd_disable() unconditionally clears DP_DP_HPD_REFTIMER_ENABLE
in REG_DP_DP_HPD_REFTIMER (while msm_dp_aux_disable() leaves it untouched).
During system suspend, drm_mode_config_helper_suspend() runs
drm_kms_helper_poll_disable() -> msm_dp_bridge_hpd_disable() ->
msm_dp_aux_hpd_disable() before drm_atomic_helper_suspend() disables active
displays.  When a display is connected and holds runtime PM active, any AUX
transactions during drm_atomic_helper_suspend() (such as
msm_dp_link_psm_config() in msm_dp_display_unprepare()) will run with the
reference timer disabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-drm-msm-dp-aux-resume-v1-1-17f5a40b9a61@gmail.com?part=1

      reply	other threads:[~2026-11-25 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 11:36 [PATCH] drm/msm/dp: clear AUX_TRANS_CTRL on reset and enable HPD_REFTIMER Robert Ijtsma
2026-11-25 11:36 ` Robert Ijtsma via B4 Relay
2026-11-25 11:56 ` sashiko-bot [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=sashiko-outbox-233304@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robertijtsma@gmail.com \
    --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.