You are not logged in.

#1 2016-08-25 04:52:46

gflegar
Member
Registered: 2016-08-25
Posts: 1

AC adapter, battery and lid switch problems

I just got a new laptop from pcspecialist.co.uk and the ACPI drivers are unable to recognize my AC adapter and battery and the lid switch is being reported open even when it's closed.
I tried it on Windows 10 and everything is working properly.
Full output from lshw https://ptpb.pw/9-Tr, though this is probably the important part (the BIOS itself says it's Phoenix Technologies):

     *-firmware
          description: BIOS
          vendor: QUANTA
          physical id: b
          version: QQ111
          date: 01/05/2016
          size: 1MiB
          capacity: 8128KiB
          capabilities: pci upgrade shadowing cdboot bootselect edd int5printscreen int9keyboard int14serial int17printer acpi usb ls120boot zipboot biosbootspecification netboot uefi

Here is the output from dmesg | grep ACPI (the battery was present at the time and the AC adapter was plugged in), and acpi gives:

$ acpi -ab
Adapter 0: off-line

I figured it was a problem with the firmware so I installed the Firmware Test Suite from AUR (fwts-git). I had to run it using the LTS kernel as fwts was unable to read the ACPI tables using the new kernel (probably because  Ubuntu uses an older kernel).
It did find some errors: here are the results of running the batch tests and here of the interactive ac_adapter, battery and lid tests.

Next, I went on to decompile the tables (here is the acpidump) and saw there were OS dependent switches (_OSI("Windows 2015"), etc. even _OSI("Linux")) in the DSDT table, so I tried them all by adding

 acpi_osi=! acpi_osi="<osi>" 

to the kernel parameters (where <osi> was one of the switches present in the DSDT table) with no luck.
Then I looked for the device-specific methods in the ACPI standard, specifically: _LID (for the lid), _STA (for battery status) and _PSR (for ac adapter) and found the corresponding methods in the DSDT.dsl file.
All of the methods have one thing in common: if the ECOK flag is not set they return some default value (like lid open, battery absent and ac adapter off-line). I searched for the place where the ECOK flag is set and found it was in the _REG method (executed if the first argument is 3 --- corresponding to the Embedded Control operating region according to the standard). Inspecting the dmesg output again there are these lines:

[    0.308389] ACPI : EC: EC started
[    0.308423] ACPI Error: Operand must be Buffer/Integer/String/Package - found type Method (20150930/exoparg1-763)
[    0.308426] ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.EC0._REG] (Node ffff8804530e0b68), AE_AML_OPERAND_TYPE (20150930/psparse-542)
[    0.308437] ACPI : EC: EC stopped

so I suppose the _REG method failed when called for this region and didn't set the ECOK flag.
This is where I got stuck. As I have absolutely no experience with the Linux kernel or the ACPI (other than what I learned in the process), I have no idea how to fix this issue, and I was unable to find anything related by searching the web.
Anyone here with experience in this things who can point me in the right direction or knows a solution to this problem? Or another workaround?

P.S.
I contacted pcspecialist asking if they have a BIOS update (since I was unable to download it from their's or the manufacturer's site) and/or know how to help me with this (though I doubt they can do the latter, ofc Linux is not officially supported).
Since it is a new laptop, I also got 14 days to return it and get a refund (I think by 31 Aug), so if I can't solve this I'll do that, though I would prefer fixing the issue.

Offline

Board footer

Powered by FluxBB