From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 506C0606A31A for ; Tue, 1 Dec 2026 13:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qZ/vVtgU; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=a8cn6KFR DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=CcSwom3LBpMU47HXagE29hU7O/MOw6RhHRQSprNZzVU=; b=qZ/vVtgUrpdaeqmZqJ+8lRB9vj QnE7BCI6K4qbOAc9/cS2T7aFu+NFLuwu4Eg7PyzwasZ+uXQ37uAoRYbojBEcR/F8LC61IS6Kv/VGq zZLd5WhVdIy+2aVVy0A5QnADyf+Txz6DTNg8g3dvM0l6qqT0e/vA8CAEIY8vBEuFmfN6T+m8Z6t9L Ipa3iD+R/GeUTZ+vGH6oCiCEUd79JyopaysBI/KA/dFciR6caRAEs9clfFWYj3PLNIR3bst102Y4v 1hHGeIGimepH12EZEY+3xe9ya4NhgVSItjt7QwiyW+P12U9NxcDFIfyO3/K1iS4YSrkFXsnJnxvgY QcYYiI4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYNdB-00000008BNy-3q63; Tue, 01 Dec 2026 13:10:49 +0000 Received: from sender5-pp-f112.zoho.com ([165.173.182.112]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYNcy-00000008B77-437e; Tue, 01 Dec 2026 13:10:45 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1796130632; cv=none; d=zohomail.com; s=zohoarc; b=TqHS0Nzg5e9LISW6WvR6JE41TFmbvQUUqeIzOWUo8uVKEeRW8tKKNMYlo6EZ8p6wKwyXDGBREp+XhvBn2ZAPXc3F5/xL/h5rRI5Bl8HVwN+5Rlty4/e4kttsCy/N8tTkDpXcDmyPTPK66LJRZG8B5Sc49VkMXiXFPuXay8gU1Tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796130632; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=CcSwom3LBpMU47HXagE29hU7O/MOw6RhHRQSprNZzVU=; b=WEWQiUa97mPrzGy0bKQdKyMm6XJ0NK4XBeTh2jqbNEVMKIhryfSgs3MqvQFXgR3xmM0QSCBB05BmspIdcOWi/5RvGfbxitBPSe8YTOgf3U/jMxj1vSUpIVtmbEkonj0XWgB1d5TwuNsa+ap9hzMTI1vXGARSuLlrAWs13r3LILg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=a8cn6KFRMF9L7Jqs805BFRXhlCIUWKoP4Q/xiNudedbJCL2iml8dJwviIaUJZt2lYlybIFTlfSkUmvbLBewh+Hz9HFNcBQ9/QqInHueSi1Amz9Ah0+IkTaFkTqWaBdAZbaDUNco0ZCAutWWMdgSCviurqS0rWOFF6LQlgAMW1lU=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=CcSwom3LBpMU47HXagE29hU7O/MOw6RhHRQSprNZzVU=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 17961306303421005.939790372208; Tue, 1 Dec 2026 05:10:30 -0800 (PST) From: Nicolas Frattaroli To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Ulf Hansson , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Alexandre Mergnat Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Alexandre Mergnat , Moudy Ho Subject: Re: [PATCH 0/3] Add the MT8196 GPU temperature sensor Date: Tue, 01 Dec 2026 14:10:25 +0100 Message-ID: In-Reply-To: <20261130-mtk-mfg-thermal-v1-0-e0617e26f902@baylibre.com> References: <20261130-mtk-mfg-thermal-v1-0-e0617e26f902@baylibre.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_051040_526708_7D353C5B X-CRM114-Status: GOOD ( 26.94 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Commenting as someone with some experience with the hardware On Monday, 30 November 2026 15:19:30 Central European Standard Time Alexandre Mergnat wrote: > No mainline driver reports the temperature of the MT8196 GPU, so a > thermal zone cannot throttle the GPU when it heats up. This series > takes the temperature that the GPUEB, the microcontroller managing > the GPU power and frequency, reports to the kernel, and makes it a > thermal sensor that a device tree thermal zone can use. > > The usual way to get this temperature would be to extend the driver of > the SoC thermal controller (LVTS) to its GPU sensors. This series uses > the value that the GPU firmware reports instead, because the firmware > already reads these sensors. Makes sense. We also have to do this for clocks here iirc, and the shader-present efuse of course. While it would've been nice to have the "real" source of that info, proxying it through the GPUEB firmware is the most reliable path since we don't know what other clocks and things it uses to get those ready, much less the addresses. > Any read clears the flag that marks a new > measurement, so this flag cannot be shared by two readers: a read by > one makes the other miss that a new measurement is there. A prototype > Linux reader of these sensors often found the flag already cleared > without having read it. Okay yeah that's extra lovely then and reinforces the need to do this through the firmware. > On the test board, the value that the firmware > reported stayed within one degree of the average of these sensors. Is any sensor compensation already done as part of the GPUEB firmware? Usually hardware has some factory calibration fused into OTP registers, though I don't know whether that's the case specifically for MT8196. > > Signed-off-by: Alexandre Mergnat > --- > Alexandre Mergnat (2): > pmdomain: mediatek: mfg: Expose GPU temperature > thermal/drivers/mediatek: Add GPUEB thermal driver > > Moudy Ho (1): > dt-bindings: power: mt8196-gpufreq: Add #thermal-sensor-cells > > .../bindings/power/mediatek,mt8196-gpufreq.yaml | 4 ++ > drivers/pmdomain/mediatek/Kconfig | 1 + > drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c | 29 ++++++++++++ > drivers/thermal/mediatek/Kconfig | 9 ++++ > drivers/thermal/mediatek/Makefile | 1 + > drivers/thermal/mediatek/gpueb_thermal.c | 52 ++++++++++++++++++++++ > include/linux/soc/mediatek/mtk-mfg.h | 13 ++++++ > 7 files changed, 109 insertions(+) > --- > base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1 > change-id: 20261115-mtk-mfg-thermal-9f4a7cc786ae > > Best regards, > -- > Alexandre Mergnat > > ACK from me for the general approach, as for implementation I haven't looked too closely at it but am wondering whether this also means I messed up when making the mtk-mfg-pmdomain.c driver a clock provider, instead of having a clock provider driver suckling on an auxiliary bus there. Any thoughts on whether that should be refactored, i.e. if there's a benefit? Kind regards, Nicolas Frattaroli