Skip to contentSkip to conversation

New: REGRESSION: charge_control missing in 6.12

Bug 219517 [email protected] 1 participant 27 messages Nov 20, 2024 – Dec 16, 2024 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=219517

            Bug ID: 219517
           Summary: REGRESSION: charge_control missing in 6.12
           Product: Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Platform_x86
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

On my ASUS Vivobook S14 (TP3402VA) I noticed that with kernel 6.12(-rc4,-rc7) several charge control related /sys entries are missing.

with kernel 6.12 the corresponding folder looks like this:
ls /sys/class/power_supply/BAT0/

alarm               charge_now   manufacturer   status      voltage_min_design
capacity            current_now  model_name     subsystem   voltage_now
capacity_level      cycle_count  power          technology
charge_full         device       present        type
charge_full_design  hwmon3       serial_number  uevent

Specifically missing is charge_control_end_threshold, which is normally used to set individual charge end points. That worked nicely up to kernel 6.11, but is defect now in the current 6.12 version.

Anything special you need from me to fix the problem?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

https://bugzilla.kernel.org/show_bug.cgi?id=219517

Armin Wolf ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Armin Wolf ([email protected]) --- Does the asus-wmi driver even load with kernel 6.12?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #2 from Michael ([email protected]) --- Hi Armin

Yes, the asus-wmi driver loads, but the asus-nb-wmi driver fails with error 5. Here is the relevant dmesg:

dmesg|grep asus

[   18.552935] asus_wmi: ASUS WMI generic driver loaded
[   18.570919] asus_wmi: Initialization: 0x1
[   18.572730] asus_wmi: SFUN value: 0x21
[   18.572746] asus-nb-wmi asus-nb-wmi: Detected ATK, not ASUSWMI, use DSTS
[   18.619578] asus_wmi: Failed to set throttle thermal policy (retval): 0x0
[   18.619584] asus_wmi: Failed to set default thermal profile
[   18.619589] asus-nb-wmi asus-nb-wmi: probe with driver asus-nb-wmi failed

with error -5

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#3 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #3 from Michael ([email protected]) ---
As a comparison, here's the dmesg from an earlier kernel with working asus-nb-wmi:

❯ dmesg|grep asus

[   14.268902] asus_wmi: ASUS WMI generic driver loaded
[   14.283569] asus_wmi: Initialization: 0x1
[   14.284980] asus_wmi: SFUN value: 0x21
[   14.284993] asus-nb-wmi asus-nb-wmi: Detected ATK, not ASUSWMI, use DSTS
[   14.329923] input: Asus WMI hotkeys as

/devices/platform/asus-nb-wmi/input/input11

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#5 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #4 from Armin Wolf ([email protected]) ---
I see, the kewly added platform profile support fails to initialize and thus the whole driver fails to load.

Can you share the output of "acpidump"?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#6 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #5 from Michael ([email protected]) --- Created attachment 307259
--> https://bugzilla.kernel.org/attachment.cgi?id=307259&action=edit
acpidump of latest kernel 6.12-rc7

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#7 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #6 from Michael ([email protected]) --- Created attachment 307260
--> https://bugzilla.kernel.org/attachment.cgi?id=307260&action=edit
acpidump of older kernel 6.9.12

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#8 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #7 from Michael ([email protected]) ---
I did acpidumps on 6.12-rc7 (with the regression) and on an older kernel 6.9.12 (with no issue). Interestingly the dump is not identical. Not sure, if that is to be expected or not. See the two attachments. And here is the diff:

❯ diff acpidump_6.*
47639c47639
< 0000: 50 48 41 54 0D 06 00 00 01 2A 5F 41 53 55 53 5F PHAT.....*_ASUS_
---

Quoted 1 line
    0000: 50 48 41 54 0D 06 00 00 01 C0 5F 41 53 55 53 5F  PHAT......_ASUS_

47708,47709c47708,47709

<     0450: 45 00 45 00 43 00 33 00 29 00 00 00 01 48 FD FB  E.E.C.3.)....H..
<     0460: A7 01 00 00 00 F1 B7 8E 98 01 00 00 00 2D 00 00  .............-..

---

Quoted 2 lines
    0450: 45 00 45 00 43 00 33 00 29 00 00 00 01 1F 3D AA  E.E.C.3.).....=.
    0460: A7 01 00 00 00 17 76 4B 99 01 00 00 00 2E 00 00  ......vK........
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#9 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #8 from Armin Wolf ([email protected]) ---
It seems that the ACPI method responsible for setting the thermal policy always returns the thermal policy passed as an argument. The driver however checks if the return value is zero and returns an error if its not.

After checking the acpidumps from other ASUS machines, it seems that the return value has not special meaning (some always return 1, some return something different).

Can you apply a patch and build a custom kernel?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#10 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #9 from Michael ([email protected]) ---
Yes, sure. Would it be sufficient to build a module or is the full kernel build needed? (The latter takes significantly longer on the laptop.)

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#14 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #13 from Armin Wolf ([email protected]) --- Created attachment 307261
--> https://bugzilla.kernel.org/attachment.cgi?id=307261&action=edit
Prototype patch

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#15 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #14 from Armin Wolf ([email protected]) --- Can you apply this patch and test if this solves the problem?

I still suspect that this is somehow a BIOS issue, so if you have a dualboot setup then please try to verify if the ASUS software under Windows can successfully switch thermal policies.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#16 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #15 from Michael ([email protected]) --- Hi Armin

I cannot comnpile the module. I get the following error:

drivers/platform/x86/asus-wmi.c: In function 'fan_boost_mode_write':
drivers/platform/x86/asus-wmi.c:3116:38: error: 'retval' undeclared (first use in this function)
3116 | &retval);
| ^~~~~~
drivers/platform/x86/asus-wmi.c:3116:38: note: each undeclared identifier is reported only once for each function it appears in
CC [M] drivers/platform/x86/gpd-pocket-fan.o
drivers/platform/x86/asus-wmi.c: In function 'throttle_thermal_policy_write':
drivers/platform/x86/asus-wmi.c:3699:13: warning: unused variable 'retval' [-Wunused-variable]

 3699 |         u32 retval;
      |             ^~~~~~
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#17 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #16 from Michael ([email protected]) ---
Update: I removed the first part of the patch (where the retval declaration was removed). Now the patch applies and restores correct functionality.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#19 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #18 from Michael ([email protected]) --- No, it is a single boot setup, running only linux.

Here is the dmesg from 6.12-rc7 with the truncated patch applied:

❯ dmesg|grep asus

[   12.756754] asus_wmi: ASUS WMI generic driver loaded
[   12.797541] asus_wmi: Initialization: 0x1
[   12.798530] asus_wmi: SFUN value: 0x21
[   12.798540] asus-nb-wmi asus-nb-wmi: Detected ATK, not ASUSWMI, use DSTS
[   12.845043] asus-nb-wmi asus-nb-wmi: Using throttle_thermal_policy for
platform_profile support
[   12.860431] input: Asus WMI hotkeys as
/devices/platform/asus-nb-wmi/input/input11
[   12.909854] asus_wmi: using asus-wmi for asus::kbd_backlight
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#20 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #19 from Armin Wolf ([email protected]) ---
I cannot replicate the issues with the original patch on the pdx86/for-next branch, so i suspect that the patch got applied incorrectly due to missing commits.

Are you ok if i use your email address inside the patch description?

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#21 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #20 from Michael ([email protected]) --- Maybe it was because I was using 6.12-rc7?

Anyway, I am ok with the email address. Thanks a lot for the fast fix!

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#23 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

Guilhem Lettron ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Blocks|                            |219573

Referenced Bugs:

https://bugzilla.kernel.org/show_bug.cgi?id=219573
[Bug 219573] ASUS Zenbook UM5302TA function keys reversed and Fn lock broken after kernel 6.12 update

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#25 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #23 from Vinay Shastry ([email protected]) --- Not the reporter, but the asus_wmi bug was affecting me in a different way - keyboard backlight control, touchpad toggle keys had stopped working on my asus laptop.

It works again on 6.12.5 and 6.13-rc2.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#26 lore raw

[Bug 219517] REGRESSION: charge_control missing in 6.12

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=219517

--- Comment #24 from Michael ([email protected]) --- (In reply to Armin Wolf from comment #22)

Quoted 2 lines

The linux 6.12.5 kernel should now contain the necessary fixes. Can you give it a try?

I'd like to, but at the moment Nixos repos are still at 6.12.4. As soon as 6.12.5 is available I'll give it a try and report back.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.