From patchwork Wed Sep 18 04:12:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2904681 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 78C22BFF05 for ; Wed, 18 Sep 2013 04:18:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A620720203 for ; Wed, 18 Sep 2013 04:18:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0D1D4201FF for ; Wed, 18 Sep 2013 04:18:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05737E68A4 for ; Tue, 17 Sep 2013 21:18:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id ABFCEE5C0A for ; Tue, 17 Sep 2013 21:13:25 -0700 (PDT) Received: by mail.bwidawsk.net (Postfix, from userid 5001) id E2DF359E19; Tue, 17 Sep 2013 21:13:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lundgren.intel.com (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by mail.bwidawsk.net (Postfix) with ESMTPSA id 933CE59E17; Tue, 17 Sep 2013 21:13:04 -0700 (PDT) From: Ben Widawsky To: Intel GFX Date: Tue, 17 Sep 2013 21:12:49 -0700 Message-Id: <1379477575-2164-8-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1379477575-2164-1-git-send-email-benjamin.widawsky@intel.com> References: <1379477575-2164-1-git-send-email-benjamin.widawsky@intel.com> Cc: Bryan Bell , Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH 08/14] intel_l3_parity: Assert all GEN7+ support X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP v2: Don't assert for Valleyview (Bryan) Rework code to be a bit more readable. CC: "Bell, Bryan J" Signed-off-by: Ben Widawsky --- tools/intel_l3_parity.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c index 970dcd6..715d095 100644 --- a/tools/intel_l3_parity.c +++ b/tools/intel_l3_parity.c @@ -116,15 +116,14 @@ int main(int argc, char *argv[]) drm_fd = drm_open_any(); devid = intel_get_drm_devid(drm_fd); + if (intel_gen(devid) < 7 || IS_VALLEYVIEW(devid)) + exit(EXIT_SUCCESS); + ret = asprintf(&path, "/sys/class/drm/card%d/l3_parity", device); assert(ret != -1); fd = open(path, O_RDWR); - if (fd == -1 && IS_IVYBRIDGE(devid)) { - perror("Opening sysfs"); - exit(EXIT_FAILURE); - } else if (fd == -1) - exit(EXIT_SUCCESS); + assert(fd != -1); ret = read(fd, l3log, NUM_REGS * sizeof(uint32_t)); if (ret == -1) {