Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] Missing error reporting for drm_edid_connector_update() on the connect path, contradicting the commit message. - [Low] The SCDC sync call on the disconnect path is a guaranteed no-op, leaving the scrambler state unhandled and introducing dead error-handling code. --
commit 41a712cbfad2ca468ecdd91cc77914f264d5dce6 Author: Cristian Ciocaltea <[email protected]> drm/display: hdmi-state-helper: Sync SCDC state on hotplug This commit attempts to synchronize SCDC status on hotplug events by hooking drm_connector_hdmi_sync_scdc() into the connect and disconnect paths. It also aims to report errors from drm_edid_connector_update() for consistency. > diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c > b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > index 8045b1d17d6ec..1e269b203b987 100644 > --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c > +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > @@ -1362,12 +1362,29 @@ drm_atomic_helper_connector_hdmi_update(struct > drm_connector *connector, > enum drm_connector_status status) > { > const struct drm_edid *drm_edid; > + int ret; > > if (status == connector_status_disconnected) { > - // TODO: also handle scramber, HDMI sink disconnected. > + /* > + * .detect_ctx() can only ever return a drm_connector_status or > + * -EDEADLK. Handle deadlocks, and report any !EDEADLK error. > + */ > + ret = drm_connector_hdmi_sync_scdc(connector, false, ctx); > + if (ret) { > + if (ret == -EDEADLK) > + return ret; > + > + drm_warn(connector->dev, "Ignored SCDC sync error: > %d\n", ret); > + } [Severity: Low] Does this actually handle the scrambler state on disconnect? If we look at drm_connector_hdmi_sync_scdc(), passing false for the plugged parameter causes it to return 0 immediately: int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged, struct drm_modeset_acquire_ctx *ctx) { ... if (!connector || !plugged || !ctx) return 0; Since ret will always be 0, the error handling block here is dead code, and the scrambler state remains unhandled on the disconnect path. > + > drm_connector_hdmi_audio_plugged_notify(connector, false); > - drm_edid_connector_update(connector, NULL); > + > + ret = drm_edid_connector_update(connector, NULL); > + if (ret) > + drm_warn(connector->dev, "Ignored EDID update error: > %d\n", ret); > + > drm_connector_cec_phys_addr_invalidate(connector); > + > return 0; > } > [ ... ] > @@ -1381,7 +1398,18 @@ drm_atomic_helper_connector_hdmi_update(struct > drm_connector *connector, > drm_edid_free(drm_edid); [Severity: Medium] The commit message states that errors from drm_edid_connector_update() will be reported for consistency. However, in drm_atomic_helper_connector_hdmi_update(), the return value of the drm_edid_connector_update() call on the connect path (which happens just before the drm_edid_free() call in the snippet above) is still being ignored: drm_edid_connector_update(connector, drm_edid); drm_edid_free(drm_edid); Should we also add error reporting to this path to match the stated intent? > > if (status == connector_status_connected) { > - // TODO: also handle scramber, HDMI sink is now connected. > + /* > + * .detect_ctx() can only ever return a drm_connector_status or > + * -EDEADLK. Handle deadlocks, and report any !EDEADLK error. > + */ > + ret = drm_connector_hdmi_sync_scdc(connector, true, ctx); > + if (ret) { > + if (ret == -EDEADLK) > + return ret; > + > + drm_warn(connector->dev, "Ignored SCDC sync error: > %d\n", ret); > + } > + > drm_connector_hdmi_audio_plugged_notify(connector, true); > drm_connector_cec_phys_addr_set(connector); > } -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=23
