Skip to content

Commit 238bcda

Browse files
jnikulagregkh
authored andcommitted
drm/xe/display: fix oops in suspend/shutdown without display
commit 68938cc upstream. The xe driver keeps track of whether to probe display, and whether display hardware is there, using xe->info.probe_display. It gets set to false if there's no display after intel_display_device_probe(). However, the display may also be disabled via fuses, detected at a later time in intel_display_device_info_runtime_init(). In this case, the xe driver does for_each_intel_crtc() on uninitialized mode config in xe_display_flush_cleanup_work(), leading to a NULL pointer dereference, and generally calls display code with display info cleared. Check for intel_display_device_present() after intel_display_device_info_runtime_init(), and reset xe->info.probe_display as necessary. Also do unset_display_features() for completeness, although display runtime init has already done that. This will need to be unified across all cases later. Move intel_display_device_info_runtime_init() call slightly earlier, similar to i915, to avoid a bunch of unnecessary setup for no display cases. Note #1: The xe driver has no business doing low level display plumbing like for_each_intel_crtc() to begin with. It all needs to happen in display code. Note #2: The actual bug is present already in commit 44e6949 ("drm/xe/display: Implement display support"), but the oops was likely introduced later at commit ddf6492 ("drm/xe/display: Make display suspend/resume work on discrete"). Fixes: 44e6949 ("drm/xe/display: Implement display support") Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7904 Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/6150 Cc: stable@vger.kernel.org # v6.8+ Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260515160920.1082842-1-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit 7c3eb9f) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d02f05d commit 238bcda

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/gpu/drm/xe/display/xe_display.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ int xe_display_init_early(struct xe_device *xe)
119119

120120
intel_display_driver_early_probe(display);
121121

122+
intel_display_device_info_runtime_init(display);
123+
124+
/* Display may have been disabled at runtime init */
125+
if (!intel_display_device_present(display)) {
126+
xe->info.probe_display = false;
127+
unset_display_features(xe);
128+
return 0;
129+
}
130+
122131
/* Early display init.. */
123132
intel_opregion_setup(display);
124133

@@ -132,8 +141,6 @@ int xe_display_init_early(struct xe_device *xe)
132141

133142
intel_bw_init_hw(display);
134143

135-
intel_display_device_info_runtime_init(display);
136-
137144
err = intel_display_driver_probe_noirq(display);
138145
if (err)
139146
goto err_opregion;

0 commit comments

Comments
 (0)