Skip to contentSkip to conversation

drm/vblank: downgrade vblank wait timeout from WARN to error

PATCH In review Chintan Patel 3 participants 6 messages Oct 3, 2025 – Oct 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 46f59883183d..0664aea1b924 100644
@@ -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
#1 lore raw
Quoted 9 lines · 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.

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

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
index 46f59883183d..0664aea1b924 100644
@@ -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
maintainer Acked-by on v3 1/1
#2 lore raw
In reply to Chintan Patel

Hi

Am 03.10.25 um 05:23 schrieb Chintan Patel:

Quoted 6 lines

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.

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.

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 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
index 46f59883183d..0664aea1b924 100644
@@ -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)
#3 lore raw
In reply to Chintan Patel

Hi

Am 03.10.25 um 05:23 schrieb Chintan Patel:

Quoted 32 lines

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 +0 -0
index 46f59883183d..0664aea1b924 100644

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)
#4 lore raw

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() 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(-)
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
index 46f59883183d..0664aea1b924 100644
@@ -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.

#5 lore raw

Hi

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() 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(-)
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
index 46f59883183d..0664aea1b924 100644
@@ -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)