From patchwork Tue Jul 10 11:31:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10516859 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 B2850603D7 for ; Tue, 10 Jul 2018 11:31:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9171728E5D for ; Tue, 10 Jul 2018 11:31:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F46028E7B; Tue, 10 Jul 2018 11:31:16 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 D2C2F28E66 for ; Tue, 10 Jul 2018 11:31:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3D996E034; Tue, 10 Jul 2018 11:31:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id B35076E034; Tue, 10 Jul 2018 11:31:12 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 12307526-1500050 for multiple; Tue, 10 Jul 2018 12:31:00 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Jul 2018 12:31:05 +0100 Message-Id: <20180710113105.17868-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.18.0 Subject: [Intel-gfx] [PATCH i-g-t] lib: Require working GEM (!wedged) to allow hang injection X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP As we ordinarily use a spinning batch to trigger a hang, we cannot do so without execbuf. On the other hand, if we do a manual reset of the wedged driver, we expect it to remain wedged and for the reset to fail; failing the test. Even if we remove the igt_assert(!wedged), the test is suspect as we don't know if the reset took place and so do not know if the conditions the test is trying to setup apply. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala --- lib/igt_gt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 4569fd36b..89b318ae6 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -162,6 +162,13 @@ igt_hang_t igt_allow_hang(int fd, unsigned ctx, unsigned flags) }; unsigned ban; + /* + * If the driver is already wedged, we don't expect it to be able + * to recover from reset and for it to remain wedged. It's hard to + * say even if we do hang/reset making the test suspect. + */ + igt_require_gem(fd); + igt_assert(igt_sysfs_set_parameter (fd, "reset", "%d", INT_MAX /* any reset method */));