All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v7 6/9] drm/msm/dp: don't take extra references on multiple plug events
Date: Fri, 23 Oct 2026 14:01:46 +0000	[thread overview]
Message-ID: <sashiko-outbox-182862@kernel.org> (raw)
In-Reply-To: <20261023-hpd-irq-events-v7-6-57a3aea3f09e@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: msm_dp_hpd_plug_handle() skips hpd_high after detect()
--

commit c63c7584ce165272a5840e2bdd5f618e2bd07d8f
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

drm/msm/dp: don't take extra references on multiple plug events

This commit skips further HPD plug events in msm_dp_hpd_plug_handle() if
dp->plugged is already set, avoiding extra runtime PM references until an
unplug event is received.

> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index fa8942922b533..ce919a26fba28 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -412,6 +412,9 @@ static int msm_dp_hpd_plug_handle(struct msm_dp_display_private *dp)
>  
>  	guard(mutex)(&dp->plugged_lock);
>  
> +	if (dp->plugged)
> +		return 0;

[Severity: High]
Can this cause msm_dp_display_process_hpd_high() to be skipped altogether
when msm_dp_bridge_detect() runs before msm_dp_hpd_plug_handle()?

In drivers/gpu/drm/display/drm_bridge_connector.c,
drm_bridge_connector_detect_ctx() invokes the bridge detect callback
immediately before notifying HPD:

	if (detect) {
		status = detect->funcs->detect(detect, connector);
		...
		drm_bridge_connector_hpd_notify(connector, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
	}

When a DisplayPort sink is connected and drm_bridge_connector_detect_ctx()
runs (for example during boot-time connector probing, resume, or
DRM_IOCTL_MODE_GETCONNECTOR before an HPD interrupt is processed),
msm_dp_bridge_detect() reads DPCD into a local buffer and sets
priv->plugged = true without calling msm_dp_display_process_hpd_high():

	status = connector_status_connected;
	priv->plugged = true;

When drm_bridge_connector_hpd_notify() -> msm_dp_bridge_hpd_notify() ->
msm_dp_hpd_plug_handle() then runs, or when a subsequent HPD plug event
arrives, this new check sees dp->plugged == true and returns early.

Because msm_dp_display_process_hpd_high() is never called, LTTPR,
dp->panel->link_info, connector EDID, dp->link->sink_count, and
dp->audio_supported remain uninitialized, causing msm_dp_bridge_get_modes()
to return 0 modes, msm_dp_display_mode_valid() to reject modes with
MODE_BAD, and msm_dp_display_prepare_link() to fail with -ENOTCONN.

Also, at the end of msm_dp_hpd_plug_handle():

	ret = msm_dp_display_process_hpd_high(dp);
	...
	dp->plugged = true;

	return ret;

dp->plugged is set to true even when msm_dp_display_process_hpd_high()
fails, which with this early return prevents subsequent HPD plug events
from retrying initialization.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-hpd-irq-events-v7-0-57a3aea3f09e@oss.qualcomm.com?part=6

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v7 6/9] drm/msm/dp: don't take extra references on multiple plug events
Date: Fri, 23 Oct 2026 14:01:46 +0000	[thread overview]
Message-ID: <sashiko-outbox-182862@kernel.org> (raw)
In-Reply-To: <20261023-hpd-irq-events-v7-6-57a3aea3f09e@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: msm_dp_hpd_plug_handle() skips hpd_high after detect()
--

commit c63c7584ce165272a5840e2bdd5f618e2bd07d8f
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

drm/msm/dp: don't take extra references on multiple plug events

This commit skips further HPD plug events in msm_dp_hpd_plug_handle() if
dp->plugged is already set, avoiding extra runtime PM references until an
unplug event is received.

> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index fa8942922b533..ce919a26fba28 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -412,6 +412,9 @@ static int msm_dp_hpd_plug_handle(struct msm_dp_display_private *dp)
>  
>  	guard(mutex)(&dp->plugged_lock);
>  
> +	if (dp->plugged)
> +		return 0;

[Severity: High]
Can this cause msm_dp_display_process_hpd_high() to be skipped altogether
when msm_dp_bridge_detect() runs before msm_dp_hpd_plug_handle()?

In drivers/gpu/drm/display/drm_bridge_connector.c,
drm_bridge_connector_detect_ctx() invokes the bridge detect callback
immediately before notifying HPD:

	if (detect) {
		status = detect->funcs->detect(detect, connector);
		...
		drm_bridge_connector_hpd_notify(connector, status, DRM_CONNECTOR_NO_EXTRA_STATUS);
	}

When a DisplayPort sink is connected and drm_bridge_connector_detect_ctx()
runs (for example during boot-time connector probing, resume, or
DRM_IOCTL_MODE_GETCONNECTOR before an HPD interrupt is processed),
msm_dp_bridge_detect() reads DPCD into a local buffer and sets
priv->plugged = true without calling msm_dp_display_process_hpd_high():

	status = connector_status_connected;
	priv->plugged = true;

When drm_bridge_connector_hpd_notify() -> msm_dp_bridge_hpd_notify() ->
msm_dp_hpd_plug_handle() then runs, or when a subsequent HPD plug event
arrives, this new check sees dp->plugged == true and returns early.

Because msm_dp_display_process_hpd_high() is never called, LTTPR,
dp->panel->link_info, connector EDID, dp->link->sink_count, and
dp->audio_supported remain uninitialized, causing msm_dp_bridge_get_modes()
to return 0 modes, msm_dp_display_mode_valid() to reject modes with
MODE_BAD, and msm_dp_display_prepare_link() to fail with -ENOTCONN.

Also, at the end of msm_dp_hpd_plug_handle():

	ret = msm_dp_display_process_hpd_high(dp);
	...
	dp->plugged = true;

	return ret;

dp->plugged is set to true even when msm_dp_display_process_hpd_high()
fails, which with this early return prevents subsequent HPD plug events
from retrying initialization.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-hpd-irq-events-v7-0-57a3aea3f09e@oss.qualcomm.com?part=6

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-10-23 14:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 13:39 [PATCH v7 0/9] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
2026-10-23 13:39 ` Dmitry Baryshkov
2026-10-23 13:39 ` [PATCH v7 1/9] drm/connector: report out-of-band IRQ_HPD events Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:53   ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 2/9] drm/connector: pass down IRQ_HPD to the drivers Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:45   ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 3/9] drm/bridge: " Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:48   ` sashiko-bot
2026-10-23 13:48     ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 4/9] drm/bridge: pass extra events to the HPD callback Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:49   ` sashiko-bot
2026-10-23 13:49     ` sashiko-bot
2026-10-23 13:58   ` Dmitry Baryshkov
2026-10-23 13:58     ` Dmitry Baryshkov
2026-10-23 13:39 ` [PATCH v7 5/9] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:44   ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 6/9] drm/msm/dp: don't take extra references on multiple plug events Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 14:01   ` sashiko-bot [this message]
2026-10-23 14:01     ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 7/9] drm/msm/dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 14:05   ` sashiko-bot
2026-10-23 14:05     ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 8/9] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:44   ` sashiko-bot
2026-10-23 13:39 ` [PATCH v7 9/9] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
2026-10-23 13:39   ` Dmitry Baryshkov
2026-10-23 13:45   ` sashiko-bot
2026-10-23 13:50 ` ✓ CI.KUnit: success for drm: handle IRQ_HPD events correctly (rev8) Patchwork
2026-10-23 14:26 ` ✓ i915.CI.BAT: " Patchwork
2026-10-23 14:29 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-23 19:26 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-23 21:03 ` ✓ i915.CI.Full: success " Patchwork

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-182862@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neil.armstrong@linaro.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.