요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
1
What: /sys/devices/.../state_synced
2
Date: May 2020
3
Contact: Saravana Kannan <[email protected]>
4
Description:
5
The /sys/devices/.../state_synced attribute is only present for
6
devices whose bus types or driver provides the .sync_state()
7
callback. The number read from it (0 or 1) reflects the value
8
of the device's 'state_synced' field. A value of 0 means the
9
.sync_state() callback hasn't been called yet. A value of 1
10
means the .sync_state() callback has been called.
12
Generally, if a device has sync_state() support and has some of
13
the resources it provides enabled at the time the kernel starts
14
(Eg: enabled by hardware reset or bootloader or anything that
15
run before the kernel starts), then it'll keep those resources
16
enabled and in a state that's compatible with the state they
17
were in at the start of the kernel. The device will stop doing
18
this only when the sync_state() callback has been called --
19
which happens only when all its consumer devices are registered
20
and have probed successfully. Resources that were left disabled
21
at the time the kernel starts are not affected or limited in
22
any way by sync_state() callbacks.
24
Writing "1" to this file will force a call to the device's
25
sync_state() function if it hasn't been called already. The
26
sync_state() call happens independent of the state of the
27
consumer devices.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Device sync-state callback status
1-29| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/devices/.../state_synced |
| Date | 2020년 5월 |
| Contact | Saravana Kannan <[email protected]> |
| Description | 이 attribute는 bus type 또는 driver가 .sync_state() callback을 제공하는 device에만 존재합니다. 여기서 읽은 0 또는 1은 device의 state_synced field 값을 반영합니다. 0은 .sync_state() callback이 아직 호출되지 않았음을, 1은 호출되었음을 뜻합니다. 일반적으로 sync_state()를 지원하는 device가 kernel 시작 시점에 제공 resource 일부를 enabled 상태로 가지고 있었다면(예: hardware reset, bootloader 또는 kernel보다 먼저 실행된 주체가 enable), 해당 resource를 계속 enable 상태로 유지하고 kernel 시작 시의 state와 호환되는 상태를 보존합니다. 이 동작은 모든 consumer device가 등록되고 probe에 성공한 뒤 .sync_state() callback이 호출되어야 끝납니다. Kernel 시작 시 disabled 상태였던 resource는 sync_state() callback의 영향을 받거나 어떤 방식으로도 제한되지 않습니다. 이 file에 "1"을 write하면 callback이 아직 호출되지 않은 경우 device의 sync_state() function을 강제로 호출합니다. 이 호출은 consumer device의 state와 무관하게 일어납니다. |
Operation / valueMeaning
Read 0.sync_state() has not been called
Read 1.sync_state() has been called
Write 1Force callback if not already called
Attribute의 read value와 write-one behavior입니다.
Kernel starts with provider resource enabled→Keep compatible enabled state→All consumers register and probe successfully→.sync_state() callback releases compatibility constraint
Boot에서 이미 enabled인 provider resource를 consumer가 준비될 때까지 보존합니다.
Provider-consumer state synchronization
sysfs-devices-state_synced:1-290/1 state는 callback 호출 전후를 나타내며, 모든 consumer가 등록·probe된 뒤 초기 enabled resources의 호환성 유지가 끝납니다. 1을 쓰면 consumer 상태와 무관하게 callback을 강제합니다.