Re: [PATCH v4 0/5] platform/x86: huawei-wmi: expose native firmware power profiles
From: Eren Özen
Date: Mon Nov 30 2026 - 09:15:53 EST
Hi Fuwei,
On Mon, 30 Nov 2026 18:12:09 +0800, Fuwei Xie wrote:
> I tested Eren's charge-mode patch on NbF-XX: writing 75/80 moved the
> EC from smart-charge mode 4 to mode 1, the thresholds read back as
> 75/80, and charging stopped as expected. Eren, could you test the
> combined v4 + charge-mode tree on CREM-WXX9?
Yes. I built huawei-wmi.c from c339f4010dea + v4 + the charge-mode
diff from my v3 reply (rebased onto v4; only its context changed)
out of tree against Fedora's 7.3.4-300.fc45 kernel and loaded it in
place of the stock module on a MateBook 16 CREM-WXX9, BIOS 2.32,
with tuned-ppd 2.28.0.
Power profiles:
- Switching through sysfs, the GNOME Power Mode menu and Fn+P turns
Turbo on and off, and platform_profile matches the firmware mode
(GTUB) after each switch. With tuned-ppd started after the module
was loaded, GNOME also follows Fn+P in both directions.
- Six rounds of 50 fast balanced/performance write pairs (tuned
masked): no round ended with a stale profile (v3's event handling:
4 of 6).
- Each write still produces two WMI events here. v4 re-reads GTUB for
both and sends no extra notification.
- s2idle in performance, plugged in: the firmware cleared Turbo, the
resume callback re-read GTUB and notified, and platform_profile
read balanced. With tuned-ppd running, GNOME also showed balanced
after resume.
- Unplugging in performance: the firmware sends 0x2a0 and the
profile follows to balanced. Writing performance on battery
returns 0, the firmware answers with 0x2a6, and platform_profile
reads balanced again within 10 ms.
- Unload and reload are clean, with no unknown-key messages or
warnings.
Charge thresholds:
- With the module loaded, the thresholds and fn_lock_state read the
same as with the stock driver (40/70).
- With the EC in smart-charge mode 4, writing 75 80 moved it to
mode 1 and the thresholds read back as 75/80 (sysfs, GBTT and
GBCM). Writing 0 100 leaves the EC in mode 1 with no limit (not
mode 4), and 75 80 after that works again, as do the battery
start/end attributes.
- The driver reports the thresholds in modes 1 and 2 and 0 100 in
modes 0 and 4, also when the module is loaded in mode 1 or mode 4.
The combined tree also builds in-tree with W=1 and sparse whitout
warnings.
Not tested: hibernation (disabled here), charge mode 3, and the
charging current itself (I checked GBCM/GBTT after each step).
The only problem I saw is in tuned-ppd, as described for v3:
choosing Performance in GNOME on battery leaves GNOME showing
Performance while the firmware stays balanced.
I'm a co-developer of 4/5, so feel free to leave my Tested-by off
that patch when you carry it forward.
Tested-by: Eren Özen <erenozen@xxxxxxxxxxxxxx> # MateBook 16 CREM-WXX9
I used an AI to write the test scripts and
I ran the tests on my machine and checked the results.
Thanks,
Eren