From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/bridge: Add ->detect_ctx hook and drm_bridge_detect_ctx() Date: Tue, 03 Mar 2026 12:42:54 +1000 Message-ID: In-Reply-To: <20260303-dw-hdmi-qp-scramb-v4-1-317d3b8bd219@collabora.com> References: <20260303-dw-hdmi-qp-scramb-v4-0-317d3b8bd219@collabora.com> <20260303-dw-hdmi-qp-scramb-v4-1-317d3b8bd219@collabora.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This patch adds the atomic variant of `drm_bridge_funcs.detect()` and a new= `drm_bridge_detect_ctx()` helper. The implementation is clean and follows = the established patterns from the connector-level `detect_ctx`. **Looks good.** A few observations: The fallback path when `detect_ctx` is NULL but `detect` exists is correct: ```c return bridge->funcs->detect(bridge, connector); ``` The self-managed locking path (ctx =3D=3D NULL) properly handles EDEADLK: ```c drm_modeset_acquire_init(&br_ctx, 0); retry: ret =3D drm_modeset_lock(&connector->dev->mode_config.connection_mutex,= &br_ctx); if (!ret) ret =3D bridge->funcs->detect_ctx(bridge, connector, &br_ctx); if (ret =3D=3D -EDEADLK) { drm_modeset_backoff(&br_ctx); goto retry; } ``` The conversion of negative errors to `connector_status_unknown` is appropri= ate: ```c if (ret < 0) ret =3D connector_status_unknown; ``` **Minor doc nit:** The doc says "If @ctx is set, it might also return -EDEA= DLK" =E2=80=94 but when ctx is passed through directly to `detect_ctx`, the= callback could return *any* negative error, not just -EDEADLK. The caller = would see all of them. This is handled correctly in practice (patch 2's `dr= m_bridge_connector_detect_ctx` checks `ret < 0`), but the doc could be more= precise. --- Generated by Claude Code Patch Reviewer