Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] drm/msm/dp: eDP PHY left uninitialized in msm_dp_display_unprepare() --
commit 3ff8f4b66e30683c7b1e9468b834d7cecc0a20e4 Author: Gianfranco Mariotti <[email protected]> drm/msm/dp: keep PHY initialized while plugged across link unprepare This commit adds dp->prepared to track link preparation and reinitializes the PHY in msm_dp_display_unprepare() and msm_dp_pm_runtime_resume() when dp->plugged is set. > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c > b/drivers/gpu/drm/msm/dp/dp_display.c > index d1925594da878..9e3d81ffbe03e 100644 > --- a/drivers/gpu/drm/msm/dp/dp_display.c > +++ b/drivers/gpu/drm/msm/dp/dp_display.c [ ... ] > @@ -1570,19 +1592,25 @@ static void msm_dp_display_unprepare(struct > msm_dp_display_private *dp) > { > struct msm_dp *msm_dp_display = &dp->msm_dp_display; > > - /* dongle is still connected but sinks are disconnected */ > - if (dp->link->sink_count == 0) > - msm_dp_link_psm_config(dp->link, &dp->panel->link_info, true); > + scoped_guard(mutex, &dp->plugged_lock) { > + if (!dp->prepared) > + return; > > - msm_dp_ctrl_off_link(dp->ctrl, dp->panel); > + /* dongle is still connected but sinks are disconnected */ > + if (dp->link->sink_count == 0 && dp->plugged) > + msm_dp_link_psm_config(dp->link, &dp->panel->link_info, > + true); > > - if (dp->link->sink_count == 0) > - /* re-init the PHY so that we can listen to Dongle disconnect */ > - msm_dp_ctrl_reinit_phy(dp->ctrl); > - else > + msm_dp_ctrl_off_link(dp->ctrl, dp->panel); > + > + /* Keep PHY initialized for AUX and IRQ_HPD while a sink > remains plugged */ > msm_dp_display_host_phy_exit(dp); > + if (dp->plugged) > + msm_dp_display_host_phy_init(dp); [Severity: High] Does this leave the eDP PHY uninitialized while the controller is still runtime-active? For eDP, msm_dp_pm_runtime_resume() initializes the PHY whenever the controller is runtime-resumed regardless of dp->plugged, and msm_dp_aux_transfer() skips the aux->enable_xfers check on eDP. In msm_dp_display_atomic_post_disable(), msm_dp_hpd_unplug_handle() runs before msm_dp_display_unprepare() and sets dp->plugged = false (and if msm_dp_display_prepare_link() failed before setting dp->prepared, msm_dp_hpd_unplug_handle() also calls msm_dp_display_host_phy_exit(dp) directly). When msm_dp_display_unprepare() then exits the PHY, dp->plugged is false so msm_dp_display_host_phy_init() is skipped. The subsequent pm_runtime_put_sync(&msm_dp_display->pdev->dev) does not suspend the controller because the child DP AUX endpoint device (panel->dev) remains runtime-active until panel_bridge_atomic_post_disable() -> drm_panel_unprepare() runs later in the bridge chain, and only triggers an asynchronous idle on the parent when it finally suspends. Any eDP AUX transfer (such as panel_edp_get_modes() or AUX backlight updates) while the controller is still RPM_ACTIVE will skip msm_dp_pm_runtime_resume() and time out with -ETIMEDOUT against the uninitialized PHY. Should msm_dp_display_unprepare() (and the failure path in msm_dp_display_prepare_link()) also reinitialize the PHY when msm_dp_display->is_edp is true, and msm_dp_hpd_unplug_handle() skip msm_dp_display_host_phy_exit() on eDP so that msm_dp_pm_runtime_suspend() remains responsible for exiting the eDP PHY? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=8
