Skip to contentSkip to conversation

drm/vkms: WARN when hrtimer_forward_now fails

PATCH Applied Shayenne Moura 2 participants 2 messages Feb 6, 2019 – Feb 10, 2019

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

PATCH 1/1 drm/vkms: WARN when hrtimer_forward_now fails

Make the variable have the same type of function hrtimer_forward_now return.

Add a warn to verify the hrtimer_forward_now return.

---
 drivers/gpu/drm/vkms/vkms_crtc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_crtc.c +3 -1
index 5a095610726b..734a3e197df8 100644
@@ -16,7 +16,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
 						  vblank_hrtimer);
 	struct drm_crtc *crtc = &output->crtc;
 	struct vkms_crtc_state *state = to_vkms_crtc_state(crtc->state);
-	int ret_overrun;
+	u64 ret_overrun;
 	bool ret;
 
 	spin_lock(&output->lock);
@@ -43,6 +43,8 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
 
 	ret_overrun = hrtimer_forward_now(&output->vblank_hrtimer,
 					  output->period_ns);
+	WARN_ON(ret_overrun != 1);
+
 	spin_unlock(&output->lock);
 
 	return HRTIMER_RESTART;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Shayenne Moura

Make the variable have the same type of function hrtimer_forward_now return.

Hi,

First of all, thanks for your patch.

Applied to the drm-misc-misc branch of drm-misc.git.

P.s.: I made a tiny change in the commit message.

Best Regards

Quoted 32 lines

Add a warn to verify the hrtimer_forward_now return.

---
 drivers/gpu/drm/vkms/vkms_crtc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_crtc.c +3 -1
index 5a095610726b..734a3e197df8 100644
@@ -16,7 +16,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
 						  vblank_hrtimer);
 	struct drm_crtc *crtc = &output->crtc;
 	struct vkms_crtc_state *state = to_vkms_crtc_state(crtc->state);
-	int ret_overrun;
+	u64 ret_overrun;
 	bool ret;
 
 	spin_lock(&output->lock);
@@ -43,6 +43,8 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
 
 	ret_overrun = hrtimer_forward_now(&output->vblank_hrtimer,
 					  output->period_ns);
+	WARN_ON(ret_overrun != 1);
+
 	spin_unlock(&output->lock);
 
 	return HRTIMER_RESTART;
Signature · 1 line
2.17.1
Signature · 5 lines
Rodrigo Siqueira
https://siqueira.tech
Graduate Student
Department of Computer Science
University of São Paulo