From: sashiko-bot@kernel.org
To: "Joonhoe Kim" <26rote@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/msm/dp: hold one runtime PM reference per plugged state
Date: Tue, 29 Sep 2026 13:20:29 +0000 [thread overview]
Message-ID: <20260929132029.911491F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260929130627.959-1-26rote@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: dropping plugged PM ref in detect() breaks PHY init on replug
--
commit c051f74425731ad4ec4c7067fd0c9ebc38bc16ab
Author: Joonhoe Kim <26rote@gmail.com>
drm/msm/dp: hold one runtime PM reference per plugged state
This commit modifies the DP runtime PM handling to take exactly one reference
for the plugged state, avoiding leaks where multiple HPD events or detect()
calls accumulate references and prevent the controller from suspending.
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 6abe30bdff120..4e47b659c71df 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
[ ... ]
> @@ -960,6 +969,12 @@ enum drm_connector_status msm_dp_bridge_detect(struct drm_bridge *bridge,
> }
>
> pm_runtime_put_sync(&dp->pdev->dev);
> + /* the sink is gone: drop the plugged state's reference too */
> + if (was_plugged)
> + pm_runtime_put_sync(&dp->pdev->dev);
[Severity: High]
Does dropping the plugged state PM reference here allow the controller to
suspend while the PHY software state still thinks it is initialized?
If msm_dp_bridge_detect() fails during a physical unplug (for example,
failing to read DPCD caps), it sets priv->plugged to false and jumps here to
drop both its own PM reference and the plugged state's PM reference.
The hardware unplug interrupt would then trigger msm_dp_hpd_unplug_handle(),
which has an early return:
drivers/gpu/drm/msm/dp/dp_display.c:msm_dp_hpd_unplug_handle() {
...
guard(mutex)(&dp->plugged_lock);
if (!dp->plugged)
return 0;
}
Because detect() already cleared dp->plugged, this early return skips tearing
down the PHY state with msm_dp_display_host_phy_exit().
Then, on the next plug, msm_dp_display_host_phy_init() will silently skip
PHY initialization because dp->phy_initialized was never reset to false:
drivers/gpu/drm/msm/dp/dp_display.c:msm_dp_display_host_phy_init() {
...
if (!dp->phy_initialized) {
msm_dp_ctrl_phy_init(dp->ctrl);
dp->phy_initialized = true;
return true;
}
return false;
}
Can this sequence leave the hardware PHY uninitialized on replug, causing
link training to fail and the display to remain broken until reboot?
> + } else if (was_plugged) {
> + /* the plugged state already holds its reference */
> + pm_runtime_put_sync(&dp->pdev->dev);
> }
>
> return status;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260929130627.959-1-26rote@gmail.com?part=1
next prev parent reply other threads:[~2026-09-29 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 13:06 [PATCH] drm/msm/dp: hold one runtime PM reference per plugged state Joonhoe Kim
2026-09-29 13:20 ` sashiko-bot [this message]
2026-09-29 17:50 ` Joonhoe Kim
2026-10-07 4:39 ` Val Packett
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=20260929132029.911491F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=26rote@gmail.com \
--cc=dri-devel@lists.freedesktop.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