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 264F8D149E8 for ; Fri, 25 Oct 2024 19:58:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1E7510EB7C; Fri, 25 Oct 2024 19:58:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mM4oH+kJ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 95E2210EB7C for ; Fri, 25 Oct 2024 19:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729886325; x=1761422325; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=XCU6pmxwFDQ6eGT1dE7L43i4g1HhVAsSFEU8FAndBT0=; b=mM4oH+kJT9hu7fVRWcCXwkBZ741EGebSS0yHWlFuqRk/ajeMLTNG9kc7 /eR7fAG7uby0TlxPbOZ/DYg+qgUvNrSrFgNdQa1G1lytcv4jNt2gQCKAf kZ0UhEZRYUnf1eyWk6pXr3KaAo789SQTFD3DtctkD0oBM9dD52eHb6P39 C1TeOKKLcs/lgkNb2to/3IAIO3bO1Tq4jcd37rp5dfLWqAAzQ3eCejmlk GhlYsdIu9PaGUU0Ucu7AzVYbho9kHWAymTpO4q0k2b3tRbfxQfGdMcmQe 3yDWsLsnVEk484e4ap7YwIW1euuihfbgrSD9i1oIHHdsdALTRv7xyagGv w==; X-CSE-ConnectionGUID: laz/88PSTNmhTMgNxTABMg== X-CSE-MsgGUID: GhDTFHH+RpWYJOiHb2Npew== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="33263228" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="33263228" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2024 12:58:45 -0700 X-CSE-ConnectionGUID: 6gIhQtnfRyWosuBEXug0Bw== X-CSE-MsgGUID: B1nbK0+iR824R6NQYh+U7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,232,1725346800"; d="scan'208";a="81467095" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2024 12:58:45 -0700 Date: Fri, 25 Oct 2024 12:58:45 -0700 Message-ID: <857c9wt0ne.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Raag Jadav Cc: lucas.demarchi@intel.com, John.C.Harrison@Intel.com, rodrigo.vivi@intel.com, matthew.d.roper@intel.com, andi.shyti@linux.intel.com, intel-xe@lists.freedesktop.org, anshuman.gupta@intel.com, badal.nilawar@intel.com, riana.tauro@intel.com Subject: Re: [PATCH v1] drm/xe: Rework throttle ABI In-Reply-To: <20241025092238.167042-1-raag.jadav@intel.com> References: <20241025092238.167042-1-raag.jadav@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-redhat-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 Fri, 25 Oct 2024 02:22:38 -0700, Raag Jadav wrote: > > Current implementation adds multiple sysfs entries for getting GT > throttle status and its reasons, which forces the user to read multiple > entries for evaluating the result. Since output of each entry is based > on the same underlying hardware register and considering the access type > of this register is RO/v, the value of this register can change at any > given point, even between subsequent sysfs reads. This makes current > implementation fundamentally flawed which can produce inconsistent results. > > Rework throttle ABI and introduce throttle_status attribute which will > provide throttle status through a oneshot register read, making it > relatively less error prone. The new ABI will provide throttle reasons > in a string based list based on the respective bits which are set in the > hardware. Empty output means no bits are set and hence no throttling. > > $ cat /sys/devices/.../tile0/gt0/freq0/throttle_status > prochot > thermal > ratl > thermalert > tdc > pl4 > pl1 > pl2 Agree this seems to be a much better way of doing this, so I'd be open to changing the ABI while we can :-) Not sure if there are any IGT's which use the current ABI though. Are there any real applications using the old ABI? Note that the top 16 bits are "latched" values of the conditions in the lower 16 bits, so maybe we can add those too in throttle_status? Ashutosh