요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
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-78EC가 deep sleep 진입 실패를 선언하고 system wake를 시도하기 전에 기다릴 시간을 millisecond로 설정합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/kernel/debug/<cros-ec-device>/console_log
Date: September 2017
KernelVersion: 4.13
Description:
If the EC supports the CONSOLE_READ command type, this file
can be used to grab the EC logs. The kernel polls for the log
and keeps its own buffer but userspace should grab this and
write it out to some logs.
What: /sys/kernel/debug/<cros-ec-device>/panicinfo
Date: September 2017
KernelVersion: 4.13
Description:
This file dumps the EC panic information from the previous
reboot. This file will only exist if the PANIC_INFO command
type is supported by the EC.
What: /sys/kernel/debug/<cros-ec-device>/pdinfo
Date: June 2018
KernelVersion: 4.17
Description:
This file provides the port role, muxes and power debug
information for all the USB PD/type-C ports available. If
the are no ports available, this file will be just an empty
file.
What: /sys/kernel/debug/<cros-ec-device>/uptime
Date: June 2019
KernelVersion: 5.3
Description:
A u32 providing the time since EC booted in ms. This is
is used for synchronizing the AP host time with the EC
log. An error is returned if the command is not supported
by the EC or there is a communication problem.
What: /sys/kernel/debug/<cros-ec-device>/last_resume_result
Date: June 2019
KernelVersion: 5.3
Description:
Some ECs have a feature where they will track transitions to
the (Intel) processor's SLP_S0 line, in order to detect cases
where a system failed to go into S0ix. When the system resumes,
an EC with this feature will return a summary of SLP_S0
transitions that occurred. The last_resume_result file returns
the most recent response from the AP's resume message to the EC.
The bottom 31 bits contain a count of the number of SLP_S0
transitions that occurred since the suspend message was
received. Bit 31 is set if the EC attempted to wake the
system due to a timeout when watching for SLP_S0 transitions.
Callers can use this to detect a wake from the EC due to
S0ix timeouts. The result will be zero if no suspend
transitions have been attempted, or the EC does not support
this feature.
Output will be in the format: "0x%08x\n".
What: /sys/kernel/debug/<cros-ec-device>/suspend_timeout_ms
Date: August 2022
KernelVersion: 6.1
Description:
Some ECs have a feature where they will track transitions of
a hardware-controlled sleep line, such as Intel's SLP_S0 line,
in order to detect cases where a system failed to go into deep
sleep states. The suspend_timeout_ms file controls the amount of
time in milliseconds the EC will wait before declaring a sleep
timeout event and attempting to wake the system.
Supply 0 to use the default value coded into EC firmware. Supply
65535 (EC_HOST_SLEEP_TIMEOUT_INFINITE) to disable the EC sleep
failure detection mechanism. Values in between 0 and 65535
indicate the number of milliseconds the EC should wait after a
sleep transition before declaring a timeout. This includes both
the duration after a sleep command was received but before the
hardware line changed, as well as the duration between when the
hardware line changed and the kernel sent an EC resume command.
Output will be in the format: "%u\n".
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
EC logs, panic, PD ports, uptime
1-34| What | Date / KernelVersion | 설명 |
|---|---|---|
| /sys/kernel/debug/<cros-ec-device>/console_log | 2017년 9월 / 4.13 | EC가 CONSOLE_READ command type을 지원하면 EC logs를 가져올 수 있습니다. Kernel이 log를 polling해 자체 buffer에 보관하지만 userspace가 이를 읽어 별도 log에 기록해야 합니다. |
| /sys/kernel/debug/<cros-ec-device>/panicinfo | 2017년 9월 / 4.13 | 이전 reboot의 EC panic information을 dump합니다. EC가 PANIC_INFO command type을 지원할 때만 file이 존재합니다. |
| /sys/kernel/debug/<cros-ec-device>/pdinfo | 2018년 6월 / 4.17 | 사용 가능한 모든 USB PD/Type-C ports의 port role, muxes, power debug information을 제공합니다. Port가 없으면 빈 file입니다. |
| /sys/kernel/debug/<cros-ec-device>/uptime | 2019년 6월 / 5.3 | EC 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 |
| Date | 2019년 6월 |
| KernelVersion | 5.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:0 | Suspend message를 받은 뒤 발생한 SLP_S0 transition 수 |
| 31 | SLP_S0 transitions를 기다리는 동안 timeout이 발생해 EC가 system wake를 시도했으면 1 |
호출자는 bit 31로 S0ix timeout 때문에 EC가 깨운 상황을 검출할 수 있습니다. Suspend transition을 한 번도 시도하지 않았거나 EC가 이 기능을 지원하지 않으면 결과는 0입니다.
출력 형식은 "0x%08x\n"입니다.
한 값 안에서 timeout wake 여부와 suspend 이후 관찰한 SLP_S0 transition 수를 분리해 읽는다.
Sleep transition timeout 설정
58-78| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/<cros-ec-device>/suspend_timeout_ms |
| Date | 2022년 8월 |
| KernelVersion | 6.1 |
일부 EC는 system이 deep sleep state에 들어가지 못한 경우를 검출하기 위해 Intel SLP_S0 같은 hardware-controlled sleep line의 transitions를 추적합니다. suspend_timeout_ms는 sleep timeout event를 선언하고 system wake를 시도하기 전 EC가 기다릴 시간을 millisecond 단위로 제어합니다.
| 설정값 | 동작 |
|---|---|
| 0 | EC firmware에 들어 있는 기본값 사용 |
| 65535 | EC_HOST_SLEEP_TIMEOUT_INFINITE. EC sleep failure detection mechanism 비활성화 |
| 1..65534 | Sleep transition 뒤 timeout을 선언하기 전에 기다릴 millisecond 수 |
Timeout에는 sleep command를 받은 뒤 hardware line이 바뀌기 전까지의 시간과, hardware line이 바뀐 뒤 kernel이 EC resume command를 보낼 때까지의 시간이 모두 포함됩니다.
출력 형식은 "%u\n"입니다.
설정한 timeout은 sleep command 이후 hardware line transition 전 구간과 transition 이후 kernel resume command 전 구간을 모두 포괄한다.
EC logs, panic, PD ports, uptime
debugfs-cros-ec:1-34EC command 지원 여부에 따라 console log와 panic information을 제공하며, USB PD/Type-C port 상태와 EC boot 이후 millisecond uptime을 노출합니다.