dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joonhoe Kim" <26rote@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/msm/dp: hold one runtime PM reference per plugged state
Date: Wed, 07 Oct 2026 16:12:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-163186@kernel.org> (raw)
In-Reply-To: <20261007155848.106-1-26rote@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: unplug teardown bypassed when detect() clears priv->plugged
--

commit 6677860d1d5222553e73900478155ec25c55e88b
Author: Joonhoe Kim <26rote@gmail.com>

drm/msm/dp: hold one runtime PM reference per plugged state

This commit adjusts PM runtime references in the DisplayPort driver to hold
exactly one reference per plugged state. It takes a reference on plug and
drops it when detect() notices the sink is gone or when the unplug handler
runs.

Link: https://lore.kernel.org/all/20260929130627.959-1-26rote@gmail.com/

> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 6abe30bdff120..4059cb9dba64b 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
[ ... ]
> @@ -910,6 +913,7 @@ enum drm_connector_status msm_dp_bridge_detect(struct drm_bridge *bridge,
>  		return status;
>  	}
>  
> +	was_plugged = priv->plugged;
>  	phy_deinit = msm_dp_display_host_phy_init(priv);
>  
>  	msm_dp_aux_enable_xfers(priv->aux, true);
[ ... ]
> @@ -962,6 +966,9 @@ enum drm_connector_status msm_dp_bridge_detect(struct drm_bridge *bridge,
>  		pm_runtime_put_sync(&dp->pdev->dev);
>  	}
>  
> +	if (was_plugged)
> +		pm_runtime_put_sync(&dp->pdev->dev);
> +
>  	return status;
>  }

[Severity: High]
Does this cement a hardware teardown bypass on unplug?

When a physical unplug occurs, msm_dp_bridge_detect() fails to read DPCD
caps and sets priv->plugged = false. By dropping the PM runtime reference
here using the newly added was_plugged flag, it completes the state
transition early.

The DRM core subsequently calls .hpd_notify() which invokes
msm_dp_hpd_unplug_handle(). Because the plugged flag was already cleared in
detect(), the unplug handler immediately early-returns:

msm_dp_hpd_unplug_handle() {
        guard(mutex)(&dp->plugged_lock);
        if (!dp->plugged)
                return 0;
        // Teardown code is skipped
        ...
}

This entirely bypasses drm_edid_connector_update(..., NULL),
drm_dp_set_subconnector_property(), and
msm_dp_display_handle_plugged_change(..., false). As a result, the EDID is
left stale, and the audio subsystem is never notified of the unplug (unless
an active audio stream was running).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261007155848.106-1-26rote@gmail.com?part=1

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 15:58 [PATCH v2] drm/msm/dp: hold one runtime PM reference per plugged state Joonhoe Kim
2026-10-07 16:12 ` sashiko-bot [this message]

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-163186@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