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 A026CC36002 for ; Tue, 25 Mar 2025 00:19:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4648F10E258; Tue, 25 Mar 2025 00:19:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="SaUG6jWB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAE8410E258 for ; Tue, 25 Mar 2025 00:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1742861941; x=1774397941; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=rGOyQ7F/h8Jnc/G18y7msCdMje5ybyoGUr1oLdXZk2M=; b=SaUG6jWBsEN57dvrbtwGe6uvxU4DDHzzPpgZna2mL/lZHTHvBV5hNM4v ysxTW2rLWlN/9iIfxuIOmkQoaqN0Tp8kSKHz637AKmFDhAzmRZw+sd3J2 LlEvY6MKkX0uTcg02JwSIfyOe/CSKv/fy3e9A8GsYLodgBMLqy/15bPLd L6VRLq0D7LNGTXSlDFWqc5XSkbhHjLA1yGvJ6mmOKAx67Sv/OQI5zdUHn iiu0P/wWiAbgKSQCQYwIohnM3co1edaQHm0RZdwVGrCUd0sMVrwHza3WQ 5Z9XpUMIK6qy/IGWGYzmqP2+spgHJLzoRsHmSY2au493anKzwe1Igs42G w==; X-CSE-ConnectionGUID: MICBlfAPSEyOXJ2fDhrBug== X-CSE-MsgGUID: Nh/OHkI8RRWls+8rsr5UUA== X-IronPort-AV: E=McAfee;i="6700,10204,11383"; a="43248589" X-IronPort-AV: E=Sophos;i="6.14,273,1736841600"; d="scan'208";a="43248589" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2025 17:18:59 -0700 X-CSE-ConnectionGUID: xc4ScIE2R9mO2i+B0RNo1w== X-CSE-MsgGUID: WsID2ZS/SSumi1ldOLLQqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,273,1736841600"; d="scan'208";a="129267108" Received: from unknown (HELO adixit-MOBL3.intel.com) ([10.125.127.34]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2025 17:19:00 -0700 Date: Mon, 24 Mar 2025 17:18:58 -0700 Message-ID: <87jz8e9d3h.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Vinay Belgaumkar Cc: intel-xe@lists.freedesktop.org, Riana Tauro , Lucas De Marchi , Rodrigo Vivi Subject: Re: [PATCH v4] drm/xe/pmu: Add GT frequency events In-Reply-To: <20250324232402.46481-1-vinay.belgaumkar@intel.com> References: <20250324232402.46481-1-vinay.belgaumkar@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/29.4 (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 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Mon, 24 Mar 2025 16:24:02 -0700, Vinay Belgaumkar wrote: > > @@ -266,11 +274,24 @@ static u64 __xe_pmu_event_read(struct perf_event *event) > case XE_PMU_EVENT_ENGINE_ACTIVE_TICKS: > case XE_PMU_EVENT_ENGINE_TOTAL_TICKS: > return read_engine_events(gt, event); > + case XE_PMU_EVENT_GT_ACTUAL_FREQUENCY: > + return xe_guc_pc_get_act_freq(>->uc.guc.pc); > + case XE_PMU_EVENT_GT_REQUESTED_FREQUENCY: > + if (!xe_guc_pc_get_cur_freq(>->uc.guc.pc, &cur_gt_freq)) This is unconditionally taking the forcewake and waking the card up just to get the sample. Do we really want to do that? So if we don't do that, both the actual and requested freq will be 0 if gt is in C6. > + return cur_gt_freq;