← Documents Documentation/ABI/testing/debugfs-cros-ec GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

ChromeOS EC debugfs ABI

ChromeOS EC의 console log, 이전 reboot panic 정보, USB PD ports, uptime, 최근 resume 결과와 hardware sleep transition timeout 설정 debugfs files를 설명합니다.

Source pathDocumentation/ABI/testing/debugfs-cros-ec
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

EC logs, panic, PD ports, uptime

debugfs-cros-ec:1-34

EC command 지원 여부에 따라 console log와 panic information을 제공하며, USB PD/Type-C port 상태와 EC boot 이후 millisecond uptime을 노출합니다.

SLP_S0 transition resume result

debugfs-cros-ec:36-56

최근 AP resume message에 대한 EC 응답에서 SLP_S0 transition 수와 timeout 때문에 EC가 wake를 시도했는지를 32-bit 값으로 보고합니다.

Hardware sleep transition timeout

debugfs-cros-ec:58-78

EC가 deep sleep 진입 실패를 선언하고 system wake를 시도하기 전에 기다릴 시간을 millisecond로 설정합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/kernel/debug/<cros-ec-device>/console_log
2 Date: September 2017
3 KernelVersion: 4.13
4 Description:
5 If the EC supports the CONSOLE_READ command type, this file
6 can be used to grab the EC logs. The kernel polls for the log
7 and keeps its own buffer but userspace should grab this and
8 write it out to some logs.
9
10 What: /sys/kernel/debug/<cros-ec-device>/panicinfo
11 Date: September 2017
12 KernelVersion: 4.13
13 Description:
14 This file dumps the EC panic information from the previous
15 reboot. This file will only exist if the PANIC_INFO command
16 type is supported by the EC.
17
18 What: /sys/kernel/debug/<cros-ec-device>/pdinfo
19 Date: June 2018
20 KernelVersion: 4.17
21 Description:
22 This file provides the port role, muxes and power debug
23 information for all the USB PD/type-C ports available. If
24 the are no ports available, this file will be just an empty
25 file.
26
27 What: /sys/kernel/debug/<cros-ec-device>/uptime
28 Date: June 2019
29 KernelVersion: 5.3
30 Description:
31 A u32 providing the time since EC booted in ms. This is
32 is used for synchronizing the AP host time with the EC
33 log. An error is returned if the command is not supported
34 by the EC or there is a communication problem.
35
36 What: /sys/kernel/debug/<cros-ec-device>/last_resume_result
37 Date: June 2019
38 KernelVersion: 5.3
39 Description:
40 Some ECs have a feature where they will track transitions to
41 the (Intel) processor's SLP_S0 line, in order to detect cases
42 where a system failed to go into S0ix. When the system resumes,
43 an EC with this feature will return a summary of SLP_S0
44 transitions that occurred. The last_resume_result file returns
45 the most recent response from the AP's resume message to the EC.
46
47 The bottom 31 bits contain a count of the number of SLP_S0
48 transitions that occurred since the suspend message was
49 received. Bit 31 is set if the EC attempted to wake the
50 system due to a timeout when watching for SLP_S0 transitions.
51 Callers can use this to detect a wake from the EC due to
52 S0ix timeouts. The result will be zero if no suspend
53 transitions have been attempted, or the EC does not support
54 this feature.
55
56 Output will be in the format: "0x%08x\n".
57
58 What: /sys/kernel/debug/<cros-ec-device>/suspend_timeout_ms
59 Date: August 2022
60 KernelVersion: 6.1
61 Description:
62 Some ECs have a feature where they will track transitions of
63 a hardware-controlled sleep line, such as Intel's SLP_S0 line,
64 in order to detect cases where a system failed to go into deep
65 sleep states. The suspend_timeout_ms file controls the amount of
66 time in milliseconds the EC will wait before declaring a sleep
67 timeout event and attempting to wake the system.
68
69 Supply 0 to use the default value coded into EC firmware. Supply
70 65535 (EC_HOST_SLEEP_TIMEOUT_INFINITE) to disable the EC sleep
71 failure detection mechanism. Values in between 0 and 65535
72 indicate the number of milliseconds the EC should wait after a
73 sleep transition before declaring a timeout. This includes both
74 the duration after a sleep command was received but before the
75 hardware line changed, as well as the duration between when the
76 hardware line changed and the kernel sent an EC resume command.
77
78 Output will be in the format: "%u\n".
79

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

EC logs, panic, PD ports, uptime

1-34
WhatDate / KernelVersion설명
/sys/kernel/debug/<cros-ec-device>/console_log2017년 9월 / 4.13EC가 CONSOLE_READ command type을 지원하면 EC logs를 가져올 수 있습니다. Kernel이 log를 polling해 자체 buffer에 보관하지만 userspace가 이를 읽어 별도 log에 기록해야 합니다.
/sys/kernel/debug/<cros-ec-device>/panicinfo2017년 9월 / 4.13이전 reboot의 EC panic information을 dump합니다. EC가 PANIC_INFO command type을 지원할 때만 file이 존재합니다.
/sys/kernel/debug/<cros-ec-device>/pdinfo2018년 6월 / 4.17사용 가능한 모든 USB PD/Type-C ports의 port role, muxes, power debug information을 제공합니다. Port가 없으면 빈 file입니다.
/sys/kernel/debug/<cros-ec-device>/uptime2019년 6월 / 5.3EC boot 이후 경과 시간을 millisecond 단위 u32로 제공합니다. AP host time과 EC log를 동기화하는 데 사용합니다. Command 미지원 또는 통신 문제 시 error를 반환합니다.

최근 SLP_S0 resume 결과

36-56
항목내용
What/sys/kernel/debug/<cros-ec-device>/last_resume_result
Date2019년 6월
KernelVersion5.3

일부 EC는 system이 S0ix에 진입하지 못한 경우를 검출하기 위해 Intel processor의 SLP_S0 line transition을 추적합니다. System resume 시 이 기능을 가진 EC는 발생한 SLP_S0 transitions의 요약을 반환하며, last_resume_result는 AP가 EC에 보낸 resume message에 대한 가장 최근 응답을 제공합니다.

Bit 구간의미
30:0Suspend message를 받은 뒤 발생한 SLP_S0 transition 수
31SLP_S0 transitions를 기다리는 동안 timeout이 발생해 EC가 system wake를 시도했으면 1

호출자는 bit 31로 S0ix timeout 때문에 EC가 깨운 상황을 검출할 수 있습니다. Suspend transition을 한 번도 시도하지 않았거나 EC가 이 기능을 지원하지 않으면 결과는 0입니다.

출력 형식은 "0x%08x\n"입니다.

last_resume_result 32-bit 구성
last_resume_resultbit 31EC timeout wake flag
last_resume_resultbits 30:0SLP_S0 transition count
No attempt or unsupported0x00000000

한 값 안에서 timeout wake 여부와 suspend 이후 관찰한 SLP_S0 transition 수를 분리해 읽는다.

Sleep transition timeout 설정

58-78
항목내용
What/sys/kernel/debug/<cros-ec-device>/suspend_timeout_ms
Date2022년 8월
KernelVersion6.1

일부 EC는 system이 deep sleep state에 들어가지 못한 경우를 검출하기 위해 Intel SLP_S0 같은 hardware-controlled sleep line의 transitions를 추적합니다. suspend_timeout_ms는 sleep timeout event를 선언하고 system wake를 시도하기 전 EC가 기다릴 시간을 millisecond 단위로 제어합니다.

설정값동작
0EC firmware에 들어 있는 기본값 사용
65535EC_HOST_SLEEP_TIMEOUT_INFINITE. EC sleep failure detection mechanism 비활성화
1..65534Sleep transition 뒤 timeout을 선언하기 전에 기다릴 millisecond 수

Timeout에는 sleep command를 받은 뒤 hardware line이 바뀌기 전까지의 시간과, hardware line이 바뀐 뒤 kernel이 EC resume command를 보낼 때까지의 시간이 모두 포함됩니다.

출력 형식은 "%u\n"입니다.

EC가 관찰하는 suspend timeout 구간
EC receives sleep commandHardware sleep line 변경 대기Sleep line transitionKernel EC resume command 대기Resume
suspend_timeout_ms두 대기 구간 감시TimeoutEC attempts system wake

설정한 timeout은 sleep command 이후 hardware line transition 전 구간과 transition 이후 kernel resume command 전 구간을 모두 포괄한다.