Commit bd738d8
committed
drm/i915: Prevent modesets during driver init/shutdown
An unexpected modeset or connector detection by a user (user space or FB
console) during the initialization/shutdown sequence is possible either
via a hotplug IRQ handling work or via the connector sysfs
(status/detect) interface. These modesets/detections should be prevented
by disabling/flushing all related hotplug handling work and
unregistering the interfaces that can start them at the beginning of the
shutdown sequence. Some of this - disabling all related intel_hotplug
work - will be done by the next patch, but others - for instance
disabling the MST hotplug works - require a bigger rework.
It makes sense - for diagnostic purpose, even with all the above work and
interface disabled - to detect and reject any such user access. This
patch does that for modeset accesses and a follow-up patch for connector
detection.
During driver loading/unloading/system suspend/shutdown and during
system resume after calling intel_display_driver_disable_user_access()
or intel_display_driver_resume_access() correspondigly, the current
thread is allowed to modeset (as this thread requires to do an
initial/restoring modeset or a disabling modeset), other threads (the
user threads) are not allowed to modeset.
During driver loading/system resume after calling
intel_display_driver_enable_user_access() all threads are allowed to
modeset.
During driver unloading/system suspend/shutdown after calling
intel_display_driver_suspend_access() no threads are allowed to modeset
(as the HW got disabled and should stay in this state).
v2: Call intel_display_driver_suspend_access()/resume_access() only
for HAS_DISPLAY(). (CI)
v3: (Jouni)
- Add commit log comments explaining how the permission of modeset
changes during HW init/deinit wrt. to the current and other user
processes.
Link: https://patchwork.freedesktop.org/patch/msgid/20240104132335.2766434-1-imre.deak@intel.com
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>1 parent 1ef28d8 commit bd738d8
File tree
5 files changed
+171
-2
lines changed- drivers/gpu/drm/i915
- display
5 files changed
+171
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6310 | 6310 | | |
6311 | 6311 | | |
6312 | 6312 | | |
| 6313 | + | |
| 6314 | + | |
| 6315 | + | |
6313 | 6316 | | |
6314 | 6317 | | |
6315 | 6318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
279 | 409 | | |
280 | 410 | | |
281 | 411 | | |
| |||
326 | 456 | | |
327 | 457 | | |
328 | 458 | | |
| 459 | + | |
| 460 | + | |
329 | 461 | | |
330 | 462 | | |
331 | 463 | | |
| |||
393 | 525 | | |
394 | 526 | | |
395 | 527 | | |
| 528 | + | |
| 529 | + | |
396 | 530 | | |
397 | 531 | | |
398 | 532 | | |
| |||
440 | 574 | | |
441 | 575 | | |
442 | 576 | | |
| 577 | + | |
| 578 | + | |
443 | 579 | | |
444 | 580 | | |
445 | 581 | | |
| |||
493 | 629 | | |
494 | 630 | | |
495 | 631 | | |
| 632 | + | |
| 633 | + | |
496 | 634 | | |
497 | 635 | | |
498 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
| 1008 | + | |
1008 | 1009 | | |
1009 | 1010 | | |
1010 | 1011 | | |
| |||
1014 | 1015 | | |
1015 | 1016 | | |
1016 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
| |||
1081 | 1085 | | |
1082 | 1086 | | |
1083 | 1087 | | |
1084 | | - | |
| 1088 | + | |
1085 | 1089 | | |
| 1090 | + | |
| 1091 | + | |
1086 | 1092 | | |
1087 | 1093 | | |
1088 | 1094 | | |
| |||
1093 | 1099 | | |
1094 | 1100 | | |
1095 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1096 | 1105 | | |
1097 | 1106 | | |
1098 | 1107 | | |
| |||
1242 | 1251 | | |
1243 | 1252 | | |
1244 | 1253 | | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1245 | 1258 | | |
1246 | 1259 | | |
1247 | 1260 | | |
1248 | 1261 | | |
1249 | 1262 | | |
1250 | 1263 | | |
1251 | | - | |
| 1264 | + | |
| 1265 | + | |
1252 | 1266 | | |
| 1267 | + | |
1253 | 1268 | | |
1254 | 1269 | | |
1255 | 1270 | | |
| |||
0 commit comments