From patchwork Mon Nov 24 14:16:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5366721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 01EF7C11AC for ; Mon, 24 Nov 2014 14:16:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1714D200ED for ; Mon, 24 Nov 2014 14:16:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 426DC2041C for ; Mon, 24 Nov 2014 14:16:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC0A56E46A; Mon, 24 Nov 2014 06:16:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id A02466E46A for ; Mon, 24 Nov 2014 06:16:27 -0800 (PST) Received: by mail-wg0-f46.google.com with SMTP id x12so12299527wgg.19 for ; Mon, 24 Nov 2014 06:16:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=49Bi0qkLCYC57uJs1woL4CI5wEv+EHgTDudrNPQxKvM=; b=JipTluJZZZyojKnWTp0T7Lj7uA5Df2b8jukvrqN06udHoDGzEEyY88Z7q8u0XSt1oU ywYyMS8myWb65KyfhLMBd4Uj3fBMl41ukCeH/HMETfkrGBL7vq7eeA9amHJ9TDWHI/d/ TDXo4kQ+uGetjjoo4HQGn5NP0bGmnOb0010rNRR3Xzvn34kucyYX3XACOkEOtdxkj/mH aeLhpC5E3vTlAwMlzj55+yQefUYK01w3Gc6INphyMqvYiajkDTVOXMSN58fh8BgMQZz6 YI9S7kr3Niz0FLkVmduObs8yPTzc1Q7lf58xXoSLzjHOdW69JguSww+L/C3Vs1gPGphs GEYQ== X-Gm-Message-State: ALoCoQnZEWhqs14uLw4mvXtrKFNAkBdTAZsRHmyMLa3Gfl9iZ9g9xi7Ky8Fry4SDFnLbBodVG2BA X-Received: by 10.194.79.227 with SMTP id m3mr21291978wjx.126.1416838586847; Mon, 24 Nov 2014 06:16:26 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id hk9sm21174793wjb.46.2014.11.24.06.16.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 06:16:25 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Mon, 24 Nov 2014 14:16:25 +0000 Message-Id: <1416838585-8324-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t] lib: fix igt_reset_connectors 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use igt_debugfs_open to open the connector file, since the forced_connectors array now only stores the connector path relative to the debugfs path. Also add some extra error checking to ensure a test failure if the reset fails. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85829 Signed-off-by: Thomas Wood Tested-by: lu hua --- lib/igt_kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5edd5ec..cba0c27 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1773,8 +1773,8 @@ void igt_reset_connectors(void) * functions that are not safe to call in signal handlers */ for (tmp = forced_connectors; *tmp; tmp++) { - int fd = open(*tmp, O_WRONLY | O_TRUNC); - write(fd, "unspecified", 11); + int fd = igt_debugfs_open(*tmp, O_WRONLY | O_TRUNC); + igt_assert(write(fd, "unspecified", 11) == 11); close(fd); } }