Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F8D7C433ED for ; Fri, 9 Apr 2021 11:46:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 436F461165 for ; Fri, 9 Apr 2021 11:46:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 436F461165 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C09416E497; Fri, 9 Apr 2021 11:46:23 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2028B6E497; Fri, 9 Apr 2021 11:46:23 +0000 (UTC) IronPort-SDR: dmmVIBMEXG1i7+ZmHIBFoBXNSgXH5eOwEDzOuMxLMYYRma5afUwKPwHwtxYwtcvWy3qahlYQOf U05x7nZ8xJDQ== X-IronPort-AV: E=McAfee;i="6000,8403,9948"; a="257727536" X-IronPort-AV: E=Sophos;i="5.82,209,1613462400"; d="scan'208";a="257727536" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 04:46:21 -0700 IronPort-SDR: Rno9XHDqeQX5uQ+9YPkP6mkeTkQWLcz2MUr0s6YKuVvpkBAbethuyGuF03Lm7pf+A3wSAaKOpe luDR1ysg30OA== X-IronPort-AV: E=Sophos;i="5.82,209,1613462400"; d="scan'208";a="520258621" Received: from jbuller-mobl1.ger.corp.intel.com (HELO [10.213.233.163]) ([10.213.233.163]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 04:46:19 -0700 To: Andi Shyti References: <20210330150637.2547762-1-tvrtko.ursulin@linux.intel.com> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc Message-ID: <941d263a-9c3f-5169-6925-f0915288d9f1@linux.intel.com> Date: Fri, 9 Apr 2021 12:46:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH] drm/i915/pmu: Do not report 100% RC6 if not supported X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org, Eero T Tamminen , dri-devel@lists.freedesktop.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 06/04/2021 12:19, Andi Shyti wrote: > Hi Tvrtko, > >> We use GT parked status to estimate RC6 while not in use, however if RC6 >> is not supported to start with that does not work very well and produces a >> false 100% RC6 readout. >> >> Fix by not advancing the estimated RC6 counter when feature is not >> supported. >> >> Signed-off-by: Tvrtko Ursulin >> Fixes: 1fe699e30113 ("drm/i915/pmu: Fix sleep under atomic in RC6 readout") >> Reported-by: Eero T Tamminen >> --- >> drivers/gpu/drm/i915/i915_pmu.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c >> index 41651ac255fa..02fe0d22c470 100644 >> --- a/drivers/gpu/drm/i915/i915_pmu.c >> +++ b/drivers/gpu/drm/i915/i915_pmu.c >> @@ -191,7 +191,10 @@ static u64 get_rc6(struct intel_gt *gt) >> * on top of the last known real value, as the approximated RC6 >> * counter value. >> */ >> - val = ktime_since_raw(pmu->sleep_last); >> + if (gt->rc6.supported) >> + val = ktime_since_raw(pmu->sleep_last); >> + else >> + val = 0; > > if rc6 is not supported, why are we here? There is another flavour of this patch which indeed prevents us from getting here if rc6 is not enabled. (By not exposing the counter if not supported.) > > Did you mean rc6.enabled ? Yeah, I did not see that one initially at all! But it doesn't matter since this patch is not going in anyway. Regards, Tvrtko _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx