From patchwork Fri Sep 29 12:39:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9977961 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 ECA976034B for ; Fri, 29 Sep 2017 12:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E41F129830 for ; Fri, 29 Sep 2017 12:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8FC22985B; Fri, 29 Sep 2017 12:40:00 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 A858329830 for ; Fri, 29 Sep 2017 12:40:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B26926EB68; Fri, 29 Sep 2017 12:39:59 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE1906EB01 for ; Fri, 29 Sep 2017 12:39:50 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id n64so1211269wrb.2 for ; Fri, 29 Sep 2017 05:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0fqaPvstmX1RJ3M7Y8MUnpa2htblgYvCE3KnQo3X1Lo=; b=L6FdGuUoAQpagMI4y3Y3bOZ+2fo3s6+LVNV/XSzcM+V6Mi0nJNdzqekCIzx5cu1xPO t9AEcQKvuzQotziWB0QygJ4G4MUAwSz5hNTf+P2vWQlK4VDs9xzQamihu1YPd0DrqYSq sGUVe4vbRvxp663EM8fcqzSBiu3Z0LXA6TFx4cIuLsyijQKfdc2gduj0N/Z1rdte0J8P 4ZJN6RoxR9c664ratSbF2LLQrJHGTsboZZsGHz2DONWs268bPi/Gk/cZyLw1I82OXRFH qD/sLJA8GzrVjcLQbhxTKpj4vbQE0wKHJgtOKYkd/T3BuGlP9F2csTl4Ptj/IvJEK6J2 np2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0fqaPvstmX1RJ3M7Y8MUnpa2htblgYvCE3KnQo3X1Lo=; b=mpx4PHoHHt7RTvbLYOj3SAfianK7g3dx/JAtOuwVV7AWE0E6PU7+fPjjEcbgzEdX2v 5f3EDbYBmdxT/pGz6uuJ2pMYeCPlX/o8f4zfJ6r6Ap1QJA/tKTRwtQmMvmQN45aarln3 KFXTmFHvyaVadV0/r8scCfXuUaU1jwj+z3qaQiwQB7f6Eo2DmDp7r6oerZbN5ay+3uJV 3LVDTxpV8iRXuqxqomg6o2J9M0+WDCSHdgyMMgLTMSaWOulyQ+lPvu/bkyZvMrklJ54q oJensaCTZ+qvdwYMNws2a65JCJrrFHSkOPHb0XdfheiChwhw1alA+FTygGARexwD79Qo q9jg== X-Gm-Message-State: AHPjjUgNC96mxiUYpJuxpsKu7yiDQqNSyVCxIbbmDNTLa64F1sykx7hD nAoPlFpdqytyhUId9bWTZgUvnQ0E X-Google-Smtp-Source: AOwi7QBgJbiygWC2wfvaY3wnUkPZbRPyqci5ZGoFpWaPjV+DR3pIFjrBGSZazN0cZ7NjmW11qtlY+A== X-Received: by 10.223.152.199 with SMTP id w65mr8529954wrb.254.1506688789298; Fri, 29 Sep 2017 05:39:49 -0700 (PDT) Received: from t460p.intel ([95.146.151.158]) by smtp.gmail.com with ESMTPSA id w5sm1959691wrg.65.2017.09.29.05.39.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 05:39:48 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Fri, 29 Sep 2017 13:39:35 +0100 Message-Id: <20170929123939.3312-4-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170929123939.3312-1-tvrtko.ursulin@linux.intel.com> References: <20170929123939.3312-1-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH i-g-t 3/7] intel-gpu-overlay: Fix interrupts PMU readout 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 From: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin --- overlay/gem-interrupts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/overlay/gem-interrupts.c b/overlay/gem-interrupts.c index a84aef0398a7..3eda24f4d7eb 100644 --- a/overlay/gem-interrupts.c +++ b/overlay/gem-interrupts.c @@ -136,8 +136,12 @@ int gem_interrupts_update(struct gem_interrupts *irqs) else val = ret; } else { - if (read(irqs->fd, &val, sizeof(val)) < 0) + uint64_t data[2]; + + if (read(irqs->fd, &data, sizeof(data)) < 0) return irqs->error = errno; + + val = data[0]; } update = irqs->last_count == 0;