Bug 215835 - EC: No SCIs detectable from brightness hotkeys (ideapad 5 15ITL05)
Summary: EC: No SCIs detectable from brightness hotkeys (ideapad 5 15ITL05)
Status: NEEDINFO
Alias: None
Product: ACPI
Classification: Unclassified
Component: EC (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_ec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-13 23:00 UTC by Johannes Penßel
Modified: 2022-06-27 04:06 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.18-rc2
Subsystem:
Regression: No
Bisected commit-id:


Attachments
acpidump (1.75 MB, text/plain)
2022-04-13 23:00 UTC, Johannes Penßel
Details

Description Johannes Penßel 2022-04-13 23:00:05 UTC
Created attachment 300753 [details]
acpidump

In Linux the brightness hotkeys on my laptop do not generate any sort of response. No key code, ACPI event, WMI event, etc...

In Windows 11, event viewer shows that pressing the keys calls one of these methods:

            Method (_Q11, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                P80B = 0x11
                Notify (^^^GFX0.DD1F, 0x87) // Device-Specific
                Notify (VPC0, 0x80) // Status Change
            }

            Method (_Q12, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                P80B = 0x12
                Notify (^^^GFX0.DD1F, 0x86) // Device-Specific
                Notify (VPC0, 0x80) // Status Change
            }

This results in an ACPI brightness event being generated. Calling these methods directly in Linux via the AML kernel debugger results in the same behaviour. But for some reason, this cannot be triggered by pressing the keys like in Windows. In contrast to other EC-controlled actions such as toggling fn-lock or changing keyboard backlight level, all of which generate EC queries, there seems to be absolutely no such response from the EC when pressing the brightness keys, other than a register increasing/decreasing in value. (logged with this command: echo -n 'file ec.c +p' | sudo tee /sys/kernel/debug/dynamic_debug/control)

The usual commandline parameters such as acpi_backlight and acpi_osi have no effect either. Backlight control is exposed through the intel_backlight sysfs device and works fine otherwise.
Comment 1 Johannes Penßel 2022-04-20 13:24:23 UTC
# ./ec -r -s 1
     00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
00:  00  01  00  00  00  00  00  00  00  00  00  00  00  00  29  00 
10:  00  00  80  00  01  00  65  04  00  01  9a  20  00  02  00  00 
20:  02  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
30:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
40:  00  00  00  00  00  00  00  00  00  00  00  00  8d  52  00  00 
50:  00  00  00  31  00  00  2d  00  00  00  00  00  00  00  00  00 
60:  00  80  02  03  02  00  00  00  00  00  00  00  00  00  00  00 
70:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
80:  00  00  00  00  08  00  00  00  80  00  96  00  20  01  00  4c 
90:  47  43  00  32  30  31  39  00  4c  31  39  4c  34  50  46  31 
A0:  00  01  00  80  00  00  c0  00  00  00  00  00  00  15  00  00 
B0:  2d  2e  00  29  00  23  00  29  02  0d  04  00  00  00  11  00 
C0:  30  02  99  1b  33  05  36  43  10  3b  58  1b  9b  1b  64  00 
D0:  c0  02  e2  02  00  00  00  23  31  0c  0b  00  00  00  00  00 
E0:  00  00  00  00  00  00  00  00  00  00  00  00  13  00  43  00 
F0:  01  00  00  00  90  51  80  43  00  00  00  00  00  00  00  00 

     00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
00:  00  01  00  00  00  00  00  00  00  00  00  00  00  00  29  00 
10:  00  00  80  00  01  00  65  04  00  01  9a  20  00  02  00  00 
20:  02  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
30:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
40:  00  00  00  00  00  00  00  00  00  00  00  00  8d  52  00  00 
50:  00  00  00  31  00  00  2d  00  00  00  00  00  00  00  00  00 
60:  00  80  02  03  02  00  00  00  00  00  00  00  00  00  00  00 
70:  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00 
80:  00  00  00  00  08  00  00  00  80  00  96  00  20  01  00  4c 
90:  47  43  00  32  30  31  39  00  4c  31  39  4c  34  50  46  31 
A0:  00  01  00  80  00  00  c0  00  00  00  00  00  00  15  00  00 
B0:  2d *2f  00  29  00  23  00  29  02 *0e  04  00  00  00  11  00 
C0:  30  02  99  1b  33  05  36  43  10  3b  58  1b  9b  1b  64  00 
D0: *be  02  e2  02  00  00  00  23  31  0c  0b  00  00  00  00  00 
E0:  00  00  00  00  00  00  00  00  00  00  00  00  13  00  43  00 
F0:  01  00  00  00  90  51  80  43  00  00  00  00  00  00  00  00 

With the kernel EC debug tool, it is possible to detect a register change at B9 when pressing the brightness keys. This value is increased/decreased by pressing the appropriate key, in a range from 0x00 to 0x0F.

If I understand the ACPI specification correctly, the EC is supposed to send out an interrupt in order for the OS to query the EC and pick up the brightness event. However, after checking each ACPI debug layer individually at max verbosity, there seems to be no output whatsoever generated by a key press.
Comment 2 Johannes Penßel 2022-04-21 14:29:01 UTC
Calling the brightness EC query method directly through the kernel ACPI debugger does not result in a change in value for the aforementioned register at B9. It appears to be dependent on a key press. 
Maybe it's also worth mentioning that when calling _Q11/_Q12, my trace wasn't able to pick up anything from GFX0.DD1F.

- debug \_SB.PC00.LPCB.EC0._Q12
Evaluating \_SB.PC00.LPCB.EC0._Q12
AML Opcode: 0070 Store


% 
ArgObj:  000000000dee6495 <Node>          Name P80B RegionField 0000000052e7b4ee
ArgObj:  000000008674c39a <Obj>           Integer 0000000000000012
ResultObj: 000000008674c39a <Obj>           Integer 0000000000000012

AML Opcode: 0086 Notify


% 
ArgObj:  0000000073452c4b <Obj>           Integer 0000000000000086
ArgObj:  00000000f420e657 <Node>          Name DD1F Device
AML Opcode: 0086 Notify


% 
ArgObj:  0000000073452c4b <Obj>           Integer 0000000000000080
ArgObj:  0000000072854c9d <Node>          Name VPC0 Device
Evaluation of \_SB.PC00.LPCB.EC0._Q12 returned object 000000001a14f500, external buffer length 18
 [Integer] = 0000000000000012




[ 1731.602892]   extrace-0138 ex_trace_point        : Method Begin [0x00000000bd1e9420:\_SB.PC00.LPCB.EC0.VPC0.VPCW] execution.
[ 1731.604041]   extrace-0138 ex_trace_point        : Method End [0x00000000bd1e9420:\_SB.PC00.LPCB.EC0.VPC0.VPCW] execution.
[ 1731.604067]   extrace-0138 ex_trace_point        : Method Begin [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.604890]   extrace-0138 ex_trace_point        : Method End [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.604917]   extrace-0138 ex_trace_point        : Method Begin [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.605023]   extrace-0138 ex_trace_point        : Method End [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.605037]   extrace-0138 ex_trace_point        : Method Begin [0x00000000bd1e9420:\_SB.PC00.LPCB.EC0.VPC0.VPCW] execution.
[ 1731.605752]   extrace-0138 ex_trace_point        : Method End [0x00000000bd1e9420:\_SB.PC00.LPCB.EC0.VPC0.VPCW] execution.
[ 1731.605766]   extrace-0138 ex_trace_point        : Method Begin [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.606439]   extrace-0138 ex_trace_point        : Method End [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.606464]   extrace-0138 ex_trace_point        : Method Begin [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
[ 1731.606555]   extrace-0138 ex_trace_point        : Method End [0x000000000372cbfe:\_SB.PC00.LPCB.EC0.VPC0.VPCR] execution.
Comment 3 Johannes Penßel 2022-04-22 22:58:13 UTC
When pressing the brightness keys in Windows, the value read out from the B9 register does not change. To me, it looks like the EC tries to control the backlight itself, and there must be some way to enable "ACPI mode" for it to generate ACPI events instead.
Comment 4 Zhang Rui 2022-06-27 04:06:05 UTC
can you get a SCI (ACPI interrupt) when pressing the hotkey?
if yes, can you get an EC GPE when pressing the hotkey?

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