Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] drm/bridge_connector: unconditional detect() after hpd_notify() breaks msm_dp - [Medium] drm/bridge_connector: suppressed IRQ_HPD uevent on downstream EDID change --
commit 639a7eb6e945d13bc1ca0a8e003c6cf0a496e228 Author: Yongxing Mou <[email protected]> drm/bridge_connector: suppress hotplug for IRQ_HPD without status changes This commit calls the bridge .detect() callback after HPD notification to update connector->status and skips sending a hotplug event on IRQ_HPD when the connector status has not changed. > diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c > b/drivers/gpu/drm/display/drm_bridge_connector.c > index 4ade63306653f..1d4502126bff3 100644 > --- a/drivers/gpu/drm/display/drm_bridge_connector.c > +++ b/drivers/gpu/drm/display/drm_bridge_connector.c > @@ -160,15 +160,25 @@ static void drm_bridge_connector_handle_hpd(struct > drm_bridge_connector *drm_bri > enum drm_connector_dp_event event) > { > struct drm_connector *connector = &drm_bridge_connector->base; > + struct drm_bridge *detect = drm_bridge_connector->bridge_detect; > struct drm_device *dev = connector->dev; > + enum drm_connector_status old_status, new_status; > + bool level_hpd; > + bool changed; > > - mutex_lock(&dev->mode_config.mutex); > - connector->status = status; > - mutex_unlock(&dev->mode_config.mutex); > + level_hpd = event == DRM_CONNECTOR_NO_EXTRA_STATUS; > > drm_bridge_connector_hpd_notify(connector, status, event); > > - drm_kms_helper_connector_hotplug_event(connector); > + mutex_lock(&dev->mode_config.mutex); > + old_status = connector->status; > + new_status = detect ? detect->funcs->detect(detect, connector) : status; [Severity: High] Does calling detect->funcs->detect() unconditionally after drm_bridge_connector_hpd_notify() leak a runtime PM reference on dp->pdev->dev in msm_dp on every connect and IRQ_HPD event? On plug and IRQ_HPD notifications, msm_dp_bridge_hpd_notify() -> msm_dp_hpd_plug_handle() acquires a runtime PM reference and sets dp->plugged = true. Calling msm_dp_bridge_detect() right after acquires a second reference and skips releasing it at exit because priv->plugged is true: drivers/gpu/drm/msm/dp/dp_display.c:msm_dp_bridge_detect() { ... ret = pm_runtime_resume_and_get(&dp->pdev->dev); ... priv->plugged = true; ... end: if (!priv->plugged) { if (phy_deinit) { msm_dp_aux_enable_xfers(priv->aux, false); msm_dp_display_host_phy_exit(priv); } pm_runtime_put_sync(&dp->pdev->dev); } } msm_dp_hpd_unplug_handle() only drops one reference when clearing dp->plugged, so the extra reference is never released and the DP controller cannot runtime suspend. If a DPCD read in msm_dp_bridge_detect() fails instead, it clears priv->plugged = false while releasing only its own reference, causing a later msm_dp_hpd_unplug_handle() to return early and skip unplug cleanup and the initial reference release. On disconnect notifications, running msm_dp_bridge_detect() after msm_dp_hpd_unplug_handle() also re-enables AUX transfers or re-initializes the PHY after unplug, and bridges whose .detect() callback does not sense HPD (such as lt9611uxc_bridge_detect() when hpd_supported is false) will overwrite connector_status_disconnected with connector_status_connected. > + connector->status = new_status; > + changed = new_status != old_status; > + mutex_unlock(&dev->mode_config.mutex); > + > + if (changed || level_hpd) > + drm_kms_helper_connector_hotplug_event(connector); > } [Severity: Medium] Can checking only new_status != old_status suppress hotplug events when a downstream DP branch device changes EDID over IRQ_HPD while remaining connected? When a branch device signals DP_DOWNSTREAM_PORT_STATUS_CHANGED while connector->status is already connector_status_connected, msm_dp_irq_hpd_handle() -> msm_dp_display_process_hpd_high() reads the new EDID and calls drm_edid_connector_update(), which increments connector->epoch_counter. Because new_status and old_status are both connector_status_connected and level_hpd is false, changed is false and userspace never receives the hotplug notification. When new_status != old_status, updating connector->status directly here without incrementing connector->epoch_counter also causes subsequent drm_helper_probe_detect() calls to see no status change and skip bumping connector->epoch_counter. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=19
