요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
ACPI와 sysfs
toshiba_haps.rst:32-87method, 지원 device, protection level과 reset file을 정리합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
====================================
Toshiba HDD Active Protection Sensor
====================================
Kernel driver: toshiba_haps
Author: Azael Avalos <[email protected]>
.. 0. Contents
1. Description
2. Interface
3. Accelerometer axes
4. Supported devices
5. Usage
1. Description
--------------
This driver provides support for the accelerometer found in various Toshiba
laptops, being called "Toshiba HDD Protection - Shock Sensor" officially,
and detects laptops automatically with this device.
On Windows, Toshiba provided software monitors this device and provides
automatic HDD protection (head unload) on sudden moves or harsh vibrations,
however, this driver only provides a notification via a sysfs file to let
userspace tools or daemons act accordingly, as well as providing a sysfs
file to set the desired protection level or sensor sensibility.
2. Interface
------------
This device comes with 3 methods:
==== =====================================================================
_STA Checks existence of the device, returning Zero if the device does not
exists or is not supported.
PTLV Sets the desired protection level.
RSSS Shuts down the HDD protection interface for a few seconds,
then restores normal operation.
==== =====================================================================
Note:
The presence of Solid State Drives (SSD) can make this driver to fail loading,
given the fact that such drives have no movable parts, and thus, not requiring
any "protection" as well as failing during the evaluation of the _STA method
found under this device.
3. Accelerometer axes
---------------------
This device does not report any axes, however, to query the sensor position
a couple HCI (Hardware Configuration Interface) calls (0x6D and 0xA6) are
provided to query such information, handled by the kernel module toshiba_acpi
since kernel version 3.15.
4. Supported devices
--------------------
This driver binds itself to the ACPI device TOS620A, and any Toshiba laptop
with this device is supported, given the fact that they have the presence of
conventional HDD and not only SSD, or a combination of both HDD and SSD.
5. Usage
--------
The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are:
================ ============================================================
protection_level The protection_level is readable and writeable, and
provides a way to let userspace query the current protection
level, as well as set the desired protection level, the
available protection levels are::
============ ======= ========== ========
0 - Disabled 1 - Low 2 - Medium 3 - High
============ ======= ========== ========
reset_protection The reset_protection entry is writeable only, being "1"
the only parameter it accepts, it is used to trigger
a reset of the protection interface.
================ ============================================================
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Driver와 목차
1-18Kernel driver는 `toshiba_haps`이며 작성자는 Azael Avalos <[email protected]>입니다.
문서는 description, interface, accelerometer axes, supported devices, usage 순서로 구성됩니다.
HDD shock sensor 지원 범위
19-31이 driver는 여러 Toshiba laptop의 accelerometer를 지원합니다. 공식 이름은 "Toshiba HDD Protection - Shock Sensor"이며 device가 있는 laptop을 자동 감지합니다.
Windows의 Toshiba software는 sudden move나 harsh vibration을 감지해 HDD head를 unload하지만, 이 driver는 sysfs file로 notification만 제공합니다. userspace tool 또는 daemon이 알맞게 대응해야 합니다. 별도 sysfs file에서 원하는 protection level 또는 sensor sensitivity를 설정할 수 있습니다.
ACPI method
32-51device는 세 method를 제공합니다.
| method | 동작 |
|---|---|
| _STA | device 존재 여부를 확인합니다. device가 없거나 unsupported이면 `0`을 반환합니다. |
| PTLV | 원하는 protection level을 설정합니다. |
| RSSS | HDD protection interface를 몇 초간 shutdown한 뒤 normal operation을 복원합니다. |
SSD에는 movable part가 없어 protection이 필요하지 않습니다. SSD 존재 때문에 이 device 아래 `_STA` 평가가 실패해 driver load가 실패할 수 있습니다.
Accelerometer axis 조회
52-60device 자체는 axis를 보고하지 않습니다. sensor position은 HCI(Hardware Configuration Interface) call `0x6D`, `0xA6`으로 조회합니다. 이 call은 kernel 3.15부터 `toshiba_acpi` module이 처리합니다.
지원 device
61-68driver는 ACPI device `TOS620A`에 bind합니다. 이 device가 있고 conventional HDD를 포함한 Toshiba laptop을 지원합니다. HDD만 있거나 HDD와 SSD를 함께 사용하는 구성은 지원되지만 SSD만 있는 구성은 대상이 아닙니다.
Sysfs 사용
69-87sysfs file은 `/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/` 아래에 있습니다.
| file | access·동작 |
|---|---|
| protection_level | read/write입니다. current level을 조회하거나 원하는 level을 설정합니다. |
| reset_protection | write-only이며 허용하는 parameter는 `1`뿐입니다. protection interface reset을 trigger합니다. |
| value | protection level |
|---|---|
| 0 | Disabled |
| 1 | Low |
| 2 | Medium |
| 3 | High |
Sensor와 driver
toshiba_haps.rst:1-31HDD shock sensor와 userspace notification 역할을 설명합니다.