Hi
Am 03.10.25 um 05:23 schrieb Chintan Patel:
When wait_event_timeout() in drm_wait_one_vblank() times out, the
current WARN can cause unnecessary kernel panics in environments
with panic_on_warn set (e.g. CI, fuzzing). These timeouts can happen
under heavy scheduling pressure or in rare cases of delayed vblank
handling, and are not always a kernel bug.
Replace the WARN with drm_err() messages that report the timeout
without crashing the system. Developers can still enable drm.debug
to diagnose genuine problems.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=147ba789658184f0ce04
Tested-by: [email protected]
Signed-off-by: Chintan Patel <[email protected]>
From my side
Acked-by: Thomas Zimmermann <[email protected]>
See [1] for another such report
[1]
https://lore.kernel.org/virtualization/[email protected]/T/#u
If there's also a way to raise priority of the vblank timer, we should
explore that as well.
Best regards
Thomas
v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout case
v3:
- Use drm_err() instead of drm_dbg_kms() (suggested by Ville Syrjälä)
- Remove unnecessary curr = drm_vblank_count() (suggested by Thomas
Zimmermann)
- Fix commit message wording (“invalid userspace calls” → “delayed vblank
handling”)
---
drivers/gpu/drm/drm_vblank.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 46f59883183d..0664aea1b924 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -1305,7 +1305,8 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned
int pipe)
last != drm_vblank_count(dev, pipe),
msecs_to_jiffies(100));
- drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe);
+ if (!ret)
+ drm_err(dev, "vblank wait timed out on crtc %i\n", pipe);
drm_vblank_put(dev, pipe);
}
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)