From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vblank: Add vblank timer
Date: Wed, 27 May 2026 14:49:44 +1000 [thread overview]
Message-ID: <review-patch1-20260526133123.691465-2-w15303746062@163.com> (raw)
In-Reply-To: <20260526133123.691465-2-w15303746062@163.com>
Patch Review
Cherry-pick of upstream `74afeb8128502a529041a2566febd26053a7be11`.
The core of the series. Introduces `struct drm_vblank_crtc_timer` and three new exported functions: `drm_crtc_vblank_start_timer()`, `drm_crtc_vblank_cancel_timer()`, and `drm_crtc_vblank_get_vblank_timeout()`. Also creates `drm_vblank_helper.c` with wrapper callbacks for `drm_crtc_funcs`.
The deadlock avoidance is the key design choice — in `drm_crtc_vblank_cancel_timer()`:
```c
spin_lock_irqsave(&vtimer->interval_lock, flags);
vtimer->interval = 0;
spin_unlock_irqrestore(&vtimer->interval_lock, flags);
hrtimer_try_to_cancel(&vtimer->timer);
```
Instead of `hrtimer_cancel()` (which waits and can deadlock), this signals the timer to self-terminate by zeroing the interval and uses `hrtimer_try_to_cancel()`. The timer function checks:
```c
if (!interval)
return HRTIMER_NORESTART;
```
This is a correct pattern to avoid the ABBA deadlock between `vblank_time_lock` and `softirq_expiry_lock`.
The comment in `drm_crtc_vblank_cancel_timer()` has a typo: `vblank_time_lime_lock` instead of `vblank_time_lock`. This exists in the upstream commit too, so it's not introduced by the backport.
One pre-existing note on `drm_crtc_vblank_start_timer()`: the busy-wait `while (hrtimer_active(...)) hrtimer_try_to_cancel(...)` loop on the non-first-invocation path could theoretically spin for a long time if the timer function keeps restarting, but in practice the interval-zeroing from cancel ensures this converges. This is unchanged from upstream.
**No issues with the backport itself.**
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-27 4:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 13:31 [PATCH v2 6.18.y 0/5] drm/vkms: Backport generic vblank timer to fix ABBA deadlock w15303746062
2026-05-26 13:31 ` [PATCH v2 6.18.y 1/5] drm/vblank: Add vblank timer w15303746062
2026-05-27 4:49 ` Claude Code Review Bot [this message]
2026-05-26 13:31 ` [PATCH v2 6.18.y 2/5] drm/vblank: Add CRTC helpers for simple use cases w15303746062
2026-05-27 4:49 ` Claude review: " Claude Code Review Bot
2026-05-26 13:31 ` [PATCH v2 6.18.y 3/5] drm/vkms: Convert to DRM's vblank timer w15303746062
2026-05-27 4:49 ` Claude review: " Claude Code Review Bot
2026-05-26 13:31 ` [PATCH v2 6.18.y 4/5] drm/atomic: Increase timeout in drm_atomic_helper_wait_for_vblanks() w15303746062
2026-05-27 4:49 ` Claude review: " Claude Code Review Bot
2026-05-26 13:31 ` [PATCH v2 6.18.y 5/5] drm/vblank: Fix kernel docs for vblank timer w15303746062
2026-05-27 4:49 ` Claude review: " Claude Code Review Bot
2026-05-27 4:49 ` Claude review: drm/vkms: Backport generic vblank timer to fix ABBA deadlock Claude Code Review Bot
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-patch1-20260526133123.691465-2-w15303746062@163.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