From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v12 12/23] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD
Date: Sat, 14 Nov 2026 05:30:39 +0000 [thread overview]
Message-ID: <sashiko-outbox-214178@kernel.org> (raw)
In-Reply-To: <20261114-synopsys-dw-dp-improvements-v12-12-d42d3dc5bdd4@collabora.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/bridge: dw-dp: missing HPD debounce wait in
dw_dp_bridge_oob_notify()
- [Low] drm/bridge: dw-dp: split __free() declaration in
dw_dp_is_routed_to_usb_c()
--
commit 8854deef3437dfb8f0f36f50f761f07577702cde
Author: Sebastian Reichel <sebastian.reichel@collabora.com>
drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD
This commit adds support for USB-C DisplayPort AltMode out-of-band hotplug
notifications to the DesignWare DisplayPort bridge driver via platform
callbacks.
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> index 74ba1306caee6..b4eed4d0a5205 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> @@ -1875,6 +1875,19 @@ static struct drm_bridge_state *dw_dp_bridge_atomic_duplicate_state(struct drm_b
> return &state->base;
> }
>
> +static bool dw_dp_is_routed_to_usb_c(struct drm_encoder *encoder)
> +{
> + struct drm_bridge *last_bridge __free(drm_bridge_put) = NULL;
> + struct fwnode_handle *fwnode;
> +
> + last_bridge = drm_bridge_chain_get_last_bridge(encoder);
[Severity: Low]
This isn't a bug, but per the Cleanup API conventions, last_bridge can be
defined and initialized in a single statement rather than declared as NULL
and assigned later:
struct drm_bridge *last_bridge __free(drm_bridge_put) =
drm_bridge_chain_get_last_bridge(encoder);
[ ... ]
> @@ -1923,6 +1943,22 @@ static void dw_dp_bridge_detach(struct drm_bridge *bridge)
> drm_dp_aux_unregister(&dp->aux);
> }
>
> +static void dw_dp_bridge_oob_notify(struct drm_bridge *bridge,
> + struct drm_connector *connector,
> + enum drm_connector_status status)
> +{
> + bool hpd_high = status != connector_status_disconnected;
> + struct dw_dp *dp = bridge_to_dp(bridge);
> +
> + if (!dp->plat_data.hpd_sw_cfg) {
> + dev_err_once(dp->dev, "Missing platform handler for OOB HPD handling\n");
> + return;
> + }
> +
> + dev_dbg(dp->dev, "Force HPD connected=%s\n", str_yes_no(hpd_high));
> + dp->plat_data.hpd_sw_cfg(dp->plat_data.data, hpd_high);
> +}
[Severity: Medium]
Does dw_dp_bridge_oob_notify() return before the DW-DP controller has
debounced the forced HPD signal in DW_DP_HPD_STATUS?
Right after bridge->funcs->oob_notify() returns,
drm_bridge_connector_oob_hotplug_event() calls
drm_bridge_connector_handle_hpd() -> drm_kms_helper_connector_hotplug_event(),
which probes the connector via dw_dp_bridge_detect() -> dw_dp_hpd_detect():
drivers/gpu/drm/bridge/synopsys/dw-dp.c:dw_dp_hpd_detect() {
...
regmap_read(dp->regmap, DW_DP_HPD_STATUS, &value);
return FIELD_GET(HPD_STATE, value) == DW_DP_HPD_STATE_PLUG;
}
As seen in dw_dp_reset() (which polls DW_DP_HPD_STATUS for up to 200 ms),
the hardware requires ~100 ms of HPD held high before asserting
HPD_HOT_PLUG and updating HPD_STATE to DW_DP_HPD_STATE_PLUG. Returning
immediately after hpd_sw_cfg() causes synchronous detection on plug-in to
read a stale HPD_STATE and overwrite connector->status back to
disconnected.
Even with the later commit "drm/bridge: synopsys: dw-dp: Add Runtime PM
support", which adds msleep(110) in dw_dp_runtime_resume(), that delay only
runs when waking from runtime suspend; if the device is already
runtime-active when dw_dp_bridge_oob_notify() is called (for example during
the 500 ms autosuspend window or while a stream is active),
dw_dp_runtime_resume() is not called and hpd_sw_cfg() still returns before
HPD_STATE updates.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-synopsys-dw-dp-improvements-v12-0-d42d3dc5bdd4@collabora.com?part=12
next prev parent reply other threads:[~2026-11-14 5:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 5:00 [PATCH v12 00/23] Synopsys DisplayPort Controller improvements for Rockchip platforms Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 01/23] drm/bridge: synopsys: dw-dp: Register DP AUX on bridge attach Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 02/23] drm/bridge: synopsys: dw-dp: Fix incorrect resource lifetimes in bind callback Sebastian Reichel
2026-11-14 5:35 ` sashiko-bot
2026-11-14 5:00 ` [PATCH v12 03/23] drm/bridge: synopsys: dw-dp: Fix error handling for DP link enablement Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 04/23] drm/bridge: synopsys: dw-dp: Document missing reset line deassert Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 05/23] drm/bridge: synopsys: dw-dp: Add missing mutex cleanups on module removal Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 06/23] drm/bridge: synopsys: dw-dp: Fix AUX transfer timeout race condition Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 07/23] drm/bridge: synopsys: dw-dp: Fix support for short I2C reads Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 08/23] drm/bridge: synopsys: dw-dp: Free output_fmts when none are valid Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 09/23] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 10/23] drm/bridge: synopsys: dw-dp: Add follow-up bridge support Sebastian Reichel
2026-11-14 5:34 ` sashiko-bot
2026-11-14 5:00 ` [PATCH v12 11/23] drm/bridge: Add out-of-band HPD notify handler Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 12/23] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD Sebastian Reichel
2026-11-14 5:30 ` sashiko-bot [this message]
2026-11-14 5:00 ` [PATCH v12 13/23] drm/rockchip: dw_dp: Implement out-of-band HPD handling Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 14/23] drm/bridge: synopsys: dw-dp: Add Runtime PM support Sebastian Reichel
2026-11-14 5:34 ` sashiko-bot
2026-11-14 5:00 ` [PATCH v12 15/23] drm/rockchip: dw_dp: Add runtime " Sebastian Reichel
2026-11-14 5:29 ` sashiko-bot
2026-11-14 5:00 ` [PATCH v12 16/23] drm/rockchip: dw_dp: Add system " Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 17/23] drm/bridge: synopsys: dw-dp: Protect sdp_reg_bank from concurrent access Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 18/23] drm/bridge: synopsys: dw-dp: Drop useless reservation of first slot Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 19/23] drm/bridge: synopsys: dw-dp: Clear only enabled SDPs on atomic disable Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 20/23] drm/bridge: synopsys: dw-dp: Use regmap_set_bits in dw_dp_send_sdp Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 21/23] dt-bindings: display: rockchip: dw-dp: Fix sound DAI cells Sebastian Reichel
2026-11-14 5:00 ` [PATCH v12 22/23] drm/bridge: synopsys: dw-dp: Add audio support Sebastian Reichel
2026-11-14 5:47 ` sashiko-bot
2026-11-14 5:00 ` [PATCH v12 23/23] drm/bridge: synopsys: dw-dp: Retrain on hotplug with pre-enabled link Sebastian Reichel
2026-11-14 5:25 ` sashiko-bot
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-214178@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sebastian.reichel@collabora.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