From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: protect encoder bridge chain with a mutex
Date: Wed, 25 Mar 2026 06:59:29 +1000 [thread overview]
Message-ID: <review-overall-20260324-drm-bridge-alloc-encoder-chain-mutex-v5-0-8bf786c5c7e6@bootlin.com> (raw)
In-Reply-To: <20260324-drm-bridge-alloc-encoder-chain-mutex-v5-0-8bf786c5c7e6@bootlin.com>
Overall Series Review
Subject: drm/bridge: protect encoder bridge chain with a mutex
Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
Patches: 8
Reviewed: 2026-03-25T06:59:29.998864
---
This is a well-structured v5 series that adds mutex protection to the DRM encoder bridge chain, preparing for hot-pluggable bridge support. The approach is sound: a per-encoder mutex serializes bridge chain modifications (attach/detach) against iterations over the chain. The series is incremental and logical, building from mutex introduction through progressive coverage of all iteration sites.
The ABBA deadlock avoidance in patch 2 (using `list_cut_before` to a temporary list) is clever and correct. The scoped for_each macros in patch 4 are well-designed, using `__free()` cleanup attributes to ensure the mutex is always released even on early return/break.
One concern worth noting: patches 6 and 7 hold the mutex while calling bridge driver callbacks (`atomic_disable`, `atomic_enable`, `pre_enable`, `post_disable`, etc.). If any bridge driver callback were to attempt a bridge attach/detach on the same encoder, this would deadlock. This seems unlikely in practice, but should be documented or at least noted.
Overall: the series looks correct and ready to merge. Minor issues noted below.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-24 20:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 8:58 [PATCH v5 0/7] drm/bridge: protect encoder bridge chain with a mutex Luca Ceresoli
2026-03-24 8:58 ` [PATCH v5 1/7] drm/encoder: add mutex to protect the bridge chain Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 2/7] drm/encoder: drm_encoder_cleanup: lock the encoder chain mutex during removal Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 3/7] drm/bridge: drm_bridge_attach: lock the encoder chain mutex during insertion Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 4/7] drm/bridge: lock the encoder chain in scoped for_each loops Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 5/7] drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_from() Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 6/7] drm/bridge: prevent encoder chain changes while iterating with list_for_each_entry_reverse() Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 8:58 ` [PATCH v5 7/7] drm/bridge: prevent encoder chain changes in pre_enable/post_disable Luca Ceresoli
2026-03-24 20:59 ` Claude review: " Claude Code Review Bot
2026-03-24 20:59 ` Claude Code Review 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=review-overall-20260324-drm-bridge-alloc-encoder-chain-mutex-v5-0-8bf786c5c7e6@bootlin.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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