[PATCH v2 0/4] pmdomain: mediatek: Enable the GPU timestamp counter on MT8188
From: Michał Kopeć
Date: Sun Oct 11 2026 - 14:48:33 EST
On MT8188 the GPU timestamp counter reads zero until a register in the
MFGCFG block feeds it the SoC system timer, and MFGCFG loses that
setting whenever the MFG1 power domain is turned off. As a result, the
SYSTEM_TIMESTAMP query and the timestamps written by GPU jobs are always
zero, which breaks timestamp queries in userspace drivers.
v1 restored the register from panfrost through a new mediatek,mfgcfg
phandle on the GPU node. As Krzysztof pointed out, the register is lost
by the power domain, so v2 restores it there instead: the power
controller lists MFGCFG in access-controllers and writes the register
every time MFG1 has been powered on.
Patch 4 converts mt8188.dtsi from the deprecated per-domain
mediatek,infracfg phandles to access-controllers. A devicetree with it
needs the driver changes of patches 2 and 3, because older kernels
expect exactly one access controller on MT8188 and fail to probe the
power controller otherwise. Older devicetrees keep working with the new
driver, without the timestamp.
MT8370 uses the MT8188 power controller and mt8188.dtsi, so it is
covered as well.
Tested on the Lenovo Chromebook Duet (MT8188): the timestamp counts at
13 MHz, also after suspend and resume.
Changes in v2:
- Restore the register from the MFG1 power domain instead of panfrost,
and drop the GPU phandle (Krzysztof).
- Drop the panfrost patch, which makes the review comments about error
propagation and MT8370 moot.
v1: https://lore.kernel.org/all/20261003200132.866240-1-michal@nozomi.space/
Michał Kopeć (4):
dt-bindings: power: mediatek: Add the MT8188 access controllers
pmdomain: mediatek: Restore a register after powering a domain on
pmdomain: mediatek: mt8188: Enable the GPU timestamp counter
arm64: dts: mediatek: mt8188: Use access-controllers in the power
controller
.../power/mediatek,power-controller.yaml | 16 +++++++++++++-
arch/arm64/boot/dts/mediatek/mt8188.dtsi | 22 +------------------
drivers/pmdomain/mediatek/mt8188-pm-domains.h | 16 +++++++++++++-
drivers/pmdomain/mediatek/mtk-pm-domains.c | 19 ++++++++++++++++
drivers/pmdomain/mediatek/mtk-pm-domains.h | 15 +++++++++++++
5 files changed, 65 insertions(+), 23 deletions(-)
--
2.56.0