요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Direct·PMP link naming과 SATA speed
sysfs-ata:37-61Port 직속 link는 linkX이고 PMP 뒤 link는 linkX.Y입니다. PMP가 있으면 15 ata_link objects를 만들며 hardware maximum, libata limit, current Gbps speed를 노출합니다.
ATA device naming
sysfs-ata:64-71각 link 뒤 최대 두 device가 devX[.Y].Z로 생성됩니다. X는 port ID, Y는 optional PMP port, Z는 device ID이며 PATA는 보통 0·1 두 개, SATA는 하나입니다.
Error·identify·mode·class attributes
sysfs-ata:74-121Device attributes는 speed downgrade count, PMP GSCR cache, error ring, ATA IDENTIFY cache, PIO·current transfer·DMA modes와 ata·atapi·pmp·none class를 제공합니다.
DSM TRIM mode
sysfs-ata:124-140trim은 unsupported·unqueued·queued·forced_unqueued 중 현재 DSM TRIM mode를 보고하며 마지막 값은 buggy queued support 때문에 unqueued commands만 보냄을 뜻합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/class/ata_*
Description:
Provide a place in sysfs for storing the ATA topology of the
system. This allows retrieving various information about ATA
objects.
Files under /sys/class/ata_port
-------------------------------
For each port, a directory ataX is created where X is the ata_port_id of the
port. The device parent is the ata host device.
What: /sys/class/ata_port/ataX/nr_pmp_links
What: /sys/class/ata_port/ataX/idle_irq
Date: May, 2010
KernelVersion: v2.6.37
Contact: Gwendal Grignou <gwendal@chromium.org>
Description:
nr_pmp_links: (RO) If a SATA Port Multiplier (PM) is
connected, the number of links behind it.
idle_irq: (RO) Number of IRQ received by the port while
idle [some ata HBA only].
What: /sys/class/ata_port/ataX/port_no
Date: May, 2013
KernelVersion: v3.11
Contact: Gwendal Grignou <gwendal@chromium.org>
Description:
(RO) Host local port number. While registering host controller,
port numbers are tracked based upon number of ports available on
the controller. This attribute is needed by udev for composing
persistent links in /dev/disk/by-path.
Files under /sys/class/ata_link
-------------------------------
Behind each port, there is a ata_link. If there is a SATA PM in the topology, 15
ata_link objects are created.
If a link is behind a port, the directory name is linkX, where X is ata_port_id
of the port. If a link is behind a PM, its name is linkX.Y where X is
ata_port_id of the parent port and Y the PM port.
What: /sys/class/ata_link/linkX[.Y]/hw_sata_spd_limit
What: /sys/class/ata_link/linkX[.Y]/sata_spd_limit
What: /sys/class/ata_link/linkX[.Y]/sata_spd
Date: May, 2010
KernelVersion: v2.6.37
Contact: Gwendal Grignou <gwendal@chromium.org>
Description:
hw_sata_spd_limit: (RO) Maximum speed supported by the
connected SATA device.
sata_spd_limit: (RO) Maximum speed imposed by libata.
sata_spd: (RO) Current speed of the link
eg. 1.5, 3 Gbps etc.
Files under /sys/class/ata_device
---------------------------------
Behind each link, up to two ata devices are created.
The name of the directory is devX[.Y].Z where:
- X is ata_port_id of the port where the device is connected,
- Y the port of the PM if any, and
- Z the device id: for PATA, there is usually 2 devices [0,1], only 1 for SATA.
What: /sys/class/ata_device/devX[.Y].Z/spdn_cnt
What: /sys/class/ata_device/devX[.Y].Z/gscr
What: /sys/class/ata_device/devX[.Y].Z/ering
What: /sys/class/ata_device/devX[.Y].Z/id
What: /sys/class/ata_device/devX[.Y].Z/pio_mode
What: /sys/class/ata_device/devX[.Y].Z/xfer_mode
What: /sys/class/ata_device/devX[.Y].Z/dma_mode
What: /sys/class/ata_device/devX[.Y].Z/class
Date: May, 2010
KernelVersion: v2.6.37
Contact: Gwendal Grignou <gwendal@chromium.org>
Description:
spdn_cnt: (RO) Number of times libata decided to lower the
speed of link due to errors.
gscr: (RO) Cached result of the dump of PM GSCR
register. Valid registers are:
0: SATA_PMP_GSCR_PROD_ID,
1: SATA_PMP_GSCR_REV,
2: SATA_PMP_GSCR_PORT_INFO,
32: SATA_PMP_GSCR_ERROR,
33: SATA_PMP_GSCR_ERROR_EN,
64: SATA_PMP_GSCR_FEAT,
96: SATA_PMP_GSCR_FEAT_EN,
130: SATA_PMP_GSCR_SII_GPIO
Only valid if the device is a PM.
ering: (RO) Formatted output of the error ring of the
device.
id: (RO) Cached result of IDENTIFY command, as
described in ATA8 7.16 and 7.17. Only valid if
the device is not a PM.
pio_mode: (RO) PIO transfer mode used by the device.
Mostly used by PATA devices.
xfer_mode: (RO) Current transfer mode. Mostly used by
PATA devices.
dma_mode: (RO) DMA transfer mode used by the device.
Mostly used by PATA devices.
class: (RO) Device class. Can be "ata" for disk,
"atapi" for packet device, "pmp" for PM, or
"none" if no device was found behind the link.
What: /sys/class/ata_device/devX[.Y].Z/trim
Date: May, 2015
KernelVersion: v4.10
Contact: Gwendal Grignou <gwendal@chromium.org>
Description:
(RO) Shows the DSM TRIM mode currently used by the device. Valid
values are:
unsupported: Drive does not support DSM TRIM
unqueued: Drive supports unqueued DSM TRIM only
queued: Drive supports queued DSM TRIM
forced_unqueued: Drive's queued DSM support is known to
be buggy and only unqueued TRIM commands
are sent
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ATA class root와 port
1-35| 항목 | 내용 |
|---|---|
| What | /sys/class/ata_* |
| Description | System의 ATA topology를 저장할 sysfs 위치를 제공합니다. 이를 통해 ATA object의 여러 정보를 검색할 수 있습니다. |
/sys/class/ata_port 아래에는 각 port마다 ataX directory를 만듭니다. X는 port의 ata_port_id입니다. Device parent는 ATA host device입니다.
| What | 전문 번역 |
|---|---|
| /sys/class/ata_port/ataX/nr_pmp_links | (RO) SATA Port Multiplier(PM)가 연결된 경우 그 뒤에 있는 link 수입니다. |
| /sys/class/ata_port/ataX/idle_irq | (RO) Port가 idle인 동안 받은 IRQ 수입니다. 일부 ATA HBA에만 있습니다. |
| 공통 항목 | 내용 |
|---|---|
| Date | 2010년 5월 |
| KernelVersion | v2.6.37 |
| Contact | Gwendal Grignou <gwendal@chromium.org> |
| 항목 | 내용 |
|---|---|
| What | /sys/class/ata_port/ataX/port_no |
| Date | 2013년 5월 |
| KernelVersion | v3.11 |
| Contact | Gwendal Grignou <gwendal@chromium.org> |
| Description | (RO) Host-local port number입니다. Host controller를 등록할 때 controller에서 사용할 수 있는 port 수를 기준으로 port number를 추적합니다. Udev가 /dev/disk/by-path의 persistent link를 구성하는 데 이 attribute가 필요합니다. |
ATA link naming과 negotiated speed
37-61각 port 뒤에는 ata_link가 하나 있습니다. Topology에 SATA PM이 있으면 ata_link object 15개를 만듭니다.
Link가 port 바로 뒤에 있으면 directory 이름은 linkX이며 X는 port의 ata_port_id입니다. Link가 PM 뒤에 있으면 이름은 linkX.Y이며 X는 parent port의 ata_port_id이고 Y는 PM port입니다.
| What | 전문 번역 |
|---|---|
| /sys/class/ata_link/linkX[.Y]/hw_sata_spd_limit | (RO) 연결된 SATA device가 지원하는 maximum speed입니다. |
| /sys/class/ata_link/linkX[.Y]/sata_spd_limit | (RO) libata가 부과한 maximum speed입니다. |
| /sys/class/ata_link/linkX[.Y]/sata_spd | (RO) Link의 current speed입니다. 예: 1.5, 3 Gbps 등. |
| 공통 항목 | 내용 |
|---|---|
| Date | 2010년 5월 |
| KernelVersion | v2.6.37 |
| Contact | Gwendal Grignou <gwendal@chromium.org> |
ATA device directory 이름
64-71각 link 뒤에는 ATA device를 최대 두 개 만듭니다. Directory 이름은 devX[.Y].Z이며 각 component 의미는 다음과 같습니다.
| Component | 의미 |
|---|---|
| X | Device가 연결된 port의 ata_port_id |
| Y | PM이 있다면 그 PM port |
| Z | Device ID. PATA에는 보통 device [0,1] 두 개, SATA에는 하나만 있습니다. |
ATA device status와 transfer attributes
74-121| Attribute | 전문 번역 |
|---|---|
| spdn_cnt | (RO) Error 때문에 libata가 link speed를 낮추기로 결정한 횟수입니다. |
| gscr | (RO) PM GSCR register dump의 cached result입니다. Device가 PM인 경우에만 유효합니다. |
| ering | (RO) Device error ring을 formatting한 output입니다. |
| id | (RO) ATA8 7.16과 7.17에 설명된 IDENTIFY command의 cached result입니다. Device가 PM이 아닌 경우에만 유효합니다. |
| pio_mode | (RO) Device가 사용하는 PIO transfer mode입니다. 주로 PATA device가 사용합니다. |
| xfer_mode | (RO) Current transfer mode입니다. 주로 PATA device가 사용합니다. |
| dma_mode | (RO) Device가 사용하는 DMA transfer mode입니다. 주로 PATA device가 사용합니다. |
| class | (RO) Device class입니다. Disk는 ata, packet device는 atapi, PM은 pmp, link 뒤에서 device를 찾지 못하면 none입니다. |
이 attribute들은 /sys/class/ata_device/devX[.Y].Z/ 아래의 spdn_cnt, gscr, ering, id, pio_mode, xfer_mode, dma_mode, class file입니다.
| GSCR register | Symbol |
|---|---|
| 0 | SATA_PMP_GSCR_PROD_ID |
| 1 | SATA_PMP_GSCR_REV |
| 2 | SATA_PMP_GSCR_PORT_INFO |
| 32 | SATA_PMP_GSCR_ERROR |
| 33 | SATA_PMP_GSCR_ERROR_EN |
| 64 | SATA_PMP_GSCR_FEAT |
| 96 | SATA_PMP_GSCR_FEAT_EN |
| 130 | SATA_PMP_GSCR_SII_GPIO |
| 공통 항목 | 내용 |
|---|---|
| Date | 2010년 5월 |
| KernelVersion | v2.6.37 |
| Contact | Gwendal Grignou <gwendal@chromium.org> |
ATA DSM TRIM mode
124-140| 항목 | 내용 |
|---|---|
| What | /sys/class/ata_device/devX[.Y].Z/trim |
| Date | 2015년 5월 |
| KernelVersion | v4.10 |
| Contact | Gwendal Grignou <gwendal@chromium.org> |
| Description | (RO) Device가 현재 사용하는 DSM TRIM mode를 보여 줍니다. |
| 값 | 의미 |
|---|---|
| unsupported | Drive가 DSM TRIM을 지원하지 않음 |
| unqueued | Drive가 unqueued DSM TRIM만 지원함 |
| queued | Drive가 queued DSM TRIM을 지원함 |
| forced_unqueued | Drive의 queued DSM support에 bug가 있다고 알려져 있어 unqueued TRIM command만 보냄 |
ATA host 아래 port, direct 또는 PMP link, device가 계층적으로 생성되고 각 ID가 sysfs directory 이름에 반영된다.
ATA topology root와 port attributes
sysfs-ata:1-35/sys/class/ata_*는 ATA topology를 저장합니다. 각 port는 ata_port_id X로 ataX가 되며 PMP link 수, idle IRQ 수, host-local port number를 제공합니다.