From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AF65AC678D5 for ; Wed, 8 Mar 2023 05:36:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1890110E341; Wed, 8 Mar 2023 05:36:51 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 172DF10E320; Wed, 8 Mar 2023 05:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678253809; x=1709789809; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=EN7nZIx9AeWGW3dJFjmj92yVmKEaOgpm/fTa17NDrwA=; b=IY7CgvyimmiLojPr8meePr0qiI31hQOYuDW0qSivoQtLSNOJZPTcf4U1 ix4yYUFgffNIhXgnEQl29FyVwu6rdynPrMgY9OKAso4LcXz49RAd4BFs/ 5HP/UvFzESvXKsJ6PbO3eK5LniUWxH2j0x/XRrQ7ZQzm5iB4DZ5VOHAQ6 9WGAcEO23OOO0yOFrnt3hAFMfSJty3VKM6E3iF6XhtO4e8VY7qFvBo8oF p7Iopm74Kc4driJ502GgNqVBLLnx1cjql1Jhh7HU87zrCPqfr238DsV4k Aao7BdiUX21xh2aI7VqWPpUEt+c7NALizy6eZ+yZErTfZy/8Ho/Jg78XT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="422334765" X-IronPort-AV: E=Sophos;i="5.98,242,1673942400"; d="scan'208";a="422334765" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 21:36:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="740987360" X-IronPort-AV: E=Sophos;i="5.98,242,1673942400"; d="scan'208";a="740987360" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.87.208]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 21:36:48 -0800 Date: Tue, 07 Mar 2023 21:36:47 -0800 Message-ID: <87ilfbn6s0.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Tvrtko Ursulin In-Reply-To: <6c005534-9919-aad7-eb6c-fba0c8e12448@linux.intel.com> References: <20230304012705.70003-1-ashutosh.dixit@intel.com> <20230304012705.70003-3-ashutosh.dixit@intel.com> <6c005534-9919-aad7-eb6c-fba0c8e12448@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Use correct requested freq for SLPC 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, dri-devel@lists.freedesktop.org, Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, 06 Mar 2023 03:10:24 -0800, Tvrtko Ursulin wrote: > Hi Tvrtko, > On 04/03/2023 01:27, Ashutosh Dixit wrote: > > SLPC does not use 'struct intel_rps'. Use UNSLICE_RATIO bits from > > Would it be more accurate to say 'SLPC does not use rps->cur_freq' rather > than it not using struct intel_rps? No actually SLPC maintains a separate 'struct intel_guc_slpc' and does not use 'struct intel_rps' at all so all of 'struct intel_rps' is 0. > Fixes: / stable ? CI chances of catching this? Same issue as Patch 1, I have answered this there. > > GEN6_RPNSWREQ for SLPC. See intel_rps_get_requested_frequency. > > > > Bspec: 52745 > > > > Signed-off-by: Ashutosh Dixit > > --- > > drivers/gpu/drm/i915/i915_pmu.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c > > index f0a1e36915b8..5ee836610801 100644 > > --- a/drivers/gpu/drm/i915/i915_pmu.c > > +++ b/drivers/gpu/drm/i915/i915_pmu.c > > @@ -394,8 +394,13 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns) > > * frequency. Fortunately, the read should rarely fail! > > */ > > val = intel_rps_get_cagf(rps, intel_rps_read_rpstat_fw(rps)); > > - if (!val) > > - val = rps->cur_freq; > > + if (!val) { > > + if (intel_uc_uses_guc_slpc(>->uc)) > > + val = intel_rps_read_punit_req(rps) >> > > + GEN9_SW_REQ_UNSLICE_RATIO_SHIFT; > > + else > > + val = rps->cur_freq; > > + } > > That's a bunch of duplication from intel_rps.c so perhaps the appropriate > helpers should be exported (some way) from there. This is also addressed in the new series: https://patchwork.freedesktop.org/series/114814/ > > add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT], > > intel_gpu_freq(rps, val), period_ns / 1000); Thanks. -- Ashutosh