From patchwork Tue Oct 18 11:25:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 9381939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A26060839 for ; Tue, 18 Oct 2016 11:25:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA0DD28A93 for ; Tue, 18 Oct 2016 11:25:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA63428B25; Tue, 18 Oct 2016 11:25:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5497A28A93 for ; Tue, 18 Oct 2016 11:25:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F7BE89B9E; Tue, 18 Oct 2016 11:25:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from johanna1.inet.fi (mta-out1.inet.fi [62.71.2.197]) by gabe.freedesktop.org (Postfix) with ESMTP id AD1A989B9E for ; Tue, 18 Oct 2016 11:25:53 +0000 (UTC) RazorGate-KAS: Status: not_detected RazorGate-KAS: Rate: 0 RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29 RazorGate-KAS: Lua profiles 69136 [Nov 12 2014] RazorGate-KAS: Method: none Received: from hufflepuff.adrinael.net (84.250.112.128) by johanna1.inet.fi (9.0.002.03-2-gbe5d057) id 5804F2B90017F888; Tue, 18 Oct 2016 14:25:52 +0300 Received: from adrinael by hufflepuff.adrinael.net with local (Exim 4.84_2) (envelope-from ) id 1bwSWm-0000td-GV; Tue, 18 Oct 2016 14:25:52 +0300 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Tue, 18 Oct 2016 14:25:21 +0300 Message-Id: <1476789921-3391-1-git-send-email-petri.latvala@intel.com> X-Mailer: git-send-email 2.1.4 Cc: Jari Tahvanainen Subject: [Intel-gfx] [PATCH i-g-t] tests/vgem_basic: Retry the initial module unload in unload test X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP If executed too soon after prime_vgem tests, the vgem unload test fails due to its execbuffers still being handled in the kernel. Retry the unload three times with sleeps before reporting a skip. When tested on HSW, one 1s sleep wasn't enough, 3s was. Signed-off-by: Petri Latvala CC: Chris Wilson CC: Jari Tahvanainen CC: Daniel Vetter --- With this change, we can leave vgem_basic@unload last in the CI testlist, and thus still catch actual unload problems. tests/vgem_basic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c index 5b54a4a..7f0750d 100644 --- a/tests/vgem_basic.c +++ b/tests/vgem_basic.c @@ -296,10 +296,15 @@ static int module_unload(void) static void test_unload(void) { struct vgem_bo bo; - int vgem, dmabuf; + int vgem, dmabuf, unloaded, retry = 3; uint32_t *ptr; - igt_require(module_unload() == 0); + while ((unloaded = module_unload()) && retry-- > 0) { + /* Sleep for a moment to let previous users finish */ + sleep(1); + } + + igt_require(unloaded == 0); vgem = __drm_open_driver(DRIVER_VGEM); igt_assert(vgem != -1);