Bug 218945
Summary: | The fix in 218789 breaks ac and battery readings for asus laptops (gu605) | ||
---|---|---|---|
Product: | ACPI | Reporter: | VitaliiT (vitaly.torshyn) |
Component: | EC | Assignee: | Rafael J. Wysocki (rjw) |
Status: | CLOSED CODE_FIX | ||
Severity: | blocking | CC: | rjw, W_Armin |
Priority: | P3 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 6.10-rc master | Subsystem: | |
Regression: | Yes | Bisected commit-id: | 60fa6ae6e6d09e377fce6f8d9b6f6a4d88769f63 |
Attachments: |
Workaround for asus gu605
Asus gu605 (BIOS 319) acpidump ACPI: EC: Evaluate _REG in EC device scope explicitly ACPI: EC: Evaluate orphan _REG under EC device |
Description
VitaliiT
2024-06-07 12:43:14 UTC
First off, it is correct to use ACPI_ROOT_OBJECT to install the EC address space handler (and this works on the majority of systems). Second, if the EC address space handler is installed at ACPI_ROOT_OBJECT, it should cover all of the EC opregions throughout the ACPI namespace including the ones below ec->handle, so something strange is going on here. Can you please attach the output of "dmesg | grep -i ACPI" after a fresh boot from both the failing and working cases? Could you also share the output of "acpidump"? Created attachment 306451 [details]
Asus gu605 (BIOS 319) acpidump
Attached acpidump for asus gu605mv/bios 319 (most recent).
It seems that "ECOK" remains zero, causing the AML code to abort all attempts to access the EC and return bogus data instead. It seem to me that we somehow forget to call the _REG method underneath the EC0 device. Ops, seems that we call acpi_execute_reg_methods() on ACPI_ROOT_OBJECT, seems that we should call it with the handle of the first ec instead. Part 6.5.4 of the ACPI specification seems to suggest that we call _REG in the scope of the EC device. But it also seems that the original device with the strange UCSI implementation also wants _REG to be executed under \_REG. Created attachment 306452 [details]
ACPI: EC: Evaluate _REG in EC device scope explicitly
We can do both in principle, so what about the attached patch?
Rafael, are you requesting to test that patch and you do believe it is a fix for regression? (In reply to VitaliiT from comment #9) > Rafael, are you requesting to test that patch and you do believe it is a fix > for regression? Does it fix your issue? I believe it's a PoC (or even ready-to-submit) change that needs to be tested. (In reply to VitaliiT from comment #9) > Rafael, are you requesting to test that patch and you do believe it is a fix > for regression? Please test it and we'll see if it helps. Created attachment 306454 [details]
ACPI: EC: Evaluate orphan _REG under EC device
After starting to install the EC address space handler at the ACPI namespace root, if there is an "orphan" _REG method in the EC device's scope, it will not be evaluated any more.
Lo and behold, there is "orphan" _REG in the EC0 scope in this DSDT and it sets ECOK, so this patch should help.
Please test (if this works, you don't need to test the previous one).
Rafael, confirmed that the fix with check if (scope_handle != ec->handle) and execution of acpi_execute_orphan_reg_method() works. The AC and BAT1 sysfs values are correct with your patch https://bugzilla.kernel.org/attachment.cgi?id=306454&action=diff Please let me know if you need additional information (e.g. dmesg or acpidump). Also, can you please confirm that the fix will be merged into 6.10? I am going to submit it for 6.10 inclusion and chances are that it will end up in 6.10. |