Bug 123221 - Either no scancodes from extra keys or no touchpad on ASUS E403SA
Summary: Either no scancodes from extra keys or no touchpad on ASUS E403SA
Status: CLOSED UNREPRODUCIBLE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Tables (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-12 14:53 UTC by Noah Hellman
Modified: 2017-02-11 22:12 UTC (History)
8 users (show)

See Also:
Kernel Version: 4.6.3-1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Decompiled DSDT for the laptop's BIOS (539.07 KB, text/x-dsl)
2016-07-12 14:53 UTC, Noah Hellman
Details
dmesg output when using no acpi_osi kernel parameter. (47.21 KB, text/plain)
2016-07-12 15:28 UTC, Noah Hellman
Details
dmesg out when using the acpi_osi="!Windows 2012" kernel parameter. (47.76 KB, text/plain)
2016-07-12 15:29 UTC, Noah Hellman
Details
acpidump (409.61 KB, text/plain)
2016-07-14 23:41 UTC, Noah Hellman
Details
customized DSDT: remove "Windows 2012" check for GPIO controllers (664.68 KB, application/octet-stream)
2016-09-02 03:05 UTC, Zhang Rui
Details
dsdt.aml created from Zhang's customized .hex (70.87 KB, application/octet-stream)
2016-11-13 13:45 UTC, Noah Hellman
Details

Description Noah Hellman 2016-07-12 14:53:35 UTC
Created attachment 223021 [details]
Decompiled DSDT for the laptop's BIOS

Pressing the extra keys (such as fn+f6 to increase brightness) or opening/closing the lid switch does not cause an event. Backlight brightness is unchanged and the laptop doesn't sleep when closing the lid. Tools such as acpi_listen, showkey, evtest and xev do not print any output when pressing any extra keys except for mute, volup, voldown. dmesg doesn't warn of any unknown keypresses.

However, when appending acpi_osi="!Windows 2012" to the kernel parameters, the lid switch and all extra keys work perfectly. The problem is that when the "Windows 2012" string is removed the touchpad doesn't work and doesn't show up in /proc/bus/input/devices anymore.

I'm currently running 4.6.3-1-ARCH but I get the exact same behavior with a Fedora 24 live USB with kernel 4.5.5.
Comment 1 Noah Hellman 2016-07-12 15:07:05 UTC
I've tested multiple variations of kernel parameters. Some disables changing backlight. No combination of strings gives a functional touchpad, working extra keys (fn-keys) and changable backlight.

kernel parameters                                 touchpad  fn-keys  backlight
none                                              yes       volume   yes
acpi_osi=!!                                       yes       volume   yes
acpi_osi=Windows                                  yes       volume   yes
acpi_osi=Linux                                    yes       volume   yes
acpi_osi=(no space)                               yes       none     no
acpi_osi= (space)                                 yes       none     no
acpi_osi=!                                        no        all      no
acpi_osi=!*                                       no        all      no
acpi_osi=!* acpi_osi=Linux                        no        all      yes
acpi_osi=!* acpi_osi=Linux acpi_osi=Windows"      no        all      yes
acpi_osi="!Windows 2012"                          no        all      yes
acpi_osi=! acpi_osi=Linux                         no        all      yes
acpi_osi=! acpi_osi=Windows                       no        all      no
acpi_osi=! acpi_osi="Windows 2000"                no        all      no
acpi_osi=! acpi_osi="Windows 2001"                no        all      no
acpi_osi=! acpi_osi="Windows 2006"                no        all      no
acpi_osi=! acpi_osi="Windows 2009"                no        all      no
acpi_osi=! acpi_osi="Windows 2012"                yes       volume   yes
acpi_osi=! acpi_osi="Windows 2013"                no        all      yes
acpi_osi=! acpi_osi="Windows 2015"                no        all      yes
acpi_osi="!Windows 2012" acpi_osi="Windows 2015"  no        all      yes
acpi_osi=! acpi_osi=Linux acpi_osi="Windows 2015" no        all      yes
acpi_osi=  acpi_osi=Linux                         yes       none     no
acpi_osi=  acpi_osi=Windows                       yes       none     no
acpi_osi=  acpi_osi="Windows 2012"                yes       none     no
acpi_osi=  acpi_osi="Windows 2015"                yes       none     no
Comment 2 Noah Hellman 2016-07-12 15:28:24 UTC
Created attachment 223031 [details]
dmesg output when using no acpi_osi kernel parameter.
Comment 3 Noah Hellman 2016-07-12 15:29:42 UTC
Created attachment 223041 [details]
dmesg out when using the acpi_osi="!Windows 2012" kernel parameter.
Comment 4 Noah Hellman 2016-07-14 23:41:51 UTC
Created attachment 223921 [details]
acpidump
Comment 5 Ben W 2016-08-11 19:44:33 UTC
Thanks for the detailed report Noah.

Looking at the dstl.dsl and your tests can you try the following combination of strings as kernel parameters?

1) acpi_osi=! acpi_osi=Linux acpi_osi="Windows 2009"
2) acpi_osi=!* acpi_osi=Linux acpi_osi="Windows 2009"

The touch is disabled at GPED._STA if the string includes a Windows version of 2013 or above.

The backlight is disabled at STBR if the string includes a Windows version of 2009 or below UNLESS we specify a string of "Linux".
Comment 6 Noah Hellman 2016-08-11 21:54:26 UTC
Hello Ben, I tested both combinations of strings and they both produce the same result: The only things that work are the extra keys and the lid switch. The touchpad is disabled and the brightness cannot be changed.
Comment 7 Zhang Rui 2016-09-02 02:58:19 UTC
The acpi tables on this platform have many places hard coded, thus may bring different problems.

        Device (GPO0)
        {
            ... 
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (!_OSI ("Windows 2012"))
                {
                    Return (Zero)
                }

                If (_OSI ("Android"))
                {
                    AVBL = Zero
                }

                If ((GOAE == One))
                {
                    Return (0x0F)
                }

                Return (Zero)
            }
            ...
         }
GPO0 is not functional unless _OSI("Windows 2012") returns true. And this explains why, acpi_osi=! acpi_osi="Windows 2012", this combination behaves quite differently than others


        Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query
        {
            If ((MSOS () >= OSW8))
            {
                STB2 (0xE0)
                STB2 (0x2E)
                STB2 (0xE0)
                STB2 (0xAE)
                Return (Zero)
            }

            If ((AVOL < 0x0F))
            {
                AVOL++
            }

            If (ATKP)
            {
                ^^^^ATKD.IANE (0x31)
            }

            Return (Zero)
        }
This and many other method runs different code path for OSW8 ("windows 2012") and above...
Comment 8 Zhang Rui 2016-09-02 02:59:43 UTC
I will try to look into more details, but first of all, I have a question, does windows have all of these features working? Because it seems that this platform is designed to support certain features for one windows version and some other features for other windows versions to me...
Comment 9 Zhang Rui 2016-09-02 03:01:52 UTC
I don;t think we can fix this problem in Linux kernel, or by using different _OSI strings.
I will provide you a customized DSDT, and it should solve your problem together with certain acpi_osi combination. But unfortunately, as I said, we can not fix the problem in the kernel...
Comment 10 Zhang Rui 2016-09-02 03:05:14 UTC
Created attachment 231791 [details]
customized DSDT: remove "Windows 2012" check for GPIO controllers
Comment 11 Zhang Rui 2016-09-02 03:09:38 UTC
please apply the customized DSDT following this steps

Put it where the kernel build can include it:

$ cp DSDT.hex $SRC/include/

Add this to the kernel .config:

CONFIG_STANDALONE=n
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"

and then reboot your new kernel with boot option acpi_osi="!Windows 2012", and check if all things work well or not.
Comment 12 crippyua 2016-09-02 10:11:03 UTC
(In reply to Zhang Rui from comment #11)

I'm having the exact same problem on Asus E402SA ubuntu 4.4.0-36, and trying to apply your solution seems to do nothing, although I suspect this might be my fault.
I moved the file (tried with both upper- and lowercase names, since the file in attachments is in lower) to a newly created directory '/include', edited '.config' file in linux-headers-4.4.0-36-generic folder to include lines you provided, and rebooted with 'acpi_osi="!Windows 2012". But also I found a similar instruction at Linux*ACPI which ends with "Make the kernel and off you go!". Does this mean I have to somehow compile the kernel after editing '.config' file, which seems to be quite a challenging task? Or should I have edited kernel .config in some other way, not by directly modifying the file?
Comment 13 Noah Hellman 2016-09-04 16:41:32 UTC
Unfortunately I am not certain if these features work on Windows. The laptop came pre-installed with Windows 10 but I wiped it and installed Arch Linux immediately.
Comment 14 Noah Hellman 2016-09-04 16:51:41 UTC
Thanks for the customized DSDT, Zhang. I am able to successfully compile the DSDT into the kernel (4.7.2-1-ARCH) following your instructions, but the system won't boot properly after installing it. It fails to find the root device by PARTUUID and leaves me with a recovery shell. When using ls in the recovery shell none of my partitions show up at all. 

I also tried to include my original DSDT and compile the kernel again with the same config and it works fine.
Comment 15 Noah Hellman 2016-09-05 16:28:25 UTC
I also tried to override the DSDT with yours by writing the char array in the .hex file to a .aml file and create a CPIO archive that the bootloader can load. The override appears to be successful according to the dmesg log:

[    0.000000] ACPI: DSDT ACPI table found in initrd [kernel/firmware/acpi/dsdt.aml][0x11b77]
[    0.000000] ACPI: Override [DSDT-Notebook], this is unsafe: tainting kernel
[    0.000000] ACPI: DSDT 0x000000007A0691E0 Logical table override, new table: 0xFFFFFFFF81896C20
[    0.000000] ACPI: DSDT 0xFFFFFFFF81896C20 011D26 (v02 _ASUS_ Notebook 01072009 INTL 20160831)
[    0.000000] ACPI: Table Upgrade: install [DSDT-_ASUS_-Notebook]
[    0.000000] ACPI: DSDT 0x0000000079FD3000 011B77 (v02 _ASUS_ Notebook 01072009 INTL 20160108)

However, the behaviour stays the same as with the original DSDT and acpi_osi="!Windows 2012 kernel parameter; extra keys work but the touchpad does not.
Comment 16 Lv Zheng 2016-09-14 08:10:31 UTC
What if you put more combinations?
For example:

acpi_osi=! acpi_osi="Windows 2012" acpi_osi=Windows

IMO, specific Windows version may return TRUE for other Windows versions.
But we don't have such knowledge.
If we have, we could implement different acpi_osi usage model for Linux to pretend to be a specific Windows by returning TRUE to all possible values.

This seems to be needing a community effort.

Similar ACPICA bug:
http://bugs.acpica.org/show_bug.cgi?id=1251

Thanks
Lv
Comment 17 Eugene 2016-11-13 12:31:21 UTC
Have you managed to resolve the issue?(In reply to Noah Hellman from comment #15)
> I also tried to override the DSDT with yours by writing the char array in
> the .hex file to a .aml file and create a CPIO archive that the bootloader
> can load. The override appears to be successful according to the dmesg log:
> 
> [    0.000000] ACPI: DSDT ACPI table found in initrd
> [kernel/firmware/acpi/dsdt.aml][0x11b77]
> [    0.000000] ACPI: Override [DSDT-Notebook], this is unsafe: tainting
> kernel
> [    0.000000] ACPI: DSDT 0x000000007A0691E0 Logical table override, new
> table: 0xFFFFFFFF81896C20
> [    0.000000] ACPI: DSDT 0xFFFFFFFF81896C20 011D26 (v02 _ASUS_ Notebook
> 01072009 INTL 20160831)
> [    0.000000] ACPI: Table Upgrade: install [DSDT-_ASUS_-Notebook]
> [    0.000000] ACPI: DSDT 0x0000000079FD3000 011B77 (v02 _ASUS_ Notebook
> 01072009 INTL 20160108)
> 
> However, the behaviour stays the same as with the original DSDT and
> acpi_osi="!Windows 2012 kernel parameter; extra keys work but the touchpad
> does not.

Have you managed to resolve the issue? Can you share Lv's gsdt.aml file?
Comment 18 Eugene 2016-11-13 12:48:01 UTC
(In reply to Zhang Rui from comment #11)
> please apply the customized DSDT following this steps
> 
> Put it where the kernel build can include it:
> 
> $ cp DSDT.hex $SRC/include/
> 
> Add this to the kernel .config:
> 
> CONFIG_STANDALONE=n
> CONFIG_ACPI_CUSTOM_DSDT=y
> CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"
> 
> and then reboot your new kernel with boot option acpi_osi="!Windows 2012",
> and check if all things work well or not.

Can you share changes what kind of changes you have made in dsdt so I can replicate in my current version of bios?
Comment 19 Noah Hellman 2016-11-13 13:45:21 UTC
Created attachment 244301 [details]
dsdt.aml created from Zhang's customized .hex
Comment 20 Noah Hellman 2016-11-13 13:48:07 UTC
(In reply to Eugene from comment #17)
> Have you managed to resolve the issue?(In reply to Noah Hellman from comment
> #15)
> > I also tried to override the DSDT with yours by writing the char array in
> > the .hex file to a .aml file and create a CPIO archive that the bootloader
> > can load. The override appears to be successful according to the dmesg log:
> > 
> > [    0.000000] ACPI: DSDT ACPI table found in initrd
> > [kernel/firmware/acpi/dsdt.aml][0x11b77]
> > [    0.000000] ACPI: Override [DSDT-Notebook], this is unsafe: tainting
> > kernel
> > [    0.000000] ACPI: DSDT 0x000000007A0691E0 Logical table override, new
> > table: 0xFFFFFFFF81896C20
> > [    0.000000] ACPI: DSDT 0xFFFFFFFF81896C20 011D26 (v02 _ASUS_ Notebook
> > 01072009 INTL 20160831)
> > [    0.000000] ACPI: Table Upgrade: install [DSDT-_ASUS_-Notebook]
> > [    0.000000] ACPI: DSDT 0x0000000079FD3000 011B77 (v02 _ASUS_ Notebook
> > 01072009 INTL 20160108)
> > 
> > However, the behaviour stays the same as with the original DSDT and
> > acpi_osi="!Windows 2012 kernel parameter; extra keys work but the touchpad
> > does not.
> 
> Have you managed to resolve the issue? Can you share Lv's gsdt.aml file?

Hey Eugene, I have not managed to resolve the issue yet. I assume you are referring to the dsdt.aml file created from Zhang's dsdt.hex file. I added it to the attachments.
Comment 21 Eugene 2016-11-21 22:09:47 UTC
Did you try 3 recompile kernel with patches from this?threadhttps://bugzilla.kernel.org/show_bug.cgi?id=98931
Comment 22 crippyua 2016-11-23 14:11:25 UTC
I've been having this bug for a while with my asus e402s. Just now I decided to boot without acpi_osi parameter and both touchpad and fn keys work on ubuntu 16.04 4.4.0-49. No idea when and how, but it got fixed for me.
Comment 23 Eugene 2016-11-27 23:23:58 UTC
Can confirm the issue been fixed in the latest xenial proposed Ubuntu kernel.
Comment 24 Lv Zheng 2016-12-16 03:43:05 UTC
Recently there are OSI quirk tables upstreamed.
Probably some of them can fix the issue.

I'm closing the bug now.
If something is still wrong, feel free to re-open it.

Thanks
Lv
Comment 25 Arthur Speer 2017-02-11 13:57:52 UTC
While this may be fixed for asus e402s, it still does not works on e403sa with ubuntu 16.10 4.8.0-37.
Comment 26 Eugene 2017-02-11 22:12:31 UTC
(In reply to Arthur Speer from comment #25)
> While this may be fixed for asus e402s, it still does not works on e403sa
> with ubuntu 16.10 4.8.0-37.

Well. Works from 4.4.0-49 to 4.4.0-59 kernels.

Note You need to log in before you can comment on or make changes to this bug.