lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200825144248.1751-1-realwakka@gmail.com>
Date:   Tue, 25 Aug 2020 14:42:48 +0000
From:   Sidong Yang <realwakka@...il.com>
To:     Daniel Vetter <daniel@...ll.ch>,
        Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>
Cc:     Sidong Yang <realwakka@...il.com>,
        Haneen Mohammed <hamohammed.sa@...il.com>,
        melissa.srw@...il.com, Emil Velikov <emil.l.velikov@...il.com>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: [PATCH] drm/vkms: fix warning in vkms_get_vblank_timestamp

From: Sidong Yang <realwakka@...il.com>, Haneen Mohammed <hamohammed.sa@...il.com>

When vkms_get_vblank_timestamp() is called very first time without
enabling vblank before, vblank time has just intial value and it makes
warning message. this patch prevents warning message by setting vblank
time to current time.

Cc: Daniel Vetter <daniel@...ll.ch>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>
Cc: Haneen Mohammed <hamohammed.sa@...il.com>
Cc: Melissa Wen <melissa.srw@...il.com>

Signed-off-by: Sidong Yang <realwakka@...il.com>
---
 drivers/gpu/drm/vkms/vkms_crtc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index ac85e17428f8..09c012d54d58 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -86,6 +86,11 @@ static bool vkms_get_vblank_timestamp(struct drm_crtc *crtc,
 	struct vkms_output *output = &vkmsdev->output;
 	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
+	if (!READ_ONCE(vblank->enabled)) {
+		*vblank_time = ktime_get();
+		return true;
+	}
+
 	*vblank_time = READ_ONCE(output->vblank_hrtimer.node.expires);
 
 	if (WARN_ON(*vblank_time == vblank->time))
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ