From patchwork Mon Apr 9 16:05:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10331723 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 303596037F for ; Mon, 9 Apr 2018 16:05:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2192328916 for ; Mon, 9 Apr 2018 16:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1635428A4A; Mon, 9 Apr 2018 16:05:49 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 A992728916 for ; Mon, 9 Apr 2018 16:05:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF1AE89DBA; Mon, 9 Apr 2018 16:05:47 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C778989DBA for ; Mon, 9 Apr 2018 16:05:45 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id x4so17762892wmh.5 for ; Mon, 09 Apr 2018 09:05:45 -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; bh=fRzHE8lPBZ6e67C5zhiDovD81rfQxA0yheKvPaYyZhg=; b=HGdC7Y7hom9qBOIVrGF6Y7yIGwmmotP7FPrQq7+6L2/4fT1YKqECKb0bIimKf+Y9Cc VAbmvq0M0HmVgu6xcRcW5auvug+3NuK/PRDgFPK5U8AiXyY1DhFFTcrkvqzi4iiffib4 jKqUaTfFaahHxFOW/J6MAAfIRR16cJrNEi2LIMEoMcuU+qbBNSLe/C7tlv0hhb1K7Yd6 Fug2OBFm0JT1PIh60YPICMk24DYRArG+DpWGmQJs3fnUaWs9xQYw/x8hB9SKoXTIk0yk mZ4IvN4y+Ge6X6KiUK7+vMRd+zm8ojy6IdLfgxwjd5eBtpGRsSGsSgofp7qROP76HJF2 qbZQ== 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; bh=fRzHE8lPBZ6e67C5zhiDovD81rfQxA0yheKvPaYyZhg=; b=ggYzpNnGVUPimOFnALXLoZLvO7DYOqU4tCeX/FS59ljrhri51n2pIUJ6fsPf94mNau AEAIvT8XDe8Q0kc1NZcm4VkXXFYUBsueXsF4fEqlWJsiqk3nHVhuICt4nCwjQJ+i2Z/6 oyVXgOlGoXednMItWwQUvetlrThZJzMiH/jmBNkfk06Q/Moo09LDzNefy33vZ6YZ6pxG 9QPgv5PmvcIB23VQJWyRJfWE+nD411kxW8b7bs+9b3u+M5wJMEFGHCRRE6ceyBdvfctz 1VFMHXb8x514/mExFCmChxTDBlm5SjIct+43O4ZINi04k/61Qqy12H/hIFbnozKcilJI IiCA== X-Gm-Message-State: ALQs6tDjEmz1/X4ObD2dMmH7dXqrF7/JZGoDDILKHBxTntVycR8WzBDi MU8aNvGK8f9j2mM6iWFrvL8v+vNS X-Google-Smtp-Source: AIpwx48U/7sA6/JbgXiXdk5R+wQ/KzbY/4KMDJbMvrggu6SYudZHleWg7BWLf7nTe0fLe06fAC5cpQ== X-Received: by 10.28.131.2 with SMTP id f2mr417765wmd.111.1523289944188; Mon, 09 Apr 2018 09:05:44 -0700 (PDT) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id n8sm1060007wrh.51.2018.04.09.09.05.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 09:05:43 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Mon, 9 Apr 2018 17:05:34 +0100 Message-Id: <20180409160534.23118-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [CI] drm/i915/pmu: check runtime resume vs pmu race 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: , 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 --- drivers/gpu/drm/i915/i915_pmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index bd7e695fc663..9302b4abe357 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -479,7 +479,11 @@ static u64 get_rc6(struct drm_i915_private *i915) val = kdev->power.suspended_jiffies - i915->pmu.suspended_jiffies_last; - val += jiffies - kdev->power.accounting_timestamp; + + if (kdev->power.runtime_status == RPM_SUSPENDED) + val += jiffies - kdev->power.accounting_timestamp; + else + WARN(1, "not suspended"); spin_unlock(&kdev->power.lock);