summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_tc.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2024-01-04 15:23:35 +0200
committerImre Deak <imre.deak@intel.com>2024-01-08 18:54:36 +0200
commitbd738d859e71acb9315634cf38676fd0585d4668 (patch)
treeb13c827c6fe3a27449cf5a6aafa8303553d7d775 /drivers/gpu/drm/i915/display/intel_tc.c
parent1ef28d86bea92503341215fcc7d934d6156b9ba0 (diff)
downloadlinux-bd738d859e71acb9315634cf38676fd0585d4668.tar.gz
linux-bd738d859e71acb9315634cf38676fd0585d4668.tar.bz2
linux-bd738d859e71acb9315634cf38676fd0585d4668.zip
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>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_tc.c')
0 files changed, 0 insertions, 0 deletions