mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org
Subject: Re: [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events
Date: Sun, 12 Jul 2026 13:33:37 +0300	[thread overview]
Message-ID: <famoeog5snpvj24b6izwox2gy74ywnwmybflfv2tvr4hjuix5q@cbtce5s7k7sv> (raw)
In-Reply-To: <20260629-msm-dp-msttypec-v1-2-646a10256233@oss.qualcomm.com>

On Mon, Jun 29, 2026 at 10:48:04PM +0800, Yongxing Mou wrote:
> The bridge connector HPD handling path currently updates
> connector->status for every hpd_notify() invocation.
> 
> This does not work well for IRQ-only notifications where the event being
> reported is carried by extra_status and no connector status transition is
> associated with it.
> 
> One example is DP MST. HPD IRQs are propagated through
> drm_bridge_hpd_notify_*() so that bridge drivers can process the
> notification. During MST operation, however, the SST connector attached
> to the bridge connector is intentionally kept disconnected while the MST
> topology manager handles all connector creation, removal and hotplug
> processing.
> 
> Updating connector->status for an IRQ-only MST notification may cause
> the SST connector state to oscillate between connected and disconnected
> depending on the notification path. These artificial state transitions
> can later be detected by the polling logic and result in unnecessary
> hotplug events being generated. Userspace then re-probes connector
> status, potentially triggering the same sequence again.

Then the API might need to be adjusted.

Remember, we have two usecases, which we must be able to interpret
correctly:
- The driver gets separate HPD and IRQ_HPD events.
- The driver gets HPD and IRQ_HPD at the same time.

> 
> Treat notifications with status == connector_status_unknown and a valid
> extra_status as IRQ-only events. Forward the notification to bridge
> drivers without modifying connector->status.
> 
> This keeps IRQ delivery working while leaving connector state management
> to the component that actually owns it, such as the DP MST topology
> framework.

How is it handled by other drivers (i915, amd, nouveau)?

> 
> Signed-off-by: Yongxing Mou <yongxing.mou@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/display/drm_bridge_connector.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 5edca47a025f..7334d6677604 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -163,6 +163,18 @@ static void drm_bridge_connector_handle_hpd(struct drm_bridge_connector *drm_bri
>  	struct drm_connector *connector = &drm_bridge_connector->base;
>  	struct drm_device *dev = connector->dev;
>  
> +	/*
> +	 * IRQ-only notification: extra_status carries the event but
> +	 * status is unknown — do not overwrite connector->status.

But it's not unknown at this point. The connector status is reported
following the HPD status.

> +	 */
> +	if (status == connector_status_unknown &&
> +	    extra_status != DRM_CONNECTOR_NO_EXTRA_STATUS) {
> +		drm_bridge_connector_hpd_notify(connector,
> +						connector->status,
> +						extra_status, NULL);
> +		return;
> +	}
> +
>  	mutex_lock(&dev->mode_config.mutex);
>  	connector->status = status;
>  	mutex_unlock(&dev->mode_config.mutex);
> 
> -- 
> 2.43.0
> 

-- 
With best wishes
Dmitry

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

  reply	other threads:[~2026-07-12 10:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 14:48 [PATCH 0/5] drm/msm/dp: Add MSM Type-C MST support Yongxing Mou
2026-06-29 14:48 ` [PATCH 1/5] drm/bridge: allow hpd_notify() to suppress connector hotplug events Yongxing Mou
2026-07-12 10:21   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 2/5] drm/bridge_connector: preserve connector status for IRQ-only HPD events Yongxing Mou
2026-07-12 10:33   ` Dmitry Baryshkov [this message]
2026-06-29 14:48 ` [PATCH 3/5] drm/msm/dp: suppress bridge hotplug events during MST operation Yongxing Mou
2026-07-12 10:44   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 4/5] drm/msm/dp: report IRQ_HPD as an IRQ-only notification Yongxing Mou
2026-07-12 10:55   ` Dmitry Baryshkov
2026-06-29 14:48 ` [PATCH 5/5] drm/msm/dp: mark the SST connector disconnected when MST is enabled Yongxing Mou
2026-07-12 10:56   ` Dmitry Baryshkov

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=famoeog5snpvj24b6izwox2gy74ywnwmybflfv2tvr4hjuix5q@cbtce5s7k7sv \
    --to=dmitry.baryshkov@oss.qualcomm.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jbrunet@baylibre.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jesszhan0024@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=khilman@baylibre.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marijn.suijten@somainline.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    --cc=yongxing.mou@oss.qualcomm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox