From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 635A132AAA8 for ; Sat, 22 Aug 2026 08:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787388856; cv=none; b=CSmfp89YOYQjAaFordWIb6O7ewev2jdeaxeiDddrUzxozK7S+2kahKQcb+PKgfGqFZcYOhEXNultCPNS9KmCVAsbkmG+gNdntuqhdzfoGPMTVTRA1pNUqWA5FSqRqmhfmBG71ETBQYU+dzIjGt0o9XiY8LjQD1p3wMuqu+UKnJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787388856; c=relaxed/simple; bh=w6WBVp/nqTJzVu/F8o6dNpn692S+TWFb0eedQ3+ZlSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gK2BdaQrPwG89uSji1hPS6jgq/+Bwo93RikVH7BSUSAVr0xjiQ+R3LdbAYBsBVeZuviEaP2aZAeLRMYJfPSvRT/Q4rcUayWvpmN6UWXGmdoDxKeyAg3uuDeMwBfbhVLkJsr+JtclxteS3RMct+nKfm1A3DwEmNQQ1aUmUaLrfZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WPiI8nyR; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WPiI8nyR" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2ceaf8a1265so20872385ad.2 for ; Sat, 22 Aug 2026 01:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787388851; x=1787993651; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=XSAtM60aX5eEvOcf6pdX1RWdmcuk2ZJPzvzzbZMEPQw=; b=WPiI8nyREopW4NlhIUl1OuD2fKq9NscGXQtSHqn8Fwrv0DOrcxVdj6uoXkyahvSDlh Hcl+MMRlTtTHMH1jexm8zp6P9kJVZpe+ROTn85jh2jQ9HIZkqC9x2Goefy7ujBC9UDvq xE9GsuBPM9GHQPZt3SYSCZPz86IbjPMuh/2JMMkLqFIPsDz/H9mfUDShDV9aHOfwAtOJ PHXiAHKYvkAdPA0/Rzq4VKEVPJWzlThbCkW9zgpRZqZ+jpwROgmcdFAUArqKkpto6HDJ KMdCSkbUe108IcwifyPyULYhqZcx/Rcy6N9WWtigu59Zkz7pFrGYaEVNcy3EUOifWY9b Bwrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787388851; x=1787993651; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XSAtM60aX5eEvOcf6pdX1RWdmcuk2ZJPzvzzbZMEPQw=; b=J9HD6Tb5EIltdyZbFe6tLPqcMq65WQdKZI3P6UQvr1SvWR1Yb1S6NBuxDC5jLkx1Et sQE6VcgeAFcjNziNt1w2Mqf+qY28Lf/dExK474/VOhae/sXSw2msrcc20KZ45A67FRsw eVLZ2ntNISYmsH5+7TBBohVNN8F9PjWwy2ZNGBUnatY4qLov4DsfYrJkuoftqh0sN4cP nTA2A4rLzi4F4D8NVmdfmuYqtgX3IG9HxnzkUWh0dniZTjCDS7NOJ+mUAxxEpnxG8u+S 5OXdYGJ5nPMM9AD901x1j3YqWCkuVscUe69WI1/tN2bbrsyXwHNyKi1pA8dSwyPvYLQU YFNg== X-Forwarded-Encrypted: i=1; AHgh+RqUCfpTTgjMo19wE2C0KiZGXzYNc2tyP63vOzUweZntb44EdOjmpUpVeiA89l9lpPXnmYj2T2JXKULqscg=@vger.kernel.org X-Gm-Message-State: AFuF++lJLp6hTNJczl42swmakyiHivXfM/eoPzPBjSHaom+UvLEdKKuk tJQtCM7vieFq8wJBJ25O6UVmVZ0igU/1997/LWDEh6XzV7asOWOR+Elr X-Gm-Gg: AR+sD13V9JwMSS9BZ5yuUFzsT15198NRU873fOE0m+0wf0W2Mh/wzfYidThwWH28KEO 79r9tJPTs5DKwiEfsfDLC+6WlVlpvJtizkjXAVh1mIbzrEUTr0i4FI+yPYTTTKTM8SPApOQvHit //zTCWk9Ny1Lx6+JxZt0OhFVjw/FcX8Ezyt3s6DzQqU/i/C6Vi1IINsM2frahczlCy1Ut74k6r4 buboGhLjg5po8HMYb8N3cJBuhVNO5lEZnO4/7KH1nqR2JJ2i+E0i5QJWnMipK3YpQGK5j2JlRV1 /HvXunJMptJKygDTXBbPmeMrx3nqkaCEfwU6euetiASxk2zdAZlO4MzjnTfuVmsu3peEIFTEMMJ /y/m1yekdkJnHp6r+NPm0hCQktWUnu+jJTdsQlWdRgsWSg9TTtLrRE49NMjh2B6/zr/chtzSrHu vZHNR1cSS7FcJk08w08wkfCUn3F+94HY3dwZh/rUdX6QyjbVV2eMSKiEn1pECnz9+5MKUWaJ7EL 1LqRymrLAWFZg== X-Received: by 2002:a17:903:1a6f:b0:2cc:aa38:4df3 with SMTP id d9443c01a7336-2d64b1851fdmr202120735ad.13.1787388850676; Sat, 22 Aug 2026 01:54:10 -0700 (PDT) Received: from mcp-node.. ([240d:f:fe4:c00:e9d:92ff:fe83:dbda]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d67676170fsm2982575ad.6.2026.08.22.01.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Aug 2026 01:54:10 -0700 (PDT) From: Yuta Higuchi To: intel-xe@lists.freedesktop.org Cc: Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/1] drm/xe/hwmon: wake render domain for BMG package temperature Date: Sat, 22 Aug 2026 17:52:03 +0900 Message-ID: <8215b921cf29322ee2a434b3a772756e56c8d03e.1787385860.git.avablaba@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On one Arc Pro B70 (8086:e223), the BMG package-temperature value exposed as temp2_input updates continuously while the GPU is active. After the final workload closes, it emits a short snapshot burst and then remains stale for more than 200 seconds while VRAM, mctrl, PCIe, fan, energy, and runtime state continue to change. An independent PID reading the same sysfs node sees the same result, excluding the collector as the source of the staleness. The package-temperature read currently reaches BMG_PACKAGE_TEMPERATURE (0x138434) through xe_mmio_read32() without an explicit forcewake reference. Experiments on this Arc Pro B70 isolated the observable dependency as follows: - stock forcewake_all kept package temperature updating; - a persistent main-GT XE_FW_RENDER reference kept it updating in three of three independent rounds; - releasing that reference was followed by renewed staleness in all three rounds; - main-GT XE_FW_GT alone was negative in the single persistent-holder round tested; - transient XE_FW_RENDER acquisition produced a fresh value in 1.17 to 2.172 ms; and - a 20 ms RENDER hold with no sysfs reads yielded a fresh first read. Acquire the main GT render forcewake domain around BMG package-temperature reads, allow 3.0 to 3.5 ms for the observed publication to settle, read the register, and release the reference automatically. The delay is empirical, not an architectural contract. FORCEWAKE_ACK_RENDER only acknowledges the wake domain; no public temperature-producer-ready indication was found. These experiments do not establish that register 0x138434 architecturally belongs to XE_FW_RENDER or identify whether PCODE, GuC, or other firmware produces the value. Keep the change limited to the BMG package-temperature channel. Runtime validation was performed on one Arc Pro B70. XE_FW_RENDER was single-domain sufficient among the directly compared states, but media, GSC, and other individual forcewake domains were not tested after that positive result. This does not claim that RENDER is the unique minimum for all BMG devices or steppings. The equivalent Ubuntu 7.0 diagnostic implementation passed three independent 180-second cooldown rounds; 1, 5, 10, and 30 second read cadences; four concurrent readers; a 30-minute run; OpenVINO workloads; suspend/resume; and Xe unbind/rebind. The directly tested drm-tip submission candidate, based on 75140c4ee9ad, additionally passed one clpeak/dual-reader/180-second-cooldown smoke and one bounded OpenVINO two-model smoke. No GPU hang, reset, fault, wedge, or kernel taint occurred. Fixes: dac328dea701 ("drm/xe/hwmon: expose package and vram temperature") Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7805 Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4560 Assisted-by: OpenAI Codex:gpt-5.6-sol Assisted-by: Claude Code:claude-fable-5 Assisted-by: ChatGPT:GPT-5.6 Sol Pro Signed-off-by: Yuta Higuchi --- drivers/gpu/drm/xe/xe_hwmon.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c index 5284cab67..1c0c6d3ab 100644 --- a/drivers/gpu/drm/xe/xe_hwmon.c +++ b/drivers/gpu/drm/xe/xe_hwmon.c @@ -3,6 +3,7 @@ * Copyright =C2=A9 2023 Intel Corporation */ =20 +#include #include #include #include @@ -14,6 +15,7 @@ #include "regs/xe_mchbar_regs.h" #include "regs/xe_pcode_regs.h" #include "xe_device.h" +#include "xe_force_wake.h" #include "xe_hwmon.h" #include "xe_mmio.h" #include "xe_pcode.h" @@ -330,6 +332,28 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon = *hwmon, enum xe_hwmon_reg return XE_REG(0); } =20 +/* + * Experiments on Arc Pro B70 show that package-temperature updates resume + * after acquiring the main GT render forcewake domain. Allow time for a f= resh + * value before reading. FORCEWAKE_ACK_RENDER acknowledges the forcewake + * domain; it is not known to indicate temperature-producer readiness. + */ +static int xe_hwmon_bmg_pkg_temp_read(struct xe_hwmon *hwmon, u64 *reg_val) +{ + struct xe_force_wake *fw =3D gt_to_fw(xe_root_mmio_gt(hwmon->xe)); + struct xe_mmio *mmio =3D xe_root_tile_mmio(hwmon->xe); + + CLASS(xe_force_wake, fw_ref)(fw, XE_FW_RENDER); + + if (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FW_RENDER)) + return -ETIMEDOUT; + + usleep_range(3000, 3500); + *reg_val =3D xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_TEMP, CHANN= EL_PKG)); + + return 0; +} + #define PL_DISABLE 0 =20 /* @@ -1037,6 +1061,17 @@ xe_hwmon_temp_read(struct xe_hwmon *hwmon, u32 attr,= int channel, long *val) case hwmon_temp_input: switch (channel) { case CHANNEL_PKG: + if (hwmon->xe->info.platform =3D=3D XE_BATTLEMAGE) { + int ret =3D xe_hwmon_bmg_pkg_temp_read(hwmon, ®_val); + + if (ret) + return ret; + + *val =3D REG_FIELD_GET(TEMP_MASK, reg_val) * + MILLIDEGREE_PER_DEGREE; + return 0; + } + fallthrough; case CHANNEL_VRAM: reg_val =3D xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_TEMP, chan= nel)); =20 --=20 2.43.0