From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 05/10] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD
Date: Tue, 21 Jul 2026 18:14:56 +0000 [thread overview]
Message-ID: <20260721181456.AEF271F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260721-synopsys-dw-dp-improvements-v4-5-f0f4a4ede712@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing Workqueue Cancellation / Use-After-Free in teardown path
--
--- Patch [5]: [PATCH v4 05/10] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD ---
commit 27d73c3f273597742127e6851884d387b3ffe886
Author: Sebastian Reichel <sebastian.reichel@collabora.com>
drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD
This patch adds support for USB-C DP AltMode out-of-band hotplug handling
by allowing platform-specific drivers to implement HPD software
configuration and selection.
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> index 0e8ecd73a0002..8eb2699dc7ab0 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
[ ... ]
> @@ -2052,6 +2086,10 @@ struct dw_dp *dw_dp_probe(struct platform_device *pdev, const struct dw_dp_plat_
>
> dp->dev = dev;
> dp->pixel_mode = plat_data->pixel_mode;
> +
> + dp->plat_data.hpd_sw_sel = plat_data->hpd_sw_sel;
> + dp->plat_data.hpd_sw_cfg = plat_data->hpd_sw_cfg;
> + dp->plat_data.data = plat_data->data;
> dp->plat_data.max_link_rate = plat_data->max_link_rate;
>
> mutex_init(&dp->irq_lock);
[Severity: High]
This is a pre-existing issue, but is there a missing workqueue cancellation
in the driver teardown path?
In dw_dp_probe(), the driver initializes a work item for hotplug detection
shortly after the modified code block:
INIT_WORK(&dp->hpd_work, dw_dp_hpd_work);
However, looking at dw_dp_unbind(), the work is never canceled:
void dw_dp_unbind(struct dw_dp *dp)
{
disable_irq(dp->irq);
phy_exit(dp->phy);
drm_bridge_put(dp->next_bridge);
drm_dp_aux_unregister(&dp->aux);
drm_bridge_remove(&dp->bridge);
}
Since the dp structure is automatically freed by devres after the remove
callback completes, could this result in a use-after-free if the IRQ
handler schedules the work right before unbound is called, and the work
executes after the dp structure is deallocated?
Would it make sense to add a cancel_work_sync(&dp->hpd_work) call to the
teardown path to ensure the work item finishes safely?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260721-synopsys-dw-dp-improvements-v4-0-f0f4a4ede712@collabora.com?part=5
next prev parent reply other threads:[~2026-07-21 18:14 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 17:52 [PATCH v4 00/10] Synopsys DisplayPort Controller improvements for Rockchip platforms Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 17:52 ` [PATCH v4 01/10] drm/bridge: synopsys: dw-dp: Fix incorrect resource lifetimes in bind callback Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:05 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 02/10] drm/bridge: synopsys: dw-dp: Support MEDIA_BUS_FMT_FIXED Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:05 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 03/10] drm/bridge: synopsys: dw-dp: Add follow-up bridge support Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:04 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 04/10] drm/bridge: Add out-of-band HPD notify handler Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 17:52 ` [PATCH v4 05/10] drm/bridge: synopsys: dw-dp: Support software triggered OOB HPD Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:14 ` sashiko-bot [this message]
2026-07-21 17:52 ` [PATCH v4 06/10] drm/rockchip: dw_dp: Implement out-of-band HPD handling Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:15 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 07/10] drm/bridge: synopsys: dw-dp: Add Runtime PM support Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:16 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 08/10] drm/rockchip: dw_dp: Add runtime " Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:23 ` sashiko-bot
2026-07-21 17:52 ` [PATCH v4 09/10] dt-bindings: display: rockchip: dw-dp: Fix sound DAI cells Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:26 ` sashiko-bot
2026-07-22 7:22 ` Krzysztof Kozlowski
2026-07-22 7:22 ` Krzysztof Kozlowski
2026-07-21 17:52 ` [PATCH v4 10/10] drm/bridge: synopsys: dw-dp: Add audio support Sebastian Reichel
2026-07-21 17:52 ` Sebastian Reichel
2026-07-21 18:25 ` sashiko-bot
2026-07-22 8:06 ` Alexey Charkov
2026-07-22 8:06 ` Alexey Charkov
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=20260721181456.AEF271F00A3A@smtp.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 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.