You are not logged in.

#1 2017-12-13 10:43:24

jfrimmel
Member
Registered: 2017-12-13
Posts: 5

Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hello Forum,

first: I'm new to this community, so please forgive mistakes :-)
second: This is a translation from the german forum, since there was no reply in months: https://bbs.archlinux.de/viewtopic.php?pid=357614

I'm using Arch Linux for a long time on my Desktop-PC and an very old Laptop (bought before Win-XP), on these machines everything runs well.
I own a newer Laptop for two years now: Acer Switch 11 Laptop/Convertible. It came pre-installed with windows, but after using it for over one year I wanted to use my favorite Linux distro on it: Arch Linux.

Some technical data (https://www.acer.com/ac/de/DE/content/m … .G2SEG.003):
Processor: Intel Core M-5Y10c with integrated graphics
RAM: 4GB
SSD: 128GB
Scree: 1920x1080 (11,6") with Multitouch
Battery: 4550mAh Li-Ion (I don't have a more useful indication)

Notes on my installation:
- all packages are up-to-date
- uname -a: Linux acer-switch 4.14.4-1-ARCH #1 SMP PREEMPT Tue Dec 5 19:10:06 UTC 2017 x86_64 GNU/Linux
- KDE Plasma as Desktop environment
- acpi is installed
- acpid is running
- BIOS is on the newest version

My Problem:
The battery is not correctly detected under Linux (Windows detected it fine). This problem shows up in the following ways:
- the tray-icon says: "0%, not charging"
- kinfocenter says everytime: "100% percentage, Has power supply: Yes" (even if I don't plugged one in)
- cat /sys/class/power_supply/BAT1/status: Unknown
- acpi -b: Battery 0: Unknown, 0%

During boot there are ACPI errors:
$ dmesg | grep ACPI
[    2.449880] ACPI Error: No handler for Region [PMRG] (ffff9e3cda121870) [GenericSerialBus] (20170303/evregion-166)
[    2.449887] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20170303/exfldio-299)
[    2.449894] ACPI Error: Method parse/execution failed [\_SB.TAMB._TMP] (Node ffff9e3cda159730), AE_NOT_EXIST (20170303/psparse-543)
[    2.451169] ACPI Error: No handler for Region [PMRG] (ffff9e3cda121870) [GenericSerialBus] (20170303/evregion-166)
[    2.451175] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20170303/exfldio-299)
[    2.451180] ACPI Error: Method parse/execution failed [\_SB.TEFN._TMP] (Node ffff9e3cda159de8), AE_NOT_EXIST (20170303/psparse-543)
[    2.451467] ACPI Error: No handler for Region [PMRG] (ffff9e3cda121870) [GenericSerialBus] (20170303/evregion-166)
[    2.451472] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20170303/exfldio-299)
[    2.451477] ACPI Error: Method parse/execution failed [\_SB.TSKN._TMP] (Node ffff9e3cda15acf8), AE_NOT_EXIST (20170303/psparse-543)

Some weeks later I conntacted the Acer support and they replied to me (translated):
"We cannot test all of our devices in all of the possible linux configurations, so we have no information to this error."
"We searched and found out that this error persists also on other notebooks and other distros, often on Kernel-versions > 4.8"
They also wrote, that the cannot or want not support this special problem.

I searched for a solution a long time on my own and I found out, taht this can be related to a wrong DSDT. If I try to de/recompile the table there are many errors...

Has anyone of you any idea how to solve this problem?

If you miss any information, I will post them as soon as I can.

Thank you in advance,
jfrimmel

Offline

#2 2017-12-14 16:44:08

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

I bought this laptop 10 days ago and i have exactly the same problem, the battery works fine only on Windows. I tried many versions of Kernel in Manjaro Linux and i couldn't solve the problem. Maybe i should open a report for this bug somewhere. Maybe the only solution is to change the DSDT.

Edit: Compilation complete. 0 Errors, 216 Warnings, 62 Remarks, 391 Optimizations

Edit2:

dmesg -l err
[    0.598280] platform wdat_wdt: failed to claim resource 4
[    0.598292] ACPI: watchdog: Failed to create platform device                                                     
[    1.960652] cgroup: cgroup2: unknown option "nsdelegate"
[    2.300353] ACPI Error: No handler for Region [PMRG] (ffff88015a0b0510) [GenericSerialBus] (20160831/evregion-166)                                                                                                                   
[    2.300484] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20160831/exfldio-299)
[    2.300756] ACPI Error: Method parse/execution failed [\_SB.TAMB._TMP] (Node ffff88015a0e82f8), AE_NOT_EXIST (20160831/psparse-543)
[    2.302124] ACPI Error: No handler for Region [PMRG] (ffff88015a0b0510) [GenericSerialBus] (20160831/evregion-166)
[    2.302251] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20160831/exfldio-299)
[    2.302347] ACPI Error: Method parse/execution failed [\_SB.TEFN._TMP] (Node ffff88015a0e8488), AE_NOT_EXIST (20160831/psparse-543)
[    2.302853] ACPI Error: No handler for Region [PMRG] (ffff88015a0b0510) [GenericSerialBus] (20160831/evregion-166)
[    2.302967] ACPI Error: Region GenericSerialBus (ID=9) has no handler (20160831/exfldio-299)
[    2.303071] ACPI Error: Method parse/execution failed [\_SB.TSKN._TMP] (Node ffff88015a0e9348), AE_NOT_EXIST (20160831/psparse-543)
[    3.080729] i2c_hid i2c-ELAN21D8:00: failed to change power setting.
[    3.081264] i2c_hid i2c-ELAN21D8:00: failed to retrieve report from device.
[    3.081323] i2c_hid i2c-ELAN21D8:00: failed to retrieve report from device.
[    3.081678] i2c_hid i2c-ELAN21D8:00: failed to change power setting.
[    3.859678] i2c_hid i2c-ITE8350:00: error in i2c_hid_init_report size:19 / ret_size:18
[    7.351031] i2c_designware INT3432:00: controller timed out
[    7.382526] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.406714] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.430427] i2c_hid i2c-ITE8350:00: failed to change power setting.
[    7.453818] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.477526] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.499957] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.522273] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.594372] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.618266] i2c_hid i2c-ITE8350:00: failed to change power setting.
[    7.641208] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.664204] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.687941] i2c_hid i2c-ITE8350:00: failed to change power setting.
[    7.710663] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.733521] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.756139] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.778448] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.847430] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.869728] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.891950] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.914188] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    7.936400] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.958616] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    7.981982] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[    8.004179] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    8.026654] i2c_hid i2c-ITE8350:00: failed to change power setting.
[    8.049693] i2c_hid i2c-ITE8350:00: failed to set a report to device.
[    8.071941] i2c_hid i2c-ITE8350:00: failed to retrieve report from device.
[ 3749.815985] iwlwifi 0000:01:00.0: Too many chunks: 20

Last edited by Hungerys (2017-12-14 17:32:06)

Offline

#3 2017-12-16 11:20:24

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Offline

#4 2018-01-08 14:30:40

jfrimmel
Member
Registered: 2017-12-13
Posts: 5

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hello,

I'm sorry that I didn't repy earlier, but somehow I missed your posts.

I gave it another try and read the imho important chapters in the ACPI Specification.
I changed some related  parts in my DSDT to see if it was accepted by the kernel:

Method (_BIF, 0, NotSerialized) {
                Return (Package {
                    0x01,               // power unit: mAh
                    0x0E10,             // capacity
                    0x0E10,             // last full capacity
                    0x01,               // rechargeable
                    0x2A30,             // voltage
                    0x6C,               // warning voltage
                    0x4B,               // low voltage
                    0x08,               // steps [warning to low]
                    0x09,               // steps [warning to full]
                    "Li-Ion 3600mA ",   // model number
                    "jfrimmel",         // serial number
                    "Lion",             // type
                    "Acer "             // OEM
                })
            }
            Method (_BIX, 0, NotSerialized) {
                Return (Package {
                    0,                  // revision: 0
                    One,                // power unit: mAh
                    0x0E10,             // capacity: 
                    0x0E10,             // last full capacity: 
                    One,                // rechargeable
                    0x2A30,             // voltage
                    0x6C,               // warning voltage
                    0x4B,               // low voltage
                    0x08,               // steps [warning to low]
                    0x09,               // steps [warning to full]
                    0x0A,               // cycles
                    0x0B,               // accuracy
                    0x0C,               // max sampling time
                    0x0D,               // min sampling time
                    0x0108,             // max avg interval
                    0x0EC4,             // min avg interval
                    "Li-Ion 3600mA ",   // model number
                    "jfrimmel",         // serial number
                    "Lion",             // type
                    "Acer "             // OEM
                })
            }

And now, the Kernel shows the "serial number" "jfrimmel" and the Vendor "Acer". So the static data is transmitted fine.

The same works, if I change the _BST-method t a method, that returns static data:

        Method (_BST, 0, NotSerialized) {
                Return (Package {
                    0x00,
                    0xDEAD,
                    0x0E10, // reports 100% charge
                    0x2A30
                })
            }

These values are correct transmitted and displayed.

But none of the I2C-transmits are working.
I guess that the eror is somewhere in methods like "ECNR()", these are responsible for the I2C transmission.
But until now, I cannot get it working :-(

If you want, you can write this to kernel.org-bugzilla, because there I have no account.

Best regards,
jfrimmel

Offline

#5 2018-01-09 06:42:44

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

jfrimmel wrote:

Hello,

I'm sorry that I didn't repy earlier, but somehow I missed your posts.

I gave it another try and read the imho important chapters in the ACPI Specification.
I changed some related  parts in my DSDT to see if it was accepted by the kernel:

...

If you want, you can write this to kernel.org-bugzilla, because there I have no account.

Best regards,
jfrimmel

Done, thank you.
For now i don't have much time, but as you are suggesting, again, the only means we have is to fix the DSDT.
I'll keep you updated

Last edited by Hungerys (2018-01-09 06:43:29)

Offline

#6 2018-01-09 18:18:54

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hungerys wrote:

I tried many versions of Kernel in Manjaro Linux and i couldn't solve the problem.

Manjaro is not Arch and we support Arch Linux only https://wiki.archlinux.org/index.php/Co … .2Aonly.2A

If you are still using Manjaro you should use their support channels.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2018-01-10 09:54:01

jfrimmel
Member
Registered: 2017-12-13
Posts: 5

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hello R00KIE,
thank you for that information.

I just want you to know, that I opend this topic, and I'm on native Arch Linux, so this problem can and should be diskussed here.

Currently we think, that the DSDT has to be changed, maybe the Kernel needn't to be patch at all.

Best regards,
jfrimmel

Offline

#8 2018-01-15 12:43:24

jfrimmel
Member
Registered: 2017-12-13
Posts: 5

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hello again,

I have some more information.

Could you please try the following out

# modprobe i2c_dev
# i2cdetect -y 1   
Warning: Can't use SMBus Quick Write command, will skip some addresses
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                                                 
10:                                                 
20:                                                 
30: 30 -- -- -- -- -- 36 --                         // <-- those are the relevant addresses, should be the same on your machine
40:                                                 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60:                                                 
70:                                                 
# i2cget -y 1 0x30 0x6F

Try the last command a few times, but try connecting and disconnecting the power adapter in between.

If you have ADP1 connected then the value 0x11 is printed.
If you have ADP1 disconnected then the value 0x01 is printed.

So we can distinguish between the states via userland I2C. The fourth (counting started at 0) bit seems to be responsible for detecting the power adapter.
But currently I can't get it working using the DSDT...

Maybe someone has an idea.

Best regards,
jfrimmel

Offline

#9 2018-01-16 13:24:54

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

jfrimmel wrote:

Hello again,

I have some more information.

Could you please try the following out

# modprobe i2c_dev
# i2cdetect -y 1   
Warning: Can't use SMBus Quick Write command, will skip some addresses
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                                                 
10:                                                 
20:                                                 
30: 30 -- -- -- -- -- 36 --                         // <-- those are the relevant addresses, should be the same on your machine
40:                                                 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60:                                                 
70:                                                 
# i2cget -y 1 0x30 0x6F

Try the last command a few times, but try connecting and disconnecting the power adapter in between.

If you have ADP1 connected then the value 0x11 is printed.
If you have ADP1 disconnected then the value 0x01 is printed.

So we can distinguish between the states via userland I2C. The fourth (counting started at 0) bit seems to be responsible for detecting the power adapter.
But currently I can't get it working using the DSDT...

Maybe someone has an idea.

Best regards,
jfrimmel

This is a good step forward, i tried each command and i get the same results.
If you want i will post these results in bugzilla as always, let me know
Also, thank you for your efforts.

Offline

#10 2018-02-05 08:33:38

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

jfrimmel wrote:

...

I am currently using a program which says, apparently, the correct values for our laptop.

https://forums.lenovo.com/t5/Linux-Disc … 2271#M9346

This is the output i get at 100% Charge

discharging @ 8.78W | Cap-remain 40.13Wh | Voltage 8.385V | Remain 4h 34m
0xc1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xd1: 0xfc 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xd0: 0xf4 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc7: 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc6: 0xd7 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc3: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc2: 0xac 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0:        1   1:  6557460   2:    40120   3:     8407
discharging @ 6.56W | Cap-remain 40.12Wh | Voltage 8.407V | Remain 6h 7m
0xc1: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xd1: 0xfc 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xd0: 0xf4 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc7: 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc6: 0xd7 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc3: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0xc2: 0xac 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0:        1   1:  6557460   2:    40120   3:     8407

Also, it guessed the remaning time before the laptop shut off.
Now, all i did to make it work is:

Copy-and-Paste this C code into a file named tpt10-bat.c : Link
Edit the line 28 into

 #define I2C_BUS         "/dev/i2c-1" 

Copy-and-Paste this Makefile code into a file named Makefile : Link
Edit the line 6 into

 CFLAGS+=-DDEBUG 

and then, put both tpt10-bat.c and Makefile in a folder which we call TPT.
Navigate into TPT folder with a shell and type

make

Make sure you loaded i2c-dev with

modprobe i2c-dev

Execute tpt10-bat with root permissions

./tpt10-bat 

You used the 0x30 address to access charging/discharging status, but using 0x70 address works too, in fact is avaiable by typing:

i2cdetect -r 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- 36 -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- 77    

I tried to edit the get_status(int fd) function to make it similar to our de-compiled DSDT, but without success.
It works better out of box, for now.

Offline

#11 2018-05-03 10:25:21

jfrimmel
Member
Registered: 2017-12-13
Posts: 5

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

Hello,

sorry for the (really) long delay, but I had other priorities...

It the mean time I have developed a Linux Kernel module, that correctly reports the battery as well as the AC adapter.
The sources can be found under https://github.com/jfrimmel/Acer-Switch-Battery-Module. There is also a simple installation instruction.

The module talks to the battery IC via I2C (similar to the program you linked in above).
It registers two power supplies: one for the battery (BAT0) and one for the AC adapter (ADP0).
The power supplies have a set of properties, that are polled by the kernel/upower. There are three categories of properties:
- static: they return a constant (hard-coded) value, that is not read from the battery
- read from battery: they return the values, as they are reported by the battery
- calculated: they return values based on other values read from the battery
I know that this is not the ideal behavior, but using this method the battery is usable.

It works for me, but no further testing is done.
If you or anyone else finds a bug please report it to me (either here or on GitHub)

It would be great to hear some feedback :-)

Best regards,
jfrimmel

Offline

#12 2018-05-25 19:22:45

Hungerys
Member
Registered: 2017-12-14
Posts: 6

Re: Acer Switch 11 (SW5-173): ACPI Errors/Battery not detected

jfrimmel wrote:

Hello,

sorry for the (really) long delay, but I had other priorities...

It the mean time I have developed a Linux Kernel module, that correctly reports the battery as well as the AC adapter.
The sources can be found under https://github.com/jfrimmel/Acer-Switch-Battery-Module. There is also a simple installation instruction.

The module talks to the battery IC via I2C (similar to the program you linked in above).
It registers two power supplies: one for the battery (BAT0) and one for the AC adapter (ADP0).
The power supplies have a set of properties, that are polled by the kernel/upower. There are three categories of properties:
- static: they return a constant (hard-coded) value, that is not read from the battery
- read from battery: they return the values, as they are reported by the battery
- calculated: they return values based on other values read from the battery
I know that this is not the ideal behavior, but using this method the battery is usable.

It works for me, but no further testing is done.
If you or anyone else finds a bug please report it to me (either here or on GitHub)

It would be great to hear some feedback :-)

Best regards,
jfrimmel

The instructions provided were flawless, i also put the module to run at startup ( by copying battery-module.ko in the /lib/modules/4.17.0-1-MANJARO directory and battery-module in /etc/modules-load.d/modules.conf ).
I compared the battery levels with Windows 10 and it is similar, i find it very accurate.
Thank you so much, i'll report any bugs if i'll find any in the future. Now i'm very happy with this laptop smile

Offline

Board footer

Powered by FluxBB