Documentation/driver-api/s390-drivers.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

Writing s390 channel device drivers

S390 CSS·CCW·CCWgroup bus 계층과 common I/O, channel measurement, adapter interrupt API를 다루는 전문 번역입니다.

Source pathDocumentation/driver-api/s390-drivers.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

s390-drivers.rst:1-135

S390 common I/O layer는 CSS subchannel을 CCW device abstraction으로 감싸 driver core와 channel I/O를 연결합니다. Driver는 ccw helper를 우회하지 않아야 하며, CCWgroup은 여러 channel을 하나의 meta-device로 묶습니다. Measurement facility와 adapter interrupt helper의 kernel-doc source도 함께 정리합니다.

문서 구성
원문 줄내용
1-30문서 범위와 channel I/O 선행 지식
31-58CSS subchannel 분류와 CCW bus 계층
59-102CCW I/O function과 channel measurement
103-120CCWgroup meta-device와 API
121-135Generic interface와 adapter interrupt

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===================================
2 Writing s390 channel device drivers
3 ===================================
4
5 :Author: Cornelia Huck
6
7 Introduction
8 ============
9
10 This document describes the interfaces available for device drivers that
11 drive s390 based channel attached I/O devices. This includes interfaces
12 for interaction with the hardware and interfaces for interacting with
13 the common driver core. Those interfaces are provided by the s390 common
14 I/O layer.
15
16 The document assumes a familarity with the technical terms associated
17 with the s390 channel I/O architecture. For a description of this
18 architecture, please refer to the "z/Architecture: Principles of
19 Operation", IBM publication no. SA22-7832.
20
21 While most I/O devices on a s390 system are typically driven through the
22 channel I/O mechanism described here, there are various other methods
23 (like the diag interface). These are out of the scope of this document.
24
25 The s390 common I/O layer also provides access to some devices that are
26 not strictly considered I/O devices. They are considered here as well,
27 although they are not the focus of this document.
28
29 Some additional information can also be found in the kernel source under
30 Documentation/arch/s390/driver-model.rst.
31
32 The css bus
33 ===========
34
35 The css bus contains the subchannels available on the system. They fall
36 into several categories:
37
38 * Standard I/O subchannels, for use by the system. They have a child
39 device on the ccw bus and are described below.
40 * I/O subchannels bound to the vfio-ccw driver. See
41 Documentation/arch/s390/vfio-ccw.rst.
42 * Message subchannels. No Linux driver currently exists.
43 * CHSC subchannels (at most one). The chsc subchannel driver can be used
44 to send asynchronous chsc commands.
45 * eADM subchannels. Used for talking to storage class memory.
46
47 The ccw bus
48 ===========
49
50 The ccw bus typically contains the majority of devices available to a
51 s390 system. Named after the channel command word (ccw), the basic
52 command structure used to address its devices, the ccw bus contains
53 so-called channel attached devices. They are addressed via I/O
54 subchannels, visible on the css bus. A device driver for
55 channel-attached devices, however, will never interact with the
56 subchannel directly, but only via the I/O device on the ccw bus, the ccw
57 device.
58
59 I/O functions for channel-attached devices
60 ------------------------------------------
61
62 Some hardware structures have been translated into C structures for use
63 by the common I/O layer and device drivers. For more information on the
64 hardware structures represented here, please consult the Principles of
65 Operation.
66
67 .. kernel-doc:: arch/s390/include/asm/cio.h
68 :internal:
69
70 ccw devices
71 -----------
72
73 Devices that want to initiate channel I/O need to attach to the ccw bus.
74 Interaction with the driver core is done via the common I/O layer, which
75 provides the abstractions of ccw devices and ccw device drivers.
76
77 The functions that initiate or terminate channel I/O all act upon a ccw
78 device structure. Device drivers must not bypass those functions or
79 strange side effects may happen.
80
81 .. kernel-doc:: arch/s390/include/asm/ccwdev.h
82 :internal:
83
84 .. kernel-doc:: drivers/s390/cio/device.c
85 :export:
86
87 .. kernel-doc:: drivers/s390/cio/device_ops.c
88 :export:
89
90 The channel-measurement facility
91 --------------------------------
92
93 The channel-measurement facility provides a means to collect measurement
94 data which is made available by the channel subsystem for each channel
95 attached device.
96
97 .. kernel-doc:: arch/s390/include/uapi/asm/cmb.h
98 :internal:
99
100 .. kernel-doc:: drivers/s390/cio/cmf.c
101 :export:
102
103 The ccwgroup bus
104 ================
105
106 The ccwgroup bus only contains artificial devices, created by the user.
107 Many networking devices (e.g. qeth) are in fact composed of several ccw
108 devices (like read, write and data channel for qeth). The ccwgroup bus
109 provides a mechanism to create a meta-device which contains those ccw
110 devices as slave devices and can be associated with the netdevice.
111
112 ccw group devices
113 -----------------
114
115 .. kernel-doc:: arch/s390/include/asm/ccwgroup.h
116 :internal:
117
118 .. kernel-doc:: drivers/s390/cio/ccwgroup.c
119 :export:
120
121 Generic interfaces
122 ==================
123
124 The following section contains interfaces in use not only by drivers
125 dealing with ccw devices, but drivers for various other s390 hardware
126 as well.
127
128 Adapter interrupts
129 ------------------
130
131 The common I/O layer provides helper functions for dealing with adapter
132 interrupts and interrupt vectors.
133
134 .. kernel-doc:: drivers/s390/cio/airq.c
135 :export:
136

3. 한국어 전문 번역

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

S390 channel device driver 문서 정보

1-6

이 문서는 s390 channel device driver 작성 방법을 설명하며 저자는 Cornelia Huck입니다.

문서 식별 정보
항목
문서Writing s390 channel device drivers
저자Cornelia Huck
주제S390 common I/O layer와 channel-attached device

===================================
Writing s390 channel device drivers
===================================

:Author: Cornelia Huck

범위와 선행 지식

7-30

이 문서는 s390 기반 channel-attached I/O device를 구동하는 driver가 사용할 수 있는 interface를 설명합니다. Hardware와 상호작용하는 interface와 common driver core와 상호작용하는 interface를 모두 포함하며, s390 common I/O layer가 이를 제공합니다.

독자는 s390 channel I/O architecture의 technical term에 익숙하다고 가정합니다. Architecture 설명은 IBM publication SA22-7832인 "z/Architecture: Principles of Operation"을 참조해야 합니다.

S390 system의 대다수 I/O device는 여기서 설명하는 channel I/O mechanism으로 구동되지만 diag interface 같은 다른 방식도 있으며 문서 범위 밖입니다.

S390 common I/O layer는 엄밀히 I/O device로 보지 않는 일부 device에도 access를 제공합니다. 이 문서에서도 다루지만 중심 대상은 아닙니다. 추가 정보는 kernel source의 `Documentation/arch/s390/driver-model.rst`에 있습니다.

S390 driver interface 범위
S390 channel-attached deviceHardware interfaceS390 common I/O layerCommon driver coreDevice driver
diag interface and other methodsOut of scope

Common I/O layer가 hardware channel interface와 Linux driver core abstraction을 연결합니다.

Introduction
============

This document describes the interfaces available for device drivers that
drive s390 based channel attached I/O devices. This includes interfaces
for interaction with the hardware and interfaces for interacting with
the common driver core. Those interfaces are provided by the s390 common
I/O layer.

The document assumes a familarity with the technical terms associated
with the s390 channel I/O architecture. For a description of this
architecture, please refer to the "z/Architecture: Principles of
Operation", IBM publication no. SA22-7832.

While most I/O devices on a s390 system are typically driven through the
channel I/O mechanism described here, there are various other methods
(like the diag interface). These are out of the scope of this document.

The s390 common I/O layer also provides access to some devices that are
not strictly considered I/O devices. They are considered here as well,
although they are not the focus of this document.

Some additional information can also be found in the kernel source under
Documentation/arch/s390/driver-model.rst.

CSS bus와 subchannel 분류

31-46

CSS bus에는 system에서 사용할 수 있는 subchannel이 들어 있으며 여러 category로 나뉩니다.

Standard I/O subchannel은 system이 사용하며 ccw bus에 child device를 둡니다. VFIO에 할당된 I/O subchannel은 `vfio-ccw` driver에 bind되고 `Documentation/arch/s390/vfio-ccw.rst`에서 설명합니다.

Message subchannel에는 현재 Linux driver가 없습니다. CHSC subchannel은 최대 하나이며 asynchronous CHSC command를 보내는 데 사용할 수 있습니다. eADM subchannel은 storage class memory와 통신합니다.

CSS bus subchannel
Category역할
Standard I/OCCW bus child device를 통한 system I/O
VFIO I/O`vfio-ccw` driver에 bind
Message현재 Linux driver 없음
CHSC최대 하나, asynchronous CHSC command
eADMStorage class memory 통신


The css bus
===========

The css bus contains the subchannels available on the system. They fall
into several categories:

* Standard I/O subchannels, for use by the system. They have a child
  device on the ccw bus and are described below.
* I/O subchannels bound to the vfio-ccw driver. See
  Documentation/arch/s390/vfio-ccw.rst.
* Message subchannels. No Linux driver currently exists.
* CHSC subchannels (at most one). The chsc subchannel driver can be used
  to send asynchronous chsc commands.
* eADM subchannels. Used for talking to storage class memory.

CCW bus와 device abstraction

47-58

CCW bus에는 보통 s390 system에서 사용할 수 있는 device 대부분이 들어 있습니다. 이름은 device를 address하는 기본 command structure인 channel command word(CCW)에서 왔습니다.

CCW bus의 channel-attached device는 CSS bus에 보이는 I/O subchannel을 통해 address됩니다. 그러나 channel-attached device driver는 subchannel과 직접 상호작용하지 않고 CCW bus의 I/O device인 ccw device만 사용합니다.

Channel-attached device 계층
Channel-attached hardwareI/O subchannel on CSS busCCW device on CCW busDevice driver

Driver는 CSS subchannel을 직접 다루지 않고 CCW device abstraction을 통해 I/O를 수행합니다.

The ccw bus
===========

The ccw bus typically contains the majority of devices available to a
s390 system. Named after the channel command word (ccw), the basic
command structure used to address its devices, the ccw bus contains
so-called channel attached devices. They are addressed via I/O
subchannels, visible on the css bus. A device driver for
channel-attached devices, however, will never interact with the
subchannel directly, but only via the I/O device on the ccw bus, the ccw
device.

Channel I/O hardware structure

59-69

Common I/O layer와 device driver에서 사용할 수 있도록 일부 hardware structure를 C structure로 옮겨 놓았습니다.

표현된 hardware structure의 자세한 의미는 Principles of Operation을 참조해야 합니다. Kernel-doc은 `arch/s390/include/asm/cio.h`의 internal interface를 가져옵니다.

Channel I/O structure source
항목내용
Hardware specificationz/Architecture Principles of Operation
C structure header`arch/s390/include/asm/cio.h`
Kernel-doc 범위`:internal:`

I/O functions for channel-attached devices
------------------------------------------

Some hardware structures have been translated into C structures for use
by the common I/O layer and device drivers. For more information on the
hardware structures represented here, please consult the Principles of
Operation.

.. kernel-doc:: arch/s390/include/asm/cio.h
   :internal:

CCW device와 I/O operation

70-89

Channel I/O를 시작하려는 device는 CCW bus에 attach해야 합니다. Driver core와의 상호작용은 ccw device와 ccw device driver abstraction을 제공하는 common I/O layer를 통해 수행합니다.

Channel I/O를 시작하거나 종료하는 function은 모두 ccw device structure를 대상으로 동작합니다. Device driver가 이 function을 우회하면 예상하지 못한 side effect가 발생할 수 있으므로 절대 우회해서는 안 됩니다.

Kernel-doc은 `arch/s390/include/asm/ccwdev.h`의 internal declaration과 `drivers/s390/cio/device.c`, `drivers/s390/cio/device_ops.c`의 exported function을 가져옵니다.

CCW device I/O 경로
CCW device driverCommon I/O exported functionsCCW device structureChannel I/O start / terminate
Bypass helper functionsUndefined or strange side effects

Common I/O helper가 driver core와 channel operation 사이의 필수 경계를 이룹니다.

ccw devices
-----------

Devices that want to initiate channel I/O need to attach to the ccw bus.
Interaction with the driver core is done via the common I/O layer, which
provides the abstractions of ccw devices and ccw device drivers.

The functions that initiate or terminate channel I/O all act upon a ccw
device structure. Device drivers must not bypass those functions or
strange side effects may happen.

.. kernel-doc:: arch/s390/include/asm/ccwdev.h
   :internal:

.. kernel-doc:: drivers/s390/cio/device.c
   :export:

.. kernel-doc:: drivers/s390/cio/device_ops.c
   :export:

Channel-measurement facility

90-102

Channel-measurement facility는 channel subsystem이 각 channel-attached device에 대해 제공하는 measurement data를 수집하는 수단입니다.

Kernel-doc은 `arch/s390/include/uapi/asm/cmb.h`의 internal interface와 `drivers/s390/cio/cmf.c`의 exported function을 가져옵니다.

Channel measurement 경로
Channel subsystemPer-device measurement dataChannel-measurement facility`cmb.h` / `cmf.c` interfaces

Channel subsystem의 device별 측정값을 CMF interface가 수집해 driver와 userspace API에 제공합니다.

The channel-measurement facility
--------------------------------

The channel-measurement facility provides a means to collect measurement
data which is made available by the channel subsystem for each channel
attached device.

.. kernel-doc:: arch/s390/include/uapi/asm/cmb.h
   :internal:

.. kernel-doc:: drivers/s390/cio/cmf.c
   :export:

CCW group meta-device

103-111

CCWgroup bus에는 user가 만든 artificial device만 들어 있습니다.

Qeth 같은 많은 networking device는 read, write, data channel처럼 여러 ccw device로 구성됩니다. CCWgroup bus는 이 ccw device들을 slave device로 포함하고 netdevice와 연결할 수 있는 meta-device를 만드는 mechanism을 제공합니다.

CCWgroup meta-device 구성
Read channel CCW deviceCCWgroup meta-deviceNetdevice
Write channel CCW deviceCCWgroup meta-device
Data channel CCW deviceCCWgroup meta-device

여러 역할의 CCW device를 하나의 user-created logical network device로 묶습니다.

The ccwgroup bus
================

The ccwgroup bus only contains artificial devices, created by the user.
Many networking devices (e.g. qeth) are in fact composed of several ccw
devices (like read, write and data channel for qeth). The ccwgroup bus
provides a mechanism to create a meta-device which contains those ccw
devices as slave devices and can be associated with the netdevice.

CCW group device API

112-120

CCW group device API의 kernel-doc은 `arch/s390/include/asm/ccwgroup.h`의 internal declaration과 `drivers/s390/cio/ccwgroup.c`의 exported function을 가져옵니다.

CCWgroup kernel-doc source
Source path범위
`arch/s390/include/asm/ccwgroup.h``:internal:`
`drivers/s390/cio/ccwgroup.c``:export:`

ccw group devices
-----------------

.. kernel-doc:: arch/s390/include/asm/ccwgroup.h
   :internal:

.. kernel-doc:: drivers/s390/cio/ccwgroup.c
   :export:

S390 generic interface

121-127

이어지는 generic interface는 ccw device를 다루는 driver뿐 아니라 여러 다른 s390 hardware driver에서도 사용됩니다.

Generic interface 적용 범위
사용자범위
CCW device driverCommon channel I/O와 보조 기능
Other s390 hardware driverArchitecture 공통 helper

Generic interfaces
==================

The following section contains interfaces in use not only by drivers
dealing with ccw devices, but drivers for various other s390 hardware
as well.

Adapter interrupt helper

128-135

Common I/O layer는 adapter interrupt와 interrupt vector를 처리하기 위한 helper function을 제공합니다.

Kernel-doc은 `drivers/s390/cio/airq.c`의 exported function을 가져옵니다.

Adapter interrupt 처리
S390 hardware driver`airq.c` exported helpersAdapter interruptInterrupt vectors

Architecture-specific common I/O helper가 interrupt와 vector 관리를 driver에 제공합니다.

Adapter interrupts
------------------

The common I/O layer provides helper functions for dealing with adapter
interrupts and interrupt vectors.

.. kernel-doc:: drivers/s390/cio/airq.c
   :export: