Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH RESEND v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()
Date: Thu, 14 May 2026 10:44:23 +0000	[thread overview]
Message-ID: <20260514104424.04B3FC2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260513-hpd-irq-events-v3-1-086857017f16@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] IRQ_HPD events are silently dropped if a status update triggers a reconfiguration while the HPD state remains unchanged.
- [High] Deferred events in `dp_altmode_configured()` unconditionally report the display as connected and leak stale `pending_irq_hpd` / `pending_hpd` state.
--

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

drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event()

This commit extends the drm_connector_oob_hotplug_event() interface to report
DisplayPort irq events. These events are now forwarded through the alt mode
messages to the sink drivers to support multi-stream transport handling.

> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 35d9c30869900..7182a8e2e7101 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
[ ... ]
> @@ -212,7 +214,10 @@ static int dp_altmode_configured(struct dp_altmode *dp)
>  	 */
>  	if (dp->pending_hpd) {
>  		drm_connector_oob_hotplug_event(dp->connector_fwnode,
> -						connector_status_connected);
> +						connector_status_connected,
> +						dp->pending_irq_hpd ?
> +						DRM_CONNECTOR_DP_IRQ_HPD :
> +						DRM_CONNECTOR_NO_EXTRA_STATUS);

Are irq events silently dropped if a status update triggers a
reconfiguration while the hotplug detect state remains unchanged?

Looking at dp_altmode_status_update(), if a status update requires
reconfiguration, the code attempts to buffer the event:

	if (!(con & DP_CONF_CURRENTLY(dp->data.conf))) {
		ret = dp_altmode_configure(dp, con);
		if (!ret) {
			dp->state = dp->plug_prime ? DP_STATE_CONFIGURE_PRIME :
						     DP_STATE_CONFIGURE;
			if (dp->hpd != hpd) {
				dp->hpd = hpd;
				dp->pending_hpd = true;
			}
			if (dp->hpd && dp->pending_hpd && irq_hpd)
				dp->pending_irq_hpd = true;
		}
	}

It only sets dp->pending_hpd = true if the hotplug detect state has toggled. If
it remains unchanged, dp->pending_hpd stays false. This prevents
dp->pending_irq_hpd from being set even if irq_hpd is true.

Could this cause DisplayPort irq events that arrive concurrently with a
configuration change to be lost, preventing downstream multi-stream transport
topology updates and link training?

Additionally, does this deferred event unconditionally report the display as
connected and leak stale state?

If multiple status update messages arrive before configuration
completes, dp->hpd can transition to false while dp->pending_hpd and
dp->pending_irq_hpd remain true.

Similarly, if the alt mode is exited via CMD_EXIT_MODE while
dp->pending_hpd is true, these pending flags are never cleared.

Will this cause the drm driver to receive a spurious connection event and
irq when configuration completes or when the alt mode is later re-entered?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-hpd-irq-events-v3-0-086857017f16@oss.qualcomm.com?part=1

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

  reply	other threads:[~2026-05-14 10:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 18:23 [PATCH RESEND v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
2026-05-14 10:44   ` sashiko-bot [this message]
2026-05-13 18:23 ` [PATCH RESEND v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
2026-05-14 12:06   ` sashiko-bot
2026-05-13 18:23 ` [PATCH RESEND v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
2026-05-14 12:35   ` sashiko-bot
2026-05-13 18:23 ` [PATCH RESEND v3 6/6] usb: typec: ucsi: huawei-gaokun: " 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=20260514104424.04B3FC2BCB3@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=linux-amlogic@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox