← Documents Documentation/power/drivers-testing.rst GitHub 원문 ↗

Linux 6.18.37 · Power

Device driver의 suspend·resume 지원 시험

새 driver를 module과 built-in으로 각각 배치하고 STD·STR의 test mode와 실제 전환을 여러 번 교차 반복하여 suspend/resume 안전성을 검증하는 절차입니다.

Source pathDocumentation/power/drivers-testing.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

drivers-testing.rst:1-52

대상 driver가 없는 기준 시스템을 먼저 안정화한 뒤 module·built-in 두 배치에서 hibernation과 suspend 경로를 반복합니다. STD와 STR를 섞은 시험 중 하나라도 실패하면 해당 driver는 suspend/resume-safe가 아닙니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ====================================================
2 Testing suspend and resume support in device drivers
3 ====================================================
4
5 (C) 2007 Rafael J. Wysocki <[email protected]>, GPL
6
7 1. Preparing the test system
8 ============================
9
10 Unfortunately, to effectively test the support for the system-wide suspend and
11 resume transitions in a driver, it is necessary to suspend and resume a fully
12 functional system with this driver loaded. Moreover, that should be done
13 several times, preferably several times in a row, and separately for hibernation
14 (aka suspend to disk or STD) and suspend to RAM (STR), because each of these
15 cases involves slightly different operations and different interactions with
16 the machine's BIOS.
17
18 Of course, for this purpose the test system has to be known to suspend and
19 resume without the driver being tested. Thus, if possible, you should first
20 resolve all suspend/resume-related problems in the test system before you start
21 testing the new driver. Please see Documentation/power/basic-pm-debugging.rst
22 for more information about the debugging of suspend/resume functionality.
23
24 2. Testing the driver
25 =====================
26
27 Once you have resolved the suspend/resume-related problems with your test system
28 without the new driver, you are ready to test it:
29
30 a) Build the driver as a module, load it and try the test modes of hibernation
31 (see: Documentation/power/basic-pm-debugging.rst, 1).
32
33 b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
34 "platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1).
35
36 c) Compile the driver directly into the kernel and try the test modes of
37 hibernation.
38
39 d) Attempt to hibernate with the driver compiled directly into the kernel
40 in the "reboot", "shutdown" and "platform" modes.
41
42 e) Try the test modes of suspend (see:
43 Documentation/power/basic-pm-debugging.rst, 2). [As far as the STR tests are
44 concerned, it should not matter whether or not the driver is built as a
45 module.]
46
47 f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
48 (see: Documentation/power/basic-pm-debugging.rst, 2).
49
50 Each of the above tests should be repeated several times and the STD tests
51 should be mixed with the STR tests. If any of them fails, the driver cannot be
52 regarded as suspend/resume-safe.
53

3. 한국어 전문 번역

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

시험 시스템 준비

1-23

Driver의 system-wide suspend·resume transition 지원을 제대로 시험하려면 그 driver를 load한 완전한 시스템을 실제로 suspend하고 resume해야 합니다. 이 작업은 한 번이 아니라 여러 번, 가능하면 연속으로 반복해야 합니다.

Hibernation, 즉 suspend to disk(STD)와 suspend to RAM(STR)은 수행하는 operation과 BIOS interaction이 조금씩 다르므로 서로 따로 시험해야 합니다.

시험 시스템은 대상 driver가 없을 때 이미 suspend·resume가 정상 동작하는 것으로 확인되어야 합니다. 가능하면 새 driver 시험 전에 시스템 자체의 모든 suspend/resume 문제를 해결하십시오. 디버깅 방법은 `Documentation/power/basic-pm-debugging.rst`를 참조합니다.

시험 전제
system without new driverresolve suspend/resume problemsknown-good baselineload new driverstart repeated tests

기준 시스템을 먼저 안정화해야 새 driver가 만든 회귀를 분리할 수 있습니다.

====================================================
Testing suspend and resume support in device drivers
====================================================

        (C) 2007 Rafael J. Wysocki <[email protected]>, GPL

1. Preparing the test system
============================

Unfortunately, to effectively test the support for the system-wide suspend and
resume transitions in a driver, it is necessary to suspend and resume a fully
functional system with this driver loaded.  Moreover, that should be done
several times, preferably several times in a row, and separately for hibernation
(aka suspend to disk or STD) and suspend to RAM (STR), because each of these
cases involves slightly different operations and different interactions with
the machine's BIOS.

Of course, for this purpose the test system has to be known to suspend and
resume without the driver being tested.  Thus, if possible, you should first
resolve all suspend/resume-related problems in the test system before you start
testing the new driver.  Please see Documentation/power/basic-pm-debugging.rst
for more information about the debugging of suspend/resume functionality.

Driver 시험 행렬

24-52

기준 시스템의 문제를 해결한 뒤 다음 시험을 수행합니다.

a) Driver를 module로 build하고 load한 뒤 hibernation test mode를 실행합니다. b) Driver를 load한 상태에서 `reboot`, `shutdown`, `platform` mode로 hibernate합니다.

c) Driver를 kernel에 직접 compile한 뒤 hibernation test mode를 실행합니다. d) Built-in driver 상태에서 `reboot`, `shutdown`, `platform` mode로 hibernate합니다.

e) Suspend test mode를 실행합니다. STR 시험에서는 driver가 module인지 여부가 중요하지 않아야 합니다. f) Driver를 load한 상태에서 `s2ram` tool로 suspend to RAM을 수행합니다.

각 시험은 여러 번 반복하고 STD와 STR 시험을 섞어 수행해야 합니다. 하나라도 실패하면 그 driver를 suspend/resume-safe로 간주할 수 없습니다.

Suspend·resume driver 시험 행렬
배치STD test modeSTD 실제 modeSTR
Module loaded필수reboot / shutdown / platformSuspend test mode + s2ram
Built into kernel필수reboot / shutdown / platformSuspend test mode
반복 조건여러 번여러 번STD와 섞어서 여러 번

Module과 built-in 배치, STD와 STR 경로를 모두 반복 검증합니다.

2. Testing the driver
=====================

Once you have resolved the suspend/resume-related problems with your test system
without the new driver, you are ready to test it:

a) Build the driver as a module, load it and try the test modes of hibernation
   (see: Documentation/power/basic-pm-debugging.rst, 1).

b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
   "platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1).

c) Compile the driver directly into the kernel and try the test modes of
   hibernation.

d) Attempt to hibernate with the driver compiled directly into the kernel
   in the "reboot", "shutdown" and "platform" modes.

e) Try the test modes of suspend (see:
   Documentation/power/basic-pm-debugging.rst, 2).  [As far as the STR tests are
   concerned, it should not matter whether or not the driver is built as a
   module.]

f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
   (see: Documentation/power/basic-pm-debugging.rst, 2).

Each of the above tests should be repeated several times and the STD tests
should be mixed with the STR tests.  If any of them fails, the driver cannot be
regarded as suspend/resume-safe.