drm/vblank: downgrade vblank wait timeout from WARN to error
Subsystems (2)
PATCH v3 1/1 drm/vblank: downgrade vblank wait timeout from WARN to error
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.
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(-)
drivers/gpu/drm/drm_vblank.c +2 -1
@@ -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); }
Signature · 1 line
2.43.0
Quoted 9 lines · Chintan Patel
When
wait_event_timeout()indrm_wait_one_vblank()times out, the current WARN can cause unnecessary kernel panics in environments withpanic_on_warnset (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.
No need to resend for this, can be fixed while applying, but the last sentence is no longer meaningful with drm_err().
BR,
Jani.
Quoted 32 lines
Reported-by [email protected]Tested-by [email protected]Signed-off-by Chintan Patel <[email protected]>v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout casev3:
- Usedrm_err()instead ofdrm_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(-)drivers/gpu/drm/drm_vblank.c +2
-1@@ -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); }
Signature · 1 line
Jani Nikula, Intel
Hi
Am 03.10.25 um 05:23 schrieb Chintan Patel:
Quoted 6 lines
When
wait_event_timeout()indrm_wait_one_vblank()times out, the current WARN can cause unnecessary kernel panics in environments withpanic_on_warnset (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.
Quoted 8 lines
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]Tested-by [email protected]Signed-off-by Chintan Patel <[email protected]>
From my side
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
Quoted 27 lines
v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout casev3:
- Usedrm_err()instead ofdrm_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(-)drivers/gpu/drm/drm_vblank.c +2
-1@@ -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); }
Signature · 7 lines
-- 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)
Thomas Zimmermann
maintainerHi
Am 03.10.25 um 05:23 schrieb Chintan Patel:
Quoted 32 lines
When
wait_event_timeout()indrm_wait_one_vblank()times out, the current WARN can cause unnecessary kernel panics in environments withpanic_on_warnset (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]Tested-by [email protected]Signed-off-by Chintan Patel <[email protected]>v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout casev3:
- Usedrm_err()instead ofdrm_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(-)drivers/gpu/drm/drm_vblank.c +0
-0
drivers/gpu/drm/drm_vblank.c void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe) · line 1306
Quoted 2 lines
drivers/gpu/drm/drm_vblank.c +0
-0@@ -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));
Instead of replacing the drm_WARN(), could you please try to increase the timeout? Let's say 1000 msec to be on the safe side.
Best regards
Thomas
Quoted 7 lines
drivers/gpu/drm/drm_vblank.c +2
-1-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); }
Signature · 7 lines
-- 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)
Hi Thomas,
Thank you Thomas for suggestions!
Quoted 30 lines · Thomas Zimmermann
Hi
Am 03.10.25 um 05:23 schrieb Chintan Patel:
Quoted 27 lines
When
wait_event_timeout()indrm_wait_one_vblank()times out, the current WARN can cause unnecessary kernel panics in environments withpanic_on_warnset (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]Tested-by [email protected]Signed-off-by Chintan Patel <[email protected]>v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout casev3:
- Usedrm_err()instead ofdrm_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(-)
Quoted 11 lines
drivers/gpu/drm/drm_vblank.c void drm_wait_one_vblank(struct drm_device *dev, · line 1307
Quoted 8 lines
drivers/gpu/drm/drm_vblank.c +0
-0@@ -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));Instead of replacing the
drm_WARN(), could you please try to increase the timeout? Let's say 1000 msec to be on the safe side.
I tried it locally and also tested with syzbot after increasing the timeout to 1000 msec. The issue no longer reproduces with this change.
I’ll send v4 shortly with the updated timeout.
Thomas Zimmermann
maintainerHi
Am 25.10.25 um 01:40 schrieb Chintan Patel:
Quoted 47 lines
Hi Thomas,
Thank you Thomas for suggestions!
Quoted 30 lines · Thomas Zimmermann
Hi
Am 03.10.25 um 05:23 schrieb Chintan Patel:
Quoted 27 lines
When
wait_event_timeout()indrm_wait_one_vblank()times out, the current WARN can cause unnecessary kernel panics in environments withpanic_on_warnset (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]Tested-by [email protected]Signed-off-by Chintan Patel <[email protected]>v2:
- Drop unnecessary in-code comment (suggested by Thomas Zimmermann)
- Remove else branch, only log timeout casev3:
- Usedrm_err()instead ofdrm_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(-)Quoted 11 lines
drivers/gpu/drm/drm_vblank.c void drm_wait_one_vblank(struct drm_device · line 1307
Quoted 8 lines
drivers/gpu/drm/drm_vblank.c +0
-0@@ -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));Instead of replacing the
drm_WARN(), could you please try to increase the timeout? Let's say 1000 msec to be on the safe side.
Quoted 3 lines
I tried it locally and also tested with syzbot after increasing the timeout to 1000 msec. The issue no longer reproduces with this change.
I’ll send v4 shortly with the updated timeout.
Ville asked for other approaches before merging the change to the warning. Great that it worked.
Best regards
Thomas
Quoted 2 lines
Signature · 7 lines
-- 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)