dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Tom St Denis <tom.stdenis@amd.com>
Subject: [PATCH 2/2] amdgpu: Make amdgpu_cs_calculate_timeout() return something sensible on error
Date: Fri, 20 Nov 2015 19:24:14 -0500	[thread overview]
Message-ID: <1448065454-6805-2-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1448065454-6805-1-git-send-email-alexander.deucher@amd.com>

From: Tom St Denis <tom.stdenis@amd.com>

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 amdgpu/amdgpu_cs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index aa594c4..6747158 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -291,8 +291,10 @@ drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)
 		struct timespec current;
 		uint64_t current_ns;
 		r = clock_gettime(CLOCK_MONOTONIC, &current);
-		if (r)
-			return r;
+		if (r) {
+			fprintf(stderr, "clock_gettime() returned error (%d)!", errno);
+			return AMDGPU_TIMEOUT_INFINITE;
+		}
 
 		current_ns = ((uint64_t)current.tv_sec) * 1000000000ull;
 		current_ns += current.tv_nsec;
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-11-21  0:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21  0:24 [PATCH 1/2] amdgpu: fix overflow for timeout calculation Alex Deucher
2015-11-21  0:24 ` Alex Deucher [this message]
2015-11-21 10:48 ` Ernst Sjöstrand
2015-11-21 11:07   ` Christian König
2015-11-21 11:25     ` Ernst Sjöstrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448065454-6805-2-git-send-email-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tom.stdenis@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox