← Documents Documentation/i2c/i2c-topology.rst GitHub 원문 ↗

Linux 6.18.37 · I2C

I2C muxes and complex topologies

mux-locked와 parent-locked mux의 잠금 범위, 중첩·형제 조합, 드라이버별 유형을 설명합니다.

Source pathDocumentation/i2c/i2c-topology.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

i2c-topology.rst:1-412

복잡한 I2C 토폴로지의 안전성은 select-transfer-deselect 동안 부모의 어느 범위를 잠그는지와 내부 I2C 전송이 잠금 있는 API인지 여부에 달려 있습니다. 중첩 mux의 auto-close와 무간섭 가정도 함께 검토해야 합니다.

문서 개요
항목
SourceDocumentation/i2c/i2c-topology.rst
분량412 source lines
잠금 방식2
복잡한 조합7
드라이버 목록17

원문 분량과 핵심 검토 대상을 요약합니다.

핵심 흐름
mux 드라이버 유형 확인부모·자식·형제 조합 분류select·deselect 내부 전송 검토ML·PL 제약과 auto-close 확인안전한 잠금 범위 확정

문서의 주요 판단 또는 탐색 순서를 압축합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ================================
2 I2C muxes and complex topologies
3 ================================
4
5 There are a couple of reasons for building more complex I2C topologies
6 than a straight-forward I2C bus with one adapter and one or more devices.
7
8 Some example use cases are:
9
10 1. A mux may be needed on the bus to prevent address collisions.
11
12 2. The bus may be accessible from some external bus master, and arbitration
13 may be needed to determine if it is ok to access the bus.
14
15 3. A device (particularly RF tuners) may want to avoid the digital noise
16 from the I2C bus, at least most of the time, and sits behind a gate
17 that has to be operated before the device can be accessed.
18
19 Several types of hardware components such as I2C muxes, I2C gates and I2C
20 arbitrators allow to handle such needs.
21
22 These components are represented as I2C adapter trees by Linux, where
23 each adapter has a parent adapter (except the root adapter) and zero or
24 more child adapters. The root adapter is the actual adapter that issues
25 I2C transfers, and all adapters with a parent are part of an "i2c-mux"
26 object (quoted, since it can also be an arbitrator or a gate).
27
28 Depending of the particular mux driver, something happens when there is
29 an I2C transfer on one of its child adapters. The mux driver can
30 obviously operate a mux, but it can also do arbitration with an external
31 bus master or open a gate. The mux driver has two operations for this,
32 select and deselect. select is called before the transfer and (the
33 optional) deselect is called after the transfer.
34
35
36 Locking
37 =======
38
39 There are two variants of locking available to I2C muxes, they can be
40 mux-locked or parent-locked muxes.
41
42
43 Mux-locked muxes
44 ----------------
45
46 Mux-locked muxes does not lock the entire parent adapter during the
47 full select-transfer-deselect transaction, only the muxes on the parent
48 adapter are locked. Mux-locked muxes are mostly interesting if the
49 select and/or deselect operations must use I2C transfers to complete
50 their tasks. Since the parent adapter is not fully locked during the
51 full transaction, unrelated I2C transfers may interleave the different
52 stages of the transaction. This has the benefit that the mux driver
53 may be easier and cleaner to implement, but it has some caveats.
54
55 Mux-locked Example
56 ~~~~~~~~~~~~~~~~~~
57
58 ::
59
60 .----------. .--------.
61 .--------. | mux- |-----| dev D1 |
62 | root |--+--| locked | '--------'
63 '--------' | | mux M1 |--. .--------.
64 | '----------' '--| dev D2 |
65 | .--------. '--------'
66 '--| dev D3 |
67 '--------'
68
69 When there is an access to D1, this happens:
70
71 1. Someone issues an I2C transfer to D1.
72 2. M1 locks muxes on its parent (the root adapter in this case).
73 3. M1 calls ->select to ready the mux.
74 4. M1 (presumably) does some I2C transfers as part of its select.
75 These transfers are normal I2C transfers that locks the parent
76 adapter.
77 5. M1 feeds the I2C transfer from step 1 to its parent adapter as a
78 normal I2C transfer that locks the parent adapter.
79 6. M1 calls ->deselect, if it has one.
80 7. Same rules as in step 4, but for ->deselect.
81 8. M1 unlocks muxes on its parent.
82
83 This means that accesses to D2 are lockout out for the full duration
84 of the entire operation. But accesses to D3 are possibly interleaved
85 at any point.
86
87 Mux-locked caveats
88 ~~~~~~~~~~~~~~~~~~
89
90 When using a mux-locked mux, be aware of the following restrictions:
91
92 [ML1]
93 If you build a topology with a mux-locked mux being the parent
94 of a parent-locked mux, this might break the expectation from the
95 parent-locked mux that the root adapter is locked during the
96 transaction.
97
98 [ML2]
99 It is not safe to build arbitrary topologies with two (or more)
100 mux-locked muxes that are not siblings, when there are address
101 collisions between the devices on the child adapters of these
102 non-sibling muxes.
103
104 I.e. the select-transfer-deselect transaction targeting e.g. device
105 address 0x42 behind mux-one may be interleaved with a similar
106 operation targeting device address 0x42 behind mux-two. The
107 intent with such a topology would in this hypothetical example
108 be that mux-one and mux-two should not be selected simultaneously,
109 but mux-locked muxes do not guarantee that in all topologies.
110
111 [ML3]
112 A mux-locked mux cannot be used by a driver for auto-closing
113 gates/muxes, i.e. something that closes automatically after a given
114 number (one, in most cases) of I2C transfers. Unrelated I2C transfers
115 may creep in and close prematurely.
116
117 [ML4]
118 If any non-I2C operation in the mux driver changes the I2C mux state,
119 the driver has to lock the root adapter during that operation.
120 Otherwise garbage may appear on the bus as seen from devices
121 behind the mux, when an unrelated I2C transfer is in flight during
122 the non-I2C mux-changing operation.
123
124
125 Parent-locked muxes
126 -------------------
127
128 Parent-locked muxes lock the parent adapter during the full select-
129 transfer-deselect transaction. The implication is that the mux driver
130 has to ensure that any and all I2C transfers through that parent
131 adapter during the transaction are unlocked I2C transfers (using e.g.
132 __i2c_transfer), or a deadlock will follow.
133
134 Parent-locked Example
135 ~~~~~~~~~~~~~~~~~~~~~
136
137 ::
138
139 .----------. .--------.
140 .--------. | parent- |-----| dev D1 |
141 | root |--+--| locked | '--------'
142 '--------' | | mux M1 |--. .--------.
143 | '----------' '--| dev D2 |
144 | .--------. '--------'
145 '--| dev D3 |
146 '--------'
147
148 When there is an access to D1, this happens:
149
150 1. Someone issues an I2C transfer to D1.
151 2. M1 locks muxes on its parent (the root adapter in this case).
152 3. M1 locks its parent adapter.
153 4. M1 calls ->select to ready the mux.
154 5. If M1 does any I2C transfers (on this root adapter) as part of
155 its select, those transfers must be unlocked I2C transfers so
156 that they do not deadlock the root adapter.
157 6. M1 feeds the I2C transfer from step 1 to the root adapter as an
158 unlocked I2C transfer, so that it does not deadlock the parent
159 adapter.
160 7. M1 calls ->deselect, if it has one.
161 8. Same rules as in step 5, but for ->deselect.
162 9. M1 unlocks its parent adapter.
163 10. M1 unlocks muxes on its parent.
164
165 This means that accesses to both D2 and D3 are locked out for the full
166 duration of the entire operation.
167
168 Parent-locked Caveats
169 ~~~~~~~~~~~~~~~~~~~~~
170
171 When using a parent-locked mux, be aware of the following restrictions:
172
173 [PL1]
174 If you build a topology with a parent-locked mux being the child
175 of another mux, this might break a possible assumption from the
176 child mux that the root adapter is unused between its select op
177 and the actual transfer (e.g. if the child mux is auto-closing
178 and the parent mux issues I2C transfers as part of its select).
179 This is especially the case if the parent mux is mux-locked, but
180 it may also happen if the parent mux is parent-locked.
181
182 [PL2]
183 If select/deselect calls out to other subsystems such as gpio,
184 pinctrl, regmap or iio, it is essential that any I2C transfers
185 caused by these subsystems are unlocked. This can be convoluted to
186 accomplish, maybe even impossible if an acceptably clean solution
187 is sought.
188
189
190 Complex Examples
191 ================
192
193 Parent-locked mux as parent of parent-locked mux
194 ------------------------------------------------
195
196 This is a useful topology, but it can be bad::
197
198 .----------. .----------. .--------.
199 .--------. | parent- |-----| parent- |-----| dev D1 |
200 | root |--+--| locked | | locked | '--------'
201 '--------' | | mux M1 |--. | mux M2 |--. .--------.
202 | '----------' | '----------' '--| dev D2 |
203 | .--------. | .--------. '--------'
204 '--| dev D4 | '--| dev D3 |
205 '--------' '--------'
206
207 When any device is accessed, all other devices are locked out for
208 the full duration of the operation (both muxes lock their parent,
209 and specifically when M2 requests its parent to lock, M1 passes
210 the buck to the root adapter).
211
212 This topology is bad if M2 is an auto-closing mux and M1->select
213 issues any unlocked I2C transfers on the root adapter that may leak
214 through and be seen by the M2 adapter, thus closing M2 prematurely.
215
216
217 Mux-locked mux as parent of mux-locked mux
218 ------------------------------------------
219
220 This is a good topology::
221
222 .----------. .----------. .--------.
223 .--------. | mux- |-----| mux- |-----| dev D1 |
224 | root |--+--| locked | | locked | '--------'
225 '--------' | | mux M1 |--. | mux M2 |--. .--------.
226 | '----------' | '----------' '--| dev D2 |
227 | .--------. | .--------. '--------'
228 '--| dev D4 | '--| dev D3 |
229 '--------' '--------'
230
231 When device D1 is accessed, accesses to D2 are locked out for the
232 full duration of the operation (muxes on the top child adapter of M1
233 are locked). But accesses to D3 and D4 are possibly interleaved at
234 any point.
235
236 Accesses to D3 locks out D1 and D2, but accesses to D4 are still possibly
237 interleaved.
238
239
240 Mux-locked mux as parent of parent-locked mux
241 ---------------------------------------------
242
243 This is probably a bad topology::
244
245 .----------. .----------. .--------.
246 .--------. | mux- |-----| parent- |-----| dev D1 |
247 | root |--+--| locked | | locked | '--------'
248 '--------' | | mux M1 |--. | mux M2 |--. .--------.
249 | '----------' | '----------' '--| dev D2 |
250 | .--------. | .--------. '--------'
251 '--| dev D4 | '--| dev D3 |
252 '--------' '--------'
253
254 When device D1 is accessed, accesses to D2 and D3 are locked out
255 for the full duration of the operation (M1 locks child muxes on the
256 root adapter). But accesses to D4 are possibly interleaved at any
257 point.
258
259 This kind of topology is generally not suitable and should probably
260 be avoided. The reason is that M2 probably assumes that there will
261 be no I2C transfers during its calls to ->select and ->deselect, and
262 if there are, any such transfers might appear on the slave side of M2
263 as partial I2C transfers, i.e. garbage or worse. This might cause
264 device lockups and/or other problems.
265
266 The topology is especially troublesome if M2 is an auto-closing
267 mux. In that case, any interleaved accesses to D4 might close M2
268 prematurely, as might any I2C transfers part of M1->select.
269
270 But if M2 is not making the above stated assumption, and if M2 is not
271 auto-closing, the topology is fine.
272
273
274 Parent-locked mux as parent of mux-locked mux
275 ---------------------------------------------
276
277 This is a good topology::
278
279 .----------. .----------. .--------.
280 .--------. | parent- |-----| mux- |-----| dev D1 |
281 | root |--+--| locked | | locked | '--------'
282 '--------' | | mux M1 |--. | mux M2 |--. .--------.
283 | '----------' | '----------' '--| dev D2 |
284 | .--------. | .--------. '--------'
285 '--| dev D4 | '--| dev D3 |
286 '--------' '--------'
287
288 When D1 is accessed, accesses to D2 are locked out for the full
289 duration of the operation (muxes on the top child adapter of M1
290 are locked). Accesses to D3 and D4 are possibly interleaved at
291 any point, just as is expected for mux-locked muxes.
292
293 When D3 or D4 are accessed, everything else is locked out. For D3
294 accesses, M1 locks the root adapter. For D4 accesses, the root
295 adapter is locked directly.
296
297
298 Two mux-locked sibling muxes
299 ----------------------------
300
301 This is a good topology::
302
303 .--------.
304 .----------. .--| dev D1 |
305 | mux- |--' '--------'
306 .--| locked | .--------.
307 | | mux M1 |-----| dev D2 |
308 | '----------' '--------'
309 | .----------. .--------.
310 .--------. | | mux- |-----| dev D3 |
311 | root |--+--| locked | '--------'
312 '--------' | | mux M2 |--. .--------.
313 | '----------' '--| dev D4 |
314 | .--------. '--------'
315 '--| dev D5 |
316 '--------'
317
318 When D1 is accessed, accesses to D2, D3 and D4 are locked out. But
319 accesses to D5 may be interleaved at any time.
320
321
322 Two parent-locked sibling muxes
323 -------------------------------
324
325 This is a good topology::
326
327 .--------.
328 .----------. .--| dev D1 |
329 | parent- |--' '--------'
330 .--| locked | .--------.
331 | | mux M1 |-----| dev D2 |
332 | '----------' '--------'
333 | .----------. .--------.
334 .--------. | | parent- |-----| dev D3 |
335 | root |--+--| locked | '--------'
336 '--------' | | mux M2 |--. .--------.
337 | '----------' '--| dev D4 |
338 | .--------. '--------'
339 '--| dev D5 |
340 '--------'
341
342 When any device is accessed, accesses to all other devices are locked
343 out.
344
345
346 Mux-locked and parent-locked sibling muxes
347 ------------------------------------------
348
349 This is a good topology::
350
351 .--------.
352 .----------. .--| dev D1 |
353 | mux- |--' '--------'
354 .--| locked | .--------.
355 | | mux M1 |-----| dev D2 |
356 | '----------' '--------'
357 | .----------. .--------.
358 .--------. | | parent- |-----| dev D3 |
359 | root |--+--| locked | '--------'
360 '--------' | | mux M2 |--. .--------.
361 | '----------' '--| dev D4 |
362 | .--------. '--------'
363 '--| dev D5 |
364 '--------'
365
366 When D1 or D2 are accessed, accesses to D3 and D4 are locked out while
367 accesses to D5 may interleave. When D3 or D4 are accessed, accesses to
368 all other devices are locked out.
369
370
371 Mux type of existing device drivers
372 ===================================
373
374 Whether a device is mux-locked or parent-locked depends on its
375 implementation. The following list was correct at the time of writing:
376
377 In drivers/i2c/muxes/:
378
379 ====================== =============================================
380 i2c-arb-gpio-challenge Parent-locked
381 i2c-mux-gpio Normally parent-locked, mux-locked iff
382 all involved gpio pins are controlled by the
383 same I2C root adapter that they mux.
384 i2c-mux-gpmux Normally parent-locked, mux-locked iff
385 specified in device-tree.
386 i2c-mux-ltc4306 Mux-locked
387 i2c-mux-mlxcpld Parent-locked
388 i2c-mux-pca9541 Parent-locked
389 i2c-mux-pca954x Parent-locked
390 i2c-mux-pinctrl Normally parent-locked, mux-locked iff
391 all involved pinctrl devices are controlled
392 by the same I2C root adapter that they mux.
393 i2c-mux-reg Parent-locked
394 ====================== =============================================
395
396 In drivers/iio/:
397
398 ====================== =============================================
399 gyro/mpu3050 Mux-locked
400 imu/inv_mpu6050/ Mux-locked
401 ====================== =============================================
402
403 In drivers/media/:
404
405 ======================= =============================================
406 dvb-frontends/lgdt3306a Mux-locked
407 dvb-frontends/m88ds3103 Parent-locked
408 dvb-frontends/rtl2830 Parent-locked
409 dvb-frontends/rtl2832 Mux-locked
410 dvb-frontends/si2168 Mux-locked
411 usb/cx231xx/ Parent-locked
412 ======================= =============================================
413

3. 한국어 전문 번역

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

복잡한 I2C 토폴로지와 어댑터 트리

1-35

하나의 어댑터와 하나 이상의 장치만 있는 단순 I2C 버스보다 복잡한 토폴로지를 구성하는 데에는 몇 가지 이유가 있습니다.

첫째, 주소 충돌을 막기 위해 버스에 mux가 필요할 수 있습니다. 둘째, 외부 버스 마스터도 버스에 접근할 수 있어 현재 접근해도 되는지 판단하는 중재가 필요할 수 있습니다. 셋째, 특히 RF 튜너 같은 장치는 대부분의 시간 동안 I2C 버스의 디지털 잡음을 피하려고 하므로 접근 전에 열어야 하는 gate 뒤에 놓일 수 있습니다.

I2C mux, I2C gate, I2C arbitrator 같은 여러 하드웨어 구성 요소가 이런 요구를 처리합니다.

Linux는 이 구성 요소를 I2C 어댑터 트리로 표현합니다. 루트 어댑터를 제외한 각 어댑터에는 부모 어댑터가 있고, 자식 어댑터는 0개 이상일 수 있습니다. 루트 어댑터는 실제 I2C 전송을 발생시키는 어댑터이며, 부모가 있는 모든 어댑터는 넓은 의미의 `i2c-mux` 객체 일부입니다. 이 객체는 실제 mux뿐 아니라 arbitrator나 gate일 수도 있습니다.

자식 어댑터에서 I2C 전송이 일어나면 해당 mux 드라이버의 종류에 맞는 작업이 수행됩니다. 실제 mux 채널을 선택하거나, 외부 마스터와 중재하거나, gate를 열 수 있습니다.

이를 위해 mux 드라이버에는 `select`와 `deselect` 두 연산이 있습니다. `select`는 전송 전에 호출되고, 선택 사항인 `deselect`는 전송 후 호출됩니다.

복잡한 I2C 토폴로지의 목적
문제구성 요소전송 전 동작
같은 주소의 장치 충돌I2C mux대상 채널 선택
외부 마스터와 공유I2C arbitrator버스 소유권 중재
디지털 잡음 차단I2C gate대상 장치 앞 gate 열기

각 하드웨어 구성 요소가 해결하는 문제입니다.

Linux I2C 어댑터 트리
계층부모역할
루트 어댑터없음실제 I2C 전송 발생
자식 어댑터루트 또는 다른 자식mux 채널·중재·gate의 논리 버스
`i2c-mux` 객체부모 어댑터에 연결mux·arbitrator·gate 동작을 감쌈

루트와 mux 자식 어댑터의 역할을 구조화합니다.

자식 어댑터 전송
자식 어댑터로 I2C 요청mux 드라이버 `select`채널 선택·중재·gate 열기부모를 통해 실제 I2C 전송선택적 `deselect`

모든 유형은 select와 전송, 선택적 deselect 순서를 따릅니다.

================================
I2C muxes and complex topologies
================================

There are a couple of reasons for building more complex I2C topologies
than a straight-forward I2C bus with one adapter and one or more devices.

Some example use cases are:

1. A mux may be needed on the bus to prevent address collisions.

2. The bus may be accessible from some external bus master, and arbitration
   may be needed to determine if it is ok to access the bus.

3. A device (particularly RF tuners) may want to avoid the digital noise
   from the I2C bus, at least most of the time, and sits behind a gate
   that has to be operated before the device can be accessed.

Several types of hardware components such as I2C muxes, I2C gates and I2C
arbitrators allow to handle such needs.

These components are represented as I2C adapter trees by Linux, where
each adapter has a parent adapter (except the root adapter) and zero or
more child adapters. The root adapter is the actual adapter that issues
I2C transfers, and all adapters with a parent are part of an "i2c-mux"
object (quoted, since it can also be an arbitrator or a gate).

Depending of the particular mux driver, something happens when there is
an I2C transfer on one of its child adapters. The mux driver can
obviously operate a mux, but it can also do arbitration with an external
bus master or open a gate. The mux driver has two operations for this,
select and deselect. select is called before the transfer and (the
optional) deselect is called after the transfer.

mux-locked 잠금과 제약

36-123

I2C mux에는 mux-locked와 parent-locked 두 가지 잠금 방식이 있습니다.

mux-locked mux는 `select-transfer-deselect` 전체 동안 부모 어댑터 전체를 잠그지 않고 부모 어댑터 위의 mux들만 잠급니다. `select`나 `deselect` 작업 자체를 완료하기 위해 I2C 전송이 필요한 경우에 특히 유용합니다.

부모 어댑터가 전체 트랜잭션 동안 잠기지 않으므로 무관한 I2C 전송이 각 단계 사이에 끼어들 수 있습니다. mux 드라이버 구현이 더 쉽고 깔끔해질 수 있지만 제약이 따릅니다.

mux-locked 예제 토폴로지
부모mux·직접 장치자식
rootmux-locked M1D1, D2
root직접 연결D3

원문의 ASCII 구조를 부모·자식 관계로 재구성합니다.

D1에 접근하면 다음 순서가 일어납니다. 누군가 D1 전송을 발행하고, M1은 부모인 루트 어댑터 위의 mux를 잠근 뒤 `select`를 호출해 mux를 준비합니다.

M1이 `select` 과정에서 I2C 전송을 수행한다면 이는 부모 어댑터를 잠그는 일반 I2C 전송입니다. 이어서 원래 D1 전송도 부모 어댑터를 잠그는 일반 전송으로 전달합니다.

그 뒤 M1은 구현되어 있다면 `deselect`를 호출합니다. 이 과정의 I2C 전송에도 `select`와 같은 규칙이 적용됩니다. 마지막으로 부모 위의 mux 잠금을 해제합니다.

mux-locked D1 접근
D1 I2C 전송 발행M1이 부모 위 mux 잠금M1 `select``select`의 일반 I2C 전송D1 전송을 부모에 일반 I2C 전송으로 전달선택적 M1 `deselect`와 일반 I2C 전송부모 위 mux 잠금 해제

부모 전체 잠금은 각 I2C 전송 동안에만 걸립니다.

전체 동작 동안 같은 M1 뒤의 D2 접근은 차단됩니다. 그러나 루트에 직접 연결된 D3 접근은 어느 단계에서든 끼어들 수 있습니다.

mux-locked 접근 범위
장치관계D1 처리 중
D2같은 mux M1의 다른 자식전체 기간 차단
D3부모 root에 직접 연결어느 시점에도 끼어들 수 있음

D1 접근 중 다른 장치의 상태입니다.

[ML1] mux-locked mux 아래에 parent-locked mux를 두면, 자식 parent-locked mux가 트랜잭션 동안 루트 어댑터가 잠겨 있다고 기대하는 조건을 깨뜨릴 수 있습니다.

[ML2] 서로 형제가 아닌 mux-locked mux가 둘 이상이고 각 자식 어댑터의 장치 주소가 충돌한다면 임의의 토폴로지는 안전하지 않습니다. 예를 들어 mux-one 뒤 주소 `0x42`를 향한 `select-transfer-deselect`가 mux-two 뒤 주소 `0x42` 작업과 섞일 수 있습니다. 두 mux가 동시에 선택되지 않아야 하는 의도라도 모든 토폴로지에서 이를 보장하지 못합니다.

[ML3] mux-locked mux는 정해진 수, 보통 한 번의 I2C 전송 후 자동으로 닫히는 gate나 mux의 드라이버에 사용할 수 없습니다. 무관한 I2C 전송이 끼어들어 너무 일찍 닫을 수 있습니다.

[ML4] mux 드라이버의 비-I2C 연산이 I2C mux 상태를 바꾼다면 그 연산 동안 루트 어댑터를 잠가야 합니다. 그렇지 않으면 상태 변경 중 무관한 I2C 전송이 진행되어 mux 뒤 장치가 버스에서 잘못된 신호를 볼 수 있습니다.

mux-locked 제약
규칙위험필요 조건
ML1자식 parent-locked mux의 루트 잠금 기대 위반중첩 구조와 루트 잠금 가정 검토
ML2비형제 mux 사이 같은 주소 전송이 교차주소 충돌이 있는 임의 중첩 금지
ML3끼어든 전송이 auto-closing mux를 조기 종료자동 닫힘 장치에 사용 금지
ML4비-I2C 상태 변경 중 버스에 잘못된 신호비-I2C 변경 동안 루트 어댑터 잠금

ML1부터 ML4까지의 위험과 대응입니다.

Locking
=======

There are two variants of locking available to I2C muxes, they can be
mux-locked or parent-locked muxes.


Mux-locked muxes
----------------

Mux-locked muxes does not lock the entire parent adapter during the
full select-transfer-deselect transaction, only the muxes on the parent
adapter are locked. Mux-locked muxes are mostly interesting if the
select and/or deselect operations must use I2C transfers to complete
their tasks. Since the parent adapter is not fully locked during the
full transaction, unrelated I2C transfers may interleave the different
stages of the transaction. This has the benefit that the mux driver
may be easier and cleaner to implement, but it has some caveats.

Mux-locked Example
~~~~~~~~~~~~~~~~~~

::

                   .----------.     .--------.
    .--------.     |   mux-   |-----| dev D1 |
    |  root  |--+--|  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  .--------.
                |  '----------'  '--| dev D2 |
                |  .--------.       '--------'
                '--| dev D3 |
                   '--------'

When there is an access to D1, this happens:

 1. Someone issues an I2C transfer to D1.
 2. M1 locks muxes on its parent (the root adapter in this case).
 3. M1 calls ->select to ready the mux.
 4. M1 (presumably) does some I2C transfers as part of its select.
    These transfers are normal I2C transfers that locks the parent
    adapter.
 5. M1 feeds the I2C transfer from step 1 to its parent adapter as a
    normal I2C transfer that locks the parent adapter.
 6. M1 calls ->deselect, if it has one.
 7. Same rules as in step 4, but for ->deselect.
 8. M1 unlocks muxes on its parent.

This means that accesses to D2 are lockout out for the full duration
of the entire operation. But accesses to D3 are possibly interleaved
at any point.

Mux-locked caveats
~~~~~~~~~~~~~~~~~~

When using a mux-locked mux, be aware of the following restrictions:

[ML1]
  If you build a topology with a mux-locked mux being the parent
  of a parent-locked mux, this might break the expectation from the
  parent-locked mux that the root adapter is locked during the
  transaction.

[ML2]
  It is not safe to build arbitrary topologies with two (or more)
  mux-locked muxes that are not siblings, when there are address
  collisions between the devices on the child adapters of these
  non-sibling muxes.

  I.e. the select-transfer-deselect transaction targeting e.g. device
  address 0x42 behind mux-one may be interleaved with a similar
  operation targeting device address 0x42 behind mux-two. The
  intent with such a topology would in this hypothetical example
  be that mux-one and mux-two should not be selected simultaneously,
  but mux-locked muxes do not guarantee that in all topologies.

[ML3]
  A mux-locked mux cannot be used by a driver for auto-closing
  gates/muxes, i.e. something that closes automatically after a given
  number (one, in most cases) of I2C transfers. Unrelated I2C transfers
  may creep in and close prematurely.

[ML4]
  If any non-I2C operation in the mux driver changes the I2C mux state,
  the driver has to lock the root adapter during that operation.
  Otherwise garbage may appear on the bus as seen from devices
  behind the mux, when an unrelated I2C transfer is in flight during
  the non-I2C mux-changing operation.

parent-locked 잠금과 제약

124-189

parent-locked mux는 `select-transfer-deselect` 전체 동안 부모 어댑터를 잠급니다. 따라서 mux 드라이버는 이 트랜잭션 중 부모 어댑터를 통과하는 모든 I2C 전송이 `__i2c_transfer` 같은 잠금 없는 I2C 전송이어야 함을 보장해야 합니다. 다시 잠그려 하면 교착 상태가 발생합니다.

parent-locked 예제 토폴로지
부모mux·직접 장치자식
rootparent-locked M1D1, D2
root직접 연결D3

원문의 ASCII 구조와 잠금 범위입니다.

D1 접근에서는 먼저 M1이 부모 위의 mux를 잠그고 부모 어댑터 자체도 잠급니다. 이어서 `select`를 호출해 mux를 준비합니다.

M1이 `select` 과정에서 같은 루트 어댑터로 I2C 전송을 한다면 루트 어댑터를 다시 잠그지 않도록 잠금 없는 전송을 사용해야 합니다. 원래 D1 전송도 교착을 피하기 위해 잠금 없는 I2C 전송으로 루트 어댑터에 전달합니다.

구현되어 있다면 `deselect`를 호출하며, 그 안의 전송에도 동일한 잠금 없는 규칙이 적용됩니다. 그 뒤 부모 어댑터 잠금을 해제하고 마지막으로 부모 위 mux 잠금을 해제합니다.

parent-locked D1 접근
D1 I2C 전송 발행M1이 부모 위 mux 잠금M1이 부모 어댑터 잠금M1 `select`, 내부 전송은 unlockedD1 전송을 부모에 unlocked로 전달선택적 `deselect`, 내부 전송은 unlocked부모 어댑터 잠금 해제부모 위 mux 잠금 해제

부모 잠금을 한 번 유지한 채 내부 전송은 모두 unlocked API로 수행합니다.

이 방식에서는 전체 동작 동안 같은 mux의 D2뿐 아니라 루트에 직접 연결된 D3 접근도 모두 차단됩니다.

[PL1] parent-locked mux가 다른 mux의 자식이라면, 자식 mux가 `select`와 실제 전송 사이에 루트 어댑터가 사용되지 않는다고 기대하는 조건을 깨뜨릴 수 있습니다. 자식이 auto-closing이고 부모 mux가 `select` 중 I2C 전송을 하는 경우가 예입니다. 부모가 mux-locked일 때 특히 문제지만 parent-locked여도 발생할 수 있습니다.

[PL2] `select`나 `deselect`가 gpio, pinctrl, regmap, iio 같은 다른 하위 시스템을 호출한다면, 이 하위 시스템이 유발하는 모든 I2C 전송도 잠금 없는 전송이어야 합니다. 이를 깔끔하게 보장하는 일은 복잡하거나 불가능할 수도 있습니다.

parent-locked 제약
규칙위험검토 사항
PL1부모 mux의 전송이 자식 mux의 무간섭 기대를 깨뜨림auto-closing과 중첩 select 전송 확인
PL2gpio·pinctrl·regmap·iio가 잠긴 부모를 다시 사용파생 I2C 전송을 모두 unlocked로 보장

PL1과 PL2의 중첩·외부 하위 시스템 위험입니다.

두 잠금 방식 비교
항목mux-lockedparent-locked
전체 기간 잠금부모 위 mux들부모 위 mux들과 부모 어댑터
무관한 부모 전송단계 사이에 끼어들 수 있음전체 기간 차단
select 내부 I2C일반 잠금 전송 가능반드시 unlocked 전송
주요 위험교차 전송·auto-close교착·하위 시스템 재진입

잠금 범위와 내부 전송 API를 한눈에 비교합니다.


Parent-locked muxes
-------------------

Parent-locked muxes lock the parent adapter during the full select-
transfer-deselect transaction. The implication is that the mux driver
has to ensure that any and all I2C transfers through that parent
adapter during the transaction are unlocked I2C transfers (using e.g.
__i2c_transfer), or a deadlock will follow.

Parent-locked Example
~~~~~~~~~~~~~~~~~~~~~

::

                   .----------.     .--------.
    .--------.     |  parent- |-----| dev D1 |
    |  root  |--+--|  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  .--------.
                |  '----------'  '--| dev D2 |
                |  .--------.       '--------'
                '--| dev D3 |
                   '--------'

When there is an access to D1, this happens:

 1.  Someone issues an I2C transfer to D1.
 2.  M1 locks muxes on its parent (the root adapter in this case).
 3.  M1 locks its parent adapter.
 4.  M1 calls ->select to ready the mux.
 5.  If M1 does any I2C transfers (on this root adapter) as part of
     its select, those transfers must be unlocked I2C transfers so
     that they do not deadlock the root adapter.
 6.  M1 feeds the I2C transfer from step 1 to the root adapter as an
     unlocked I2C transfer, so that it does not deadlock the parent
     adapter.
 7.  M1 calls ->deselect, if it has one.
 8.  Same rules as in step 5, but for ->deselect.
 9.  M1 unlocks its parent adapter.
 10. M1 unlocks muxes on its parent.

This means that accesses to both D2 and D3 are locked out for the full
duration of the entire operation.

Parent-locked Caveats
~~~~~~~~~~~~~~~~~~~~~

When using a parent-locked mux, be aware of the following restrictions:

[PL1]
  If you build a topology with a parent-locked mux being the child
  of another mux, this might break a possible assumption from the
  child mux that the root adapter is unused between its select op
  and the actual transfer (e.g. if the child mux is auto-closing
  and the parent mux issues I2C transfers as part of its select).
  This is especially the case if the parent mux is mux-locked, but
  it may also happen if the parent mux is parent-locked.

[PL2]
  If select/deselect calls out to other subsystems such as gpio,
  pinctrl, regmap or iio, it is essential that any I2C transfers
  caused by these subsystems are unlocked. This can be convoluted to
  accomplish, maybe even impossible if an acceptably clean solution
  is sought.

중첩 mux 조합: parent-parent, mux-mux, mux-parent

190-273

parent-locked M1 아래에 parent-locked M2를 두는 구성은 유용하지만 나쁠 수도 있습니다. M2가 부모 잠금을 요청하면 M1이 이를 루트 어댑터까지 전달하므로 어떤 장치에 접근하든 다른 모든 장치는 전체 기간 차단됩니다.

그러나 M2가 auto-closing mux이고 M1의 `select`가 루트 어댑터에서 잠금 없는 I2C 전송을 수행한다면 그 전송이 M2 어댑터 쪽에 새어 들어가 M2를 너무 일찍 닫을 수 있습니다.

parent-locked 아래 parent-locked
경로접근 대상차단평가
root → parent M1 → parent M2D1 또는 D2D2·D3·D4 등 나머지 모두유용하지만 M2 auto-close 시 위험
root → parent M1D3나머지 모두전체 루트 잠금
root 직접D4나머지 모두루트 직접 잠금

원문의 D1~D4 구조와 차단 범위입니다.

mux-locked M1 아래에 mux-locked M2를 두는 것은 좋은 구성입니다. D1 접근 중 같은 M2 뒤의 D2는 전체 기간 차단되지만, M1의 다른 자식 D3와 루트 직결 D4는 어느 시점에도 끼어들 수 있습니다.

D3 접근은 D1과 D2를 차단하지만 D4 접근은 여전히 끼어들 수 있습니다.

mux-locked 아래 mux-locked
접근 대상차단 대상끼어들 수 있음
D1D2D3, D4
D3D1, D2D4
D4루트 전송 동안만 충돌다른 단계 사이

계층별 mux 잠금만 적용되는 좋은 구성입니다.

mux-locked M1 아래에 parent-locked M2를 두는 구성은 대체로 나쁩니다. D1 접근 중 M1이 루트 어댑터의 자식 mux를 잠그므로 D2와 D3는 전체 기간 차단되지만 D4는 어느 시점에도 끼어들 수 있습니다.

M2는 `select`와 `deselect` 동안 다른 I2C 전송이 없다고 가정할 가능성이 큽니다. D4 전송이 끼어들면 M2의 슬레이브 쪽에는 부분 I2C 전송, 즉 잘못된 신호가 나타나 장치 잠금이나 다른 문제를 일으킬 수 있습니다.

M2가 auto-closing이면 D4 접근이나 M1의 `select`에 포함된 I2C 전송이 M2를 너무 일찍 닫을 수 있어 특히 문제입니다. 다만 M2가 무간섭을 가정하지 않고 auto-closing도 아니라면 이 토폴로지도 사용할 수 있습니다.

mux-locked 아래 parent-locked
접근차단끼어들 수 있음판정
D1D2, D3D4대체로 부적합
M2 select/deselect자식 경로D4 또는 M1 내부 전송부분 전송·잘못된 신호 위험
예외M2가 무간섭을 가정하지 않음M2가 auto-closing 아님두 조건이면 사용 가능

기본적으로 피해야 하는 중첩 조합입니다.

중첩 mux 검토
부모 mux 잠금 유형 확인자식 mux 잠금 유형 확인select·deselect 내부 I2C 전송 확인자식의 무간섭·auto-close 가정 확인교차 전송이 보이면 구성 변경

부모·자식 잠금 방식과 auto-close 가정을 함께 확인합니다.

Complex Examples
================

Parent-locked mux as parent of parent-locked mux
------------------------------------------------

This is a useful topology, but it can be bad::

                   .----------.     .----------.     .--------.
    .--------.     |  parent- |-----|  parent- |-----| dev D1 |
    |  root  |--+--|  locked  |     |  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  |  mux M2  |--.  .--------.
                |  '----------'  |  '----------'  '--| dev D2 |
                |  .--------.    |  .--------.       '--------'
                '--| dev D4 |    '--| dev D3 |
                   '--------'       '--------'

When any device is accessed, all other devices are locked out for
the full duration of the operation (both muxes lock their parent,
and specifically when M2 requests its parent to lock, M1 passes
the buck to the root adapter).

This topology is bad if M2 is an auto-closing mux and M1->select
issues any unlocked I2C transfers on the root adapter that may leak
through and be seen by the M2 adapter, thus closing M2 prematurely.


Mux-locked mux as parent of mux-locked mux
------------------------------------------

This is a good topology::

                   .----------.     .----------.     .--------.
    .--------.     |   mux-   |-----|   mux-   |-----| dev D1 |
    |  root  |--+--|  locked  |     |  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  |  mux M2  |--.  .--------.
                |  '----------'  |  '----------'  '--| dev D2 |
                |  .--------.    |  .--------.       '--------'
                '--| dev D4 |    '--| dev D3 |
                   '--------'       '--------'

When device D1 is accessed, accesses to D2 are locked out for the
full duration of the operation (muxes on the top child adapter of M1
are locked). But accesses to D3 and D4 are possibly interleaved at
any point.

Accesses to D3 locks out D1 and D2, but accesses to D4 are still possibly
interleaved.


Mux-locked mux as parent of parent-locked mux
---------------------------------------------

This is probably a bad topology::

                   .----------.     .----------.     .--------.
    .--------.     |   mux-   |-----|  parent- |-----| dev D1 |
    |  root  |--+--|  locked  |     |  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  |  mux M2  |--.  .--------.
                |  '----------'  |  '----------'  '--| dev D2 |
                |  .--------.    |  .--------.       '--------'
                '--| dev D4 |    '--| dev D3 |
                   '--------'       '--------'

When device D1 is accessed, accesses to D2 and D3 are locked out
for the full duration of the operation (M1 locks child muxes on the
root adapter). But accesses to D4 are possibly interleaved at any
point.

This kind of topology is generally not suitable and should probably
be avoided. The reason is that M2 probably assumes that there will
be no I2C transfers during its calls to ->select and ->deselect, and
if there are, any such transfers might appear on the slave side of M2
as partial I2C transfers, i.e. garbage or worse. This might cause
device lockups and/or other problems.

The topology is especially troublesome if M2 is an auto-closing
mux. In that case, any interleaved accesses to D4 might close M2
prematurely, as might any I2C transfers part of M1->select.

But if M2 is not making the above stated assumption, and if M2 is not
auto-closing, the topology is fine.

중첩·형제 mux의 안전한 조합

274-370

parent-locked M1 아래에 mux-locked M2를 두는 것은 좋은 구성입니다. D1 접근 중 M1의 최상위 자식 어댑터에 있는 mux들이 잠기므로 D2는 전체 기간 차단되지만 D3와 D4는 mux-locked 방식의 예상대로 어느 시점에도 끼어들 수 있습니다.

D3이나 D4에 접근할 때는 그 밖의 모든 장치가 차단됩니다. D3 접근에서는 M1이 루트 어댑터를 잠그고, D4 접근에서는 루트 어댑터가 직접 잠깁니다.

parent-locked 아래 mux-locked
접근 대상차단 대상끼어들 수 있음
D1D2D3, D4
D3D1, D2, D4없음
D4D1, D2, D3없음

부모의 강한 잠금과 자식의 국소 잠금이 양립하는 좋은 구성입니다.

mux-locked 형제 mux M1과 M2가 루트에 함께 연결된 구성도 좋습니다. M1 뒤 D1에 접근하면 같은 M1의 D2뿐 아니라 형제 mux M2 뒤 D3과 D4도 차단되지만, 루트에 직접 연결된 D5는 언제든 끼어들 수 있습니다.

mux-locked 형제
접근 대상차단 대상끼어들 수 있음
M1의 D1M1의 D2, M2의 D3·D4root 직접 D5
M2의 D3M2의 D4, M1의 D1·D2root 직접 D5

형제 mux들은 함께 잠기지만 루트 직접 장치는 열려 있습니다.

parent-locked 형제 mux M1과 M2가 루트에 연결된 구성도 좋습니다. 어떤 장치에 접근하더라도 부모 루트 어댑터가 잠기므로 다른 모든 장치 접근이 차단됩니다.

parent-locked 형제
접근 위치차단 범위
M1 뒤 D1·D2M2 뒤 D3·D4와 root 직접 D5 포함 나머지 모두
M2 뒤 D3·D4M1 뒤 D1·D2와 root 직접 D5 포함 나머지 모두
root 직접 D5루트 전송 중 나머지 모두

어느 가지에 접근해도 루트 전체가 잠깁니다.

mux-locked M1과 parent-locked M2가 형제로 루트에 연결된 혼합 구성도 좋습니다. M1 뒤 D1이나 D2에 접근하면 M2 뒤 D3과 D4는 차단되지만 루트 직결 D5는 끼어들 수 있습니다.

반대로 parent-locked M2 뒤 D3이나 D4에 접근하면 다른 모든 장치가 차단됩니다.

mux-locked와 parent-locked 형제
접근 대상차단 대상끼어들 수 있음
mux-locked M1의 D1·D2parent-locked M2의 D3·D4root 직접 D5
parent-locked M2의 D3·D4M1의 D1·D2와 root 직접 D5없음

접근하는 가지의 잠금 방식에 따라 차단 범위가 달라집니다.

복잡한 토폴로지 판정 요약
부모·배치자식·형제평가
parent-locked 부모parent-locked 자식유용하지만 auto-close와 부모 select 전송 주의
mux-locked 부모mux-locked 자식좋음
mux-locked 부모parent-locked 자식대체로 나쁨, 조건부 가능
parent-locked 부모mux-locked 자식좋음
mux-locked 형제mux-locked 형제좋음
parent-locked 형제parent-locked 형제좋음
mux-locked 형제parent-locked 형제좋음

원문이 제시한 중첩·형제 조합의 평가입니다.

장치 접근별 잠금 전파
대상 장치의 직계 mux 확인mux-locked면 해당 부모 위 mux 집합 잠금parent-locked면 부모 어댑터까지 잠금중첩 mux가 요청을 상위로 전달차단·교차 가능 장치 집합 결정

자식에서 시작한 잠금 요청이 mux 종류에 따라 루트까지 전파됩니다.

Parent-locked mux as parent of mux-locked mux
---------------------------------------------

This is a good topology::

                   .----------.     .----------.     .--------.
    .--------.     |  parent- |-----|   mux-   |-----| dev D1 |
    |  root  |--+--|  locked  |     |  locked  |     '--------'
    '--------'  |  |  mux M1  |--.  |  mux M2  |--.  .--------.
                |  '----------'  |  '----------'  '--| dev D2 |
                |  .--------.    |  .--------.       '--------'
                '--| dev D4 |    '--| dev D3 |
                   '--------'       '--------'

When D1 is accessed, accesses to D2 are locked out for the full
duration of the operation (muxes on the top child adapter of M1
are locked). Accesses to D3 and D4 are possibly interleaved at
any point, just as is expected for mux-locked muxes.

When D3 or D4 are accessed, everything else is locked out. For D3
accesses, M1 locks the root adapter. For D4 accesses, the root
adapter is locked directly.


Two mux-locked sibling muxes
----------------------------

This is a good topology::

                                    .--------.
                   .----------.  .--| dev D1 |
                   |   mux-   |--'  '--------'
                .--|  locked  |     .--------.
                |  |  mux M1  |-----| dev D2 |
                |  '----------'     '--------'
                |  .----------.     .--------.
    .--------.  |  |   mux-   |-----| dev D3 |
    |  root  |--+--|  locked  |     '--------'
    '--------'  |  |  mux M2  |--.  .--------.
                |  '----------'  '--| dev D4 |
                |  .--------.       '--------'
                '--| dev D5 |
                   '--------'

When D1 is accessed, accesses to D2, D3 and D4 are locked out. But
accesses to D5 may be interleaved at any time.


Two parent-locked sibling muxes
-------------------------------

This is a good topology::

                                    .--------.
                   .----------.  .--| dev D1 |
                   |  parent- |--'  '--------'
                .--|  locked  |     .--------.
                |  |  mux M1  |-----| dev D2 |
                |  '----------'     '--------'
                |  .----------.     .--------.
    .--------.  |  |  parent- |-----| dev D3 |
    |  root  |--+--|  locked  |     '--------'
    '--------'  |  |  mux M2  |--.  .--------.
                |  '----------'  '--| dev D4 |
                |  .--------.       '--------'
                '--| dev D5 |
                   '--------'

When any device is accessed, accesses to all other devices are locked
out.


Mux-locked and parent-locked sibling muxes
------------------------------------------

This is a good topology::

                                    .--------.
                   .----------.  .--| dev D1 |
                   |   mux-   |--'  '--------'
                .--|  locked  |     .--------.
                |  |  mux M1  |-----| dev D2 |
                |  '----------'     '--------'
                |  .----------.     .--------.
    .--------.  |  |  parent- |-----| dev D3 |
    |  root  |--+--|  locked  |     '--------'
    '--------'  |  |  mux M2  |--.  .--------.
                |  '----------'  '--| dev D4 |
                |  .--------.       '--------'
                '--| dev D5 |
                   '--------'

When D1 or D2 are accessed, accesses to D3 and D4 are locked out while
accesses to D5 may interleave. When D3 or D4 are accessed, accesses to
all other devices are locked out.

기존 드라이버의 mux 잠금 유형

371-412

장치가 mux-locked인지 parent-locked인지는 구현에 따라 달라집니다. 다음 목록은 문서 작성 당시의 상태입니다.

drivers/i2c/muxes 잠금 유형
드라이버잠금 유형
`i2c-arb-gpio-challenge`Parent-locked
`i2c-mux-gpio`일반적으로 parent-locked. 관련 GPIO 핀이 모두 자신이 mux하는 동일 I2C 루트 어댑터로 제어될 때 mux-locked
`i2c-mux-gpmux`일반적으로 parent-locked. Device Tree에 지정되었을 때 mux-locked
`i2c-mux-ltc4306`Mux-locked
`i2c-mux-mlxcpld`Parent-locked
`i2c-mux-pca9541`Parent-locked
`i2c-mux-pca954x`Parent-locked
`i2c-mux-pinctrl`일반적으로 parent-locked. 관련 pinctrl 장치가 모두 자신이 mux하는 동일 I2C 루트 어댑터로 제어될 때 mux-locked
`i2c-mux-reg`Parent-locked

I2C mux·arbitrator 드라이버의 잠금 방식을 보존합니다.

drivers/iio 잠금 유형
드라이버잠금 유형
`gyro/mpu3050`Mux-locked
`imu/inv_mpu6050/`Mux-locked

IIO의 mux 제공 드라이버입니다.

drivers/media 잠금 유형
드라이버잠금 유형
`dvb-frontends/lgdt3306a`Mux-locked
`dvb-frontends/m88ds3103`Parent-locked
`dvb-frontends/rtl2830`Parent-locked
`dvb-frontends/rtl2832`Mux-locked
`dvb-frontends/si2168`Mux-locked
`usb/cx231xx/`Parent-locked

미디어 하위 시스템의 mux 제공 드라이버입니다.

드라이버 토폴로지 검토
사용할 mux 드라이버 확인구현 또는 표에서 잠금 유형 확인부모·자식·형제 조합 분류ML·PL 제약과 auto-close 여부 검토안전한 토폴로지로 확정

드라이버 구현의 실제 잠금 유형을 기준으로 조합을 평가합니다.

Mux type of existing device drivers
===================================

Whether a device is mux-locked or parent-locked depends on its
implementation. The following list was correct at the time of writing:

In drivers/i2c/muxes/:

======================    =============================================
i2c-arb-gpio-challenge    Parent-locked
i2c-mux-gpio              Normally parent-locked, mux-locked iff
                          all involved gpio pins are controlled by the
                          same I2C root adapter that they mux.
i2c-mux-gpmux             Normally parent-locked, mux-locked iff
                          specified in device-tree.
i2c-mux-ltc4306           Mux-locked
i2c-mux-mlxcpld           Parent-locked
i2c-mux-pca9541           Parent-locked
i2c-mux-pca954x           Parent-locked
i2c-mux-pinctrl           Normally parent-locked, mux-locked iff
                          all involved pinctrl devices are controlled
                          by the same I2C root adapter that they mux.
i2c-mux-reg               Parent-locked
======================    =============================================

In drivers/iio/:

======================    =============================================
gyro/mpu3050              Mux-locked
imu/inv_mpu6050/          Mux-locked
======================    =============================================

In drivers/media/:

=======================   =============================================
dvb-frontends/lgdt3306a   Mux-locked
dvb-frontends/m88ds3103   Parent-locked
dvb-frontends/rtl2830     Parent-locked
dvb-frontends/rtl2832     Mux-locked
dvb-frontends/si2168      Mux-locked
usb/cx231xx/              Parent-locked
=======================   =============================================