[regression] ac and battery readings for asus laptops (gu605) broken since "ACPI: EC: Install address space handler at the namespace root"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Thorsten here, the Linux kernel's regression tracker.

Rafael, I noticed a report about a regression in bugzilla.kernel.org
that (if I understood things correctly, which in this case I'm not
entirely sure of) appears to be caused by a change of yours:
60fa6ae6e6d09e ("ACPI: EC: Install address space handler at the
namespace root")

As many (most?) kernel developers don't keep an eye on the bug tracker,
I decided to write this mail. To quote from
https://bugzilla.kernel.org/show_bug.cgi?id=218945 :

>  VitaliiT 2024-06-07 12:43:14 UTC
> 
> Created attachment 306438 [details]
> Workaround for asus gu605
> 
> Creating this ticket to highlight a regression introduced with a fix
> proposed in https://bugzilla.kernel.org/show_bug.cgi?id=218789
>
> Actually that patch breaks ac and battery modules.
> Sysfs readings for gu605 reported:
> - that AC is always online independently if power source connected
> - battery readings are wrong: capacity always 100, voltage is always
> 5000, current is always 1000000; charge_full and charge_full_design is
> always 5000. All values are not correct.
> 
> I've updated defect 218789 with a workaround patch that makes ac and
> battery modules working again with 6.10 source tree.
> 
> Unfortunately, I can not provide correct solution since I am not acpi
> expert, but I feel that Lenovo laptop might need quirks or separate
> logic for EC initialization flow.
> 
> Additionally, not sure if it is correct to use ACPI_ROOT_OBJECT as
> acpi_handle when actual acpi_ec requested for initialization. An ACPI
> expert might need to look into this.
> 
> Here are some results of investigation:
> 
> In 218789 due to reported error proposed to use ACPI_ROOT_OBJECT which
> supposed to initalize EC's, but on asus laptops this change breaks
> backward compatibility.
> 
> So ec_install_handlers is called from acpi_ec_setup and first_ec will be
> set to ec in the beginning, so in ec_install_handlers() ACPI_ROOT_OBJECT
> will be used as handler.
>  static int ec_install_handlers(struct acpi_ec *ec, struct acpi_device
> *device,
>                                bool call_reg)
>  {
>        acpi_handle scope_handle = ec == first_ec ? ACPI_ROOT_OBJECT :
> ec->handle;
> 
> And this method is called from acpi_ec_setup where first_ec will be set
> to ec:
> 
> static int acpi_ec_setup(struct acpi_ec *ec, struct acpi_device *device,
> bool call_reg)
> {
> 	int ret;
> 
> 	/* First EC capable of handling transactions */
> 	if (!first_ec)
> 		first_ec = ec;
> 
> I understand th> VitaliiT 2024-06-07 12:43:14 UTC
at original defect should be fixed, but preserving things
> which used to work should be also priority.
> 
> Please let me know if additional information is needed.
> 
> The fix which just works (probably it is not "proper" fix, but that
> patch makes asus battery and ac modules working as supposed to).

See the ticket for more details. Note, you have to use bugzilla to reach
the reporter, as I sadly[1] can not CCed them in mails like this.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

[1] because bugzilla.kernel.org tells users upon registration their
"email address will never be displayed to logged out users"

P.S.: let me use this mail to also add the report to the list of tracked
regressions to ensure it's doesn't fall through the cracks:

#regzbot introduced: 60fa6ae6e6d09e
#regzbot title: ACPI: EC: ac and battery readings for asus laptops
(gu605) broken
#regzbot from: VitaliiT
#regzbot duplicate: https://bugzilla.kernel.org/show_bug.cgi?id=218945
#regzbot ignore-activity




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux