From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Wood Subject: [PATCH i-g-t 2/2] lib: set a timeout when reading crc values Date: Mon, 12 May 2014 11:35:21 +0100 Message-ID: <1399890921-13068-2-git-send-email-thomas.wood@intel.com> References: <1399890921-13068-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by gabe.freedesktop.org (Postfix) with ESMTP id E36756E4C8 for ; Mon, 12 May 2014 03:35:25 -0700 (PDT) Received: by mail-we0-f182.google.com with SMTP id t60so6663595wes.13 for ; Mon, 12 May 2014 03:35:24 -0700 (PDT) In-Reply-To: <1399890921-13068-1-git-send-email-thomas.wood@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Signed-off-by: Thomas Wood --- lib/igt_debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 4fd2e5a..0912f5b 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -459,7 +459,10 @@ static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) ssize_t bytes_read; char buf[pipe_crc->buffer_len]; + igt_set_timeout(5); bytes_read = read(pipe_crc->crc_fd, &buf, pipe_crc->line_len); + igt_set_timeout(0); + igt_assert_cmpint(bytes_read, ==, pipe_crc->line_len); buf[bytes_read] = '\0'; -- 1.9.0