History

Merge tag 'drm-xe-next-2026-01-15' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

UAPI Changes: - Remove unused KEEP_ACTIVE flag in the new multi queue uAPI (Niranjana) - Expose new temperature attributes in HWMON (Karthik) Driver Changes: - Force i2c into polling mode when in survivability (Raag) - Validate preferred system memory placement in xe_svm_range_validate (Brost) - Adjust page count tracepoints in shrinker (Brost) - Fix a couple drm_pagemap issues with multi-GPU (Brost) - Define GuC firmware for NVL-S (Roper) - Handle GT resume failure (Raag) - Improve wedged mode handling (Lukasz) - Add missing newlines to drm_warn messages (Osama) - Fix WQ_MEM_RECLAIM passed as max_active to alloc_workqueue (Marco) - Page-reclaim fixes and PRL stats addition (Brian) - Fix struct guc_lfd_file_header kernel-doc (Jani) - Allow compressible surfaces to be 1-way coherent (Xin) - Fix DRM scheduler layering violations in Xe (Brost) - Minor improvements to MERT code (Michal) - Privatize struct xe_ggtt_node (Maarten) - Convert wait for lmem init into an assert (Bala) - Enable GSC loading and PXP for PTL (Daniele) - Replace use of system_wq with tlb_inval->timeout_wq (Marco) - VRAM addr range bit expansion (Fei) - Cleanup unused header includes (Roper) Signed-off-by: Dave Airlie <airlied@redhat.com>

Dave Airlie committed 10 months ago

Commit 971c2b62 parents 9d10cd5 8367585134 files · +1391 −973Browse files

Unified · Split

134 files
  1. Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon +110 −0
  2. drivers/gpu/drm/drm_pagemap.c +17 −5
  3. drivers/gpu/drm/xe/Makefile +2 −1
  4. drivers/gpu/drm/xe/abi/guc_lfd_abi.h +2 −3
  5. drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h +2 −2
  6. drivers/gpu/drm/xe/display/xe_fb_pin.c +52 −52
  7. drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +1 −1
  8. drivers/gpu/drm/xe/display/xe_stolen.c +1 −1
  9. drivers/gpu/drm/xe/regs/xe_gt_regs.h +6 −0
  10. drivers/gpu/drm/xe/regs/xe_mert_regs.h +6 −4
  11. drivers/gpu/drm/xe/regs/xe_pcode_regs.h +3 −0
  12. drivers/gpu/drm/xe/tests/xe_bo.c +1 −0
  13. drivers/gpu/drm/xe/tests/xe_guc_buf_kunit.c +1 −1
  14. drivers/gpu/drm/xe/xe_bb.c +1 −2
  15. drivers/gpu/drm/xe/xe_bo.c +19 −14
  16. drivers/gpu/drm/xe/xe_bo.h +5 −3
  17. drivers/gpu/drm/xe/xe_debugfs.c +60 −15
  18. drivers/gpu/drm/xe/xe_devcoredump.c +1 −2
  19. drivers/gpu/drm/xe/xe_device.c +71 −70
  20. drivers/gpu/drm/xe/xe_device.h +2 −0
  21. drivers/gpu/drm/xe/xe_device_types.h +24 −1
  22. drivers/gpu/drm/xe/xe_exec.c +0 −1
  23. drivers/gpu/drm/xe/xe_exec_queue.c +4 −58
  24. drivers/gpu/drm/xe/xe_exec_queue.h +0 −2
  25. drivers/gpu/drm/xe/xe_exec_queue_types.h +0 −4
  26. drivers/gpu/drm/xe/xe_execlist.c +1 −2
  27. drivers/gpu/drm/xe/xe_ggtt.c +161 −58
  28. drivers/gpu/drm/xe/xe_ggtt.h +10 −4
  29. drivers/gpu/drm/xe/xe_ggtt_types.h +12 −20
  30. drivers/gpu/drm/xe/xe_gpu_scheduler.c +5 −4
  31. drivers/gpu/drm/xe/xe_gpu_scheduler.h +9 −28
  32. drivers/gpu/drm/xe/xe_gpu_scheduler_types.h +2 −0
  33. drivers/gpu/drm/xe/xe_gsc.c +7 −6
  34. drivers/gpu/drm/xe/xe_gsc_debugfs.c +2 −3
  35. drivers/gpu/drm/xe/xe_gsc_proxy.c +1 −1
  36. drivers/gpu/drm/xe/xe_gsc_submit.c +0 −2
  37. drivers/gpu/drm/xe/xe_gt.c +32 −2
  38. drivers/gpu/drm/xe/xe_gt_clock.c +1 −5
  39. drivers/gpu/drm/xe/xe_gt_debugfs.c +0 −1
  40. drivers/gpu/drm/xe/xe_gt_idle.c +0 −1
  41. drivers/gpu/drm/xe/xe_gt_mcr.c +0 −1
  42. drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +10 −11
  43. drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +0 −1
  44. drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c +1 −1
  45. drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c +0 −1
  46. drivers/gpu/drm/xe/xe_gt_sriov_pf_service.c +2 −3
  47. drivers/gpu/drm/xe/xe_gt_sriov_vf.c +0 −1
  48. drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h +2 −2
  49. drivers/gpu/drm/xe/xe_gt_stats.c +6 −1
  50. drivers/gpu/drm/xe/xe_gt_stats_types.h +5 −0
  51. drivers/gpu/drm/xe/xe_gt_sysfs.c +1 −1
  52. drivers/gpu/drm/xe/xe_gt_throttle.c +1 −1
  53. drivers/gpu/drm/xe/xe_guc_ads.c +9 −9
  54. drivers/gpu/drm/xe/xe_guc_ads.h +4 −1
  55. drivers/gpu/drm/xe/xe_guc_buf.c +0 −1
  56. drivers/gpu/drm/xe/xe_guc_capture.c +9 −5
  57. drivers/gpu/drm/xe/xe_guc_debugfs.c +2 −3
  58. drivers/gpu/drm/xe/xe_guc_exec_queue_types.h +0 −2
  59. drivers/gpu/drm/xe/xe_guc_hwconfig.c +2 −2
  60. drivers/gpu/drm/xe/xe_guc_log.c +1 −1
  61. drivers/gpu/drm/xe/xe_guc_relay.c +1 −2
  62. drivers/gpu/drm/xe/xe_guc_submit.c +61 −316
  63. drivers/gpu/drm/xe/xe_guc_submit_types.h +0 −11
  64. drivers/gpu/drm/xe/xe_guc_tlb_inval.c +3 −0
  65. drivers/gpu/drm/xe/xe_heci_gsc.c +0 −1
  66. drivers/gpu/drm/xe/xe_huc.c +0 −1
  67. drivers/gpu/drm/xe/xe_huc_debugfs.c +2 −3
  68. drivers/gpu/drm/xe/xe_hw_engine.c +0 −1
  69. drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +1 −1
  70. drivers/gpu/drm/xe/xe_hw_engine_group.c +1 −1
  71. drivers/gpu/drm/xe/xe_hw_fence.c +1 −19
  72. drivers/gpu/drm/xe/xe_hw_fence.h +0 −2
  73. drivers/gpu/drm/xe/xe_hwmon.c +271 −8
  74. drivers/gpu/drm/xe/xe_i2c.c +8 −5
  75. drivers/gpu/drm/xe/xe_irq.c +0 −1
  76. drivers/gpu/drm/xe/xe_late_bind_fw_types.h +3 −1
  77. drivers/gpu/drm/xe/xe_lmtt.c +1 −1
  78. drivers/gpu/drm/xe/xe_lrc.c +31 −14
  79. drivers/gpu/drm/xe/xe_lrc.h +2 −1
  80. drivers/gpu/drm/xe/xe_memirq.c +0 −2
  81. drivers/gpu/drm/xe/xe_mert.c +56 −20
  82. drivers/gpu/drm/xe/xe_mert.h +9 −6
  83. drivers/gpu/drm/xe/xe_mmio.c +0 −4
  84. drivers/gpu/drm/xe/xe_mocs.c +0 −2
  85. drivers/gpu/drm/xe/xe_module.c +6 −4
  86. drivers/gpu/drm/xe/xe_module.h +1 −1
  87. drivers/gpu/drm/xe/xe_nvm.c +0 −1
  88. drivers/gpu/drm/xe/xe_page_reclaim.c +1 −5
  89. drivers/gpu/drm/xe/xe_page_reclaim.h +20 −0
  90. drivers/gpu/drm/xe/xe_pat.c +46 −6
  91. drivers/gpu/drm/xe/xe_pat.h +2 −0
  92. drivers/gpu/drm/xe/xe_pci.c +4 −1
  93. drivers/gpu/drm/xe/xe_pci_types.h +1 −0
  94. drivers/gpu/drm/xe/xe_pcode_api.h +7 −0
  95. drivers/gpu/drm/xe/xe_pm.c +22 −4
  96. drivers/gpu/drm/xe/xe_psmi.c +1 −1
  97. drivers/gpu/drm/xe/xe_pt.c +58 −26
  98. drivers/gpu/drm/xe/xe_pt_types.h +1 −0
  99. drivers/gpu/drm/xe/xe_pxp.c +0 −1
  100. drivers/gpu/drm/xe/xe_pxp_debugfs.c +1 −1
  101. drivers/gpu/drm/xe/xe_reg_sr.c +1 −4
  102. drivers/gpu/drm/xe/xe_reg_whitelist.c +0 −1
  103. drivers/gpu/drm/xe/xe_ring_ops.c +21 −8
  104. drivers/gpu/drm/xe/xe_rtp.c +0 −1
  105. drivers/gpu/drm/xe/xe_sa.c +1 −1
  106. drivers/gpu/drm/xe/xe_sched_job.c +2 −1
  107. drivers/gpu/drm/xe/xe_sched_job_types.h +2 −0
  108. drivers/gpu/drm/xe/xe_sriov_packet.c +0 −1
  109. drivers/gpu/drm/xe/xe_sriov_pf.c +1 −3
  110. drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c +0 −1
  111. drivers/gpu/drm/xe/xe_sriov_vf.c +0 −1
  112. drivers/gpu/drm/xe/xe_step.c +2 −1
  113. drivers/gpu/drm/xe/xe_survivability_mode.c +1 −2
  114. drivers/gpu/drm/xe/xe_svm.c +2 −0
  115. drivers/gpu/drm/xe/xe_tile.c +1 −2
  116. drivers/gpu/drm/xe/xe_tlb_inval.c +9 −8
  117. drivers/gpu/drm/xe/xe_tlb_inval_types.h +2 −0
  118. drivers/gpu/drm/xe/xe_trace.h +0 −5
  119. drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c +0 −1
  120. drivers/gpu/drm/xe/xe_ttm_sys_mgr.c +0 −1
  121. drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +0 −1
  122. drivers/gpu/drm/xe/xe_uc.c +0 −2
  123. drivers/gpu/drm/xe/xe_uc_debugfs.c +1 −1
  124. drivers/gpu/drm/xe/xe_uc_fw.c +10 −4
  125. drivers/gpu/drm/xe/xe_validation.c +0 −1
  126. drivers/gpu/drm/xe/xe_vm.c +20 −8
  127. drivers/gpu/drm/xe/xe_vm.h +1 −1
  128. drivers/gpu/drm/xe/xe_vram.c +1 −3
  129. drivers/gpu/drm/xe/xe_vram_freq.c +0 −1
  130. drivers/gpu/drm/xe/xe_vsec.c +0 −1
  131. drivers/gpu/drm/xe/xe_wa.c +1 −1
  132. drivers/gpu/drm/xe/xe_wait_user_fence.c +0 −1
  133. drivers/gpu/drm/xe/xe_wopcm.c +1 −1
  134. include/uapi/drm/xe_drm.h +0 −4
Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon+110−0
@@ -109,6 +109,22 @@ Description: RO. Package current voltage in millivolt. · 108 unmodified lines
109109
110110 Only supported for particular Intel Xe graphics platforms.
111111
112+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_crit
113+Date: January 2026
114+KernelVersion: 7.0
115+Contact: intel-xe@lists.freedesktop.org
116+Description: RO. Package critical temperature in millidegree Celsius.
117+
118+ Only supported for particular Intel Xe graphics platforms.
119+
120+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_emergency
121+Date: January 2026
122+KernelVersion: 7.0
123+Contact: intel-xe@lists.freedesktop.org
124+Description: RO. Package shutdown temperature in millidegree Celsius.
125+
126+ Only supported for particular Intel Xe graphics platforms.
127+
112128 What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_input
113129 Date: March 2025
114130 KernelVersion: 6.15
@@ -117,6 +133,30 @@ Description: RO. Package temperature in millidegree Celsius. · 2 unmodified lines
117133
118134 Only supported for particular Intel Xe graphics platforms.
119135
136+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_max
137+Date: January 2026
138+KernelVersion: 7.0
139+Contact: intel-xe@lists.freedesktop.org
140+Description: RO. Package maximum temperature limit in millidegree Celsius.
141+
142+ Only supported for particular Intel Xe graphics platforms.
143+
144+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_crit
145+Date: January 2026
146+KernelVersion: 7.0
147+Contact: intel-xe@lists.freedesktop.org
148+Description: RO. VRAM critical temperature in millidegree Celsius.
149+
150+ Only supported for particular Intel Xe graphics platforms.
151+
152+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_emergency
153+Date: January 2026
154+KernelVersion: 7.0
155+Contact: intel-xe@lists.freedesktop.org
156+Description: RO. VRAM shutdown temperature in millidegree Celsius.
157+
158+ Only supported for particular Intel Xe graphics platforms.
159+
120160 What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_input
121161 Date: March 2025
122162 KernelVersion: 6.15
@@ -125,6 +165,76 @@ Description: RO. VRAM temperature in millidegree Celsius. · 2 unmodified lines
125165
126166 Only supported for particular Intel Xe graphics platforms.
127167
168+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp4_crit
169+Date: January 2026
170+KernelVersion: 7.0
171+Contact: intel-xe@lists.freedesktop.org
172+Description: RO. Memory controller critical temperature in millidegree Celsius.
173+
174+ Only supported for particular Intel Xe graphics platforms.
175+
176+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp4_emergency
177+Date: January 2026
178+KernelVersion: 7.0
179+Contact: intel-xe@lists.freedesktop.org
180+Description: RO. Memory controller shutdown temperature in millidegree Celsius.
181+
182+ Only supported for particular Intel Xe graphics platforms.
183+
184+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp4_input
185+Date: January 2026
186+KernelVersion: 7.0
187+Contact: intel-xe@lists.freedesktop.org
188+Description: RO. Memory controller average temperature in millidegree Celsius.
189+
190+ Only supported for particular Intel Xe graphics platforms.
191+
192+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp5_crit
193+Date: January 2026
194+KernelVersion: 7.0
195+Contact: intel-xe@lists.freedesktop.org
196+Description: RO. GPU PCIe critical temperature in millidegree Celsius.
197+
198+ Only supported for particular Intel Xe graphics platforms.
199+
200+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp5_emergency
201+Date: January 2026
202+KernelVersion: 7.0
203+Contact: intel-xe@lists.freedesktop.org
204+Description: RO. GPU PCIe shutdown temperature in millidegree Celsius.
205+
206+ Only supported for particular Intel Xe graphics platforms.
207+
208+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp5_input
209+Date: January 2026
210+KernelVersion: 7.0
211+Contact: intel-xe@lists.freedesktop.org
212+Description: RO. GPU PCIe temperature in millidegree Celsius.
213+
214+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp[6-21]_crit
215+Date: January 2026
216+KernelVersion: 7.0
217+Contact: intel-xe@lists.freedesktop.org
218+Description: RO. VRAM channel critical temperature in millidegree Celsius.
219+
220+ Only supported for particular Intel Xe graphics platforms.
221+
222+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp[6-21]_emergency
223+Date: January 2026
224+KernelVersion: 7.0
225+Contact: intel-xe@lists.freedesktop.org
226+Description: RO. VRAM channel shutdown temperature in millidegree Celsius.
227+
228+ Only supported for particular Intel Xe graphics platforms.
229+
230+What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp[6-21]_input
231+Date: January 2026
232+KernelVersion: 7.0
233+Contact: intel-xe@lists.freedesktop.org
234+Description: RO. VRAM channel temperature in millidegree Celsius.
235+
236+ Only supported for particular Intel Xe graphics platforms.
237+
128238 What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/fan1_input
129239 Date: March 2025
130240 KernelVersion: 6.16
drivers/gpu/drm/drm_pagemap.c+17−5
@@ -480,8 +480,18 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation, · 479 unmodified lines
480480 .start = start,
481481 .end = end,
482482 .pgmap_owner = pagemap->owner,
483− .flags = MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT |
484− MIGRATE_VMA_SELECT_DEVICE_PRIVATE,
483+ /*
484+ * FIXME: MIGRATE_VMA_SELECT_DEVICE_PRIVATE intermittently
485+ * causes 'xe_exec_system_allocator --r *race*no*' to trigger aa
486+ * engine reset and a hard hang due to getting stuck on a folio
487+ * lock. This should work and needs to be root-caused. The only
488+ * downside of not selecting MIGRATE_VMA_SELECT_DEVICE_PRIVATE
489+ * is that device-to-device migrations won’t work; instead,
490+ * memory will bounce through system memory. This path should be
491+ * rare and only occur when the madvise attributes of memory are
492+ * changed or atomics are being used.
493+ */
494+ .flags = MIGRATE_VMA_SELECT_SYSTEM | MIGRATE_VMA_SELECT_DEVICE_COHERENT,
485495 };
486496 unsigned long i, npages = npages_in_range(start, end);
487497 unsigned long own_pages = 0, migrated_pages = 0;
@@ -582,7 +592,7 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation, · 94 unmodified lines
582592
583593 err = ops->populate_devmem_pfn(devmem_allocation, npages, migrate.dst);
584594 if (err)
585− goto err_finalize;
595+ goto err_aborted_migration;
586596
587597 own_pages = 0;
588598
@@ -621,8 +631,10 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation, · 32 unmodified lines
621631 err = drm_pagemap_migrate_range(devmem_allocation, migrate.src, migrate.dst,
622632 pages, pagemap_addr, &last, &cur,
623633 mdetails);
624− if (err)
634+ if (err) {
635+ npages = i + 1;
625636 goto err_finalize;
637+ }
626638 }
627639 cur.start = npages;
628640 cur.ops = NULL; /* Force migration */
@@ -646,7 +658,7 @@ err_finalize: · 17 unmodified lines
646658 err_aborted_migration:
647659 migrate_vma_pages(&migrate);
648660
649− for (i = 0; i < npages;) {
661+ for (i = 0; !err && i < npages;) {
650662 struct page *page = migrate_pfn_to_page(migrate.src[i]);
651663 unsigned long nr_pages = page ? NR_PAGES(folio_order(page_folio(page))) : 1;
652664
drivers/gpu/drm/xe/Makefile+2−1
@@ -370,7 +370,8 @@ always-$(CONFIG_DRM_XE_WERROR) += \ · 369 unmodified lines
370370 $(patsubst %.h,%.hdrtest, $(shell cd $(src) && find * -name '*.h' $(hdrtest_find_args)))
371371
372372 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
373− cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
373+ cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $< -include $<; \
374+ $(srctree)/scripts/kernel-doc -none -Werror $<; touch $@
374375
375376 $(obj)/%.hdrtest: $(src)/%.h FORCE
376377 $(call if_changed_dep,hdrtest)
drivers/gpu/drm/xe/abi/guc_lfd_abi.h+2−3
@@ -148,7 +148,7 @@ struct guc_lfd_data_os_info { · 147 unmodified lines
148148 } __packed;
149149
150150 /**
151− * struct guc_logfile_header - Header of GuC Log Streaming-LFD-File Format.
151+ * struct guc_lfd_file_header - Header of GuC Log Streaming-LFD-File Format.
152152 * This structure encapsulates the layout of the guc-log-file format
153153 */
154154 struct guc_lfd_file_header {
@@ -163,8 +163,7 @@ struct guc_lfd_file_header { · 8 unmodified lines
163163 #define GUC_LFD_FILE_HEADER_VERSION_MASK_MAJOR GENMASK(31, 16)
164164 #define GUC_LFD_FILE_HEADER_VERSION_MASK_MINOR GENMASK(15, 0)
165165
166− /** @stream: A stream of one or more guc_lfd_data LFD blocks
167− */
166+ /** @stream: A stream of one or more guc_lfd_data LFD blocks */
168167 u32 stream[];
169168 } __packed;
170169
drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h+2−2
@@ -8,7 +8,7 @@ · 7 unmodified lines
88
99 #include <uapi/drm/i915_drm.h>
1010
11−#include "xe_ggtt_types.h"
11+#include "xe_ggtt.h"
1212
1313 #include <linux/refcount.h>
1414
@@ -30,7 +30,7 @@ struct i915_vma { · 15 unmodified lines
3030
3131 static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
3232 {
33− return vma->node->base.start;
33+ return xe_ggtt_node_addr(vma->node);
3434 }
3535
3636 #endif
drivers/gpu/drm/xe/display/xe_fb_pin.c+52−52
@@ -171,12 +171,13 @@ static int __xe_pin_fb_vma_dpt(const struct intel_framebuffer *fb, · 170 unmodified lines
171171 }
172172
173173 static void
174−write_ggtt_rotated(struct xe_bo *bo, struct xe_ggtt *ggtt, u32 *ggtt_ofs, u32 bo_ofs,
174+write_ggtt_rotated(struct xe_ggtt *ggtt, u32 *ggtt_ofs,
175+ u64 pte_flags,
176+ xe_ggtt_set_pte_fn write_pte,
177+ struct xe_bo *bo, u32 bo_ofs,
175178 u32 width, u32 height, u32 src_stride, u32 dst_stride)
176179 {
177− struct xe_device *xe = xe_bo_device(bo);
178180 u32 column, row;
179− u64 pte = ggtt->pt_ops->pte_encode_flags(bo, xe->pat.idx[XE_CACHE_NONE]);
180181
181182 for (column = 0; column < width; column++) {
182183 u32 src_idx = src_stride * (height - 1) + column + bo_ofs;
@@ -184,7 +185,7 @@ write_ggtt_rotated(struct xe_bo *bo, struct xe_ggtt *ggtt, u32 *ggtt_ofs, u32 bo · 1 unmodified line
184185 for (row = 0; row < height; row++) {
185186 u64 addr = xe_bo_addr(bo, src_idx * XE_PAGE_SIZE, XE_PAGE_SIZE);
186187
187− ggtt->pt_ops->ggtt_set_pte(ggtt, *ggtt_ofs, pte | addr);
188+ write_pte(ggtt, *ggtt_ofs, pte_flags | addr);
188189 *ggtt_ofs += XE_PAGE_SIZE;
189190 src_idx -= src_stride;
190191 }
@@ -194,6 +195,28 @@ write_ggtt_rotated(struct xe_bo *bo, struct xe_ggtt *ggtt, u32 *ggtt_ofs, u32 bo · 3 unmodified lines
194195 }
195196 }
196197
198+struct fb_rotate_args {
199+ const struct i915_gtt_view *view;
200+ struct xe_bo *bo;
201+};
202+
203+static void write_ggtt_rotated_node(struct xe_ggtt *ggtt, struct xe_ggtt_node *node,
204+ u64 pte_flags, xe_ggtt_set_pte_fn write_pte, void *data)
205+{
206+ struct fb_rotate_args *args = data;
207+ struct xe_bo *bo = args->bo;
208+ const struct intel_rotation_info *rot_info = &args->view->rotated;
209+ u32 ggtt_ofs = xe_ggtt_node_addr(node);
210+
211+ for (u32 i = 0; i < ARRAY_SIZE(rot_info->plane); i++)
212+ write_ggtt_rotated(ggtt, &ggtt_ofs, pte_flags, write_pte,
213+ bo, rot_info->plane[i].offset,
214+ rot_info->plane[i].width,
215+ rot_info->plane[i].height,
216+ rot_info->plane[i].src_stride,
217+ rot_info->plane[i].dst_stride);
218+}
219+
197220 static int __xe_pin_fb_vma_ggtt(const struct intel_framebuffer *fb,
198221 const struct i915_gtt_view *view,
199222 struct i915_vma *vma,
@@ -204,66 +227,43 @@ static int __xe_pin_fb_vma_ggtt(const struct intel_framebuffer *fb, · 4 unmodified lines
204227 struct xe_device *xe = to_xe_device(fb->base.dev);
205228 struct xe_tile *tile0 = xe_device_get_root_tile(xe);
206229 struct xe_ggtt *ggtt = tile0->mem.ggtt;
230+ u64 pte, size;
207231 u32 align;
208− int ret;
232+ int ret = 0;
209233
210234 /* TODO: Consider sharing framebuffer mapping?
211235 * embed i915_vma inside intel_framebuffer
212236 */
213237 guard(xe_pm_runtime_noresume)(xe);
214− ACQUIRE(mutex_intr, lock)(&ggtt->lock);
215− ret = ACQUIRE_ERR(mutex_intr, &lock);
216− if (ret)
217− return ret;
218238
219239 align = XE_PAGE_SIZE;
220− if (xe_bo_is_vram(bo) && ggtt->flags & XE_GGTT_FLAGS_64K)
221− align = max_t(u32, align, SZ_64K);
240+ if (xe_bo_is_vram(bo) && xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K)
241+ align = max(align, SZ_64K);
222242
243+ /* Fast case, preallocated GGTT view? */
223244 if (bo->ggtt_node[tile0->id] && view->type == I915_GTT_VIEW_NORMAL) {
224245 vma->node = bo->ggtt_node[tile0->id];
225− } else if (view->type == I915_GTT_VIEW_NORMAL) {
226− vma->node = xe_ggtt_node_init(ggtt);
227− if (IS_ERR(vma->node))
228− return PTR_ERR(vma->node);
229−
230− ret = xe_ggtt_node_insert_locked(vma->node, xe_bo_size(bo), align, 0);
231− if (ret) {
232− xe_ggtt_node_fini(vma->node);
233− return ret;
234− }
235−
236− xe_ggtt_map_bo(ggtt, vma->node, bo, xe->pat.idx[XE_CACHE_NONE]);
237− } else {
238− u32 i, ggtt_ofs;
239− const struct intel_rotation_info *rot_info = &view->rotated;
240−
241− /* display seems to use tiles instead of bytes here, so convert it back.. */
242− u32 size = intel_rotation_info_size(rot_info) * XE_PAGE_SIZE;
243−
244− vma->node = xe_ggtt_node_init(ggtt);
245− if (IS_ERR(vma->node)) {
246− ret = PTR_ERR(vma->node);
247− return ret;
248− }
249−
250− ret = xe_ggtt_node_insert_locked(vma->node, size, align, 0);
251− if (ret) {
252− xe_ggtt_node_fini(vma->node);
253− return ret;
254− }
255−
256− ggtt_ofs = vma->node->base.start;
257−
258− for (i = 0; i < ARRAY_SIZE(rot_info->plane); i++)
259− write_ggtt_rotated(bo, ggtt, &ggtt_ofs,
260− rot_info->plane[i].offset,
261− rot_info->plane[i].width,
262− rot_info->plane[i].height,
263− rot_info->plane[i].src_stride,
264− rot_info->plane[i].dst_stride);
246+ return 0;
265247 }
266248
249+ /* TODO: Consider sharing framebuffer mapping?
250+ * embed i915_vma inside intel_framebuffer
251+ */
252+ if (view->type == I915_GTT_VIEW_NORMAL)
253+ size = xe_bo_size(bo);
254+ else
255+ /* display uses tiles instead of bytes here, so convert it back.. */
256+ size = intel_rotation_info_size(&view->rotated) * XE_PAGE_SIZE;
257+
258+ pte = xe_ggtt_encode_pte_flags(ggtt, bo, xe->pat.idx[XE_CACHE_NONE]);
259+ vma->node = xe_ggtt_node_insert_transform(ggtt, bo, pte,
260+ ALIGN(size, align), align,
261+ view->type == I915_GTT_VIEW_NORMAL ?
262+ NULL : write_ggtt_rotated_node,
263+ &(struct fb_rotate_args){view, bo});
264+ if (IS_ERR(vma->node))
265+ ret = PTR_ERR(vma->node);
266+
267267 return ret;
268268 }
269269
@@ -353,7 +353,7 @@ static void __xe_unpin_fb_vma(struct i915_vma *vma) · 83 unmodified lines
353353 if (vma->dpt)
354354 xe_bo_unpin_map_no_vm(vma->dpt);
355355 else if (!xe_ggtt_node_allocated(vma->bo->ggtt_node[tile_id]) ||
356− vma->bo->ggtt_node[tile_id]->base.start != vma->node->base.start)
356+ vma->bo->ggtt_node[tile_id] != vma->node)
357357 xe_ggtt_node_remove(vma->node, false);
358358
359359 ttm_bo_reserve(&vma->bo->ttm, false, false, NULL);
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c+1−1
@@ -39,7 +39,7 @@ static bool intel_hdcp_gsc_check_status(struct drm_device *drm) · 38 unmodified lines
3939 struct xe_gt *gt = tile->media_gt;
4040 struct xe_gsc *gsc = &gt->uc.gsc;
4141
42− if (!gsc || !xe_uc_fw_is_enabled(&gsc->fw)) {
42+ if (!gsc || !xe_uc_fw_is_available(&gsc->fw)) {
4343 drm_dbg_kms(&xe->drm,
4444 "GSC Components not ready for HDCP2.x\n");
4545 return false;
drivers/gpu/drm/xe/display/xe_stolen.c+1−1
@@ -78,7 +78,7 @@ static u64 xe_stolen_node_address(const struct intel_stolen_node *node) · 77 unmodified lines
7878
7979 static u64 xe_stolen_node_size(const struct intel_stolen_node *node)
8080 {
81− return node->bo->ttm.base.size;
81+ return xe_bo_size(node->bo);
8282 }
8383
8484 static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm)
drivers/gpu/drm/xe/regs/xe_gt_regs.h+6−0
@@ -89,6 +89,7 @@ · 88 unmodified lines
8989 #define UNIFIED_COMPRESSION_FORMAT REG_GENMASK(3, 0)
9090
9191 #define XE2_GAMREQSTRM_CTRL XE_REG_MCR(0x4194)
92+#define EN_CMP_1WCOH REG_BIT(15)
9293 #define CG_DIS_CNTLBUS REG_BIT(6)
9394
9495 #define CCS_AUX_INV XE_REG(0x4208)
@@ -101,6 +102,11 @@ · 6 unmodified lines
101102
102103 #define XE2_LMEM_CFG XE_REG(0x48b0)
103104
105+#define XE2_GAMWALK_CTRL 0x47e4
106+#define XE2_GAMWALK_CTRL_MEDIA XE_REG(XE2_GAMWALK_CTRL + MEDIA_GT_GSI_OFFSET)
107+#define XE2_GAMWALK_CTRL_3D XE_REG_MCR(XE2_GAMWALK_CTRL)
108+#define EN_CMP_1WCOH_GW REG_BIT(14)
109+
104110 #define XEHP_FLAT_CCS_BASE_ADDR XE_REG_MCR(0x4910)
105111 #define XEHP_FLAT_CCS_PTR REG_GENMASK(31, 8)
106112
drivers/gpu/drm/xe/regs/xe_mert_regs.h+6−4
@@ -11,11 +11,13 @@ · 10 unmodified lines
1111 #define MERT_LMEM_CFG XE_REG(0x1448b0)
1212
1313 #define MERT_TLB_CT_INTR_ERR_ID_PORT XE_REG(0x145190)
14−#define MERT_TLB_CT_VFID_MASK REG_GENMASK(16, 9)
15−#define MERT_TLB_CT_ERROR_MASK REG_GENMASK(5, 0)
16−#define MERT_TLB_CT_LMTT_FAULT 0x05
14+#define CATERR_VFID REG_GENMASK(16, 9)
15+#define CATERR_CODES REG_GENMASK(5, 0)
16+#define CATERR_NO_ERROR 0x00
17+#define CATERR_UNMAPPED_GGTT 0x01
18+#define CATERR_LMTT_FAULT 0x05
1719
1820 #define MERT_TLB_INV_DESC_A XE_REG(0x14cf7c)
1921 #define MERT_TLB_INV_DESC_A_VALID REG_BIT(0)
2022
21−#endif /* _XE_MERT_REGS_H_ */
23+#endif
drivers/gpu/drm/xe/regs/xe_pcode_regs.h+3−0
@@ -21,7 +21,10 @@ · 20 unmodified lines
2121 #define BMG_FAN_1_SPEED XE_REG(0x138140)
2222 #define BMG_FAN_2_SPEED XE_REG(0x138170)
2323 #define BMG_FAN_3_SPEED XE_REG(0x1381a0)
24+#define BMG_VRAM_TEMPERATURE_N(n) XE_REG(0x138260 + ((n) * (sizeof(u32))))
2425 #define BMG_VRAM_TEMPERATURE XE_REG(0x1382c0)
26+#define TEMP_MASK_VRAM_N REG_GENMASK(30, 8)
27+#define TEMP_SIGN_MASK REG_BIT(31)
2528 #define BMG_PACKAGE_TEMPERATURE XE_REG(0x138434)
2629
2730 #endif /* _XE_PCODE_REGS_H_ */
drivers/gpu/drm/xe/tests/xe_bo.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include "tests/xe_test.h"
1919
2020 #include "xe_bo_evict.h"
21+#include "xe_gt.h"
2122 #include "xe_pci.h"
2223 #include "xe_pm.h"
2324
drivers/gpu/drm/xe/tests/xe_guc_buf_kunit.c+1−1
@@ -67,7 +67,7 @@ static int guc_buf_test_init(struct kunit *test) · 66 unmodified lines
6767
6868 KUNIT_ASSERT_EQ(test, 0,
6969 xe_ggtt_init_kunit(ggtt, DUT_GGTT_START,
70− DUT_GGTT_START + DUT_GGTT_SIZE));
70+ DUT_GGTT_SIZE));
7171
7272 kunit_activate_static_stub(test, xe_managed_bo_create_pin_map,
7373 replacement_xe_managed_bo_create_pin_map);
drivers/gpu/drm/xe/xe_bb.c+1−2
@@ -7,10 +7,9 @@ · 6 unmodified lines
77
88 #include "instructions/xe_mi_commands.h"
99 #include "xe_assert.h"
10−#include "xe_device.h"
10+#include "xe_device_types.h"
1111 #include "xe_exec_queue_types.h"
1212 #include "xe_gt.h"
13−#include "xe_hw_fence.h"
1413 #include "xe_sa.h"
1514 #include "xe_sched_job.h"
1615 #include "xe_vm_types.h"
drivers/gpu/drm/xe/xe_bo.c+19−14
@@ -26,9 +26,9 @@ · 25 unmodified lines
2626 #include "xe_dma_buf.h"
2727 #include "xe_drm_client.h"
2828 #include "xe_ggtt.h"
29−#include "xe_gt.h"
3029 #include "xe_map.h"
3130 #include "xe_migrate.h"
31+#include "xe_pat.h"
3232 #include "xe_pm.h"
3333 #include "xe_preempt_fence.h"
3434 #include "xe_pxp.h"
@@ -1054,6 +1054,7 @@ static long xe_bo_shrink_purge(struct ttm_operation_ctx *ctx, · 1019 unmodified lines
10541054 unsigned long *scanned)
10551055 {
10561056 struct xe_device *xe = ttm_to_xe_device(bo->bdev);
1057+ struct ttm_tt *tt = bo->ttm;
10571058 long lret;
10581059
10591060 /* Fake move to system, without copying data. */
@@ -1078,8 +1079,10 @@ static long xe_bo_shrink_purge(struct ttm_operation_ctx *ctx, · 18 unmodified lines
10781079 .writeback = false,
10791080 .allow_move = false});
10801081
1081− if (lret > 0)
1082+ if (lret > 0) {
10821083 xe_ttm_tt_account_subtract(xe, bo->ttm);
1084+ update_global_total_pages(bo->bdev, -(long)tt->num_pages);
1085+ }
10831086
10841087 return lret;
10851088 }
@@ -1165,8 +1168,10 @@ long xe_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo, · 79 unmodified lines
11651168 if (needs_rpm)
11661169 xe_pm_runtime_put(xe);
11671170
1168− if (lret > 0)
1171+ if (lret > 0) {
11691172 xe_ttm_tt_account_subtract(xe, tt);
1173+ update_global_total_pages(bo->bdev, -(long)tt->num_pages);
1174+ }
11701175
11711176 out_unref:
11721177 xe_bo_put(xe_bo);
@@ -1709,7 +1714,7 @@ static void xe_ttm_bo_destroy(struct ttm_buffer_object *ttm_bo) · 536 unmodified lines
17091714 xe_assert(xe, list_empty(&ttm_bo->base.gpuva.list));
17101715
17111716 for_each_tile(tile, xe, id)
1712− if (bo->ggtt_node[id] && bo->ggtt_node[id]->base.size)
1717+ if (bo->ggtt_node[id])
17131718 xe_ggtt_remove_bo(tile->mem.ggtt, bo);
17141719
17151720 #ifdef CONFIG_PROC_FS
@@ -3517,16 +3522,16 @@ bool xe_bo_needs_ccs_pages(struct xe_bo *bo) · 1801 unmodified lines
35173522 if (IS_DGFX(xe) && (bo->flags & XE_BO_FLAG_SYSTEM))
35183523 return false;
35193524
3525+ /* Check if userspace explicitly requested no compression */
3526+ if (bo->flags & XE_BO_FLAG_NO_COMPRESSION)
3527+ return false;
3528+
35203529 /*
3521− * Compression implies coh_none, therefore we know for sure that WB
3522− * memory can't currently use compression, which is likely one of the
3523− * common cases.
3524− * Additionally, userspace may explicitly request no compression via the
3525− * DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION flag, which should also disable
3526− * CCS usage.
3530+ * For WB (Write-Back) CPU caching mode, check if the device
3531+ * supports WB compression with coherency.
35273532 */
3528− if (bo->cpu_caching == DRM_XE_GEM_CPU_CACHING_WB ||
3529− bo->flags & XE_BO_FLAG_NO_COMPRESSION)
3533+ if (bo->cpu_caching == DRM_XE_GEM_CPU_CACHING_WB &&
3534+ xe->pat.idx[XE_CACHE_WB_COMPRESSION] == XE_PAT_INVALID_IDX)
35303535 return false;
35313536
35323537 return true;
@@ -3603,8 +3608,8 @@ void xe_bo_put(struct xe_bo *bo) · 70 unmodified lines
36033608 might_lock(&bo->client->bos_lock);
36043609 #endif
36053610 for_each_tile(tile, xe_bo_device(bo), id)
3606− if (bo->ggtt_node[id] && bo->ggtt_node[id]->ggtt)
3607− xe_ggtt_might_lock(bo->ggtt_node[id]->ggtt);
3611+ if (bo->ggtt_node[id])
3612+ xe_ggtt_might_lock(tile->mem.ggtt);
36083613 drm_gem_object_put(&bo->ttm.base);
36093614 }
36103615 }
drivers/gpu/drm/xe/xe_bo.h+5−3
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <drm/ttm/ttm_tt.h>
1010
1111 #include "xe_bo_types.h"
12+#include "xe_ggtt.h"
1213 #include "xe_macros.h"
1314 #include "xe_validation.h"
1415 #include "xe_vm_types.h"
@@ -252,13 +253,14 @@ static inline u32 · 237 unmodified lines
252253 __xe_bo_ggtt_addr(struct xe_bo *bo, u8 tile_id)
253254 {
254255 struct xe_ggtt_node *ggtt_node = bo->ggtt_node[tile_id];
256+ u64 offset;
255257
256258 if (XE_WARN_ON(!ggtt_node))
257259 return 0;
258260
259− XE_WARN_ON(ggtt_node->base.size > xe_bo_size(bo));
260− XE_WARN_ON(ggtt_node->base.start + ggtt_node->base.size > (1ull << 32));
261− return ggtt_node->base.start;
261+ offset = xe_ggtt_node_addr(ggtt_node);
262+ XE_WARN_ON(offset + xe_bo_size(bo) > (1ull << 32));
263+ return offset;
262264 }
263265
264266 static inline u32
drivers/gpu/drm/xe/xe_debugfs.c+60−15
@@ -254,36 +254,81 @@ static ssize_t wedged_mode_show(struct file *f, char __user *ubuf, · 253 unmodified lines
254254 return simple_read_from_buffer(ubuf, size, pos, buf, len);
255255 }
256256
257+static int __wedged_mode_set_reset_policy(struct xe_gt *gt, enum xe_wedged_mode mode)
258+{
259+ bool enable_engine_reset;
260+ int ret;
261+
262+ enable_engine_reset = (mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET);
263+ ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads,
264+ enable_engine_reset);
265+ if (ret)
266+ xe_gt_err(gt, "Failed to update GuC ADS scheduler policy (%pe)\n", ERR_PTR(ret));
267+
268+ return ret;
269+}
270+
271+static int wedged_mode_set_reset_policy(struct xe_device *xe, enum xe_wedged_mode mode)
272+{
273+ struct xe_gt *gt;
274+ int ret;
275+ u8 id;
276+
277+ guard(xe_pm_runtime)(xe);
278+ for_each_gt(gt, xe, id) {
279+ ret = __wedged_mode_set_reset_policy(gt, mode);
280+ if (ret) {
281+ if (id > 0) {
282+ xe->wedged.inconsistent_reset = true;
283+ drm_err(&xe->drm, "Inconsistent reset policy state between GTs\n");
284+ }
285+ return ret;
286+ }
287+ }
288+
289+ xe->wedged.inconsistent_reset = false;
290+
291+ return 0;
292+}
293+
294+static bool wedged_mode_needs_policy_update(struct xe_device *xe, enum xe_wedged_mode mode)
295+{
296+ if (xe->wedged.inconsistent_reset)
297+ return true;
298+
299+ if (xe->wedged.mode == mode)
300+ return false;
301+
302+ if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET ||
303+ mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
304+ return true;
305+
306+ return false;
307+}
308+
257309 static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
258310 size_t size, loff_t *pos)
259311 {
260312 struct xe_device *xe = file_inode(f)->i_private;
261− struct xe_gt *gt;
262313 u32 wedged_mode;
263314 ssize_t ret;
264− u8 id;
265315
266316 ret = kstrtouint_from_user(ubuf, size, 0, &wedged_mode);
267317 if (ret)
268318 return ret;
269319
270− if (wedged_mode > 2)
271− return -EINVAL;
320+ ret = xe_device_validate_wedged_mode(xe, wedged_mode);
321+ if (ret)
322+ return ret;
272323
273− if (xe->wedged.mode == wedged_mode)
274− return size;
324+ if (wedged_mode_needs_policy_update(xe, wedged_mode)) {
325+ ret = wedged_mode_set_reset_policy(xe, wedged_mode);
326+ if (ret)
327+ return ret;
328+ }
275329
276330 xe->wedged.mode = wedged_mode;
277331
278− guard(xe_pm_runtime)(xe);
279− for_each_gt(gt, xe, id) {
280− ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads);
281− if (ret) {
282− xe_gt_err(gt, "Failed to update GuC ADS scheduler policy. GuC may still cause engine reset even with wedged_mode=2\n");
283− return -EIO;
284− }
285− }
286−
287332 return size;
288333 }
289334
drivers/gpu/drm/xe/xe_devcoredump.c+1−2
@@ -15,14 +15,13 @@ · 14 unmodified lines
1515 #include "xe_device.h"
1616 #include "xe_exec_queue.h"
1717 #include "xe_force_wake.h"
18−#include "xe_gt.h"
1918 #include "xe_gt_printk.h"
19+#include "xe_gt_types.h"
2020 #include "xe_guc_capture.h"
2121 #include "xe_guc_ct.h"
2222 #include "xe_guc_log.h"
2323 #include "xe_guc_submit.h"
2424 #include "xe_hw_engine.h"
25−#include "xe_module.h"
2625 #include "xe_pm.h"
2726 #include "xe_sched_job.h"
2827 #include "xe_vm.h"
drivers/gpu/drm/xe/xe_device.c+71−70
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <linux/aperture.h>
99 #include <linux/delay.h>
1010 #include <linux/fault-inject.h>
11−#include <linux/iopoll.h>
1211 #include <linux/units.h>
1312
1413 #include <drm/drm_atomic_helper.h>
@@ -36,7 +35,6 @@ · 21 unmodified lines
3635 #include "xe_exec_queue.h"
3736 #include "xe_force_wake.h"
3837 #include "xe_ggtt.h"
39−#include "xe_gsc_proxy.h"
4038 #include "xe_gt.h"
4139 #include "xe_gt_mcr.h"
4240 #include "xe_gt_printk.h"
@@ -180,12 +178,7 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file) · 137 unmodified lines
180178 xa_for_each(&xef->exec_queue.xa, idx, q) {
181179 if (q->vm && q->hwe->hw_engine_group)
182180 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
183−
184− if (xe_exec_queue_is_multi_queue_primary(q))
185− xe_exec_queue_group_kill_put(q->multi_queue.group);
186− else
187− xe_exec_queue_kill(q);
188−
181+ xe_exec_queue_kill(q);
189182 xe_exec_queue_put(q);
190183 }
191184 xa_for_each(&xef->vm.xa, idx, vm)
@@ -659,62 +652,14 @@ mask_err: · 467 unmodified lines
659652 return err;
660653 }
661654
662−static int lmem_initializing(struct xe_device *xe)
655+static void assert_lmem_ready(struct xe_device *xe)
663656 {
664− if (xe_mmio_read32(xe_root_tile_mmio(xe), GU_CNTL) & LMEM_INIT)
665− return 0;
666−
667− if (signal_pending(current))
668− return -EINTR;
669−
670− return 1;
671−}
672−
673−static int wait_for_lmem_ready(struct xe_device *xe)
674−{
675− const unsigned long TIMEOUT_SEC = 60;
676− unsigned long prev_jiffies;
677− int initializing;
678−
679− if (!IS_DGFX(xe))
680− return 0;
681−
682− if (IS_SRIOV_VF(xe))
683− return 0;
684−
685− if (!lmem_initializing(xe))
686− return 0;
687−
688− drm_dbg(&xe->drm, "Waiting for lmem initialization\n");
689− prev_jiffies = jiffies;
690−
691− /*
692− * The boot firmware initializes local memory and
693− * assesses its health. If memory training fails,
694− * the punit will have been instructed to keep the GT powered
695− * down.we won't be able to communicate with it
696− *
697− * If the status check is done before punit updates the register,
698− * it can lead to the system being unusable.
699− * use a timeout and defer the probe to prevent this.
700− */
701− poll_timeout_us(initializing = lmem_initializing(xe),
702− initializing <= 0,
703− 20 * USEC_PER_MSEC, TIMEOUT_SEC * USEC_PER_SEC, true);
704− if (initializing < 0)
705− return initializing;
706−
707− if (initializing) {
708− drm_dbg(&xe->drm, "lmem not initialized by firmware\n");
709− return -EPROBE_DEFER;
710− }
711−
712− drm_dbg(&xe->drm, "lmem ready after %ums",
713− jiffies_to_msecs(jiffies - prev_jiffies));
657+ if (!IS_DGFX(xe) || IS_SRIOV_VF(xe))
658+ return;
714659
715− return 0;
660+ xe_assert(xe, xe_mmio_read32(xe_root_tile_mmio(xe), GU_CNTL) &
661+ LMEM_INIT);
716662 }
717−ALLOW_ERROR_INJECTION(wait_for_lmem_ready, ERRNO); /* See xe_pci_probe() */
718663
719664 static void vf_update_device_info(struct xe_device *xe)
720665 {
@@ -769,6 +714,11 @@ int xe_device_probe_early(struct xe_device *xe) · 48 unmodified lines
769714 if (IS_SRIOV_VF(xe))
770715 vf_update_device_info(xe);
771716
717+ /*
718+ * Check for pcode uncore_init status to confirm if the SoC
719+ * initialization is complete. Until done, any MMIO or lmem access from
720+ * the driver will be blocked
721+ */
772722 err = xe_pcode_probe_early(xe);
773723 if (err || xe_survivability_mode_is_requested(xe)) {
774724 int save_err = err;
@@ -785,11 +735,17 @@ int xe_device_probe_early(struct xe_device *xe) · 10 unmodified lines
785735 return save_err;
786736 }
787737
788− err = wait_for_lmem_ready(xe);
789− if (err)
790− return err;
738+ /*
739+ * Make sure the lmem is initialized and ready to use. xe_pcode_ready()
740+ * is flagged after full initialization is complete. Assert if lmem is
741+ * not initialized.
742+ */
743+ assert_lmem_ready(xe);
791744
792− xe->wedged.mode = xe_modparam.wedged_mode;
745+ xe->wedged.mode = xe_device_validate_wedged_mode(xe, xe_modparam.wedged_mode) ?
746+ XE_WEDGED_MODE_DEFAULT : xe_modparam.wedged_mode;
747+ drm_dbg(&xe->drm, "wedged_mode: setting mode (%u) %s\n",
748+ xe->wedged.mode, xe_wedged_mode_to_string(xe->wedged.mode));
793749
794750 err = xe_device_vram_alloc(xe);
795751 if (err)
@@ -1272,10 +1228,10 @@ static void xe_device_wedged_fini(struct drm_device *drm, void *arg) · 476 unmodified lines
12721228 * DOC: Xe Device Wedging
12731229 *
12741230 * Xe driver uses drm device wedged uevent as documented in Documentation/gpu/drm-uapi.rst.
1275− * When device is in wedged state, every IOCTL will be blocked and GT cannot be
1276− * used. Certain critical errors like gt reset failure, firmware failures can cause
1277− * the device to be wedged. The default recovery method for a wedged state
1278− * is rebind/bus-reset.
1231+ * When device is in wedged state, every IOCTL will be blocked and GT cannot
1232+ * be used. The conditions under which the driver declares the device wedged
1233+ * depend on the wedged mode configuration (see &enum xe_wedged_mode). The
1234+ * default recovery method for a wedged state is rebind/bus-reset.
12791235 *
12801236 * Another recovery method is vendor-specific. Below are the cases that send
12811237 * ``WEDGED=vendor-specific`` recovery method in drm device wedged uevent.
@@ -1340,7 +1296,7 @@ void xe_device_declare_wedged(struct xe_device *xe) · 58 unmodified lines
13401296 struct xe_gt *gt;
13411297 u8 id;
13421298
1343− if (xe->wedged.mode == 0) {
1299+ if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
13441300 drm_dbg(&xe->drm, "Wedged mode is forcibly disabled\n");
13451301 return;
13461302 }
@@ -1374,3 +1330,48 @@ void xe_device_declare_wedged(struct xe_device *xe) · 27 unmodified lines
13741330 drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL);
13751331 }
13761332 }
1333+
1334+/**
1335+ * xe_device_validate_wedged_mode - Check if given mode is supported
1336+ * @xe: the &xe_device
1337+ * @mode: requested mode to validate
1338+ *
1339+ * Check whether the provided wedged mode is supported.
1340+ *
1341+ * Return: 0 if mode is supported, error code otherwise.
1342+ */
1343+int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode)
1344+{
1345+ if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
1346+ drm_dbg(&xe->drm, "wedged_mode: invalid value (%u)\n", mode);
1347+ return -EINVAL;
1348+ } else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
1349+ (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
1350+ drm_dbg(&xe->drm, "wedged_mode: (%u) %s mode is not supported for %s\n",
1351+ mode, xe_wedged_mode_to_string(mode),
1352+ xe_sriov_mode_to_string(xe_device_sriov_mode(xe)));
1353+ return -EPERM;
1354+ }
1355+
1356+ return 0;
1357+}
1358+
1359+/**
1360+ * xe_wedged_mode_to_string - Convert enum value to string.
1361+ * @mode: the &xe_wedged_mode to convert
1362+ *
1363+ * Returns: wedged mode as a user friendly string.
1364+ */
1365+const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode)
1366+{
1367+ switch (mode) {
1368+ case XE_WEDGED_MODE_NEVER:
1369+ return "never";
1370+ case XE_WEDGED_MODE_UPON_CRITICAL_ERROR:
1371+ return "upon-critical-error";
1372+ case XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET:
1373+ return "upon-any-hang-no-reset";
1374+ default:
1375+ return "<invalid>";
1376+ }
1377+}
drivers/gpu/drm/xe/xe_device.h+2−0
@@ -194,6 +194,8 @@ static inline bool xe_device_wedged(struct xe_device *xe) · 193 unmodified lines
194194
195195 void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method);
196196 void xe_device_declare_wedged(struct xe_device *xe);
197+int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode);
198+const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode);
197199
198200 struct xe_file *xe_file_get(struct xe_file *xef);
199201 void xe_file_put(struct xe_file *xef);
drivers/gpu/drm/xe/xe_device_types.h+24−1
@@ -46,6 +46,25 @@ struct xe_pat_ops; · 45 unmodified lines
4646 struct xe_pxp;
4747 struct xe_vram_region;
4848
49+/**
50+ * enum xe_wedged_mode - possible wedged modes
51+ * @XE_WEDGED_MODE_NEVER: Device will never be declared wedged.
52+ * @XE_WEDGED_MODE_UPON_CRITICAL_ERROR: Device will be declared wedged only
53+ * when critical error occurs like GT reset failure or firmware failure.
54+ * This is the default mode.
55+ * @XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET: Device will be declared wedged on
56+ * any hang. In this mode, engine resets are disabled to avoid automatic
57+ * recovery attempts. This mode is primarily intended for debugging hangs.
58+ */
59+enum xe_wedged_mode {
60+ XE_WEDGED_MODE_NEVER = 0,
61+ XE_WEDGED_MODE_UPON_CRITICAL_ERROR = 1,
62+ XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
63+};
64+
65+#define XE_WEDGED_MODE_DEFAULT XE_WEDGED_MODE_UPON_CRITICAL_ERROR
66+#define XE_WEDGED_MODE_DEFAULT_STR "upon-critical-error"
67+
4968 #define XE_BO_INVALID_OFFSET LONG_MAX
5069
5170 #define GRAPHICS_VER(xe) ((xe)->info.graphics_verx100 / 100)
@@ -322,6 +341,8 @@ struct xe_device { · 270 unmodified lines
322341 * pcode mailbox commands.
323342 */
324343 u8 has_mbx_power_limits:1;
344+ /** @info.has_mbx_thermal_info: Device supports thermal mailbox commands */
345+ u8 has_mbx_thermal_info:1;
325346 /** @info.has_mem_copy_instr: Device supports MEM_COPY instruction */
326347 u8 has_mem_copy_instr:1;
327348 /** @info.has_mert: Device has standalone MERT */
@@ -626,9 +647,11 @@ struct xe_device { · 298 unmodified lines
626647 /** @wedged.flag: Xe device faced a critical error and is now blocked. */
627648 atomic_t flag;
628649 /** @wedged.mode: Mode controlled by kernel parameter and debugfs */
629− int mode;
650+ enum xe_wedged_mode mode;
630651 /** @wedged.method: Recovery method to be sent in the drm device wedged uevent */
631652 unsigned long method;
653+ /** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
654+ bool inconsistent_reset;
632655 } wedged;
633656
634657 /** @bo_device: Struct to control async free of BOs */
drivers/gpu/drm/xe/xe_exec.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <uapi/drm/xe_drm.h>
1212 #include <linux/delay.h>
1313
14−#include "xe_bo.h"
1514 #include "xe_device.h"
1615 #include "xe_exec_queue.h"
1716 #include "xe_hw_engine_group.h"
drivers/gpu/drm/xe/xe_exec_queue.c+4−58
@@ -21,13 +21,11 @@ · 20 unmodified lines
2121 #include "xe_gt_sriov_vf.h"
2222 #include "xe_hw_engine_class_sysfs.h"
2323 #include "xe_hw_engine_group.h"
24−#include "xe_hw_fence.h"
2524 #include "xe_irq.h"
2625 #include "xe_lrc.h"
2726 #include "xe_macros.h"
2827 #include "xe_migrate.h"
2928 #include "xe_pm.h"
30−#include "xe_ring_ops_types.h"
3129 #include "xe_trace.h"
3230 #include "xe_vm.h"
3331 #include "xe_pxp.h"
@@ -84,9 +82,8 @@ · 50 unmodified lines
8482 * group is destroyed. The secondary queues hold a reference to the primary
8583 * queue thus preventing the group from being destroyed when user destroys
8684 * the primary queue. Once the primary queue is destroyed, secondary queues
87− * can't be added to the queue group, but they can continue to submit the
88− * jobs if the DRM_XE_MULTI_GROUP_KEEP_ACTIVE flag is set during the multi
89− * queue group creation.
85+ * can't be added to the queue group and new job submissions on existing
86+ * secondary queues are not allowed.
9087 *
9188 * The queues of a multi queue group can set their priority within the group
9289 * through the DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY property.
@@ -467,26 +464,6 @@ struct xe_exec_queue *xe_exec_queue_create_bind(struct xe_device *xe, · 374 unmodified lines
467464 }
468465 ALLOW_ERROR_INJECTION(xe_exec_queue_create_bind, ERRNO);
469466
470−static void xe_exec_queue_group_kill(struct kref *ref)
471−{
472− struct xe_exec_queue_group *group = container_of(ref, struct xe_exec_queue_group,
473− kill_refcount);
474− xe_exec_queue_kill(group->primary);
475−}
476−
477−static inline void xe_exec_queue_group_kill_get(struct xe_exec_queue_group *group)
478−{
479− kref_get(&group->kill_refcount);
480−}
481−
482−void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group)
483−{
484− if (!group)
485− return;
486−
487− kref_put(&group->kill_refcount, xe_exec_queue_group_kill);
488−}
489−
490467 void xe_exec_queue_destroy(struct kref *ref)
491468 {
492469 struct xe_exec_queue *q = container_of(ref, struct xe_exec_queue, refcount);
@@ -716,7 +693,6 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue * · 223 unmodified lines
716693 group->primary = q;
717694 group->cgp_bo = bo;
718695 INIT_LIST_HEAD(&group->list);
719− kref_init(&group->kill_refcount);
720696 xa_init_flags(&group->xa, XA_FLAGS_ALLOC1);
721697 mutex_init(&group->list_lock);
722698 q->multi_queue.group = group;
@@ -792,11 +768,6 @@ static int xe_exec_queue_group_add(struct xe_device *xe, struct xe_exec_queue *q · 69 unmodified lines
792768
793769 q->multi_queue.pos = pos;
794770
795− if (group->primary->multi_queue.keep_active) {
796− xe_exec_queue_group_kill_get(group);
797− q->multi_queue.keep_active = true;
798− }
799−
800771 return 0;
801772 }
802773
@@ -810,11 +781,6 @@ static void xe_exec_queue_group_delete(struct xe_device *xe, struct xe_exec_queu · 7 unmodified lines
810781 lrc = xa_erase(&group->xa, q->multi_queue.pos);
811782 xe_assert(xe, lrc);
812783 xe_lrc_put(lrc);
813−
814− if (q->multi_queue.keep_active) {
815− xe_exec_queue_group_kill_put(group);
816− q->multi_queue.keep_active = false;
817− }
818784 }
819785
820786 static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue *q,
@@ -836,24 +802,12 @@ static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue · 15 unmodified lines
836802 return -EINVAL;
837803
838804 if (value & DRM_XE_MULTI_GROUP_CREATE) {
839− if (XE_IOCTL_DBG(xe, value & ~(DRM_XE_MULTI_GROUP_CREATE |
840− DRM_XE_MULTI_GROUP_KEEP_ACTIVE)))
841− return -EINVAL;
842−
843− /*
844− * KEEP_ACTIVE is not supported in preempt fence mode as in that mode,
845− * VM_DESTROY ioctl expects all exec queues of that VM are already killed.
846− */
847− if (XE_IOCTL_DBG(xe, (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE) &&
848− xe_vm_in_preempt_fence_mode(q->vm)))
805+ if (XE_IOCTL_DBG(xe, value & ~DRM_XE_MULTI_GROUP_CREATE))
849806 return -EINVAL;
850807
851808 q->multi_queue.valid = true;
852809 q->multi_queue.is_primary = true;
853810 q->multi_queue.pos = 0;
854− if (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE)
855− q->multi_queue.keep_active = true;
856−
857811 return 0;
858812 }
859813
@@ -1419,11 +1373,6 @@ void xe_exec_queue_kill(struct xe_exec_queue *q) · 559 unmodified lines
14191373
14201374 q->ops->kill(q);
14211375 xe_vm_remove_compute_exec_queue(q->vm, q);
1422−
1423− if (!xe_exec_queue_is_multi_queue_primary(q) && q->multi_queue.keep_active) {
1424− xe_exec_queue_group_kill_put(q->multi_queue.group);
1425− q->multi_queue.keep_active = false;
1426− }
14271376 }
14281377
14291378 int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,
@@ -1450,10 +1399,7 @@ int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data, · 20 unmodified lines
14501399 if (q->vm && q->hwe->hw_engine_group)
14511400 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
14521401
1453− if (xe_exec_queue_is_multi_queue_primary(q))
1454− xe_exec_queue_group_kill_put(q->multi_queue.group);
1455− else
1456− xe_exec_queue_kill(q);
1402+ xe_exec_queue_kill(q);
14571403
14581404 trace_xe_exec_queue_close(q);
14591405 xe_exec_queue_put(q);
drivers/gpu/drm/xe/xe_exec_queue.h+0−2
@@ -113,8 +113,6 @@ static inline struct xe_exec_queue *xe_exec_queue_multi_queue_primary(struct xe_ · 112 unmodified lines
113113 return xe_exec_queue_is_multi_queue(q) ? q->multi_queue.group->primary : q;
114114 }
115115
116−void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group);
117−
118116 bool xe_exec_queue_is_lr(struct xe_exec_queue *q);
119117
120118 bool xe_exec_queue_is_idle(struct xe_exec_queue *q);
drivers/gpu/drm/xe/xe_exec_queue_types.h+0−4
@@ -62,8 +62,6 @@ struct xe_exec_queue_group { · 61 unmodified lines
6262 struct list_head list;
6363 /** @list_lock: Secondary queue list lock */
6464 struct mutex list_lock;
65− /** @kill_refcount: ref count to kill primary queue */
66− struct kref kill_refcount;
6765 /** @sync_pending: CGP_SYNC_DONE g2h response pending */
6866 bool sync_pending;
6967 /** @banned: Group banned */
@@ -163,8 +161,6 @@ struct xe_exec_queue { · 93 unmodified lines
163161 u8 valid:1;
164162 /** @multi_queue.is_primary: Is primary queue (Q0) of the group */
165163 u8 is_primary:1;
166− /** @multi_queue.keep_active: Keep the group active after primary is destroyed */
167− u8 keep_active:1;
168164 } multi_queue;
169165
170166 /** @sched_props: scheduling properties */
drivers/gpu/drm/xe/xe_execlist.c+1−2
@@ -15,8 +15,7 @@ · 14 unmodified lines
1515 #include "xe_bo.h"
1616 #include "xe_device.h"
1717 #include "xe_exec_queue.h"
18−#include "xe_gt.h"
19−#include "xe_hw_fence.h"
18+#include "xe_gt_types.h"
2019 #include "xe_irq.h"
2120 #include "xe_lrc.h"
2221 #include "xe_macros.h"
drivers/gpu/drm/xe/xe_ggtt.c+161−58
@@ -20,9 +20,8 @@ · 19 unmodified lines
2020 #include "regs/xe_regs.h"
2121 #include "xe_assert.h"
2222 #include "xe_bo.h"
23−#include "xe_device.h"
24−#include "xe_gt.h"
2523 #include "xe_gt_printk.h"
24+#include "xe_gt_types.h"
2625 #include "xe_map.h"
2726 #include "xe_mmio.h"
2827 #include "xe_pm.h"
@@ -67,6 +66,24 @@ · 38 unmodified lines
6766 * give us the correct placement for free.
6867 */
6968
69+/**
70+ * struct xe_ggtt_node - A node in GGTT.
71+ *
72+ * This struct needs to be initialized (only-once) with xe_ggtt_node_init() before any node
73+ * insertion, reservation, or 'ballooning'.
74+ * It will, then, be finalized by either xe_ggtt_node_remove() or xe_ggtt_node_deballoon().
75+ */
76+struct xe_ggtt_node {
77+ /** @ggtt: Back pointer to xe_ggtt where this region will be inserted at */
78+ struct xe_ggtt *ggtt;
79+ /** @base: A drm_mm_node */
80+ struct drm_mm_node base;
81+ /** @delayed_removal_work: The work struct for the delayed removal */
82+ struct work_struct delayed_removal_work;
83+ /** @invalidate_on_remove: If it needs invalidation upon removal */
84+ bool invalidate_on_remove;
85+};
86+
7087 static u64 xelp_ggtt_pte_flags(struct xe_bo *bo, u16 pat_index)
7188 {
7289 u64 pte = XE_PAGE_PRESENT;
@@ -137,10 +154,32 @@ static void ggtt_update_access_counter(struct xe_ggtt *ggtt) · 64 unmodified lines
137154 }
138155 }
139156
157+/**
158+ * xe_ggtt_start - Get starting offset of GGTT.
159+ * @ggtt: &xe_ggtt
160+ *
161+ * Returns: Starting offset for this &xe_ggtt.
162+ */
163+u64 xe_ggtt_start(struct xe_ggtt *ggtt)
164+{
165+ return ggtt->start;
166+}
167+
168+/**
169+ * xe_ggtt_size - Get size of GGTT.
170+ * @ggtt: &xe_ggtt
171+ *
172+ * Returns: Total usable size of this &xe_ggtt.
173+ */
174+u64 xe_ggtt_size(struct xe_ggtt *ggtt)
175+{
176+ return ggtt->size;
177+}
178+
140179 static void xe_ggtt_set_pte(struct xe_ggtt *ggtt, u64 addr, u64 pte)
141180 {
142181 xe_tile_assert(ggtt->tile, !(addr & XE_PTE_MASK));
143− xe_tile_assert(ggtt->tile, addr < ggtt->size);
182+ xe_tile_assert(ggtt->tile, addr < ggtt->start + ggtt->size);
144183
145184 writeq(pte, &ggtt->gsm[addr >> XE_PTE_SHIFT]);
146185 }
@@ -256,16 +295,16 @@ static const struct xe_ggtt_pt_ops xelpg_pt_wa_ops = { · 109 unmodified lines
256295 .ggtt_get_pte = xe_ggtt_get_pte,
257296 };
258297
259−static void __xe_ggtt_init_early(struct xe_ggtt *ggtt, u32 reserved)
298+static void __xe_ggtt_init_early(struct xe_ggtt *ggtt, u64 start, u64 size)
260299 {
261− drm_mm_init(&ggtt->mm, reserved,
262− ggtt->size - reserved);
300+ ggtt->start = start;
301+ ggtt->size = size;
302+ drm_mm_init(&ggtt->mm, start, size);
263303 }
264304
265−int xe_ggtt_init_kunit(struct xe_ggtt *ggtt, u32 reserved, u32 size)
305+int xe_ggtt_init_kunit(struct xe_ggtt *ggtt, u32 start, u32 size)
266306 {
267− ggtt->size = size;
268− __xe_ggtt_init_early(ggtt, reserved);
307+ __xe_ggtt_init_early(ggtt, start, size);
269308 return 0;
270309 }
271310 EXPORT_SYMBOL_IF_KUNIT(xe_ggtt_init_kunit);
@@ -293,26 +332,32 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt) · 21 unmodified lines
293332 struct xe_device *xe = tile_to_xe(ggtt->tile);
294333 struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
295334 unsigned int gsm_size;
335+ u64 ggtt_start, wopcm = xe_wopcm_size(xe), ggtt_size;
296336 int err;
297337
298− if (IS_SRIOV_VF(xe) || GRAPHICS_VERx100(xe) >= 1250)
299− gsm_size = SZ_8M; /* GGTT is expected to be 4GiB */
300− else
301− gsm_size = probe_gsm_size(pdev);
302−
303− if (gsm_size == 0) {
304− xe_tile_err(ggtt->tile, "Hardware reported no preallocated GSM\n");
305− return -ENOMEM;
338+ if (!IS_SRIOV_VF(xe)) {
339+ if (GRAPHICS_VERx100(xe) >= 1250)
340+ gsm_size = SZ_8M; /* GGTT is expected to be 4GiB */
341+ else
342+ gsm_size = probe_gsm_size(pdev);
343+ if (gsm_size == 0) {
344+ xe_tile_err(ggtt->tile, "Hardware reported no preallocated GSM\n");
345+ return -ENOMEM;
346+ }
347+ ggtt_start = wopcm;
348+ ggtt_size = (gsm_size / 8) * (u64)XE_PAGE_SIZE - ggtt_start;
349+ } else {
350+ /* GGTT is expected to be 4GiB */
351+ ggtt_start = wopcm;
352+ ggtt_size = SZ_4G - ggtt_start;
306353 }
307354
308355 ggtt->gsm = ggtt->tile->mmio.regs + SZ_8M;
309− ggtt->size = (gsm_size / 8) * (u64) XE_PAGE_SIZE;
310−
311356 if (IS_DGFX(xe) && xe->info.vram_flags & XE_VRAM_FLAGS_NEED64K)
312357 ggtt->flags |= XE_GGTT_FLAGS_64K;
313358
314− if (ggtt->size > GUC_GGTT_TOP)
315− ggtt->size = GUC_GGTT_TOP;
359+ if (ggtt_size + ggtt_start > GUC_GGTT_TOP)
360+ ggtt_size = GUC_GGTT_TOP - ggtt_start;
316361
317362 if (GRAPHICS_VERx100(xe) >= 1270)
318363 ggtt->pt_ops =
@@ -322,11 +367,11 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt) · 3 unmodified lines
322367 else
323368 ggtt->pt_ops = &xelp_pt_ops;
324369
325− ggtt->wq = alloc_workqueue("xe-ggtt-wq", 0, WQ_MEM_RECLAIM);
370+ ggtt->wq = alloc_workqueue("xe-ggtt-wq", WQ_MEM_RECLAIM, 0);
326371 if (!ggtt->wq)
327372 return -ENOMEM;
328373
329− __xe_ggtt_init_early(ggtt, xe_wopcm_size(xe));
374+ __xe_ggtt_init_early(ggtt, ggtt_start, ggtt_size);
330375
331376 err = drmm_add_action_or_reset(&xe->drm, ggtt_fini_early, ggtt);
332377 if (err)
@@ -563,11 +608,9 @@ void xe_ggtt_node_remove_balloon_locked(struct xe_ggtt_node *node) · 230 unmodified lines
563608 static void xe_ggtt_assert_fit(struct xe_ggtt *ggtt, u64 start, u64 size)
564609 {
565610 struct xe_tile *tile = ggtt->tile;
566− struct xe_device *xe = tile_to_xe(tile);
567− u64 __maybe_unused wopcm = xe_wopcm_size(xe);
568611
569− xe_tile_assert(tile, start >= wopcm);
570− xe_tile_assert(tile, start + size < ggtt->size - wopcm);
612+ xe_tile_assert(tile, start >= ggtt->start);
613+ xe_tile_assert(tile, start + size <= ggtt->start + ggtt->size);
571614 }
572615
573616 /**
@@ -610,20 +653,8 @@ void xe_ggtt_shift_nodes_locked(struct xe_ggtt *ggtt, s64 shift) · 36 unmodified lines
610653 }
611654 }
612655
613−/**
614− * xe_ggtt_node_insert_locked - Locked version to insert a &xe_ggtt_node into the GGTT
615− * @node: the &xe_ggtt_node to be inserted
616− * @size: size of the node
617− * @align: alignment constrain of the node
618− * @mm_flags: flags to control the node behavior
619− *
620− * It cannot be called without first having called xe_ggtt_init() once.
621− * To be used in cases where ggtt->lock is already taken.
622− *
623− * Return: 0 on success or a negative error code on failure.
624− */
625−int xe_ggtt_node_insert_locked(struct xe_ggtt_node *node,
626− u32 size, u32 align, u32 mm_flags)
656+static int xe_ggtt_node_insert_locked(struct xe_ggtt_node *node,
657+ u32 size, u32 align, u32 mm_flags)
627658 {
628659 return drm_mm_insert_node_generic(&node->ggtt->mm, &node->base, size, align, 0,
629660 mm_flags);
@@ -661,9 +692,11 @@ int xe_ggtt_node_insert(struct xe_ggtt_node *node, u32 size, u32 align) · 31 unmodified lines
661692 * This function will allocate the struct %xe_ggtt_node and return its pointer.
662693 * This struct will then be freed after the node removal upon xe_ggtt_node_remove()
663694 * or xe_ggtt_node_remove_balloon_locked().
664− * Having %xe_ggtt_node struct allocated doesn't mean that the node is already allocated
665− * in GGTT. Only the xe_ggtt_node_insert(), xe_ggtt_node_insert_locked(),
666− * xe_ggtt_node_insert_balloon_locked() will ensure the node is inserted or reserved in GGTT.
695+ *
696+ * Having %xe_ggtt_node struct allocated doesn't mean that the node is already
697+ * allocated in GGTT. Only xe_ggtt_node_insert(), allocation through
698+ * xe_ggtt_node_insert_transform(), or xe_ggtt_node_insert_balloon_locked() will ensure the node is inserted or reserved
699+ * in GGTT.
667700 *
668701 * Return: A pointer to %xe_ggtt_node struct on success. An ERR_PTR otherwise.
669702 **/
@@ -726,13 +759,12 @@ size_t xe_ggtt_node_pt_size(const struct xe_ggtt_node *node) · 56 unmodified lines
726759 * @ggtt: the &xe_ggtt where node will be mapped
727760 * @node: the &xe_ggtt_node where this BO is mapped
728761 * @bo: the &xe_bo to be mapped
729− * @pat_index: Which pat_index to use.
762+ * @pte: The pte flags to append.
730763 */
731−void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_ggtt_node *node,
732− struct xe_bo *bo, u16 pat_index)
764+static void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_ggtt_node *node,
765+ struct xe_bo *bo, u64 pte)
733766 {
734−
735− u64 start, pte, end;
767+ u64 start, end;
736768 struct xe_res_cursor cur;
737769
738770 if (XE_WARN_ON(!node))
@@ -741,7 +773,6 @@ void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_ggtt_node *node, · 2 unmodified lines
741773 start = node->base.start;
742774 end = start + xe_bo_size(bo);
743775
744− pte = ggtt->pt_ops->pte_encode_flags(bo, pat_index);
745776 if (!xe_bo_is_vram(bo) && !xe_bo_is_stolen(bo)) {
746777 xe_assert(xe_bo_device(bo), bo->ttm.ttm);
747778
@@ -771,12 +802,65 @@ void xe_ggtt_map_bo_unlocked(struct xe_ggtt *ggtt, struct xe_bo *bo) · 23 unmodified lines
771802 {
772803 u16 cache_mode = bo->flags & XE_BO_FLAG_NEEDS_UC ? XE_CACHE_NONE : XE_CACHE_WB;
773804 u16 pat_index = tile_to_xe(ggtt->tile)->pat.idx[cache_mode];
805+ u64 pte;
774806
775807 mutex_lock(&ggtt->lock);
776− xe_ggtt_map_bo(ggtt, bo->ggtt_node[ggtt->tile->id], bo, pat_index);
808+ pte = ggtt->pt_ops->pte_encode_flags(bo, pat_index);
809+ xe_ggtt_map_bo(ggtt, bo->ggtt_node[ggtt->tile->id], bo, pte);
777810 mutex_unlock(&ggtt->lock);
778811 }
779812
813+/**
814+ * xe_ggtt_node_insert_transform - Insert a newly allocated &xe_ggtt_node into the GGTT
815+ * @ggtt: the &xe_ggtt where the node will inserted/reserved.
816+ * @bo: The bo to be transformed
817+ * @pte_flags: The extra GGTT flags to add to mapping.
818+ * @size: size of the node
819+ * @align: required alignment for node
820+ * @transform: transformation function that will populate the GGTT node, or NULL for linear mapping.
821+ * @arg: Extra argument to pass to the transformation function.
822+ *
823+ * This function allows inserting a GGTT node with a custom transformation function.
824+ * This is useful for display to allow inserting rotated framebuffers to GGTT.
825+ *
826+ * Return: A pointer to %xe_ggtt_node struct on success. An ERR_PTR otherwise.
827+ */
828+struct xe_ggtt_node *xe_ggtt_node_insert_transform(struct xe_ggtt *ggtt,
829+ struct xe_bo *bo, u64 pte_flags,
830+ u64 size, u32 align,
831+ xe_ggtt_transform_cb transform, void *arg)
832+{
833+ struct xe_ggtt_node *node;
834+ int ret;
835+
836+ node = xe_ggtt_node_init(ggtt);
837+ if (IS_ERR(node))
838+ return ERR_CAST(node);
839+
840+ if (mutex_lock_interruptible(&ggtt->lock) < 0) {
841+ ret = -ERESTARTSYS;
842+ goto err;
843+ }
844+
845+ ret = xe_ggtt_node_insert_locked(node, size, align, 0);
846+ if (ret)
847+ goto err_unlock;
848+
849+ if (transform)
850+ transform(ggtt, node, pte_flags, ggtt->pt_ops->ggtt_set_pte, arg);
851+ else
852+ xe_ggtt_map_bo(ggtt, node, bo, pte_flags);
853+
854+ mutex_unlock(&ggtt->lock);
855+ return node;
856+
857+err_unlock:
858+ mutex_unlock(&ggtt->lock);
859+err:
860+ xe_ggtt_node_fini(node);
861+ return ERR_PTR(ret);
862+}
863+
780864 static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo,
781865 u64 start, u64 end, struct drm_exec *exec)
782866 {
@@ -815,8 +899,9 @@ static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo, · 32 unmodified lines
815899 } else {
816900 u16 cache_mode = bo->flags & XE_BO_FLAG_NEEDS_UC ? XE_CACHE_NONE : XE_CACHE_WB;
817901 u16 pat_index = tile_to_xe(ggtt->tile)->pat.idx[cache_mode];
902+ u64 pte = ggtt->pt_ops->pte_encode_flags(bo, pat_index);
818903
819− xe_ggtt_map_bo(ggtt, bo->ggtt_node[tile_id], bo, pat_index);
904+ xe_ggtt_map_bo(ggtt, bo->ggtt_node[tile_id], bo, pte);
820905 }
821906 mutex_unlock(&ggtt->lock);
822907
@@ -890,14 +975,12 @@ u64 xe_ggtt_largest_hole(struct xe_ggtt *ggtt, u64 alignment, u64 *spare) · 67 unmodified lines
890975 {
891976 const struct drm_mm *mm = &ggtt->mm;
892977 const struct drm_mm_node *entry;
893− u64 hole_min_start = xe_wopcm_size(tile_to_xe(ggtt->tile));
894978 u64 hole_start, hole_end, hole_size;
895979 u64 max_hole = 0;
896980
897981 mutex_lock(&ggtt->lock);
898−
899982 drm_mm_for_each_hole(entry, mm, hole_start, hole_end) {
900− hole_start = max(hole_start, hole_min_start);
983+ hole_start = max(hole_start, ggtt->start);
901984 hole_start = ALIGN(hole_start, alignment);
902985 hole_end = ALIGN_DOWN(hole_end, alignment);
903986 if (hole_start >= hole_end)
@@ -1069,15 +1152,13 @@ u64 xe_ggtt_print_holes(struct xe_ggtt *ggtt, u64 alignment, struct drm_printer · 165 unmodified lines
10691152 {
10701153 const struct drm_mm *mm = &ggtt->mm;
10711154 const struct drm_mm_node *entry;
1072− u64 hole_min_start = xe_wopcm_size(tile_to_xe(ggtt->tile));
10731155 u64 hole_start, hole_end, hole_size;
10741156 u64 total = 0;
10751157 char buf[10];
10761158
10771159 mutex_lock(&ggtt->lock);
1078−
10791160 drm_mm_for_each_hole(entry, mm, hole_start, hole_end) {
1080− hole_start = max(hole_start, hole_min_start);
1161+ hole_start = max(hole_start, ggtt->start);
10811162 hole_start = ALIGN(hole_start, alignment);
10821163 hole_end = ALIGN_DOWN(hole_end, alignment);
10831164 if (hole_start >= hole_end)
@@ -1121,3 +1202,25 @@ u64 xe_ggtt_read_pte(struct xe_ggtt *ggtt, u64 offset) · 37 unmodified lines
11211202 {
11221203 return ioread64(ggtt->gsm + (offset / XE_PAGE_SIZE));
11231204 }
1205+
1206+/**
1207+ * xe_ggtt_node_addr - Get @node offset in GGTT.
1208+ * @node: &xe_ggtt_node
1209+ *
1210+ * Get the GGTT offset for allocated node.
1211+ */
1212+u64 xe_ggtt_node_addr(const struct xe_ggtt_node *node)
1213+{
1214+ return node->base.start;
1215+}
1216+
1217+/**
1218+ * xe_ggtt_node_size - Get @node allocation size.
1219+ * @node: &xe_ggtt_node
1220+ *
1221+ * Get the allocated node's size.
1222+ */
1223+u64 xe_ggtt_node_size(const struct xe_ggtt_node *node)
1224+{
1225+ return node->base.size;
1226+}
drivers/gpu/drm/xe/xe_ggtt.h+10−4
@@ -23,15 +23,18 @@ int xe_ggtt_node_insert_balloon_locked(struct xe_ggtt_node *node, · 22 unmodified lines
2323 u64 start, u64 size);
2424 void xe_ggtt_node_remove_balloon_locked(struct xe_ggtt_node *node);
2525 void xe_ggtt_shift_nodes_locked(struct xe_ggtt *ggtt, s64 shift);
26+u64 xe_ggtt_start(struct xe_ggtt *ggtt);
27+u64 xe_ggtt_size(struct xe_ggtt *ggtt);
2628
2729 int xe_ggtt_node_insert(struct xe_ggtt_node *node, u32 size, u32 align);
28−int xe_ggtt_node_insert_locked(struct xe_ggtt_node *node,
29− u32 size, u32 align, u32 mm_flags);
30+struct xe_ggtt_node *
31+xe_ggtt_node_insert_transform(struct xe_ggtt *ggtt,
32+ struct xe_bo *bo, u64 pte,
33+ u64 size, u32 align,
34+ xe_ggtt_transform_cb transform, void *arg);
3035 void xe_ggtt_node_remove(struct xe_ggtt_node *node, bool invalidate);
3136 bool xe_ggtt_node_allocated(const struct xe_ggtt_node *node);
3237 size_t xe_ggtt_node_pt_size(const struct xe_ggtt_node *node);
33−void xe_ggtt_map_bo(struct xe_ggtt *ggtt, struct xe_ggtt_node *node,
34− struct xe_bo *bo, u16 pat_index);
3538 void xe_ggtt_map_bo_unlocked(struct xe_ggtt *ggtt, struct xe_bo *bo);
3639 int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo, struct drm_exec *exec);
3740 int xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo,
@@ -58,4 +61,7 @@ void xe_ggtt_might_lock(struct xe_ggtt *ggtt); · 20 unmodified lines
5861 u64 xe_ggtt_encode_pte_flags(struct xe_ggtt *ggtt, struct xe_bo *bo, u16 pat_index);
5962 u64 xe_ggtt_read_pte(struct xe_ggtt *ggtt, u64 offset);
6063
64+u64 xe_ggtt_node_addr(const struct xe_ggtt_node *node);
65+u64 xe_ggtt_node_size(const struct xe_ggtt_node *node);
66+
6167 #endif
drivers/gpu/drm/xe/xe_ggtt_types.h+12−20
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include "xe_pt_types.h"
1212
1313 struct xe_bo;
14+struct xe_ggtt_node;
1415 struct xe_gt;
1516
1617 /**
@@ -22,7 +23,9 @@ struct xe_gt; · 5 unmodified lines
2223 struct xe_ggtt {
2324 /** @tile: Back pointer to tile where this GGTT belongs */
2425 struct xe_tile *tile;
25− /** @size: Total size of this GGTT */
26+ /** @start: Start offset of GGTT */
27+ u64 start;
28+ /** @size: Total usable size of this GGTT */
2629 u64 size;
2730
2831 #define XE_GGTT_FLAGS_64K BIT(0)
@@ -51,24 +54,11 @@ struct xe_ggtt { · 22 unmodified lines
5154 struct workqueue_struct *wq;
5255 };
5356
54−/**
55− * struct xe_ggtt_node - A node in GGTT.
56− *
57− * This struct needs to be initialized (only-once) with xe_ggtt_node_init() before any node
58− * insertion, reservation, or 'ballooning'.
59− * It will, then, be finalized by either xe_ggtt_node_remove() or xe_ggtt_node_deballoon().
60− */
61−struct xe_ggtt_node {
62− /** @ggtt: Back pointer to xe_ggtt where this region will be inserted at */
63− struct xe_ggtt *ggtt;
64− /** @base: A drm_mm_node */
65− struct drm_mm_node base;
66− /** @delayed_removal_work: The work struct for the delayed removal */
67− struct work_struct delayed_removal_work;
68− /** @invalidate_on_remove: If it needs invalidation upon removal */
69− bool invalidate_on_remove;
70−};
71−
57+typedef void (*xe_ggtt_set_pte_fn)(struct xe_ggtt *ggtt, u64 addr, u64 pte);
58+typedef void (*xe_ggtt_transform_cb)(struct xe_ggtt *ggtt,
59+ struct xe_ggtt_node *node,
60+ u64 pte_flags,
61+ xe_ggtt_set_pte_fn set_pte, void *arg);
7262 /**
7363 * struct xe_ggtt_pt_ops - GGTT Page table operations
7464 * Which can vary from platform to platform.
@@ -76,8 +66,10 @@ struct xe_ggtt_node { · 1 unmodified line
7666 struct xe_ggtt_pt_ops {
7767 /** @pte_encode_flags: Encode PTE flags for a given BO */
7868 u64 (*pte_encode_flags)(struct xe_bo *bo, u16 pat_index);
69+
7970 /** @ggtt_set_pte: Directly write into GGTT's PTE */
80− void (*ggtt_set_pte)(struct xe_ggtt *ggtt, u64 addr, u64 pte);
71+ xe_ggtt_set_pte_fn ggtt_set_pte;
72+
8173 /** @ggtt_get_pte: Directly read from GGTT's PTE */
8274 u64 (*ggtt_get_pte)(struct xe_ggtt *ggtt, u64 addr);
8375 };
drivers/gpu/drm/xe/xe_gpu_scheduler.c+5−4
@@ -7,7 +7,7 @@ · 6 unmodified lines
77
88 static void xe_sched_process_msg_queue(struct xe_gpu_scheduler *sched)
99 {
10− if (!READ_ONCE(sched->base.pause_submit))
10+ if (!drm_sched_is_stopped(&sched->base))
1111 queue_work(sched->base.submit_wq, &sched->work_process_msg);
1212 }
1313
@@ -43,7 +43,7 @@ static void xe_sched_process_msg_work(struct work_struct *w) · 29 unmodified lines
4343 container_of(w, struct xe_gpu_scheduler, work_process_msg);
4444 struct xe_sched_msg *msg;
4545
46− if (READ_ONCE(sched->base.pause_submit))
46+ if (drm_sched_is_stopped(&sched->base))
4747 return;
4848
4949 msg = xe_sched_get_msg(sched);
@@ -77,6 +77,7 @@ int xe_sched_init(struct xe_gpu_scheduler *sched, · 27 unmodified lines
7777 };
7878
7979 sched->ops = xe_ops;
80+ spin_lock_init(&sched->msg_lock);
8081 INIT_LIST_HEAD(&sched->msgs);
8182 INIT_WORK(&sched->work_process_msg, xe_sched_process_msg_work);
8283
@@ -117,7 +118,7 @@ void xe_sched_add_msg(struct xe_gpu_scheduler *sched, · 34 unmodified lines
117118 void xe_sched_add_msg_locked(struct xe_gpu_scheduler *sched,
118119 struct xe_sched_msg *msg)
119120 {
120− lockdep_assert_held(&sched->base.job_list_lock);
121+ lockdep_assert_held(&sched->msg_lock);
121122
122123 list_add_tail(&msg->link, &sched->msgs);
123124 xe_sched_process_msg_queue(sched);
@@ -131,7 +132,7 @@ void xe_sched_add_msg_locked(struct xe_gpu_scheduler *sched, · 7 unmodified lines
131132 void xe_sched_add_msg_head(struct xe_gpu_scheduler *sched,
132133 struct xe_sched_msg *msg)
133134 {
134− lockdep_assert_held(&sched->base.job_list_lock);
135+ lockdep_assert_held(&sched->msg_lock);
135136
136137 list_add(&msg->link, &sched->msgs);
137138 xe_sched_process_msg_queue(sched);
drivers/gpu/drm/xe/xe_gpu_scheduler.h+9−28
@@ -33,12 +33,12 @@ void xe_sched_add_msg_head(struct xe_gpu_scheduler *sched, · 32 unmodified lines
3333
3434 static inline void xe_sched_msg_lock(struct xe_gpu_scheduler *sched)
3535 {
36− spin_lock(&sched->base.job_list_lock);
36+ spin_lock(&sched->msg_lock);
3737 }
3838
3939 static inline void xe_sched_msg_unlock(struct xe_gpu_scheduler *sched)
4040 {
41− spin_unlock(&sched->base.job_list_lock);
41+ spin_unlock(&sched->msg_lock);
4242 }
4343
4444 static inline void xe_sched_stop(struct xe_gpu_scheduler *sched)
@@ -56,12 +56,9 @@ static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched) · 11 unmodified lines
5656 struct drm_sched_job *s_job;
5757 bool restore_replay = false;
5858
59− list_for_each_entry(s_job, &sched->base.pending_list, list) {
60− struct drm_sched_fence *s_fence = s_job->s_fence;
61− struct dma_fence *hw_fence = s_fence->parent;
62−
59+ drm_sched_for_each_pending_job(s_job, &sched->base, NULL) {
6360 restore_replay |= to_xe_sched_job(s_job)->restore_replay;
64− if (restore_replay || (hw_fence && !dma_fence_is_signaled(hw_fence)))
61+ if (restore_replay || !drm_sched_job_is_signaled(s_job))
6562 sched->base.ops->run_job(s_job);
6663 }
6764 }
@@ -72,14 +69,6 @@ xe_sched_invalidate_job(struct xe_sched_job *job, int threshold) · 4 unmodified lines
7269 return drm_sched_invalidate_job(&job->drm, threshold);
7370 }
7471
75−static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
76− struct xe_sched_job *job)
77−{
78− spin_lock(&sched->base.job_list_lock);
79− list_add(&job->drm.list, &sched->base.pending_list);
80− spin_unlock(&sched->base.job_list_lock);
81−}
82−
8372 /**
8473 * xe_sched_first_pending_job() - Find first pending job which is unsignaled
8574 * @sched: Xe GPU scheduler
@@ -89,21 +78,13 @@ static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched, · 3 unmodified lines
8978 static inline
9079 struct xe_sched_job *xe_sched_first_pending_job(struct xe_gpu_scheduler *sched)
9180 {
92− struct xe_sched_job *job, *r_job = NULL;
93−
94− spin_lock(&sched->base.job_list_lock);
95− list_for_each_entry(job, &sched->base.pending_list, drm.list) {
96− struct drm_sched_fence *s_fence = job->drm.s_fence;
97− struct dma_fence *hw_fence = s_fence->parent;
81+ struct drm_sched_job *job;
9882
99− if (hw_fence && !dma_fence_is_signaled(hw_fence)) {
100− r_job = job;
101− break;
102− }
103− }
104− spin_unlock(&sched->base.job_list_lock);
83+ drm_sched_for_each_pending_job(job, &sched->base, NULL)
84+ if (!drm_sched_job_is_signaled(job))
85+ return to_xe_sched_job(job);
10586
106− return r_job;
87+ return NULL;
10788 }
10889
10990 static inline int
drivers/gpu/drm/xe/xe_gpu_scheduler_types.h+2−0
@@ -47,6 +47,8 @@ struct xe_gpu_scheduler { · 46 unmodified lines
4747 const struct xe_sched_backend_ops *ops;
4848 /** @msgs: list of messages to be processed in @work_process_msg */
4949 struct list_head msgs;
50+ /** @msg_lock: Message lock */
51+ spinlock_t msg_lock;
5052 /** @work_process_msg: processes messages */
5153 struct work_struct work_process_msg;
5254 };
drivers/gpu/drm/xe/xe_gsc.c+7−6
@@ -414,15 +414,16 @@ int xe_gsc_init(struct xe_gsc *gsc) · 413 unmodified lines
414414 }
415415
416416 /*
417− * Some platforms can have GuC but not GSC. That would cause
418− * xe_uc_fw_init(gsc) to return a "not supported" failure code and abort
419− * all firmware loading. So check for GSC being enabled before
420− * propagating the failure back up. That way the higher level will keep
421− * going and load GuC as appropriate.
417+ * Starting from BMG the GSC is no longer needed for MC6 entry, so the
418+ * only missing features if the FW is lacking would be the content
419+ * protection ones. This is acceptable, so we allow the driver load to
420+ * continue if the GSC FW is missing.
422421 */
423422 ret = xe_uc_fw_init(&gsc->fw);
424423 if (!xe_uc_fw_is_enabled(&gsc->fw))
425424 return 0;
425+ else if (gt_to_xe(gt)->info.platform >= XE_BATTLEMAGE && !xe_uc_fw_is_available(&gsc->fw))
426+ return 0;
426427 else if (ret)
427428 goto out;
428429
@@ -614,7 +615,7 @@ void xe_gsc_print_info(struct xe_gsc *gsc, struct drm_printer *p) · 185 unmodified lines
614615
615616 drm_printf(p, "\tfound security version %u\n", gsc->security_version);
616617
617− if (!xe_uc_fw_is_enabled(&gsc->fw))
618+ if (!xe_uc_fw_is_available(&gsc->fw))
618619 return;
619620
620621 CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GSC);
drivers/gpu/drm/xe/xe_gsc_debugfs.c+2−3
@@ -7,11 +7,10 @@ · 6 unmodified lines
77
88 #include <drm/drm_debugfs.h>
99 #include <drm/drm_managed.h>
10+#include <drm/drm_print.h>
1011
11−#include "xe_device.h"
12−#include "xe_gt.h"
12+#include "xe_gt_types.h"
1313 #include "xe_gsc.h"
14−#include "xe_macros.h"
1514 #include "xe_pm.h"
1615
1716 static struct xe_gt *
drivers/gpu/drm/xe/xe_gsc_proxy.c+1−1
@@ -18,8 +18,8 @@ · 17 unmodified lines
1818 #include "xe_force_wake.h"
1919 #include "xe_gsc.h"
2020 #include "xe_gsc_submit.h"
21−#include "xe_gt.h"
2221 #include "xe_gt_printk.h"
22+#include "xe_gt_types.h"
2323 #include "xe_map.h"
2424 #include "xe_mmio.h"
2525 #include "xe_pm.h"
drivers/gpu/drm/xe/xe_gsc_submit.c+0−2
@@ -11,12 +11,10 @@ · 10 unmodified lines
1111 #include "xe_assert.h"
1212 #include "xe_bb.h"
1313 #include "xe_exec_queue.h"
14−#include "xe_gt_printk.h"
1514 #include "xe_gt_types.h"
1615 #include "xe_map.h"
1716 #include "xe_sched_job.h"
1817 #include "instructions/xe_gsc_commands.h"
19−#include "regs/xe_gsc_regs.h"
2018
2119 #define GSC_HDR_SIZE (sizeof(struct intel_gsc_mtl_header)) /* shorthand define */
2220
drivers/gpu/drm/xe/xe_gt.c+32−2
@@ -13,13 +13,11 @@ · 12 unmodified lines
1313 #include <generated/xe_wa_oob.h>
1414
1515 #include "instructions/xe_alu_commands.h"
16−#include "instructions/xe_gfxpipe_commands.h"
1716 #include "instructions/xe_mi_commands.h"
1817 #include "regs/xe_engine_regs.h"
1918 #include "regs/xe_gt_regs.h"
2019 #include "xe_assert.h"
2120 #include "xe_bb.h"
22−#include "xe_bo.h"
2321 #include "xe_device.h"
2422 #include "xe_eu_stall.h"
2523 #include "xe_exec_queue.h"
@@ -140,6 +138,36 @@ static void xe_gt_disable_host_l2_vram(struct xe_gt *gt) · 114 unmodified lines
140138 xe_gt_mcr_multicast_write(gt, XE2_GAMREQSTRM_CTRL, reg);
141139 }
142140
141+static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt)
142+{
143+ struct xe_device *xe = gt_to_xe(gt);
144+ unsigned int fw_ref;
145+ u32 reg;
146+
147+ if (IS_SRIOV_VF(xe))
148+ return;
149+
150+ if (GRAPHICS_VER(xe) >= 30 && xe->info.has_flat_ccs) {
151+ fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
152+ if (!fw_ref)
153+ return;
154+
155+ reg = xe_gt_mcr_unicast_read_any(gt, XE2_GAMREQSTRM_CTRL);
156+ reg |= EN_CMP_1WCOH;
157+ xe_gt_mcr_multicast_write(gt, XE2_GAMREQSTRM_CTRL, reg);
158+
159+ if (xe_gt_is_media_type(gt)) {
160+ xe_mmio_rmw32(&gt->mmio, XE2_GAMWALK_CTRL_MEDIA, 0, EN_CMP_1WCOH_GW);
161+ } else {
162+ reg = xe_gt_mcr_unicast_read_any(gt, XE2_GAMWALK_CTRL_3D);
163+ reg |= EN_CMP_1WCOH_GW;
164+ xe_gt_mcr_multicast_write(gt, XE2_GAMWALK_CTRL_3D, reg);
165+ }
166+
167+ xe_force_wake_put(gt_to_fw(gt), fw_ref);
168+ }
169+}
170+
143171 static void gt_reset_worker(struct work_struct *w);
144172
145173 static int emit_job_sync(struct xe_exec_queue *q, struct xe_bb *bb,
@@ -466,6 +494,7 @@ static int gt_init_with_gt_forcewake(struct xe_gt *gt) · 320 unmodified lines
466494 xe_gt_topology_init(gt);
467495 xe_gt_mcr_init(gt);
468496 xe_gt_enable_host_l2_vram(gt);
497+ xe_gt_enable_comp_1wcoh(gt);
469498
470499 if (xe_gt_is_main_type(gt)) {
471500 err = xe_ggtt_init(gt_to_tile(gt)->mem.ggtt);
@@ -745,6 +774,7 @@ static int do_gt_restart(struct xe_gt *gt) · 273 unmodified lines
745774 xe_pat_init(gt);
746775
747776 xe_gt_enable_host_l2_vram(gt);
777+ xe_gt_enable_comp_1wcoh(gt);
748778
749779 xe_gt_mcr_set_implicit_defaults(gt);
750780 xe_reg_sr_apply_mmio(&gt->reg_sr, gt);
drivers/gpu/drm/xe/xe_gt_clock.c+1−5
@@ -8,12 +8,8 @@ · 7 unmodified lines
88 #include "xe_gt_clock.h"
99
1010 #include "regs/xe_gt_regs.h"
11−#include "regs/xe_regs.h"
12−#include "xe_assert.h"
13−#include "xe_device.h"
14−#include "xe_gt.h"
11+#include "xe_gt_types.h"
1512 #include "xe_gt_printk.h"
16−#include "xe_macros.h"
1713 #include "xe_mmio.h"
1814
1915 #define f19_2_mhz 19200000
drivers/gpu/drm/xe/xe_gt_debugfs.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include "xe_guc_hwconfig.h"
2323 #include "xe_hw_engine.h"
2424 #include "xe_lrc.h"
25−#include "xe_macros.h"
2625 #include "xe_mocs.h"
2726 #include "xe_pat.h"
2827 #include "xe_pm.h"
drivers/gpu/drm/xe/xe_gt_idle.c+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #include "xe_gt_sysfs.h"
1414 #include "xe_guc_pc.h"
1515 #include "regs/xe_gt_regs.h"
16−#include "xe_macros.h"
1716 #include "xe_mmio.h"
1817 #include "xe_pm.h"
1918 #include "xe_sriov.h"
drivers/gpu/drm/xe/xe_gt_mcr.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
77
88 #include "regs/xe_gt_regs.h"
99 #include "xe_assert.h"
10−#include "xe_gt.h"
1110 #include "xe_gt_printk.h"
1211 #include "xe_gt_topology.h"
1312 #include "xe_gt_types.h"
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c+10−11
@@ -24,13 +24,11 @@ · 23 unmodified lines
2424 #include "xe_guc_buf.h"
2525 #include "xe_guc_ct.h"
2626 #include "xe_guc_db_mgr.h"
27−#include "xe_guc_fwif.h"
2827 #include "xe_guc_id_mgr.h"
2928 #include "xe_guc_klv_helpers.h"
3029 #include "xe_guc_klv_thresholds_set.h"
3130 #include "xe_guc_submit.h"
3231 #include "xe_lmtt.h"
33−#include "xe_map.h"
3432 #include "xe_migrate.h"
3533 #include "xe_sriov.h"
3634 #include "xe_ttm_vram_mgr.h"
@@ -284,7 +282,7 @@ static u32 encode_config_ggtt(u32 *cfg, const struct xe_gt_sriov_config *config, · 247 unmodified lines
284282 if (!xe_ggtt_node_allocated(node))
285283 return 0;
286284
287− return encode_ggtt(cfg, node->base.start, node->base.size, details);
285+ return encode_ggtt(cfg, xe_ggtt_node_addr(node), xe_ggtt_node_size(node), details);
288286 }
289287
290288 static u32 encode_config_sched(struct xe_gt *gt, u32 *cfg, u32 n,
@@ -393,8 +391,8 @@ static int pf_push_full_vf_config(struct xe_gt *gt, unsigned int vfid) · 102 unmodified lines
393391 xe_gt_assert(gt, num_dwords <= max_cfg_dwords);
394392
395393 if (vfid == PFID) {
396− u64 ggtt_start = xe_wopcm_size(gt_to_xe(gt));
397− u64 ggtt_size = gt_to_tile(gt)->mem.ggtt->size - ggtt_start;
394+ u64 ggtt_start = xe_ggtt_start(gt_to_tile(gt)->mem.ggtt);
395+ u64 ggtt_size = xe_ggtt_size(gt_to_tile(gt)->mem.ggtt);
398396
399397 /* plain PF config data will never include a real GGTT region */
400398 xe_gt_assert(gt, !encode_config_ggtt(cfg + num_dwords, config, true));
@@ -545,9 +543,9 @@ static int pf_provision_vf_ggtt(struct xe_gt *gt, unsigned int vfid, u64 size) · 144 unmodified lines
545543
546544 xe_ggtt_assign(node, vfid);
547545 xe_gt_sriov_dbg_verbose(gt, "VF%u assigned GGTT %llx-%llx\n",
548− vfid, node->base.start, node->base.start + node->base.size - 1);
546+ vfid, xe_ggtt_node_addr(node), xe_ggtt_node_addr(node) + size - 1);
549547
550− err = pf_distribute_config_ggtt(gt->tile, vfid, node->base.start, node->base.size);
548+ err = pf_distribute_config_ggtt(gt->tile, vfid, xe_ggtt_node_addr(node), size);
551549 if (unlikely(err))
552550 goto err;
553551
@@ -564,7 +562,7 @@ static u64 pf_get_vf_config_ggtt(struct xe_gt *gt, unsigned int vfid) · 10 unmodified lines
564562 struct xe_ggtt_node *node = config->ggtt_region;
565563
566564 xe_gt_assert(gt, xe_gt_is_main_type(gt));
567− return xe_ggtt_node_allocated(node) ? node->base.size : 0;
565+ return xe_ggtt_node_allocated(node) ? xe_ggtt_node_size(node) : 0;
568566 }
569567
570568 /**
@@ -3040,11 +3038,12 @@ int xe_gt_sriov_pf_config_print_ggtt(struct xe_gt *gt, struct drm_printer *p) · 2469 unmodified lines
30403038 if (!xe_ggtt_node_allocated(config->ggtt_region))
30413039 continue;
30423040
3043− string_get_size(config->ggtt_region->base.size, 1, STRING_UNITS_2,
3041+ string_get_size(xe_ggtt_node_size(config->ggtt_region), 1, STRING_UNITS_2,
30443042 buf, sizeof(buf));
30453043 drm_printf(p, "VF%u:\t%#0llx-%#llx\t(%s)\n",
3046− n, config->ggtt_region->base.start,
3047− config->ggtt_region->base.start + config->ggtt_region->base.size - 1,
3044+ n, xe_ggtt_node_addr(config->ggtt_region),
3045+ xe_ggtt_node_addr(config->ggtt_region) +
3046+ xe_ggtt_node_size(config->ggtt_region) - 1,
30483047 buf);
30493048 }
30503049
drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c+0−1
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include <drm/drm_print.h>
99 #include <drm/drm_debugfs.h>
1010
11−#include "xe_bo.h"
1211 #include "xe_debugfs.h"
1312 #include "xe_device.h"
1413 #include "xe_gt.h"
drivers/gpu/drm/xe/xe_gt_sriov_pf_migration.c+1−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include "xe_gt_sriov_pf.h"
1515 #include "xe_gt_sriov_pf_config.h"
1616 #include "xe_gt_sriov_pf_control.h"
17−#include "xe_gt_sriov_pf_helpers.h"
1817 #include "xe_gt_sriov_pf_migration.h"
1918 #include "xe_gt_sriov_printk.h"
2019 #include "xe_guc.h"
@@ -25,6 +24,7 @@ · 4 unmodified lines
2524 #include "xe_sriov.h"
2625 #include "xe_sriov_packet.h"
2726 #include "xe_sriov_packet_types.h"
27+#include "xe_sriov_pf_helpers.h"
2828 #include "xe_sriov_pf_migration.h"
2929
3030 #define XE_GT_SRIOV_PF_MIGRATION_RING_SIZE 5
drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
77
88 #include "abi/guc_actions_sriov_abi.h"
99
10−#include "xe_bo.h"
1110 #include "xe_gt.h"
1211 #include "xe_gt_sriov_pf_helpers.h"
1312 #include "xe_gt_sriov_pf_policy.h"
drivers/gpu/drm/xe/xe_gt_sriov_pf_service.c+2−3
@@ -5,20 +5,19 @@ · 4 unmodified lines
55
66 #include <drm/drm_managed.h>
77
8−#include "abi/guc_actions_sriov_abi.h"
98 #include "abi/guc_relay_actions_abi.h"
109
1110 #include "regs/xe_gt_regs.h"
1211 #include "regs/xe_guc_regs.h"
13−#include "regs/xe_regs.h"
1412
13+#include "xe_assert.h"
1514 #include "xe_mmio.h"
1615 #include "xe_gt_sriov_printk.h"
17−#include "xe_gt_sriov_pf_helpers.h"
1816 #include "xe_gt_sriov_pf_service.h"
1917 #include "xe_gt_sriov_pf_service_types.h"
2018 #include "xe_guc_ct.h"
2119 #include "xe_guc_hxg_helpers.h"
20+#include "xe_sriov.h"
2221 #include "xe_sriov_pf_service.h"
2322
2423 static const struct xe_reg tgl_runtime_regs[] = {
drivers/gpu/drm/xe/xe_gt_sriov_vf.c+0−1
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 #include "abi/guc_klvs_abi.h"
1616 #include "abi/guc_relay_actions_abi.h"
1717 #include "regs/xe_gt_regs.h"
18−#include "regs/xe_gtt_defs.h"
1918
2019 #include "xe_assert.h"
2120 #include "xe_device.h"
drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h+2−2
@@ -43,10 +43,10 @@ struct xe_gt_sriov_vf_runtime { · 42 unmodified lines
4343 };
4444
4545 /**
46− * xe_gt_sriov_vf_migration - VF migration data.
46+ * struct xe_gt_sriov_vf_migration - VF migration data.
4747 */
4848 struct xe_gt_sriov_vf_migration {
49− /** @migration: VF migration recovery worker */
49+ /** @worker: VF migration recovery worker */
5050 struct work_struct worker;
5151 /** @lock: Protects recovery_queued, teardown */
5252 spinlock_t lock;
drivers/gpu/drm/xe/xe_gt_stats.c+6−1
@@ -7,8 +7,8 @@ · 6 unmodified lines
77
88 #include <drm/drm_print.h>
99
10−#include "xe_gt.h"
1110 #include "xe_gt_stats.h"
11+#include "xe_gt_types.h"
1212
1313 /**
1414 * xe_gt_stats_incr - Increments the specified stats counter
@@ -76,6 +76,11 @@ static const char *const stat_description[__XE_GT_STATS_NUM_IDS] = { · 61 unmodified lines
7676 "hw_engine_group_suspend_lr_queue_us"),
7777 DEF_STAT_STR(HW_ENGINE_GROUP_WAIT_DMA_QUEUE_US,
7878 "hw_engine_group_wait_dma_queue_us"),
79+ DEF_STAT_STR(PRL_4K_ENTRY_COUNT, "prl_4k_entry_count"),
80+ DEF_STAT_STR(PRL_64K_ENTRY_COUNT, "prl_64k_entry_count"),
81+ DEF_STAT_STR(PRL_2M_ENTRY_COUNT, "prl_2m_entry_count"),
82+ DEF_STAT_STR(PRL_ISSUED_COUNT, "prl_issued_count"),
83+ DEF_STAT_STR(PRL_ABORTED_COUNT, "prl_aborted_count"),
7984 };
8085
8186 /**
drivers/gpu/drm/xe/xe_gt_stats_types.h+5−0
@@ -49,6 +49,11 @@ enum xe_gt_stats_id { · 48 unmodified lines
4949 XE_GT_STATS_ID_HW_ENGINE_GROUP_WAIT_DMA_QUEUE_COUNT,
5050 XE_GT_STATS_ID_HW_ENGINE_GROUP_SUSPEND_LR_QUEUE_US,
5151 XE_GT_STATS_ID_HW_ENGINE_GROUP_WAIT_DMA_QUEUE_US,
52+ XE_GT_STATS_ID_PRL_4K_ENTRY_COUNT,
53+ XE_GT_STATS_ID_PRL_64K_ENTRY_COUNT,
54+ XE_GT_STATS_ID_PRL_2M_ENTRY_COUNT,
55+ XE_GT_STATS_ID_PRL_ISSUED_COUNT,
56+ XE_GT_STATS_ID_PRL_ABORTED_COUNT,
5257 /* must be the last entry */
5358 __XE_GT_STATS_NUM_IDS,
5459 };
drivers/gpu/drm/xe/xe_gt_sysfs.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010
1111 #include <drm/drm_managed.h>
1212
13−#include "xe_gt.h"
13+#include "xe_gt_types.h"
1414
1515 static void xe_gt_sysfs_kobj_release(struct kobject *kobj)
1616 {
drivers/gpu/drm/xe/xe_gt_throttle.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include <drm/drm_managed.h>
77
88 #include <regs/xe_gt_regs.h>
9−#include "xe_device.h"
9+#include "xe_device_types.h"
1010 #include "xe_gt.h"
1111 #include "xe_gt_sysfs.h"
1212 #include "xe_gt_throttle.h"
drivers/gpu/drm/xe/xe_guc_ads.c+9−9
@@ -28,8 +28,6 @@ · 27 unmodified lines
2828 #include "xe_lrc.h"
2929 #include "xe_map.h"
3030 #include "xe_mmio.h"
31−#include "xe_platform_types.h"
32−#include "xe_uc_fw.h"
3331 #include "xe_wa.h"
3432
3533 /* Slack of a few additional entries per engine */
@@ -451,7 +449,7 @@ static void guc_policies_init(struct xe_guc_ads *ads) · 415 unmodified lines
451449 ads_blob_write(ads, policies.max_num_work_items,
452450 GLOBAL_POLICY_MAX_NUM_WI);
453451
454− if (xe->wedged.mode == 2)
452+ if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
455453 global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
456454
457455 ads_blob_write(ads, policies.global_flags, global_flags);
@@ -983,16 +981,17 @@ static int guc_ads_action_update_policies(struct xe_guc_ads *ads, u32 policy_off · 525 unmodified lines
983981 /**
984982 * xe_guc_ads_scheduler_policy_toggle_reset - Toggle reset policy
985983 * @ads: Additional data structures object
984+ * @enable_engine_reset: true to enable engine resets, false otherwise
986985 *
987− * This function update the GuC's engine reset policy based on wedged.mode.
986+ * This function update the GuC's engine reset policy.
988987 *
989988 * Return: 0 on success, and negative error code otherwise.
990989 */
991−int xe_guc_ads_scheduler_policy_toggle_reset(struct xe_guc_ads *ads)
990+int xe_guc_ads_scheduler_policy_toggle_reset(struct xe_guc_ads *ads,
991+ bool enable_engine_reset)
992992 {
993993 struct guc_policies *policies;
994994 struct xe_guc *guc = ads_to_guc(ads);
995− struct xe_device *xe = ads_to_xe(ads);
996995 CLASS(xe_guc_buf, buf)(&guc->buf, sizeof(*policies));
997996
998997 if (!xe_guc_buf_is_valid(buf))
@@ -1004,10 +1003,11 @@ int xe_guc_ads_scheduler_policy_toggle_reset(struct xe_guc_ads *ads) · 5 unmodified lines
10041003 policies->dpc_promote_time = ads_blob_read(ads, policies.dpc_promote_time);
10051004 policies->max_num_work_items = ads_blob_read(ads, policies.max_num_work_items);
10061005 policies->is_valid = 1;
1007− if (xe->wedged.mode == 2)
1008− policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
1009− else
1006+
1007+ if (enable_engine_reset)
10101008 policies->global_flags &= ~GLOBAL_POLICY_DISABLE_ENGINE_RESET;
1009+ else
1010+ policies->global_flags |= GLOBAL_POLICY_DISABLE_ENGINE_RESET;
10111011
10121012 return guc_ads_action_update_policies(ads, xe_guc_buf_flush(buf));
10131013 }
drivers/gpu/drm/xe/xe_guc_ads.h+4−1
@@ -6,6 +6,8 @@ · 5 unmodified lines
66 #ifndef _XE_GUC_ADS_H_
77 #define _XE_GUC_ADS_H_
88
9+#include <linux/types.h>
10+
911 struct xe_guc_ads;
1012
1113 int xe_guc_ads_init(struct xe_guc_ads *ads);
@@ -13,6 +15,7 @@ int xe_guc_ads_init_post_hwconfig(struct xe_guc_ads *ads); · 1 unmodified line
1315 void xe_guc_ads_populate(struct xe_guc_ads *ads);
1416 void xe_guc_ads_populate_minimal(struct xe_guc_ads *ads);
1517 void xe_guc_ads_populate_post_load(struct xe_guc_ads *ads);
16−int xe_guc_ads_scheduler_policy_toggle_reset(struct xe_guc_ads *ads);
18+int xe_guc_ads_scheduler_policy_toggle_reset(struct xe_guc_ads *ads,
19+ bool enable_engine_reset);
1720
1821 #endif
drivers/gpu/drm/xe/xe_guc_buf.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/cleanup.h>
77 #include <drm/drm_managed.h>
88
9−#include "xe_assert.h"
109 #include "xe_bo.h"
1110 #include "xe_gt_printk.h"
1211 #include "xe_guc.h"
drivers/gpu/drm/xe/xe_guc_capture.c+9−5
@@ -13,17 +13,14 @@ · 12 unmodified lines
1313 #include "abi/guc_log_abi.h"
1414 #include "regs/xe_engine_regs.h"
1515 #include "regs/xe_gt_regs.h"
16−#include "regs/xe_guc_regs.h"
17−#include "regs/xe_regs.h"
1816
19−#include "xe_bo.h"
17+#include "xe_bo_types.h"
2018 #include "xe_device.h"
2119 #include "xe_exec_queue_types.h"
2220 #include "xe_gt.h"
2321 #include "xe_gt_mcr.h"
2422 #include "xe_gt_printk.h"
2523 #include "xe_guc.h"
26−#include "xe_guc_ads.h"
2724 #include "xe_guc_capture.h"
2825 #include "xe_guc_capture_types.h"
2926 #include "xe_guc_ct.h"
@@ -1889,7 +1886,14 @@ xe_guc_capture_get_matching_and_lock(struct xe_exec_queue *q) · 1859 unmodified lines
18891886 return NULL;
18901887
18911888 xe = gt_to_xe(q->gt);
1892− if (xe->wedged.mode >= 2 || !xe_device_uc_enabled(xe) || IS_SRIOV_VF(xe))
1889+
1890+ if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
1891+ return NULL;
1892+
1893+ if (!xe_device_uc_enabled(xe))
1894+ return NULL;
1895+
1896+ if (IS_SRIOV_VF(xe))
18931897 return NULL;
18941898
18951899 ss = &xe->devcoredump.snapshot;
drivers/gpu/drm/xe/xe_guc_debugfs.c+2−3
@@ -8,13 +8,12 @@ · 7 unmodified lines
88 #include <drm/drm_debugfs.h>
99 #include <drm/drm_managed.h>
1010
11−#include "xe_device.h"
12−#include "xe_gt.h"
11+#include "xe_device_types.h"
12+#include "xe_gt_types.h"
1313 #include "xe_guc.h"
1414 #include "xe_guc_ct.h"
1515 #include "xe_guc_log.h"
1616 #include "xe_guc_pc.h"
17−#include "xe_macros.h"
1817 #include "xe_pm.h"
1918
2019 /*
drivers/gpu/drm/xe/xe_guc_exec_queue_types.h+0−2
@@ -33,8 +33,6 @@ struct xe_guc_exec_queue { · 32 unmodified lines
3333 */
3434 #define MAX_STATIC_MSG_TYPE 3
3535 struct xe_sched_msg static_msgs[MAX_STATIC_MSG_TYPE];
36− /** @lr_tdr: long running TDR worker */
37− struct work_struct lr_tdr;
3836 /** @destroy_async: do final destroy async from this worker */
3937 struct work_struct destroy_async;
4038 /** @resume_time: time of last resume */
drivers/gpu/drm/xe/xe_guc_hwconfig.c+2−2
@@ -10,8 +10,8 @@ · 9 unmodified lines
1010
1111 #include "abi/guc_actions_abi.h"
1212 #include "xe_bo.h"
13−#include "xe_device.h"
14−#include "xe_gt.h"
13+#include "xe_device_types.h"
14+#include "xe_gt_types.h"
1515 #include "xe_guc.h"
1616 #include "xe_map.h"
1717
drivers/gpu/drm/xe/xe_guc_log.c+1−1
@@ -15,8 +15,8 @@ · 14 unmodified lines
1515 #include "xe_bo.h"
1616 #include "xe_devcoredump.h"
1717 #include "xe_force_wake.h"
18−#include "xe_gt.h"
1918 #include "xe_gt_printk.h"
19+#include "xe_gt_types.h"
2020 #include "xe_map.h"
2121 #include "xe_mmio.h"
2222 #include "xe_module.h"
drivers/gpu/drm/xe/xe_guc_relay.c+1−2
@@ -17,8 +17,7 @@ · 16 unmodified lines
1717 #include "abi/guc_relay_communication_abi.h"
1818
1919 #include "xe_assert.h"
20−#include "xe_device.h"
21−#include "xe_gt.h"
20+#include "xe_device_types.h"
2221 #include "xe_gt_sriov_printk.h"
2322 #include "xe_gt_sriov_pf_service.h"
2423 #include "xe_guc.h"
drivers/gpu/drm/xe/xe_guc_submit.c+61−316
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include "abi/guc_actions_abi.h"
1818 #include "abi/guc_actions_slpc_abi.h"
1919 #include "abi/guc_klvs_abi.h"
20−#include "regs/xe_lrc_layout.h"
2120 #include "xe_assert.h"
2221 #include "xe_bo.h"
2322 #include "xe_devcoredump.h"
@@ -36,7 +35,6 @@ · 12 unmodified lines
3635 #include "xe_guc_klv_helpers.h"
3736 #include "xe_guc_submit_types.h"
3837 #include "xe_hw_engine.h"
39−#include "xe_hw_fence.h"
4038 #include "xe_lrc.h"
4139 #include "xe_macros.h"
4240 #include "xe_map.h"
@@ -71,11 +69,8 @@ exec_queue_to_guc(struct xe_exec_queue *q) · 28 unmodified lines
7169 #define EXEC_QUEUE_STATE_KILLED (1 << 7)
7270 #define EXEC_QUEUE_STATE_WEDGED (1 << 8)
7371 #define EXEC_QUEUE_STATE_BANNED (1 << 9)
74−#define EXEC_QUEUE_STATE_CHECK_TIMEOUT (1 << 10)
75−#define EXEC_QUEUE_STATE_EXTRA_REF (1 << 11)
76−#define EXEC_QUEUE_STATE_PENDING_RESUME (1 << 12)
77−#define EXEC_QUEUE_STATE_PENDING_TDR_EXIT (1 << 13)
78−#define EXEC_QUEUE_STATE_IDLE_SKIP_SUSPEND (1 << 14)
72+#define EXEC_QUEUE_STATE_PENDING_RESUME (1 << 10)
73+#define EXEC_QUEUE_STATE_IDLE_SKIP_SUSPEND (1 << 11)
7974
8075 static bool exec_queue_registered(struct xe_exec_queue *q)
8176 {
@@ -207,36 +202,6 @@ static void set_exec_queue_wedged(struct xe_exec_queue *q) · 125 unmodified lines
207202 atomic_or(EXEC_QUEUE_STATE_WEDGED, &q->guc->state);
208203 }
209204
210−static bool exec_queue_check_timeout(struct xe_exec_queue *q)
211−{
212− return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_CHECK_TIMEOUT;
213−}
214−
215−static void set_exec_queue_check_timeout(struct xe_exec_queue *q)
216−{
217− atomic_or(EXEC_QUEUE_STATE_CHECK_TIMEOUT, &q->guc->state);
218−}
219−
220−static void clear_exec_queue_check_timeout(struct xe_exec_queue *q)
221−{
222− atomic_and(~EXEC_QUEUE_STATE_CHECK_TIMEOUT, &q->guc->state);
223−}
224−
225−static bool exec_queue_extra_ref(struct xe_exec_queue *q)
226−{
227− return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_EXTRA_REF;
228−}
229−
230−static void set_exec_queue_extra_ref(struct xe_exec_queue *q)
231−{
232− atomic_or(EXEC_QUEUE_STATE_EXTRA_REF, &q->guc->state);
233−}
234−
235−static void clear_exec_queue_extra_ref(struct xe_exec_queue *q)
236−{
237− atomic_and(~EXEC_QUEUE_STATE_EXTRA_REF, &q->guc->state);
238−}
239−
240205 static bool exec_queue_pending_resume(struct xe_exec_queue *q)
241206 {
242207 return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_PENDING_RESUME;
@@ -252,21 +217,6 @@ static void clear_exec_queue_pending_resume(struct xe_exec_queue *q) · 9 unmodified lines
252217 atomic_and(~EXEC_QUEUE_STATE_PENDING_RESUME, &q->guc->state);
253218 }
254219
255−static bool exec_queue_pending_tdr_exit(struct xe_exec_queue *q)
256−{
257− return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_PENDING_TDR_EXIT;
258−}
259−
260−static void set_exec_queue_pending_tdr_exit(struct xe_exec_queue *q)
261−{
262− atomic_or(EXEC_QUEUE_STATE_PENDING_TDR_EXIT, &q->guc->state);
263−}
264−
265−static void clear_exec_queue_pending_tdr_exit(struct xe_exec_queue *q)
266−{
267− atomic_and(~EXEC_QUEUE_STATE_PENDING_TDR_EXIT, &q->guc->state);
268−}
269−
270220 static bool exec_queue_idle_skip_suspend(struct xe_exec_queue *q)
271221 {
272222 return atomic_read(&q->guc->state) & EXEC_QUEUE_STATE_IDLE_SKIP_SUSPEND;
@@ -603,10 +553,7 @@ static void xe_guc_exec_queue_trigger_cleanup(struct xe_exec_queue *q) · 330 unmodified lines
603553 /** to wakeup xe_wait_user_fence ioctl if exec queue is reset */
604554 wake_up_all(&xe->ufence_wq);
605555
606− if (xe_exec_queue_is_lr(q))
607− queue_work(guc_to_gt(guc)->ordered_wq, &q->guc->lr_tdr);
608− else
609− xe_sched_tdr_queue_imm(&q->guc->sched);
556+ xe_sched_tdr_queue_imm(&q->guc->sched);
610557 }
611558
612559 static void xe_guc_exec_queue_group_trigger_cleanup(struct xe_exec_queue *q)
@@ -639,19 +586,19 @@ static void xe_guc_exec_queue_reset_trigger_cleanup(struct xe_exec_queue *q) · 26 unmodified lines
639586 WRITE_ONCE(group->banned, true);
640587
641588 set_exec_queue_reset(primary);
642− if (!exec_queue_banned(primary) && !exec_queue_check_timeout(primary))
589+ if (!exec_queue_banned(primary))
643590 xe_guc_exec_queue_trigger_cleanup(primary);
644591
645592 mutex_lock(&group->list_lock);
646593 list_for_each_entry(eq, &group->list, multi_queue.link) {
647594 set_exec_queue_reset(eq);
648− if (!exec_queue_banned(eq) && !exec_queue_check_timeout(eq))
595+ if (!exec_queue_banned(eq))
649596 xe_guc_exec_queue_trigger_cleanup(eq);
650597 }
651598 mutex_unlock(&group->list_lock);
652599 } else {
653600 set_exec_queue_reset(q);
654− if (!exec_queue_banned(q) && !exec_queue_check_timeout(q))
601+ if (!exec_queue_banned(q))
655602 xe_guc_exec_queue_trigger_cleanup(q);
656603 }
657604 }
@@ -994,14 +941,6 @@ static void register_exec_queue(struct xe_exec_queue *q, int ctx_type) · 336 unmodified lines
994941 parallel_write(xe, map, wq_desc.wq_status, WQ_STATUS_ACTIVE);
995942 }
996943
997− /*
998− * We must keep a reference for LR engines if engine is registered with
999− * the GuC as jobs signal immediately and can't destroy an engine if the
1000− * GuC has a reference to it.
1001− */
1002− if (xe_exec_queue_is_lr(q))
1003− xe_exec_queue_get(q);
1004−
1005944 set_exec_queue_registered(q);
1006945 trace_xe_exec_queue_register(q);
1007946 if (xe_exec_queue_is_multi_queue_primary(q))
@@ -1202,7 +1141,7 @@ guc_exec_queue_run_job(struct drm_sched_job *drm_job) · 194 unmodified lines
12021141 struct xe_sched_job *job = to_xe_sched_job(drm_job);
12031142 struct xe_exec_queue *q = job->q;
12041143 struct xe_guc *guc = exec_queue_to_guc(q);
1205− bool lr = xe_exec_queue_is_lr(q), killed_or_banned_or_wedged =
1144+ bool killed_or_banned_or_wedged =
12061145 exec_queue_killed_or_banned_or_wedged(q);
12071146
12081147 xe_gt_assert(guc_to_gt(guc), !(exec_queue_destroyed(q) || exec_queue_pending_disable(q)) ||
@@ -1232,14 +1171,6 @@ guc_exec_queue_run_job(struct drm_sched_job *drm_job) · 23 unmodified lines
12321171 }
12331172
12341173 run_job_out:
1235− /*
1236− * We don't care about job-fence ordering in LR VMs because these fences
1237− * are never exported; they are used solely to keep jobs on the pending
1238− * list. Once a queue enters an error state, there's no need to track
1239− * them.
1240− */
1241− if (killed_or_banned_or_wedged && lr)
1242− xe_sched_job_set_error(job, -ECANCELED);
12431174
12441175 return job->fence;
12451176 }
@@ -1291,8 +1222,7 @@ static void disable_scheduling_deregister(struct xe_guc *guc, · 45 unmodified lines
12911222 xe_gt_warn(q->gt, "Pending enable/disable failed to respond\n");
12921223 xe_sched_submission_start(sched);
12931224 xe_gt_reset_async(q->gt);
1294− if (!xe_exec_queue_is_lr(q))
1295− xe_sched_tdr_queue_imm(sched);
1225+ xe_sched_tdr_queue_imm(sched);
12961226 return;
12971227 }
12981228
@@ -1339,8 +1269,9 @@ void xe_guc_submit_wedge(struct xe_guc *guc) · 40 unmodified lines
13391269 err = devm_add_action_or_reset(guc_to_xe(guc)->drm.dev,
13401270 guc_submit_wedged_fini, guc);
13411271 if (err) {
1342− xe_gt_err(gt, "Failed to register clean-up on wedged.mode=2; "
1343− "Although device is wedged.\n");
1272+ xe_gt_err(gt, "Failed to register clean-up in wedged.mode=%s; "
1273+ "Although device is wedged.\n",
1274+ xe_wedged_mode_to_string(XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET));
13441275 return;
13451276 }
13461277
@@ -1355,7 +1286,7 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc) · 8 unmodified lines
13551286 {
13561287 struct xe_device *xe = guc_to_xe(guc);
13571288
1358− if (xe->wedged.mode != 2)
1289+ if (xe->wedged.mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
13591290 return false;
13601291
13611292 if (xe_device_wedged(xe))
@@ -1366,84 +1297,6 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc) · 4 unmodified lines
13661297 return true;
13671298 }
13681299
1369−static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w)
1370−{
1371− struct xe_guc_exec_queue *ge =
1372− container_of(w, struct xe_guc_exec_queue, lr_tdr);
1373− struct xe_exec_queue *q = ge->q;
1374− struct xe_guc *guc = exec_queue_to_guc(q);
1375− struct xe_gpu_scheduler *sched = &ge->sched;
1376− struct xe_sched_job *job;
1377− bool wedged = false;
1378−
1379− xe_gt_assert(guc_to_gt(guc), xe_exec_queue_is_lr(q));
1380−
1381− if (vf_recovery(guc))
1382− return;
1383−
1384− trace_xe_exec_queue_lr_cleanup(q);
1385−
1386− if (!exec_queue_killed(q))
1387− wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
1388−
1389− /* Kill the run_job / process_msg entry points */
1390− xe_sched_submission_stop(sched);
1391−
1392− /*
1393− * Engine state now mostly stable, disable scheduling / deregister if
1394− * needed. This cleanup routine might be called multiple times, where
1395− * the actual async engine deregister drops the final engine ref.
1396− * Calling disable_scheduling_deregister will mark the engine as
1397− * destroyed and fire off the CT requests to disable scheduling /
1398− * deregister, which we only want to do once. We also don't want to mark
1399− * the engine as pending_disable again as this may race with the
1400− * xe_guc_deregister_done_handler() which treats it as an unexpected
1401− * state.
1402− */
1403− if (!wedged && exec_queue_registered(q) && !exec_queue_destroyed(q)) {
1404− struct xe_guc *guc = exec_queue_to_guc(q);
1405− int ret;
1406−
1407− set_exec_queue_banned(q);
1408− disable_scheduling_deregister(guc, q);
1409−
1410− /*
1411− * Must wait for scheduling to be disabled before signalling
1412− * any fences, if GT broken the GT reset code should signal us.
1413− */
1414− ret = wait_event_timeout(guc->ct.wq,
1415− !exec_queue_pending_disable(q) ||
1416− xe_guc_read_stopped(guc) ||
1417− vf_recovery(guc), HZ * 5);
1418− if (vf_recovery(guc))
1419− return;
1420−
1421− if (!ret) {
1422− xe_gt_warn(q->gt, "Schedule disable failed to respond, guc_id=%d\n",
1423− q->guc->id);
1424− xe_devcoredump(q, NULL, "Schedule disable failed to respond, guc_id=%d\n",
1425− q->guc->id);
1426− xe_sched_submission_start(sched);
1427− xe_gt_reset_async(q->gt);
1428− return;
1429− }
1430− }
1431−
1432− if (!exec_queue_killed(q) && !xe_lrc_ring_is_idle(q->lrc[0]))
1433− xe_devcoredump(q, NULL, "LR job cleanup, guc_id=%d", q->guc->id);
1434−
1435− xe_hw_fence_irq_stop(q->fence_irq);
1436−
1437− xe_sched_submission_start(sched);
1438−
1439− spin_lock(&sched->base.job_list_lock);
1440− list_for_each_entry(job, &sched->base.pending_list, drm.list)
1441− xe_sched_job_set_error(job, -ECANCELED);
1442− spin_unlock(&sched->base.job_list_lock);
1443−
1444− xe_hw_fence_irq_start(q->fence_irq);
1445−}
1446−
14471300 #define ADJUST_FIVE_PERCENT(__t) mul_u64_u32_div(__t, 105, 100)
14481301
14491302 static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
@@ -1462,7 +1315,16 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job) · 12 unmodified lines
14621315 return xe_sched_invalidate_job(job, 2);
14631316 }
14641317
1465− ctx_timestamp = lower_32_bits(xe_lrc_ctx_timestamp(q->lrc[0]));
1318+ ctx_timestamp = lower_32_bits(xe_lrc_timestamp(q->lrc[0]));
1319+ if (ctx_timestamp == job->sample_timestamp) {
1320+ xe_gt_warn(gt, "Check job timeout: seqno=%u, lrc_seqno=%u, guc_id=%d, timestamp stuck",
1321+ xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job),
1322+ q->guc->id);
1323+
1324+ return xe_sched_invalidate_job(job, 0);
1325+ }
1326+
1327+ job->sample_timestamp = ctx_timestamp;
14661328 ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
14671329
14681330 /*
@@ -1516,8 +1378,7 @@ static void enable_scheduling(struct xe_exec_queue *q) · 47 unmodified lines
15161378 xe_gt_warn(guc_to_gt(guc), "Schedule enable failed to respond");
15171379 set_exec_queue_banned(q);
15181380 xe_gt_reset_async(q->gt);
1519− if (!xe_exec_queue_is_lr(q))
1520− xe_sched_tdr_queue_imm(&q->guc->sched);
1381+ xe_sched_tdr_queue_imm(&q->guc->sched);
15211382 }
15221383 }
15231384
@@ -1543,33 +1404,11 @@ static void disable_scheduling(struct xe_exec_queue *q, bool immediate) · 19 unmodified lines
15431404 G2H_LEN_DW_SCHED_CONTEXT_MODE_SET, 1);
15441405 }
15451406
1546−static void __deregister_exec_queue(struct xe_guc *guc, struct xe_exec_queue *q)
1547−{
1548− u32 action[] = {
1549− XE_GUC_ACTION_DEREGISTER_CONTEXT,
1550− q->guc->id,
1551− };
1552−
1553− xe_gt_assert(guc_to_gt(guc), !exec_queue_destroyed(q));
1554− xe_gt_assert(guc_to_gt(guc), exec_queue_registered(q));
1555− xe_gt_assert(guc_to_gt(guc), !exec_queue_pending_enable(q));
1556− xe_gt_assert(guc_to_gt(guc), !exec_queue_pending_disable(q));
1557−
1558− set_exec_queue_destroyed(q);
1559− trace_xe_exec_queue_deregister(q);
1560−
1561− if (xe_exec_queue_is_multi_queue_secondary(q))
1562− handle_deregister_done(guc, q);
1563− else
1564− xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action),
1565− G2H_LEN_DW_DEREGISTER_CONTEXT, 1);
1566−}
1567−
15681407 static enum drm_gpu_sched_stat
15691408 guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
15701409 {
15711410 struct xe_sched_job *job = to_xe_sched_job(drm_job);
1572− struct xe_sched_job *tmp_job;
1411+ struct drm_sched_job *tmp_job;
15731412 struct xe_exec_queue *q = job->q;
15741413 struct xe_gpu_scheduler *sched = &q->guc->sched;
15751414 struct xe_guc *guc = exec_queue_to_guc(q);
@@ -1577,10 +1416,9 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 1 unmodified line
15771416 struct xe_device *xe = guc_to_xe(guc);
15781417 int err = -ETIME;
15791418 pid_t pid = -1;
1580− int i = 0;
15811419 bool wedged = false, skip_timeout_check;
15821420
1583− xe_gt_assert(guc_to_gt(guc), !xe_exec_queue_is_lr(q));
1421+ xe_gt_assert(guc_to_gt(guc), !exec_queue_destroyed(q));
15841422
15851423 /*
15861424 * TDR has fired before free job worker. Common if exec queue
@@ -1597,14 +1435,17 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 10 unmodified lines
15971435
15981436 /* Must check all state after stopping scheduler */
15991437 skip_timeout_check = exec_queue_reset(q) ||
1600− exec_queue_killed_or_banned_or_wedged(q) ||
1601− exec_queue_destroyed(q);
1438+ exec_queue_killed_or_banned_or_wedged(q);
16021439
16031440 /* Skip timeout check if multi-queue group is banned */
16041441 if (xe_exec_queue_is_multi_queue(q) &&
16051442 READ_ONCE(q->multi_queue.group->banned))
16061443 skip_timeout_check = true;
16071444
1445+ /* LR jobs can only get here if queue has been killed or hit an error */
1446+ if (xe_exec_queue_is_lr(q))
1447+ xe_gt_assert(guc_to_gt(guc), skip_timeout_check);
1448+
16081449 /*
16091450 * FIXME: In multi-queue scenario, the TDR must ensure that the whole
16101451 * multi-queue group is off the HW before signaling the fences to avoid
@@ -1628,23 +1469,24 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 17 unmodified lines
16281469 }
16291470
16301471 /*
1631− * XXX: Sampling timeout doesn't work in wedged mode as we have to
1632− * modify scheduling state to read timestamp. We could read the
1633− * timestamp from a register to accumulate current running time but this
1634− * doesn't work for SRIOV. For now assuming timeouts in wedged mode are
1635− * genuine timeouts.
1472+ * Check if job is actually timed out, if so restart job execution and TDR
16361473 */
1474+ if (!skip_timeout_check && !check_timeout(q, job))
1475+ goto rearm;
1476+
16371477 if (!exec_queue_killed(q))
16381478 wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
16391479
1640− /* Engine state now stable, disable scheduling to check timestamp */
1641− if (!wedged && exec_queue_registered(q)) {
1480+ set_exec_queue_banned(q);
1481+
1482+ /* Kick job / queue off hardware */
1483+ if (!wedged && (exec_queue_enabled(q) || exec_queue_pending_disable(q))) {
16421484 int ret;
16431485
16441486 if (exec_queue_reset(q))
16451487 err = -EIO;
16461488
1647− if (!exec_queue_destroyed(q)) {
1489+ if (xe_uc_fw_is_running(&guc->fw)) {
16481490 /*
16491491 * Wait for any pending G2H to flush out before
16501492 * modifying state
@@ -1659,13 +1501,6 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 8 unmodified lines
16591501 if (!ret || xe_guc_read_stopped(guc))
16601502 goto trigger_reset;
16611503
1662− /*
1663− * Flag communicates to G2H handler that schedule
1664− * disable originated from a timeout check. The G2H then
1665− * avoid triggering cleanup or deregistering the exec
1666− * queue.
1667− */
1668− set_exec_queue_check_timeout(q);
16691504 disable_scheduling(q, skip_timeout_check);
16701505 }
16711506
@@ -1679,6 +1514,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job) · 7 unmodified lines
16791514 */
16801515 smp_rmb();
16811516 ret = wait_event_timeout(guc->ct.wq,
1517+ !xe_uc_fw_is_running(&guc->fw) ||
16821518 !exec_queue_pending_disable(q) ||
16831519 xe_guc_read_stopped(guc) ||
16841520 vf_recovery(guc), HZ * 5);
@@ -1693,24 +1529,12 @@ trigger_reset: · 8 unmodified lines
16931529 xe_devcoredump(q, job,
16941530 "Schedule disable failed to respond, guc_id=%d, ret=%d, guc_read=%d",
16951531 q->guc->id, ret, xe_guc_read_stopped(guc));
1696− set_exec_queue_extra_ref(q);
1697− xe_exec_queue_get(q); /* GT reset owns this */
1698− set_exec_queue_banned(q);
16991532 xe_gt_reset_async(q->gt);
17001533 xe_sched_tdr_queue_imm(sched);
17011534 goto rearm;
17021535 }
17031536 }
17041537
1705− /*
1706− * Check if job is actually timed out, if so restart job execution and TDR
1707− */
1708− if (!wedged && !skip_timeout_check && !check_timeout(q, job) &&
1709− !exec_queue_reset(q) && exec_queue_registered(q)) {
1710− clear_exec_queue_check_timeout(q);
1711− goto sched_enable;
1712− }
1713−
17141538 if (q->vm && q->vm->xef) {
17151539 process_name = q->vm->xef->process_name;
17161540 pid = q->vm->xef->pid;
@@ -1741,28 +1565,16 @@ trigger_reset: · 24 unmodified lines
17411565 if (!wedged && (q->flags & EXEC_QUEUE_FLAG_KERNEL ||
17421566 (q->flags & EXEC_QUEUE_FLAG_VM && !exec_queue_killed(q)))) {
17431567 if (!xe_sched_invalidate_job(job, 2)) {
1744− clear_exec_queue_check_timeout(q);
17451568 xe_gt_reset_async(q->gt);
17461569 goto rearm;
17471570 }
17481571 }
17491572
1750− /* Finish cleaning up exec queue via deregister */
1751− set_exec_queue_banned(q);
1752− if (!wedged && exec_queue_registered(q) && !exec_queue_destroyed(q)) {
1753− set_exec_queue_extra_ref(q);
1754− xe_exec_queue_get(q);
1755− __deregister_exec_queue(guc, q);
1756− }
1757−
1758− /* Stop fence signaling */
1759− xe_hw_fence_irq_stop(q->fence_irq);
1573+ /* Mark all outstanding jobs as bad, thus completing them */
1574+ xe_sched_job_set_error(job, err);
1575+ drm_sched_for_each_pending_job(tmp_job, &sched->base, NULL)
1576+ xe_sched_job_set_error(to_xe_sched_job(tmp_job), -ECANCELED);
17601577
1761− /*
1762− * Fence state now stable, stop / start scheduler which cleans up any
1763− * fences that are complete
1764− */
1765− xe_sched_add_pending_job(sched, job);
17661578 xe_sched_submission_start(sched);
17671579
17681580 if (xe_exec_queue_is_multi_queue(q))
@@ -1770,20 +1582,12 @@ trigger_reset: · 1 unmodified line
17701582 else
17711583 xe_guc_exec_queue_trigger_cleanup(q);
17721584
1773− /* Mark all outstanding jobs as bad, thus completing them */
1774− spin_lock(&sched->base.job_list_lock);
1775− list_for_each_entry(tmp_job, &sched->base.pending_list, drm.list)
1776− xe_sched_job_set_error(tmp_job, !i++ ? err : -ECANCELED);
1777− spin_unlock(&sched->base.job_list_lock);
1778−
1779− /* Start fence signaling */
1780− xe_hw_fence_irq_start(q->fence_irq);
1781−
1782− return DRM_GPU_SCHED_STAT_RESET;
1585+ /*
1586+ * We want the job added back to the pending list so it gets freed; this
1587+ * is what DRM_GPU_SCHED_STAT_NO_HANG does.
1588+ */
1589+ return DRM_GPU_SCHED_STAT_NO_HANG;
17831590
1784−sched_enable:
1785− set_exec_queue_pending_tdr_exit(q);
1786− enable_scheduling(q);
17871591 rearm:
17881592 /*
17891593 * XXX: Ideally want to adjust timeout based on current execution time
@@ -1829,8 +1633,6 @@ static void __guc_exec_queue_destroy_async(struct work_struct *w) · 39 unmodified lines
18291633 mutex_unlock(&group->list_lock);
18301634 }
18311635
1832− if (xe_exec_queue_is_lr(q))
1833− cancel_work_sync(&ge->lr_tdr);
18341636 /* Confirm no work left behind accessing device structures */
18351637 cancel_delayed_work_sync(&ge->sched.base.work_tdr);
18361638
@@ -2134,9 +1936,6 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) · 297 unmodified lines
21341936 if (err)
21351937 goto err_sched;
21361938
2137− if (xe_exec_queue_is_lr(q))
2138− INIT_WORK(&q->guc->lr_tdr, xe_guc_exec_queue_lr_cleanup);
2139−
21401939 mutex_lock(&guc->submission_state.lock);
21411940
21421941 err = alloc_guc_id(guc, q);
@@ -2432,9 +2231,7 @@ static void guc_exec_queue_stop(struct xe_guc *guc, struct xe_exec_queue *q) · 289 unmodified lines
24322231
24332232 /* Clean up lost G2H + reset engine state */
24342233 if (exec_queue_registered(q)) {
2435− if (exec_queue_extra_ref(q) || xe_exec_queue_is_lr(q))
2436− xe_exec_queue_put(q);
2437− else if (exec_queue_destroyed(q))
2234+ if (exec_queue_destroyed(q))
24382235 __guc_exec_queue_destroy(guc, q);
24392236 }
24402237 if (q->guc->suspend_pending) {
@@ -2464,9 +2261,6 @@ static void guc_exec_queue_stop(struct xe_guc *guc, struct xe_exec_queue *q) · 23 unmodified lines
24642261 trace_xe_sched_job_ban(job);
24652262 ban = true;
24662263 }
2467− } else if (xe_exec_queue_is_lr(q) &&
2468− !xe_lrc_ring_is_idle(q->lrc[0])) {
2469− ban = true;
24702264 }
24712265
24722266 if (ban) {
@@ -2546,11 +2340,8 @@ static void guc_exec_queue_revert_pending_state_change(struct xe_guc *guc, · 73 unmodified lines
25462340 q->guc->id);
25472341 }
25482342
2549− if (pending_enable && !pending_resume &&
2550− !exec_queue_pending_tdr_exit(q)) {
2343+ if (pending_enable && !pending_resume) {
25512344 clear_exec_queue_registered(q);
2552− if (xe_exec_queue_is_lr(q))
2553− xe_exec_queue_put(q);
25542345 xe_gt_dbg(guc_to_gt(guc), "Replay REGISTER - guc_id=%d",
25552346 q->guc->id);
25562347 }
@@ -2558,7 +2349,6 @@ static void guc_exec_queue_revert_pending_state_change(struct xe_guc *guc, · 1 unmodified line
25582349 if (pending_enable) {
25592350 clear_exec_queue_enabled(q);
25602351 clear_exec_queue_pending_resume(q);
2561− clear_exec_queue_pending_tdr_exit(q);
25622352 clear_exec_queue_pending_enable(q);
25632353 xe_gt_dbg(guc_to_gt(guc), "Replay ENABLE - guc_id=%d",
25642354 q->guc->id);
@@ -2566,11 +2356,7 @@ static void guc_exec_queue_revert_pending_state_change(struct xe_guc *guc, · 1 unmodified line
25662356
25672357 if (exec_queue_destroyed(q) && exec_queue_registered(q)) {
25682358 clear_exec_queue_destroyed(q);
2569− if (exec_queue_extra_ref(q))
2570− xe_exec_queue_put(q);
2571− else
2572− q->guc->needs_cleanup = true;
2573− clear_exec_queue_extra_ref(q);
2359+ q->guc->needs_cleanup = true;
25742360 xe_gt_dbg(guc_to_gt(guc), "Replay CLEANUP - guc_id=%d",
25752361 q->guc->id);
25762362 }
@@ -2588,7 +2374,6 @@ static void guc_exec_queue_revert_pending_state_change(struct xe_guc *guc, · 11 unmodified lines
25882374 if (!pending_enable)
25892375 set_exec_queue_enabled(q);
25902376 clear_exec_queue_pending_disable(q);
2591− clear_exec_queue_check_timeout(q);
25922377 xe_gt_dbg(guc_to_gt(guc), "Replay DISABLE - guc_id=%d",
25932378 q->guc->id);
25942379 }
@@ -2623,10 +2408,7 @@ static void guc_exec_queue_pause(struct xe_guc *guc, struct xe_exec_queue *q) · 28 unmodified lines
26232408
26242409 /* Stop scheduling + flush any DRM scheduler operations */
26252410 xe_sched_submission_stop(sched);
2626− if (xe_exec_queue_is_lr(q))
2627− cancel_work_sync(&q->guc->lr_tdr);
2628− else
2629− cancel_delayed_work_sync(&sched->base.work_tdr);
2411+ cancel_delayed_work_sync(&sched->base.work_tdr);
26302412
26312413 guc_exec_queue_revert_pending_state_change(guc, q);
26322414
@@ -2753,11 +2535,12 @@ static void guc_exec_queue_unpause_prepare(struct xe_guc *guc, · 120 unmodified lines
27532535 struct xe_exec_queue *q)
27542536 {
27552537 struct xe_gpu_scheduler *sched = &q->guc->sched;
2756− struct xe_sched_job *job = NULL, *__job;
2538+ struct xe_sched_job *job = NULL;
2539+ struct drm_sched_job *s_job;
27572540 bool restore_replay = false;
27582541
2759− list_for_each_entry(__job, &sched->base.pending_list, drm.list) {
2760− job = __job;
2542+ drm_sched_for_each_pending_job(s_job, &sched->base, NULL) {
2543+ job = to_xe_sched_job(s_job);
27612544 restore_replay |= job->restore_replay;
27622545 if (restore_replay) {
27632546 xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d",
@@ -2881,7 +2664,7 @@ void xe_guc_submit_unpause_vf(struct xe_guc *guc) · 117 unmodified lines
28812664 * created after resfix done.
28822665 */
28832666 if (q->guc->id != index ||
2884− !READ_ONCE(q->guc->sched.base.pause_submit))
2667+ !drm_sched_is_stopped(&q->guc->sched.base))
28852668 continue;
28862669
28872670 guc_exec_queue_unpause(guc, q);
@@ -2967,13 +2750,10 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q, · 79 unmodified lines
29672750
29682751 q->guc->resume_time = ktime_get();
29692752 clear_exec_queue_pending_resume(q);
2970− clear_exec_queue_pending_tdr_exit(q);
29712753 clear_exec_queue_pending_enable(q);
29722754 smp_wmb();
29732755 wake_up_all(&guc->ct.wq);
29742756 } else {
2975− bool check_timeout = exec_queue_check_timeout(q);
2976−
29772757 xe_gt_assert(guc_to_gt(guc), runnable_state == 0);
29782758 xe_gt_assert(guc_to_gt(guc), exec_queue_pending_disable(q));
29792759
@@ -2981,11 +2761,11 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q, · 1 unmodified line
29812761 suspend_fence_signal(q);
29822762 clear_exec_queue_pending_disable(q);
29832763 } else {
2984− if (exec_queue_banned(q) || check_timeout) {
2764+ if (exec_queue_banned(q)) {
29852765 smp_wmb();
29862766 wake_up_all(&guc->ct.wq);
29872767 }
2988− if (!check_timeout && exec_queue_destroyed(q)) {
2768+ if (exec_queue_destroyed(q)) {
29892769 /*
29902770 * Make sure to clear the pending_disable only
29912771 * after sampling the destroyed state. We want
@@ -3048,11 +2828,7 @@ static void handle_deregister_done(struct xe_guc *guc, struct xe_exec_queue *q) · 56 unmodified lines
30482828 trace_xe_exec_queue_deregister_done(q);
30492829
30502830 clear_exec_queue_registered(q);
3051−
3052− if (exec_queue_extra_ref(q) || xe_exec_queue_is_lr(q))
3053− xe_exec_queue_put(q);
3054− else
3055− __guc_exec_queue_destroy(guc, q);
2831+ __guc_exec_queue_destroy(guc, q);
30562832 }
30572833
30582834 int xe_guc_deregister_done_handler(struct xe_guc *guc, u32 *msg, u32 len)
@@ -3386,29 +3162,6 @@ xe_guc_exec_queue_snapshot_capture(struct xe_exec_queue *q) · 327 unmodified lines
33863162 snapshot->multi_queue.primary = xe_exec_queue_multi_queue_primary(q)->guc->id;
33873163 snapshot->multi_queue.pos = q->multi_queue.pos;
33883164 }
3389− spin_lock(&sched->base.job_list_lock);
3390− snapshot->pending_list_size = list_count_nodes(&sched->base.pending_list);
3391− snapshot->pending_list = kmalloc_array(snapshot->pending_list_size,
3392− sizeof(struct pending_list_snapshot),
3393− GFP_ATOMIC);
3394−
3395− if (snapshot->pending_list) {
3396− struct xe_sched_job *job_iter;
3397−
3398− i = 0;
3399− list_for_each_entry(job_iter, &sched->base.pending_list, drm.list) {
3400− snapshot->pending_list[i].seqno =
3401− xe_sched_job_seqno(job_iter);
3402− snapshot->pending_list[i].fence =
3403− dma_fence_is_signaled(job_iter->fence) ? 1 : 0;
3404− snapshot->pending_list[i].finished =
3405− dma_fence_is_signaled(&job_iter->drm.s_fence->finished)
3406− ? 1 : 0;
3407− i++;
3408− }
3409− }
3410−
3411− spin_unlock(&sched->base.job_list_lock);
34123165
34133166 return snapshot;
34143167 }
@@ -3472,13 +3225,6 @@ xe_guc_exec_queue_snapshot_print(struct xe_guc_submit_exec_queue_snapshot *snaps · 57 unmodified lines
34723225 drm_printf(p, "\tMulti queue primary GuC ID: %d\n", snapshot->multi_queue.primary);
34733226 drm_printf(p, "\tMulti queue position: %d\n", snapshot->multi_queue.pos);
34743227 }
3475−
3476− for (i = 0; snapshot->pending_list && i < snapshot->pending_list_size;
3477− i++)
3478− drm_printf(p, "\tJob: seqno=%d, fence=%d, finished=%d\n",
3479− snapshot->pending_list[i].seqno,
3480− snapshot->pending_list[i].fence,
3481− snapshot->pending_list[i].finished);
34823228 }
34833229
34843230 /**
@@ -3501,7 +3247,6 @@ void xe_guc_exec_queue_snapshot_free(struct xe_guc_submit_exec_queue_snapshot *s · 16 unmodified lines
35013247 xe_lrc_snapshot_free(snapshot->lrc[i]);
35023248 kfree(snapshot->lrc);
35033249 }
3504− kfree(snapshot->pending_list);
35053250 kfree(snapshot);
35063251 }
35073252
drivers/gpu/drm/xe/xe_guc_submit_types.h+0−11
@@ -61,12 +61,6 @@ struct guc_submit_parallel_scratch { · 60 unmodified lines
6161 u32 wq[WQ_SIZE / sizeof(u32)];
6262 };
6363
64−struct pending_list_snapshot {
65− u32 seqno;
66− bool fence;
67− bool finished;
68−};
69−
7064 /**
7165 * struct xe_guc_submit_exec_queue_snapshot - Snapshot for devcoredump
7266 */
@@ -147,11 +141,6 @@ struct xe_guc_submit_exec_queue_snapshot { · 74 unmodified lines
147141 /** @valid: The exec queue is part of a multi queue group */
148142 bool valid;
149143 } multi_queue;
150−
151− /** @pending_list_size: Size of the pending list snapshot array */
152− int pending_list_size;
153− /** @pending_list: snapshot of the pending list info */
154− struct pending_list_snapshot *pending_list;
155144 };
156145
157146 #endif
drivers/gpu/drm/xe/xe_guc_tlb_inval.c+3−0
@@ -97,6 +97,7 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval *tlb_inval, u32 seqno) · 96 unmodified lines
9797 static int send_page_reclaim(struct xe_guc *guc, u32 seqno,
9898 u64 gpu_addr)
9999 {
100+ struct xe_gt *gt = guc_to_gt(guc);
100101 u32 action[] = {
101102 XE_GUC_ACTION_PAGE_RECLAMATION,
102103 seqno,
@@ -104,6 +105,8 @@ static int send_page_reclaim(struct xe_guc *guc, u32 seqno, · 1 unmodified line
104105 upper_32_bits(gpu_addr),
105106 };
106107
108+ xe_gt_stats_incr(gt, XE_GT_STATS_ID_PRL_ISSUED_COUNT, 1);
109+
107110 return xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action),
108111 G2H_LEN_DW_PAGE_RECLAMATION, 1);
109112 }
drivers/gpu/drm/xe/xe_heci_gsc.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <drm/drm_print.h>
1212
1313 #include "xe_device_types.h"
14−#include "xe_drv.h"
1514 #include "xe_heci_gsc.h"
1615 #include "regs/xe_gsc_regs.h"
1716 #include "xe_platform_types.h"
drivers/gpu/drm/xe/xe_huc.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include "abi/gsc_pxp_commands_abi.h"
1313 #include "regs/xe_gsc_regs.h"
1414 #include "regs/xe_guc_regs.h"
15−#include "xe_assert.h"
1615 #include "xe_bo.h"
1716 #include "xe_device.h"
1817 #include "xe_force_wake.h"
drivers/gpu/drm/xe/xe_huc_debugfs.c+2−3
@@ -7,11 +7,10 @@ · 6 unmodified lines
77
88 #include <drm/drm_debugfs.h>
99 #include <drm/drm_managed.h>
10+#include <drm/drm_print.h>
1011
11−#include "xe_device.h"
12−#include "xe_gt.h"
12+#include "xe_gt_types.h"
1313 #include "xe_huc.h"
14−#include "xe_macros.h"
1514 #include "xe_pm.h"
1615
1716 static struct xe_gt *
drivers/gpu/drm/xe/xe_hw_engine.c+0−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include "xe_hw_fence.h"
3434 #include "xe_irq.h"
3535 #include "xe_lrc.h"
36−#include "xe_macros.h"
3736 #include "xe_mmio.h"
3837 #include "xe_reg_sr.h"
3938 #include "xe_reg_whitelist.h"
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 #include <linux/kobject.h>
88 #include <linux/sysfs.h>
99
10−#include "xe_device.h"
10+#include "xe_device_types.h"
1111 #include "xe_gt.h"
1212 #include "xe_hw_engine_class_sysfs.h"
1313 #include "xe_pm.h"
drivers/gpu/drm/xe/xe_hw_engine_group.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include <drm/drm_managed.h>
77
88 #include "xe_assert.h"
9−#include "xe_device.h"
9+#include "xe_device_types.h"
1010 #include "xe_exec_queue.h"
1111 #include "xe_gt.h"
1212 #include "xe_gt_stats.h"
drivers/gpu/drm/xe/xe_hw_fence.c+1−19
@@ -8,9 +8,7 @@ · 7 unmodified lines
88 #include <linux/device.h>
99 #include <linux/slab.h>
1010
11−#include "xe_bo.h"
12−#include "xe_device.h"
13−#include "xe_gt.h"
11+#include "xe_device_types.h"
1412 #include "xe_hw_engine.h"
1513 #include "xe_macros.h"
1614 #include "xe_map.h"
@@ -108,22 +106,6 @@ void xe_hw_fence_irq_run(struct xe_hw_fence_irq *irq) · 91 unmodified lines
108106 irq_work_queue(&irq->work);
109107 }
110108
111−void xe_hw_fence_irq_stop(struct xe_hw_fence_irq *irq)
112−{
113− spin_lock_irq(&irq->lock);
114− irq->enabled = false;
115− spin_unlock_irq(&irq->lock);
116−}
117−
118−void xe_hw_fence_irq_start(struct xe_hw_fence_irq *irq)
119−{
120− spin_lock_irq(&irq->lock);
121− irq->enabled = true;
122− spin_unlock_irq(&irq->lock);
123−
124− irq_work_queue(&irq->work);
125−}
126−
127109 void xe_hw_fence_ctx_init(struct xe_hw_fence_ctx *ctx, struct xe_gt *gt,
128110 struct xe_hw_fence_irq *irq, const char *name)
129111 {
drivers/gpu/drm/xe/xe_hw_fence.h+0−2
@@ -17,8 +17,6 @@ void xe_hw_fence_module_exit(void); · 16 unmodified lines
1717 void xe_hw_fence_irq_init(struct xe_hw_fence_irq *irq);
1818 void xe_hw_fence_irq_finish(struct xe_hw_fence_irq *irq);
1919 void xe_hw_fence_irq_run(struct xe_hw_fence_irq *irq);
20−void xe_hw_fence_irq_stop(struct xe_hw_fence_irq *irq);
21−void xe_hw_fence_irq_start(struct xe_hw_fence_irq *irq);
2220
2321 void xe_hw_fence_ctx_init(struct xe_hw_fence_ctx *ctx, struct xe_gt *gt,
2422 struct xe_hw_fence_irq *irq, const char *name);
drivers/gpu/drm/xe/xe_hwmon.c+271−8
@@ -39,10 +39,16 @@ enum xe_hwmon_reg_operation { · 38 unmodified lines
3939 REG_READ64,
4040 };
4141
42+#define MAX_VRAM_CHANNELS (16)
43+
4244 enum xe_hwmon_channel {
4345 CHANNEL_CARD,
4446 CHANNEL_PKG,
4547 CHANNEL_VRAM,
48+ CHANNEL_MCTRL,
49+ CHANNEL_PCIE,
50+ CHANNEL_VRAM_N,
51+ CHANNEL_VRAM_N_MAX = CHANNEL_VRAM_N + MAX_VRAM_CHANNELS,
4652 CHANNEL_MAX,
4753 };
4854
@@ -53,6 +59,15 @@ enum xe_fan_channel { · 4 unmodified lines
5359 FAN_MAX,
5460 };
5561
62+enum xe_temp_limit {
63+ TEMP_LIMIT_PKG_SHUTDOWN,
64+ TEMP_LIMIT_PKG_CRIT,
65+ TEMP_LIMIT_MEM_SHUTDOWN,
66+ TEMP_LIMIT_PKG_MAX,
67+ TEMP_LIMIT_MEM_CRIT,
68+ TEMP_LIMIT_MAX
69+};
70+
5671 /* Attribute index for powerX_xxx_interval sysfs entries */
5772 enum sensor_attr_power {
5873 SENSOR_INDEX_PSYS_PL1,
@@ -91,6 +106,12 @@ enum sensor_attr_power { · 32 unmodified lines
91106 */
92107 #define PL_WRITE_MBX_TIMEOUT_MS (1)
93108
109+/* Index of memory controller in READ_THERMAL_DATA output */
110+#define TEMP_INDEX_MCTRL 2
111+
112+/* Maximum characters in hwmon label name */
113+#define MAX_LABEL_SIZE 16
114+
94115 /**
95116 * struct xe_hwmon_energy_info - to accumulate energy
96117 */
@@ -111,6 +132,24 @@ struct xe_hwmon_fan_info { · 14 unmodified lines
111132 u64 time_prev;
112133 };
113134
135+/**
136+ * struct xe_hwmon_thermal_info - to store temperature data
137+ */
138+struct xe_hwmon_thermal_info {
139+ union {
140+ /** @limit: temperatures limits */
141+ u8 limit[TEMP_LIMIT_MAX];
142+ /** @data: temperature limits in dwords */
143+ u32 data[DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32))];
144+ };
145+ /** @count: no of temperature sensors available for the platform */
146+ u8 count;
147+ /** @value: signed value from each sensor */
148+ s8 value[U8_MAX];
149+ /** @vram_label: vram label names */
150+ char vram_label[MAX_VRAM_CHANNELS][MAX_LABEL_SIZE];
151+};
152+
114153 /**
115154 * struct xe_hwmon - xe hwmon data structure
116155 */
@@ -137,7 +176,8 @@ struct xe_hwmon { · 20 unmodified lines
137176 u32 pl1_on_boot[CHANNEL_MAX];
138177 /** @pl2_on_boot: power limit PL2 on boot */
139178 u32 pl2_on_boot[CHANNEL_MAX];
140−
179+ /** @temp: Temperature info */
180+ struct xe_hwmon_thermal_info temp;
141181 };
142182
143183 static int xe_hwmon_pcode_read_power_limit(const struct xe_hwmon *hwmon, u32 attr, int channel,
@@ -224,6 +264,8 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg · 80 unmodified lines
224264 return BMG_PACKAGE_TEMPERATURE;
225265 else if (channel == CHANNEL_VRAM)
226266 return BMG_VRAM_TEMPERATURE;
267+ else if (in_range(channel, CHANNEL_VRAM_N, CHANNEL_VRAM_N_MAX))
268+ return BMG_VRAM_TEMPERATURE_N(channel - CHANNEL_VRAM_N);
227269 } else if (xe->info.platform == XE_DG2) {
228270 if (channel == CHANNEL_PKG)
229271 return PCU_CR_PACKAGE_TEMPERATURE;
@@ -677,8 +719,29 @@ static const struct attribute_group *hwmon_groups[] = { · 447 unmodified lines
677719 };
678720
679721 static const struct hwmon_channel_info * const hwmon_info[] = {
680− HWMON_CHANNEL_INFO(temp, HWMON_T_LABEL, HWMON_T_INPUT | HWMON_T_LABEL,
681− HWMON_T_INPUT | HWMON_T_LABEL),
722+ HWMON_CHANNEL_INFO(temp,
723+ HWMON_T_LABEL,
724+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL |
725+ HWMON_T_MAX,
726+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
727+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
728+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
729+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
730+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
731+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
732+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
733+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
734+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
735+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
736+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
737+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
738+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
739+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
740+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
741+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
742+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
743+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL,
744+ HWMON_T_CRIT | HWMON_T_EMERGENCY | HWMON_T_INPUT | HWMON_T_LABEL),
682745 HWMON_CHANNEL_INFO(power, HWMON_P_MAX | HWMON_P_RATED_MAX | HWMON_P_LABEL | HWMON_P_CRIT |
683746 HWMON_P_CAP,
684747 HWMON_P_MAX | HWMON_P_RATED_MAX | HWMON_P_LABEL | HWMON_P_CAP),
@@ -689,6 +752,75 @@ static const struct hwmon_channel_info * const hwmon_info[] = { · 4 unmodified lines
689752 NULL
690753 };
691754
755+static int xe_hwmon_pcode_read_thermal_info(struct xe_hwmon *hwmon)
756+{
757+ struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
758+ u32 config = 0;
759+ int ret;
760+
761+ ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_LIMITS, 0),
762+ &hwmon->temp.data[0], &hwmon->temp.data[1]);
763+ if (ret)
764+ return ret;
765+
766+ drm_dbg(&hwmon->xe->drm, "thermal info read val 0x%x val1 0x%x\n",
767+ hwmon->temp.data[0], hwmon->temp.data[1]);
768+
769+ ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_CONFIG, 0),
770+ &config, NULL);
771+ if (ret)
772+ return ret;
773+
774+ drm_dbg(&hwmon->xe->drm, "thermal config count 0x%x\n", config);
775+ hwmon->temp.count = REG_FIELD_GET(TEMP_MASK, config);
776+
777+ return ret;
778+}
779+
780+static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
781+{
782+ struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
783+ u32 *dword = (u32 *)hwmon->temp.value;
784+ s32 average = 0;
785+ int ret, i;
786+
787+ for (i = 0; i < DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32)); i++) {
788+ ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_DATA, i),
789+ (dword + i), NULL);
790+ if (ret)
791+ return ret;
792+ drm_dbg(&hwmon->xe->drm, "thermal data for group %d val 0x%x\n", i, dword[i]);
793+ }
794+
795+ for (i = TEMP_INDEX_MCTRL; i < hwmon->temp.count - 1; i++)
796+ average += hwmon->temp.value[i];
797+
798+ average /= (hwmon->temp.count - TEMP_INDEX_MCTRL - 1);
799+ *val = average * MILLIDEGREE_PER_DEGREE;
800+ return 0;
801+}
802+
803+static int get_pcie_temp(struct xe_hwmon *hwmon, long *val)
804+{
805+ struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
806+ u32 data = 0;
807+ int ret;
808+
809+ ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_DATA,
810+ PCIE_SENSOR_GROUP_ID), &data, NULL);
811+ if (ret)
812+ return ret;
813+
814+ /* Sensor offset is different for G21 */
815+ if (hwmon->xe->info.subplatform != XE_SUBPLATFORM_BATTLEMAGE_G21)
816+ data = REG_FIELD_GET(PCIE_SENSOR_MASK, data);
817+
818+ data = REG_FIELD_GET(TEMP_MASK, data);
819+ *val = (s8)data * MILLIDEGREE_PER_DEGREE;
820+
821+ return 0;
822+}
823+
692824 /* I1 is exposed as power_crit or as curr_crit depending on bit 31 */
693825 static int xe_hwmon_pcode_read_i1(const struct xe_hwmon *hwmon, u32 *uval)
694826 {
@@ -783,13 +915,77 @@ static void xe_hwmon_get_voltage(struct xe_hwmon *hwmon, int channel, long *valu · 88 unmodified lines
783915 *value = DIV_ROUND_CLOSEST(REG_FIELD_GET(VOLTAGE_MASK, reg_val) * 2500, SF_VOLTAGE);
784916 }
785917
918+static inline bool is_vram_ch_available(struct xe_hwmon *hwmon, int channel)
919+{
920+ struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe);
921+ int vram_id = channel - CHANNEL_VRAM_N;
922+ struct xe_reg vram_reg;
923+
924+ vram_reg = xe_hwmon_get_reg(hwmon, REG_TEMP, channel);
925+ if (!xe_reg_is_valid(vram_reg) || !xe_mmio_read32(mmio, vram_reg))
926+ return false;
927+
928+ /* Create label only for available vram channel */
929+ sprintf(hwmon->temp.vram_label[vram_id], "vram_ch_%d", vram_id);
930+ return true;
931+}
932+
786933 static umode_t
787934 xe_hwmon_temp_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
788935 {
789936 switch (attr) {
937+ case hwmon_temp_emergency:
938+ switch (channel) {
939+ case CHANNEL_PKG:
940+ return hwmon->temp.limit[TEMP_LIMIT_PKG_SHUTDOWN] ? 0444 : 0;
941+ case CHANNEL_VRAM:
942+ return hwmon->temp.limit[TEMP_LIMIT_MEM_SHUTDOWN] ? 0444 : 0;
943+ case CHANNEL_MCTRL:
944+ case CHANNEL_PCIE:
945+ return hwmon->temp.count ? 0444 : 0;
946+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
947+ return (is_vram_ch_available(hwmon, channel) &&
948+ hwmon->temp.limit[TEMP_LIMIT_MEM_SHUTDOWN]) ? 0444 : 0;
949+ default:
950+ return 0;
951+ }
952+ case hwmon_temp_crit:
953+ switch (channel) {
954+ case CHANNEL_PKG:
955+ return hwmon->temp.limit[TEMP_LIMIT_PKG_CRIT] ? 0444 : 0;
956+ case CHANNEL_VRAM:
957+ return hwmon->temp.limit[TEMP_LIMIT_MEM_CRIT] ? 0444 : 0;
958+ case CHANNEL_MCTRL:
959+ case CHANNEL_PCIE:
960+ return hwmon->temp.count ? 0444 : 0;
961+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
962+ return (is_vram_ch_available(hwmon, channel) &&
963+ hwmon->temp.limit[TEMP_LIMIT_MEM_CRIT]) ? 0444 : 0;
964+ default:
965+ return 0;
966+ }
967+ case hwmon_temp_max:
968+ switch (channel) {
969+ case CHANNEL_PKG:
970+ return hwmon->temp.limit[TEMP_LIMIT_PKG_MAX] ? 0444 : 0;
971+ default:
972+ return 0;
973+ }
790974 case hwmon_temp_input:
791975 case hwmon_temp_label:
792− return xe_reg_is_valid(xe_hwmon_get_reg(hwmon, REG_TEMP, channel)) ? 0444 : 0;
976+ switch (channel) {
977+ case CHANNEL_PKG:
978+ case CHANNEL_VRAM:
979+ return xe_reg_is_valid(xe_hwmon_get_reg(hwmon, REG_TEMP,
980+ channel)) ? 0444 : 0;
981+ case CHANNEL_MCTRL:
982+ case CHANNEL_PCIE:
983+ return hwmon->temp.count ? 0444 : 0;
984+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
985+ return is_vram_ch_available(hwmon, channel) ? 0444 : 0;
986+ default:
987+ return 0;
988+ }
793989 default:
794990 return 0;
795991 }
@@ -803,11 +999,67 @@ xe_hwmon_temp_read(struct xe_hwmon *hwmon, u32 attr, int channel, long *val) · 7 unmodified lines
803999
8041000 switch (attr) {
8051001 case hwmon_temp_input:
806− reg_val = xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_TEMP, channel));
1002+ switch (channel) {
1003+ case CHANNEL_PKG:
1004+ case CHANNEL_VRAM:
1005+ reg_val = xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_TEMP, channel));
8071006
808− /* HW register value is in degrees Celsius, convert to millidegrees. */
809− *val = REG_FIELD_GET(TEMP_MASK, reg_val) * MILLIDEGREE_PER_DEGREE;
810− return 0;
1007+ /* HW register value is in degrees Celsius, convert to millidegrees. */
1008+ *val = REG_FIELD_GET(TEMP_MASK, reg_val) * MILLIDEGREE_PER_DEGREE;
1009+ return 0;
1010+ case CHANNEL_MCTRL:
1011+ return get_mc_temp(hwmon, val);
1012+ case CHANNEL_PCIE:
1013+ return get_pcie_temp(hwmon, val);
1014+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
1015+ reg_val = xe_mmio_read32(mmio, xe_hwmon_get_reg(hwmon, REG_TEMP, channel));
1016+ /*
1017+ * This temperature format is 24 bit [31:8] signed integer and 8 bit
1018+ * [7:0] fraction.
1019+ */
1020+ *val = (s32)(REG_FIELD_GET(TEMP_MASK_VRAM_N, reg_val)) *
1021+ (REG_FIELD_GET(TEMP_SIGN_MASK, reg_val) ? -1 : 1) *
1022+ MILLIDEGREE_PER_DEGREE;
1023+ return 0;
1024+ default:
1025+ return -EOPNOTSUPP;
1026+ }
1027+ case hwmon_temp_emergency:
1028+ switch (channel) {
1029+ case CHANNEL_PKG:
1030+ case CHANNEL_MCTRL:
1031+ case CHANNEL_PCIE:
1032+ *val = hwmon->temp.limit[TEMP_LIMIT_PKG_SHUTDOWN] * MILLIDEGREE_PER_DEGREE;
1033+ return 0;
1034+ case CHANNEL_VRAM:
1035+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
1036+ *val = hwmon->temp.limit[TEMP_LIMIT_MEM_SHUTDOWN] * MILLIDEGREE_PER_DEGREE;
1037+ return 0;
1038+ default:
1039+ return -EOPNOTSUPP;
1040+ }
1041+ case hwmon_temp_crit:
1042+ switch (channel) {
1043+ case CHANNEL_PKG:
1044+ case CHANNEL_MCTRL:
1045+ case CHANNEL_PCIE:
1046+ *val = hwmon->temp.limit[TEMP_LIMIT_PKG_CRIT] * MILLIDEGREE_PER_DEGREE;
1047+ return 0;
1048+ case CHANNEL_VRAM:
1049+ case CHANNEL_VRAM_N...CHANNEL_VRAM_N_MAX:
1050+ *val = hwmon->temp.limit[TEMP_LIMIT_MEM_CRIT] * MILLIDEGREE_PER_DEGREE;
1051+ return 0;
1052+ default:
1053+ return -EOPNOTSUPP;
1054+ }
1055+ case hwmon_temp_max:
1056+ switch (channel) {
1057+ case CHANNEL_PKG:
1058+ *val = hwmon->temp.limit[TEMP_LIMIT_PKG_MAX] * MILLIDEGREE_PER_DEGREE;
1059+ return 0;
1060+ default:
1061+ return -EOPNOTSUPP;
1062+ }
8111063 default:
8121064 return -EOPNOTSUPP;
8131065 }
@@ -1163,12 +1415,20 @@ static int xe_hwmon_read_label(struct device *dev, · 349 unmodified lines
11631415 enum hwmon_sensor_types type,
11641416 u32 attr, int channel, const char **str)
11651417 {
1418+ struct xe_hwmon *hwmon = dev_get_drvdata(dev);
1419+
11661420 switch (type) {
11671421 case hwmon_temp:
11681422 if (channel == CHANNEL_PKG)
11691423 *str = "pkg";
11701424 else if (channel == CHANNEL_VRAM)
11711425 *str = "vram";
1426+ else if (channel == CHANNEL_MCTRL)
1427+ *str = "mctrl";
1428+ else if (channel == CHANNEL_PCIE)
1429+ *str = "pcie";
1430+ else if (in_range(channel, CHANNEL_VRAM_N, CHANNEL_VRAM_N_MAX))
1431+ *str = hwmon->temp.vram_label[channel - CHANNEL_VRAM_N];
11721432 return 0;
11731433 case hwmon_power:
11741434 case hwmon_energy:
@@ -1263,6 +1523,9 @@ xe_hwmon_get_preregistration_info(struct xe_hwmon *hwmon) · 88 unmodified lines
12631523 for (channel = 0; channel < FAN_MAX; channel++)
12641524 if (xe_hwmon_is_visible(hwmon, hwmon_fan, hwmon_fan_input, channel))
12651525 xe_hwmon_fan_input_read(hwmon, channel, &fan_speed);
1526+
1527+ if (hwmon->xe->info.has_mbx_thermal_info && xe_hwmon_pcode_read_thermal_info(hwmon))
1528+ drm_warn(&hwmon->xe->drm, "Thermal mailbox not supported by card firmware\n");
12661529 }
12671530
12681531 int xe_hwmon_register(struct xe_device *xe)
drivers/gpu/drm/xe/xe_i2c.c+8−5
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 * Copyright (C) 2025 Intel Corporation.
66 */
77
8+#include <drm/drm_print.h>
89 #include <linux/array_size.h>
910 #include <linux/container_of.h>
1011 #include <linux/device.h>
@@ -26,11 +27,11 @@ · 15 unmodified lines
2627 #include "regs/xe_i2c_regs.h"
2728 #include "regs/xe_irq_regs.h"
2829
29−#include "xe_device.h"
3030 #include "xe_device_types.h"
3131 #include "xe_i2c.h"
3232 #include "xe_mmio.h"
33−#include "xe_platform_types.h"
33+#include "xe_sriov.h"
34+#include "xe_survivability_mode.h"
3435
3536 /**
3637 * DOC: Xe I2C devices
@@ -213,11 +214,13 @@ static const struct irq_domain_ops xe_i2c_irq_ops = { · 176 unmodified lines
213214 .map = xe_i2c_irq_map,
214215 };
215216
216−static int xe_i2c_create_irq(struct xe_i2c *i2c)
217+static int xe_i2c_create_irq(struct xe_device *xe)
217218 {
219+ struct xe_i2c *i2c = xe->i2c;
218220 struct irq_domain *domain;
219221
220− if (!(i2c->ep.capabilities & XE_I2C_EP_CAP_IRQ))
222+ if (!(i2c->ep.capabilities & XE_I2C_EP_CAP_IRQ) ||
223+ xe_survivability_mode_is_boot_enabled(xe))
221224 return 0;
222225
223226 domain = irq_domain_create_linear(dev_fwnode(i2c->drm_dev), 1, &xe_i2c_irq_ops, NULL);
@@ -351,7 +354,7 @@ int xe_i2c_probe(struct xe_device *xe) · 127 unmodified lines
351354 if (ret)
352355 return ret;
353356
354− ret = xe_i2c_create_irq(i2c);
357+ ret = xe_i2c_create_irq(xe);
355358 if (ret)
356359 goto err_unregister_notifier;
357360
drivers/gpu/drm/xe/xe_irq.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <drm/drm_managed.h>
1111
1212 #include "display/xe_display.h"
13−#include "regs/xe_guc_regs.h"
1413 #include "regs/xe_irq_regs.h"
1514 #include "xe_device.h"
1615 #include "xe_drv.h"
drivers/gpu/drm/xe/xe_late_bind_fw_types.h+3−1
@@ -15,10 +15,12 @@ · 14 unmodified lines
1515 #define XE_LB_MAX_PAYLOAD_SIZE SZ_4K
1616
1717 /**
18− * xe_late_bind_fw_id - enum to determine late binding fw index
18+ * enum xe_late_bind_fw_id - enum to determine late binding fw index
1919 */
2020 enum xe_late_bind_fw_id {
21+ /** @XE_LB_FW_FAN_CONTROL: Fan control */
2122 XE_LB_FW_FAN_CONTROL = 0,
23+ /** @XE_LB_FW_MAX_ID: Number of IDs */
2224 XE_LB_FW_MAX_ID
2325 };
2426
drivers/gpu/drm/xe/xe_lmtt.c+1−1
@@ -289,7 +289,7 @@ void xe_lmtt_invalidate_hw(struct xe_lmtt *lmtt) · 288 unmodified lines
289289 ERR_PTR(err));
290290
291291 if (xe_device_has_mert(xe) && xe_tile_is_root(tile)) {
292− err = xe_mert_invalidate_lmtt(tile);
292+ err = xe_mert_invalidate_lmtt(xe);
293293 if (err)
294294 xe_tile_sriov_err(tile, "MERT LMTT invalidation failed (%pe)",
295295 ERR_PTR(err));
drivers/gpu/drm/xe/xe_lrc.c+31−14
@@ -857,7 +857,7 @@ u32 xe_lrc_ctx_timestamp_udw_ggtt_addr(struct xe_lrc *lrc) · 856 unmodified lines
857857 *
858858 * Returns: ctx timestamp value
859859 */
860−u64 xe_lrc_ctx_timestamp(struct xe_lrc *lrc)
860+static u64 xe_lrc_ctx_timestamp(struct xe_lrc *lrc)
861861 {
862862 struct xe_device *xe = lrc_to_xe(lrc);
863863 struct iosys_map map;
@@ -1068,6 +1068,9 @@ static ssize_t setup_utilization_wa(struct xe_lrc *lrc, · 204 unmodified lines
10681068 {
10691069 u32 *cmd = batch;
10701070
1071+ if (IS_SRIOV_VF(gt_to_xe(lrc->gt)))
1072+ return 0;
1073+
10711074 if (xe_gt_WARN_ON(lrc->gt, max_len < 12))
10721075 return -ENOSPC;
10731076
@@ -2406,35 +2409,31 @@ static int get_ctx_timestamp(struct xe_lrc *lrc, u32 engine_id, u64 *reg_ctx_ts) · 1332 unmodified lines
24062409 }
24072410
24082411 /**
2409− * xe_lrc_update_timestamp() - Update ctx timestamp
2412+ * xe_lrc_timestamp() - Current ctx timestamp
24102413 * @lrc: Pointer to the lrc.
2411− * @old_ts: Old timestamp value
24122414 *
2413− * Populate @old_ts current saved ctx timestamp, read new ctx timestamp and
2414− * update saved value. With support for active contexts, the calculation may be
2415− * slightly racy, so follow a read-again logic to ensure that the context is
2416− * still active before returning the right timestamp.
2415+ * Return latest ctx timestamp. With support for active contexts, the
2416+ * calculation may bb slightly racy, so follow a read-again logic to ensure that
2417+ * the context is still active before returning the right timestamp.
24172418 *
24182419 * Returns: New ctx timestamp value
24192420 */
2420−u64 xe_lrc_update_timestamp(struct xe_lrc *lrc, u64 *old_ts)
2421+u64 xe_lrc_timestamp(struct xe_lrc *lrc)
24212422 {
2422− u64 lrc_ts, reg_ts;
2423+ u64 lrc_ts, reg_ts, new_ts;
24232424 u32 engine_id;
24242425
2425− *old_ts = lrc->ctx_timestamp;
2426−
24272426 lrc_ts = xe_lrc_ctx_timestamp(lrc);
24282427 /* CTX_TIMESTAMP mmio read is invalid on VF, so return the LRC value */
24292428 if (IS_SRIOV_VF(lrc_to_xe(lrc))) {
2430− lrc->ctx_timestamp = lrc_ts;
2429+ new_ts = lrc_ts;
24312430 goto done;
24322431 }
24332432
24342433 if (lrc_ts == CONTEXT_ACTIVE) {
24352434 engine_id = xe_lrc_engine_id(lrc);
24362435 if (!get_ctx_timestamp(lrc, engine_id, &reg_ts))
2437− lrc->ctx_timestamp = reg_ts;
2436+ new_ts = reg_ts;
24382437
24392438 /* read lrc again to ensure context is still active */
24402439 lrc_ts = xe_lrc_ctx_timestamp(lrc);
@@ -2445,9 +2444,27 @@ u64 xe_lrc_update_timestamp(struct xe_lrc *lrc, u64 *old_ts) · 4 unmodified lines
24452444 * be a separate if condition.
24462445 */
24472446 if (lrc_ts != CONTEXT_ACTIVE)
2448− lrc->ctx_timestamp = lrc_ts;
2447+ new_ts = lrc_ts;
24492448
24502449 done:
2450+ return new_ts;
2451+}
2452+
2453+/**
2454+ * xe_lrc_update_timestamp() - Update ctx timestamp
2455+ * @lrc: Pointer to the lrc.
2456+ * @old_ts: Old timestamp value
2457+ *
2458+ * Populate @old_ts current saved ctx timestamp, read new ctx timestamp and
2459+ * update saved value.
2460+ *
2461+ * Returns: New ctx timestamp value
2462+ */
2463+u64 xe_lrc_update_timestamp(struct xe_lrc *lrc, u64 *old_ts)
2464+{
2465+ *old_ts = lrc->ctx_timestamp;
2466+ lrc->ctx_timestamp = xe_lrc_timestamp(lrc);
2467+
24512468 trace_xe_lrc_update_timestamp(lrc, *old_ts);
24522469
24532470 return lrc->ctx_timestamp;
drivers/gpu/drm/xe/xe_lrc.h+2−1
@@ -145,7 +145,6 @@ void xe_lrc_snapshot_free(struct xe_lrc_snapshot *snapshot); · 144 unmodified lines
145145
146146 u32 xe_lrc_ctx_timestamp_ggtt_addr(struct xe_lrc *lrc);
147147 u32 xe_lrc_ctx_timestamp_udw_ggtt_addr(struct xe_lrc *lrc);
148−u64 xe_lrc_ctx_timestamp(struct xe_lrc *lrc);
149148 u32 xe_lrc_ctx_job_timestamp_ggtt_addr(struct xe_lrc *lrc);
150149 u32 xe_lrc_ctx_job_timestamp(struct xe_lrc *lrc);
151150 int xe_lrc_setup_wa_bb_with_scratch(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
@@ -165,4 +164,6 @@ int xe_lrc_setup_wa_bb_with_scratch(struct xe_lrc *lrc, struct xe_hw_engine *hwe · 13 unmodified lines
165164 */
166165 u64 xe_lrc_update_timestamp(struct xe_lrc *lrc, u64 *old_ts);
167166
167+u64 xe_lrc_timestamp(struct xe_lrc *lrc);
168+
168169 #endif
drivers/gpu/drm/xe/xe_memirq.c+0−2
@@ -7,7 +7,6 @@ · 6 unmodified lines
77
88 #include "regs/xe_guc_regs.h"
99 #include "regs/xe_irq_regs.h"
10−#include "regs/xe_regs.h"
1110
1211 #include "xe_assert.h"
1312 #include "xe_bo.h"
@@ -16,7 +15,6 @@ · 2 unmodified lines
1615 #include "xe_gt.h"
1716 #include "xe_guc.h"
1817 #include "xe_hw_engine.h"
19−#include "xe_map.h"
2018 #include "xe_memirq.h"
2119 #include "xe_tile_printk.h"
2220
drivers/gpu/drm/xe/xe_mert.c+56−20
@@ -9,25 +9,38 @@ · 8 unmodified lines
99 #include "xe_device.h"
1010 #include "xe_mert.h"
1111 #include "xe_mmio.h"
12+#include "xe_sriov_printk.h"
1213 #include "xe_tile.h"
1314
1415 /**
15− * xe_mert_invalidate_lmtt - Invalidate MERT LMTT
16− * @tile: the &xe_tile
16+ * xe_mert_init_early() - Initialize MERT data
17+ * @xe: the &xe_device with MERT to init
18+ */
19+void xe_mert_init_early(struct xe_device *xe)
20+{
21+ struct xe_tile *tile = xe_device_get_root_tile(xe);
22+ struct xe_mert *mert = &tile->mert;
23+
24+ spin_lock_init(&mert->lock);
25+ init_completion(&mert->tlb_inv_done);
26+}
27+
28+/**
29+ * xe_mert_invalidate_lmtt() - Invalidate MERT LMTT
30+ * @xe: the &xe_device with MERT
1731 *
1832 * Trigger invalidation of the MERT LMTT and wait for completion.
1933 *
2034 * Return: 0 on success or -ETIMEDOUT in case of a timeout.
2135 */
22−int xe_mert_invalidate_lmtt(struct xe_tile *tile)
36+int xe_mert_invalidate_lmtt(struct xe_device *xe)
2337 {
24− struct xe_device *xe = tile_to_xe(tile);
38+ struct xe_tile *tile = xe_device_get_root_tile(xe);
2539 struct xe_mert *mert = &tile->mert;
2640 const long timeout = HZ / 4;
2741 unsigned long flags;
2842
2943 xe_assert(xe, xe_device_has_mert(xe));
30− xe_assert(xe, xe_tile_is_root(tile));
3144
3245 spin_lock_irqsave(&mert->lock, flags);
3346 if (!mert->tlb_inv_triggered) {
@@ -43,6 +56,37 @@ int xe_mert_invalidate_lmtt(struct xe_tile *tile) · 9 unmodified lines
4356 return 0;
4457 }
4558
59+static void mert_handle_cat_error(struct xe_device *xe)
60+{
61+ struct xe_tile *tile = xe_device_get_root_tile(xe);
62+ u32 reg_val, vfid, code;
63+
64+ reg_val = xe_mmio_read32(&tile->mmio, MERT_TLB_CT_INTR_ERR_ID_PORT);
65+ if (!reg_val)
66+ return;
67+ xe_mmio_write32(&tile->mmio, MERT_TLB_CT_INTR_ERR_ID_PORT, 0);
68+
69+ vfid = FIELD_GET(CATERR_VFID, reg_val);
70+ code = FIELD_GET(CATERR_CODES, reg_val);
71+
72+ switch (code) {
73+ case CATERR_NO_ERROR:
74+ break;
75+ case CATERR_UNMAPPED_GGTT:
76+ xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
77+ xe_device_declare_wedged(xe);
78+ break;
79+ case CATERR_LMTT_FAULT:
80+ xe_sriov_dbg(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
81+ /* XXX: track/report malicious VF activity */
82+ break;
83+ default:
84+ xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
85+ xe_device_declare_wedged(xe);
86+ break;
87+ }
88+}
89+
4690 /**
4791 * xe_mert_irq_handler - Handler for MERT interrupts
4892 * @xe: the &xe_device
@@ -53,30 +97,22 @@ int xe_mert_invalidate_lmtt(struct xe_tile *tile) · 4 unmodified lines
5397 void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl)
5498 {
5599 struct xe_tile *tile = xe_device_get_root_tile(xe);
100+ struct xe_mert *mert = &tile->mert;
56101 unsigned long flags;
57102 u32 reg_val;
58− u8 err;
59103
60104 if (!(master_ctl & SOC_H2DMEMINT_IRQ))
61105 return;
62106
63− reg_val = xe_mmio_read32(&tile->mmio, MERT_TLB_CT_INTR_ERR_ID_PORT);
64− xe_mmio_write32(&tile->mmio, MERT_TLB_CT_INTR_ERR_ID_PORT, 0);
65−
66− err = FIELD_GET(MERT_TLB_CT_ERROR_MASK, reg_val);
67− if (err == MERT_TLB_CT_LMTT_FAULT)
68− drm_dbg(&xe->drm, "MERT catastrophic error: LMTT fault (VF%u)\n",
69− FIELD_GET(MERT_TLB_CT_VFID_MASK, reg_val));
70− else if (err)
71− drm_dbg(&xe->drm, "MERT catastrophic error: Unexpected fault (0x%x)\n", err);
107+ mert_handle_cat_error(xe);
72108
73− spin_lock_irqsave(&tile->mert.lock, flags);
74− if (tile->mert.tlb_inv_triggered) {
109+ spin_lock_irqsave(&mert->lock, flags);
110+ if (mert->tlb_inv_triggered) {
75111 reg_val = xe_mmio_read32(&tile->mmio, MERT_TLB_INV_DESC_A);
76112 if (!(reg_val & MERT_TLB_INV_DESC_A_VALID)) {
77− tile->mert.tlb_inv_triggered = false;
78− complete_all(&tile->mert.tlb_inv_done);
113+ mert->tlb_inv_triggered = false;
114+ complete_all(&mert->tlb_inv_done);
79115 }
80116 }
81− spin_unlock_irqrestore(&tile->mert.lock, flags);
117+ spin_unlock_irqrestore(&mert->lock, flags);
82118 }
drivers/gpu/drm/xe/xe_mert.h+9−6
@@ -3,30 +3,33 @@ · 2 unmodified lines
33 * Copyright(c) 2025, Intel Corporation. All rights reserved.
44 */
55
6−#ifndef __XE_MERT_H__
7−#define __XE_MERT_H__
6+#ifndef _XE_MERT_H_
7+#define _XE_MERT_H_
88
99 #include <linux/completion.h>
1010 #include <linux/spinlock.h>
1111 #include <linux/types.h>
1212
1313 struct xe_device;
14−struct xe_tile;
1514
15+/**
16+ * struct xe_mert - MERT related data
17+ */
1618 struct xe_mert {
1719 /** @lock: protects the TLB invalidation status */
1820 spinlock_t lock;
1921 /** @tlb_inv_triggered: indicates if TLB invalidation was triggered */
2022 bool tlb_inv_triggered;
21− /** @mert.tlb_inv_done: completion of TLB invalidation */
23+ /** @tlb_inv_done: completion of TLB invalidation */
2224 struct completion tlb_inv_done;
2325 };
2426
2527 #ifdef CONFIG_PCI_IOV
26−int xe_mert_invalidate_lmtt(struct xe_tile *tile);
28+void xe_mert_init_early(struct xe_device *xe);
29+int xe_mert_invalidate_lmtt(struct xe_device *xe);
2730 void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
2831 #else
2932 static inline void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl) { }
3033 #endif
3134
32−#endif /* __XE_MERT_H__ */
35+#endif
drivers/gpu/drm/xe/xe_mmio.c+0−4
@@ -14,12 +14,8 @@ · 13 unmodified lines
1414 #include <drm/drm_print.h>
1515
1616 #include "regs/xe_bars.h"
17−#include "regs/xe_regs.h"
1817 #include "xe_device.h"
19−#include "xe_gt.h"
20−#include "xe_gt_printk.h"
2118 #include "xe_gt_sriov_vf.h"
22−#include "xe_macros.h"
2319 #include "xe_sriov.h"
2420 #include "xe_trace.h"
2521 #include "xe_wa.h"
drivers/gpu/drm/xe/xe_mocs.c+0−2
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include "xe_mocs.h"
77
88 #include "regs/xe_gt_regs.h"
9−#include "xe_bo.h"
109 #include "xe_device.h"
1110 #include "xe_exec_queue.h"
1211 #include "xe_force_wake.h"
@@ -17,7 +16,6 @@ · 4 unmodified lines
1716 #include "xe_platform_types.h"
1817 #include "xe_pm.h"
1918 #include "xe_sriov.h"
20−#include "xe_step_types.h"
2119
2220 #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
2321 #define mocs_dbg xe_gt_dbg
drivers/gpu/drm/xe/xe_module.c+6−4
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #include <drm/drm_module.h>
1212
13+#include "xe_device_types.h"
1314 #include "xe_drv.h"
1415 #include "xe_configfs.h"
1516 #include "xe_hw_fence.h"
@@ -29,7 +30,8 @@ · 13 unmodified lines
2930 #define DEFAULT_FORCE_PROBE CONFIG_DRM_XE_FORCE_PROBE
3031 #define DEFAULT_MAX_VFS ~0
3132 #define DEFAULT_MAX_VFS_STR "unlimited"
32−#define DEFAULT_WEDGED_MODE 1
33+#define DEFAULT_WEDGED_MODE XE_WEDGED_MODE_DEFAULT
34+#define DEFAULT_WEDGED_MODE_STR XE_WEDGED_MODE_DEFAULT_STR
3335 #define DEFAULT_SVM_NOTIFIER_SIZE 512
3436
3537 struct xe_modparam xe_modparam = {
@@ -88,10 +90,10 @@ MODULE_PARM_DESC(max_vfs, · 52 unmodified lines
8890 "[default=" DEFAULT_MAX_VFS_STR "])");
8991 #endif
9092
91−module_param_named_unsafe(wedged_mode, xe_modparam.wedged_mode, int, 0600);
93+module_param_named_unsafe(wedged_mode, xe_modparam.wedged_mode, uint, 0600);
9294 MODULE_PARM_DESC(wedged_mode,
93− "Module's default policy for the wedged mode (0=never, 1=upon-critical-errors, 2=upon-any-hang "
94− "[default=" __stringify(DEFAULT_WEDGED_MODE) "])");
95+ "Module's default policy for the wedged mode (0=never, 1=upon-critical-error, 2=upon-any-hang-no-reset "
96+ "[default=" DEFAULT_WEDGED_MODE_STR "])");
9597
9698 static int xe_check_nomodeset(void)
9799 {
drivers/gpu/drm/xe/xe_module.h+1−1
@@ -21,7 +21,7 @@ struct xe_modparam { · 20 unmodified lines
2121 #ifdef CONFIG_PCI_IOV
2222 unsigned int max_vfs;
2323 #endif
24− int wedged_mode;
24+ unsigned int wedged_mode;
2525 u32 svm_notifier_size;
2626 };
2727
drivers/gpu/drm/xe/xe_nvm.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/intel_dg_nvm_aux.h>
77 #include <linux/pci.h>
88
9−#include "xe_device.h"
109 #include "xe_device_types.h"
1110 #include "xe_mmio.h"
1211 #include "xe_nvm.h"
drivers/gpu/drm/xe/xe_page_reclaim.c+1−5
@@ -10,14 +10,11 @@ · 9 unmodified lines
1010
1111 #include "xe_page_reclaim.h"
1212
13−#include "regs/xe_gt_regs.h"
14−#include "xe_assert.h"
13+#include "xe_gt_stats.h"
1514 #include "xe_macros.h"
16−#include "xe_mmio.h"
1715 #include "xe_pat.h"
1816 #include "xe_sa.h"
1917 #include "xe_tlb_inval_types.h"
20−#include "xe_vm.h"
2118
2219 /**
2320 * xe_page_reclaim_skip() - Decide whether PRL should be skipped for a VMA
@@ -108,7 +105,6 @@ void xe_page_reclaim_list_invalidate(struct xe_page_reclaim_list *prl) · 84 unmodified lines
108105 */
109106 void xe_page_reclaim_list_init(struct xe_page_reclaim_list *prl)
110107 {
111− // xe_page_reclaim_list_invalidate(prl);
112108 prl->entries = NULL;
113109 prl->num_entries = 0;
114110 }
drivers/gpu/drm/xe/xe_page_reclaim.h+20−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 struct xe_tlb_inval;
2020 struct xe_tlb_inval_fence;
2121 struct xe_tile;
22+struct xe_gt;
2223 struct xe_vma;
2324
2425 struct xe_guc_page_reclaim_entry {
@@ -75,6 +76,25 @@ struct drm_suballoc *xe_page_reclaim_create_prl_bo(struct xe_tlb_inval *tlb_inva · 50 unmodified lines
7576 struct xe_page_reclaim_list *prl,
7677 struct xe_tlb_inval_fence *fence);
7778 void xe_page_reclaim_list_invalidate(struct xe_page_reclaim_list *prl);
79+
80+/**
81+ * xe_page_reclaim_list_abort() - Invalidate a PRL and log an abort reason
82+ * @gt: GT owning the page reclaim request
83+ * @prl: Page reclaim list to invalidate
84+ * @fmt: format string for the log message with args
85+ *
86+ * Abort page reclaim process by invalidating PRL and doing any relevant logging.
87+ */
88+#define xe_page_reclaim_list_abort(gt, prl, fmt, ...) \
89+ do { \
90+ struct xe_gt *__gt = (gt); \
91+ struct xe_page_reclaim_list *__prl = (prl); \
92+ \
93+ xe_page_reclaim_list_invalidate(__prl); \
94+ xe_gt_stats_incr(__gt, XE_GT_STATS_ID_PRL_ABORTED_COUNT, 1); \
95+ vm_dbg(&gt_to_xe(__gt)->drm, "PRL aborted: " fmt, ##__VA_ARGS__); \
96+ } while (0)
97+
7898 void xe_page_reclaim_list_init(struct xe_page_reclaim_list *prl);
7999 int xe_page_reclaim_list_alloc_entries(struct xe_page_reclaim_list *prl);
80100 /**
drivers/gpu/drm/xe/xe_pat.c+46−6
@@ -132,9 +132,10 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = { · 131 unmodified lines
132132 * in the table.
133133 *
134134 * Note: There is an implicit assumption in the driver that compression and
135− * coh_1way+ are mutually exclusive. If this is ever not true then userptr
136− * and imported dma-buf from external device will have uncleared ccs state. See
137− * also xe_bo_needs_ccs_pages().
135+ * coh_1way+ are mutually exclusive for platforms prior to Xe3. Starting
136+ * with Xe3, compression can be combined with coherency. If using compression
137+ * with coherency, userptr and imported dma-buf from external device will
138+ * have uncleared ccs state. See also xe_bo_needs_ccs_pages().
138139 */
139140 #define XE2_PAT(no_promote, comp_en, l3clos, l3_policy, l4_policy, __coh_mode) \
140141 { \
@@ -144,8 +145,7 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = { · 3 unmodified lines
144145 REG_FIELD_PREP(XE2_L3_POLICY, l3_policy) | \
145146 REG_FIELD_PREP(XE2_L4_POLICY, l4_policy) | \
146147 REG_FIELD_PREP(XE2_COH_MODE, __coh_mode), \
147− .coh_mode = (BUILD_BUG_ON_ZERO(__coh_mode && comp_en) || __coh_mode) ? \
148− XE_COH_AT_LEAST_1WAY : XE_COH_NONE, \
148+ .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE, \
149149 .valid = 1 \
150150 }
151151
@@ -181,6 +181,38 @@ static const struct xe_pat_table_entry xe2_pat_table[] = { · 29 unmodified lines
181181 [31] = XE2_PAT( 0, 0, 3, 0, 3, 3 ),
182182 };
183183
184+static const struct xe_pat_table_entry xe3_lpg_pat_table[] = {
185+ [ 0] = XE2_PAT( 0, 0, 0, 0, 3, 0 ),
186+ [ 1] = XE2_PAT( 0, 0, 0, 0, 3, 2 ),
187+ [ 2] = XE2_PAT( 0, 0, 0, 0, 3, 3 ),
188+ [ 3] = XE2_PAT( 0, 0, 0, 3, 3, 0 ),
189+ [ 4] = XE2_PAT( 0, 0, 0, 3, 0, 2 ),
190+ [ 5] = XE2_PAT( 0, 0, 0, 3, 3, 2 ),
191+ [ 6] = XE2_PAT( 1, 0, 0, 1, 3, 0 ),
192+ [ 7] = XE2_PAT( 0, 0, 0, 3, 0, 3 ),
193+ [ 8] = XE2_PAT( 0, 0, 0, 3, 0, 0 ),
194+ [ 9] = XE2_PAT( 0, 1, 0, 0, 3, 0 ),
195+ [10] = XE2_PAT( 0, 1, 0, 3, 0, 0 ),
196+ [11] = XE2_PAT( 1, 1, 0, 1, 3, 0 ),
197+ [12] = XE2_PAT( 0, 1, 0, 3, 3, 0 ),
198+ [13] = XE2_PAT( 0, 0, 0, 0, 0, 0 ),
199+ [14] = XE2_PAT( 0, 1, 0, 0, 0, 0 ),
200+ [15] = XE2_PAT( 1, 1, 0, 1, 1, 0 ),
201+ [16] = XE2_PAT( 0, 1, 0, 0, 3, 2 ),
202+ /* 17..19 are reserved; leave set to all 0's */
203+ [20] = XE2_PAT( 0, 0, 1, 0, 3, 0 ),
204+ [21] = XE2_PAT( 0, 1, 1, 0, 3, 0 ),
205+ [22] = XE2_PAT( 0, 0, 1, 0, 3, 2 ),
206+ [23] = XE2_PAT( 0, 0, 1, 0, 3, 3 ),
207+ [24] = XE2_PAT( 0, 0, 2, 0, 3, 0 ),
208+ [25] = XE2_PAT( 0, 1, 2, 0, 3, 0 ),
209+ [26] = XE2_PAT( 0, 0, 2, 0, 3, 2 ),
210+ [27] = XE2_PAT( 0, 0, 2, 0, 3, 3 ),
211+ [28] = XE2_PAT( 0, 0, 3, 0, 3, 0 ),
212+ [29] = XE2_PAT( 0, 1, 3, 0, 3, 0 ),
213+ [30] = XE2_PAT( 0, 0, 3, 0, 3, 2 ),
214+ [31] = XE2_PAT( 0, 0, 3, 0, 3, 3 ),
215+};
184216 /* Special PAT values programmed outside the main table */
185217 static const struct xe_pat_table_entry xe2_pat_ats = XE2_PAT( 0, 0, 0, 0, 3, 3 );
186218 static const struct xe_pat_table_entry xe2_pat_pta = XE2_PAT( 0, 0, 0, 0, 3, 0 );
@@ -490,6 +522,7 @@ static const struct xe_pat_ops xe3p_xpc_pat_ops = { · 303 unmodified lines
490522
491523 void xe_pat_init_early(struct xe_device *xe)
492524 {
525+ xe->pat.idx[XE_CACHE_WB_COMPRESSION] = XE_PAT_INVALID_IDX;
493526 if (GRAPHICS_VERx100(xe) == 3511) {
494527 xe->pat.ops = &xe3p_xpc_pat_ops;
495528 xe->pat.table = xe3p_xpc_pat_table;
@@ -501,7 +534,12 @@ void xe_pat_init_early(struct xe_device *xe) · 5 unmodified lines
501534 xe->pat.idx[XE_CACHE_WB] = 2;
502535 } else if (GRAPHICS_VER(xe) == 30 || GRAPHICS_VER(xe) == 20) {
503536 xe->pat.ops = &xe2_pat_ops;
504− xe->pat.table = xe2_pat_table;
537+ if (GRAPHICS_VER(xe) == 30) {
538+ xe->pat.table = xe3_lpg_pat_table;
539+ xe->pat.idx[XE_CACHE_WB_COMPRESSION] = 16;
540+ } else {
541+ xe->pat.table = xe2_pat_table;
542+ }
505543 xe->pat.pat_ats = &xe2_pat_ats;
506544 if (IS_DGFX(xe))
507545 xe->pat.pat_pta = &xe2_pat_pta;
@@ -658,6 +696,8 @@ int xe_pat_dump_sw_config(struct xe_gt *gt, struct drm_printer *p) · 150 unmodified lines
658696 if (GRAPHICS_VER(xe) >= 20) {
659697 drm_printf(p, "IDX[XE_CACHE_NONE_COMPRESSION] = %d\n",
660698 xe->pat.idx[XE_CACHE_NONE_COMPRESSION]);
699+ drm_printf(p, "IDX[XE_CACHE_WB_COMPRESSION] = %d\n",
700+ xe->pat.idx[XE_CACHE_WB_COMPRESSION]);
661701 }
662702
663703 return 0;
drivers/gpu/drm/xe/xe_pat.h+2−0
@@ -12,6 +12,8 @@ struct drm_printer; · 11 unmodified lines
1212 struct xe_device;
1313 struct xe_gt;
1414
15+#define XE_PAT_INVALID_IDX U16_MAX
16+
1517 /**
1618 * struct xe_pat_table_entry - The pat_index encoding and other meta information.
1719 */
drivers/gpu/drm/xe/xe_pci.c+4−1
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #include "xe_gt.h"
2525 #include "xe_gt_sriov_vf.h"
2626 #include "xe_guc.h"
27−#include "xe_macros.h"
2827 #include "xe_mmio.h"
2928 #include "xe_module.h"
3029 #include "xe_pci_rebar.h"
@@ -366,6 +365,7 @@ static const struct xe_device_desc bmg_desc = { · 335 unmodified lines
366365 .has_fan_control = true,
367366 .has_flat_ccs = 1,
368367 .has_mbx_power_limits = true,
368+ .has_mbx_thermal_info = true,
369369 .has_gsc_nvm = 1,
370370 .has_heci_cscfi = 1,
371371 .has_i2c = true,
@@ -392,6 +392,7 @@ static const struct xe_device_desc ptl_desc = { · 20 unmodified lines
392392 .has_sriov = true,
393393 .has_mem_copy_instr = true,
394394 .has_pre_prod_wa = 1,
395+ .has_pxp = true,
395396 .max_gt_per_tile = 2,
396397 .needs_scratch = true,
397398 .needs_shared_vf_gt_wq = true,
@@ -421,6 +422,7 @@ static const struct xe_device_desc cri_desc = { · 23 unmodified lines
421422 .has_gsc_nvm = 1,
422423 .has_i2c = true,
423424 .has_mbx_power_limits = true,
425+ .has_mbx_thermal_info = true,
424426 .has_mert = true,
425427 .has_pre_prod_wa = 1,
426428 .has_soc_remapper_sysctrl = true,
@@ -686,6 +688,7 @@ static int xe_info_init_early(struct xe_device *xe, · 259 unmodified lines
686688 /* runtime fusing may force flat_ccs to disabled later */
687689 xe->info.has_flat_ccs = desc->has_flat_ccs;
688690 xe->info.has_mbx_power_limits = desc->has_mbx_power_limits;
691+ xe->info.has_mbx_thermal_info = desc->has_mbx_thermal_info;
689692 xe->info.has_gsc_nvm = desc->has_gsc_nvm;
690693 xe->info.has_heci_gscfi = desc->has_heci_gscfi;
691694 xe->info.has_heci_cscfi = desc->has_heci_cscfi;
drivers/gpu/drm/xe/xe_pci_types.h+1−0
@@ -48,6 +48,7 @@ struct xe_device_desc { · 47 unmodified lines
4848 u8 has_late_bind:1;
4949 u8 has_llc:1;
5050 u8 has_mbx_power_limits:1;
51+ u8 has_mbx_thermal_info:1;
5152 u8 has_mem_copy_instr:1;
5253 u8 has_mert:1;
5354 u8 has_pre_prod_wa:1;
drivers/gpu/drm/xe/xe_pcode_api.h+7−0
@@ -50,6 +50,13 @@ · 49 unmodified lines
5050 #define READ_PL_FROM_FW 0x1
5151 #define READ_PL_FROM_PCODE 0x0
5252
53+#define PCODE_THERMAL_INFO 0x25
54+#define READ_THERMAL_LIMITS 0x0
55+#define READ_THERMAL_CONFIG 0x1
56+#define READ_THERMAL_DATA 0x2
57+#define PCIE_SENSOR_GROUP_ID 0x2
58+#define PCIE_SENSOR_MASK REG_GENMASK(31, 16)
59+
5360 #define PCODE_LATE_BINDING 0x5C
5461 #define GET_CAPABILITY_STATUS 0x0
5562 #define V1_FAN_SUPPORTED REG_BIT(0)
drivers/gpu/drm/xe/xe_pm.c+22−4
@@ -260,10 +260,19 @@ int xe_pm_resume(struct xe_device *xe) · 259 unmodified lines
260260
261261 xe_irq_resume(xe);
262262
263− for_each_gt(gt, xe, id)
264− xe_gt_resume(gt);
263+ for_each_gt(gt, xe, id) {
264+ err = xe_gt_resume(gt);
265+ if (err)
266+ break;
267+ }
265268
269+ /*
270+ * Try to bring up display before bailing from GT resume failure,
271+ * so we don't leave the user clueless with a blank screen.
272+ */
266273 xe_display_pm_resume(xe);
274+ if (err)
275+ goto err;
267276
268277 err = xe_bo_restore_late(xe);
269278 if (err)
@@ -656,10 +665,19 @@ int xe_pm_runtime_resume(struct xe_device *xe) · 386 unmodified lines
656665
657666 xe_irq_resume(xe);
658667
659− for_each_gt(gt, xe, id)
660− xe->d3cold.allowed ? xe_gt_resume(gt) : xe_gt_runtime_resume(gt);
668+ for_each_gt(gt, xe, id) {
669+ err = xe->d3cold.allowed ? xe_gt_resume(gt) : xe_gt_runtime_resume(gt);
670+ if (err)
671+ break;
672+ }
661673
674+ /*
675+ * Try to bring up display before bailing from GT resume failure,
676+ * so we don't leave the user clueless with a blank screen.
677+ */
662678 xe_display_pm_runtime_resume(xe);
679+ if (err)
680+ goto out;
663681
664682 if (xe->d3cold.allowed) {
665683 err = xe_bo_restore_late(xe);
drivers/gpu/drm/xe/xe_psmi.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include <linux/debugfs.h>
77
88 #include "xe_bo.h"
9−#include "xe_device.h"
9+#include "xe_device_types.h"
1010 #include "xe_configfs.h"
1111 #include "xe_psmi.h"
1212
drivers/gpu/drm/xe/xe_pt.c+58−26
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include "xe_drm_client.h"
1212 #include "xe_exec_queue.h"
1313 #include "xe_gt.h"
14+#include "xe_gt_stats.h"
1415 #include "xe_migrate.h"
1516 #include "xe_page_reclaim.h"
1617 #include "xe_pt_types.h"
@@ -1576,12 +1577,6 @@ static bool xe_pt_check_kill(u64 addr, u64 next, unsigned int level, · 1559 unmodified lines
15761577 return false;
15771578 }
15781579
1579−/* Huge 2MB leaf lives directly in a level-1 table and has no children */
1580−static bool is_2m_pte(struct xe_pt *pte)
1581−{
1582− return pte->level == 1 && !pte->base.children;
1583−}
1584−
15851580 /* page_size = 2^(reclamation_size + XE_PTE_SHIFT) */
15861581 #define COMPUTE_RECLAIM_ADDRESS_MASK(page_size) \
15871582 ({ \
@@ -1593,8 +1588,10 @@ static int generate_reclaim_entry(struct xe_tile *tile, · 5 unmodified lines
15931588 struct xe_page_reclaim_list *prl,
15941589 u64 pte, struct xe_pt *xe_child)
15951590 {
1591+ struct xe_gt *gt = tile->primary_gt;
15961592 struct xe_guc_page_reclaim_entry *reclaim_entries = prl->entries;
1597− u64 phys_page = (pte & XE_PTE_ADDR_MASK) >> XE_PTE_SHIFT;
1593+ u64 phys_addr = pte & XE_PTE_ADDR_MASK;
1594+ u64 phys_page = phys_addr >> XE_PTE_SHIFT;
15981595 int num_entries = prl->num_entries;
15991596 u32 reclamation_size;
16001597
@@ -1612,16 +1609,21 @@ static int generate_reclaim_entry(struct xe_tile *tile, · 11 unmodified lines
16121609 * Only 4K, 64K (level 0), and 2M pages are supported by hardware for page reclaim
16131610 */
16141611 if (xe_child->level == 0 && !(pte & XE_PTE_PS64)) {
1612+ xe_gt_stats_incr(gt, XE_GT_STATS_ID_PRL_4K_ENTRY_COUNT, 1);
16151613 reclamation_size = COMPUTE_RECLAIM_ADDRESS_MASK(SZ_4K); /* reclamation_size = 0 */
1614+ xe_tile_assert(tile, phys_addr % SZ_4K == 0);
16161615 } else if (xe_child->level == 0) {
1616+ xe_gt_stats_incr(gt, XE_GT_STATS_ID_PRL_64K_ENTRY_COUNT, 1);
16171617 reclamation_size = COMPUTE_RECLAIM_ADDRESS_MASK(SZ_64K); /* reclamation_size = 4 */
1618− } else if (is_2m_pte(xe_child)) {
1618+ xe_tile_assert(tile, phys_addr % SZ_64K == 0);
1619+ } else if (xe_child->level == 1 && pte & XE_PDE_PS_2M) {
1620+ xe_gt_stats_incr(gt, XE_GT_STATS_ID_PRL_2M_ENTRY_COUNT, 1);
16191621 reclamation_size = COMPUTE_RECLAIM_ADDRESS_MASK(SZ_2M); /* reclamation_size = 9 */
1622+ xe_tile_assert(tile, phys_addr % SZ_2M == 0);
16201623 } else {
1621− xe_page_reclaim_list_invalidate(prl);
1622− vm_dbg(&tile_to_xe(tile)->drm,
1623− "PRL invalidate: unsupported PTE level=%u pte=%#llx\n",
1624− xe_child->level, pte);
1624+ xe_page_reclaim_list_abort(tile->primary_gt, prl,
1625+ "unsupported PTE level=%u pte=%#llx",
1626+ xe_child->level, pte);
16251627 return -EINVAL;
16261628 }
16271629
@@ -1648,20 +1650,40 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset, · 20 unmodified lines
16481650 struct xe_pt_stage_unbind_walk *xe_walk =
16491651 container_of(walk, typeof(*xe_walk), base);
16501652 struct xe_device *xe = tile_to_xe(xe_walk->tile);
1653+ pgoff_t first = xe_pt_offset(addr, xe_child->level, walk);
1654+ bool killed;
16511655
16521656 XE_WARN_ON(!*child);
16531657 XE_WARN_ON(!level);
16541658 /* Check for leaf node */
16551659 if (xe_walk->prl && xe_page_reclaim_list_valid(xe_walk->prl) &&
1656− !xe_child->base.children) {
1660+ (!xe_child->base.children || !xe_child->base.children[first])) {
16571661 struct iosys_map *leaf_map = &xe_child->bo->vmap;
1658− pgoff_t first = xe_pt_offset(addr, 0, walk);
1659− pgoff_t count = xe_pt_num_entries(addr, next, 0, walk);
1662+ pgoff_t count = xe_pt_num_entries(addr, next, xe_child->level, walk);
16601663
16611664 for (pgoff_t i = 0; i < count; i++) {
16621665 u64 pte = xe_map_rd(xe, leaf_map, (first + i) * sizeof(u64), u64);
16631666 int ret;
16641667
1668+ /*
1669+ * In rare scenarios, pte may not be written yet due to racy conditions.
1670+ * In such cases, invalidate the PRL and fallback to full PPC invalidation.
1671+ */
1672+ if (!pte) {
1673+ xe_page_reclaim_list_abort(xe_walk->tile->primary_gt, xe_walk->prl,
1674+ "found zero pte at addr=%#llx", addr);
1675+ break;
1676+ }
1677+
1678+ /* Ensure it is a defined page */
1679+ xe_tile_assert(xe_walk->tile,
1680+ xe_child->level == 0 ||
1681+ (pte & (XE_PTE_PS64 | XE_PDE_PS_2M | XE_PDPE_PS_1G)));
1682+
1683+ /* An entry should be added for 64KB but contigious 4K have XE_PTE_PS64 */
1684+ if (pte & XE_PTE_PS64)
1685+ i += 15; /* Skip other 15 consecutive 4K pages in the 64K page */
1686+
16651687 /* Account for NULL terminated entry on end (-1) */
16661688 if (xe_walk->prl->num_entries < XE_PAGE_RECLAIM_MAX_ENTRIES - 1) {
16671689 ret = generate_reclaim_entry(xe_walk->tile, xe_walk->prl,
@@ -1670,22 +1692,32 @@ static int xe_pt_stage_unbind_entry(struct xe_ptw *parent, pgoff_t offset, · 2 unmodified lines
16701692 break;
16711693 } else {
16721694 /* overflow, mark as invalid */
1673− xe_page_reclaim_list_invalidate(xe_walk->prl);
1674− vm_dbg(&xe->drm,
1675− "PRL invalidate: overflow while adding pte=%#llx",
1676− pte);
1695+ xe_page_reclaim_list_abort(xe_walk->tile->primary_gt, xe_walk->prl,
1696+ "overflow while adding pte=%#llx",
1697+ pte);
16771698 break;
16781699 }
16791700 }
16801701 }
16811702
1682− /* If aborting page walk early, invalidate PRL since PTE may be dropped from this abort */
1683− if (xe_pt_check_kill(addr, next, level - 1, xe_child, action, walk) &&
1684− xe_walk->prl && level > 1 && xe_child->base.children && xe_child->num_live != 0) {
1685− xe_page_reclaim_list_invalidate(xe_walk->prl);
1686− vm_dbg(&xe->drm,
1687− "PRL invalidate: kill at level=%u addr=%#llx next=%#llx num_live=%u\n",
1688− level, addr, next, xe_child->num_live);
1703+ killed = xe_pt_check_kill(addr, next, level - 1, xe_child, action, walk);
1704+
1705+ /*
1706+ * Verify PRL is active and if entry is not a leaf pte (base.children conditions),
1707+ * there is a potential need to invalidate the PRL if any PTE (num_live) are dropped.
1708+ */
1709+ if (xe_walk->prl && level > 1 && xe_child->num_live &&
1710+ xe_child->base.children && xe_child->base.children[first]) {
1711+ bool covered = xe_pt_covers(addr, next, xe_child->level, &xe_walk->base);
1712+
1713+ /*
1714+ * If aborting page walk early (kill) or page walk completes the full range
1715+ * we need to invalidate the PRL.
1716+ */
1717+ if (killed || covered)
1718+ xe_page_reclaim_list_abort(xe_walk->tile->primary_gt, xe_walk->prl,
1719+ "kill at level=%u addr=%#llx next=%#llx num_live=%u",
1720+ level, addr, next, xe_child->num_live);
16891721 }
16901722
16911723 return 0;
drivers/gpu/drm/xe/xe_pt_types.h+1−0
@@ -20,6 +20,7 @@ enum xe_cache_level { · 19 unmodified lines
2020 XE_CACHE_WT,
2121 XE_CACHE_WB,
2222 XE_CACHE_NONE_COMPRESSION, /*UC + COH_NONE + COMPRESSION */
23+ XE_CACHE_WB_COMPRESSION,
2324 __XE_CACHE_LEVEL_COUNT,
2425 };
2526
drivers/gpu/drm/xe/xe_pxp.c+0−1
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 #include "xe_force_wake.h"
1616 #include "xe_guc_submit.h"
1717 #include "xe_gsc_proxy.h"
18−#include "xe_gt.h"
1918 #include "xe_gt_types.h"
2019 #include "xe_huc.h"
2120 #include "xe_mmio.h"
drivers/gpu/drm/xe/xe_pxp_debugfs.c+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 #include <drm/drm_managed.h>
1212 #include <drm/drm_print.h>
1313
14−#include "xe_device.h"
14+#include "xe_device_types.h"
1515 #include "xe_pxp.h"
1616 #include "xe_pxp_types.h"
1717 #include "regs/xe_irq_regs.h"
drivers/gpu/drm/xe/xe_reg_sr.c+1−4
@@ -13,16 +13,13 @@ · 12 unmodified lines
1313 #include <drm/drm_managed.h>
1414 #include <drm/drm_print.h>
1515
16−#include "regs/xe_engine_regs.h"
17−#include "regs/xe_gt_regs.h"
1816 #include "xe_device.h"
1917 #include "xe_device_types.h"
2018 #include "xe_force_wake.h"
21−#include "xe_gt.h"
2219 #include "xe_gt_mcr.h"
2320 #include "xe_gt_printk.h"
21+#include "xe_gt_types.h"
2422 #include "xe_hw_engine_types.h"
25−#include "xe_macros.h"
2623 #include "xe_mmio.h"
2724 #include "xe_rtp_types.h"
2825
drivers/gpu/drm/xe/xe_reg_whitelist.c+0−1
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include "regs/xe_engine_regs.h"
99 #include "regs/xe_gt_regs.h"
1010 #include "regs/xe_oa_regs.h"
11−#include "regs/xe_regs.h"
1211 #include "xe_device.h"
1312 #include "xe_gt_types.h"
1413 #include "xe_gt_printk.h"
drivers/gpu/drm/xe/xe_ring_ops.c+21−8
@@ -11,11 +11,9 @@ · 10 unmodified lines
1111 #include "instructions/xe_mi_commands.h"
1212 #include "regs/xe_engine_regs.h"
1313 #include "regs/xe_gt_regs.h"
14−#include "regs/xe_lrc_layout.h"
1514 #include "xe_exec_queue.h"
16−#include "xe_gt.h"
15+#include "xe_gt_types.h"
1716 #include "xe_lrc.h"
18−#include "xe_macros.h"
1917 #include "xe_sched_job.h"
2018 #include "xe_sriov.h"
2119 #include "xe_vm_types.h"
@@ -235,13 +233,26 @@ static u32 get_ppgtt_flag(struct xe_sched_job *job) · 213 unmodified lines
235233 return 0;
236234 }
237235
238−static int emit_copy_timestamp(struct xe_lrc *lrc, u32 *dw, int i)
236+static int emit_copy_timestamp(struct xe_device *xe, struct xe_lrc *lrc,
237+ u32 *dw, int i)
239238 {
240239 dw[i++] = MI_STORE_REGISTER_MEM | MI_SRM_USE_GGTT | MI_SRM_ADD_CS_OFFSET;
241240 dw[i++] = RING_CTX_TIMESTAMP(0).addr;
242241 dw[i++] = xe_lrc_ctx_job_timestamp_ggtt_addr(lrc);
243242 dw[i++] = 0;
244243
244+ /*
245+ * Ensure CTX timestamp >= Job timestamp during VF sampling to avoid
246+ * arithmetic wraparound in TDR.
247+ */
248+ if (IS_SRIOV_VF(xe)) {
249+ dw[i++] = MI_STORE_REGISTER_MEM | MI_SRM_USE_GGTT |
250+ MI_SRM_ADD_CS_OFFSET;
251+ dw[i++] = RING_CTX_TIMESTAMP(0).addr;
252+ dw[i++] = xe_lrc_ctx_timestamp_ggtt_addr(lrc);
253+ dw[i++] = 0;
254+ }
255+
245256 return i;
246257 }
247258
@@ -255,7 +266,7 @@ static void __emit_job_gen12_simple(struct xe_sched_job *job, struct xe_lrc *lrc · 7 unmodified lines
255266
256267 *head = lrc->ring.tail;
257268
258− i = emit_copy_timestamp(lrc, dw, i);
269+ i = emit_copy_timestamp(gt_to_xe(gt), lrc, dw, i);
259270
260271 if (job->ring_ops_flush_tlb) {
261272 dw[i++] = preparser_disable(true);
@@ -310,7 +321,7 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc, · 48 unmodified lines
310321
311322 *head = lrc->ring.tail;
312323
313− i = emit_copy_timestamp(lrc, dw, i);
324+ i = emit_copy_timestamp(xe, lrc, dw, i);
314325
315326 dw[i++] = preparser_disable(true);
316327
@@ -364,7 +375,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job, · 47 unmodified lines
364375
365376 *head = lrc->ring.tail;
366377
367− i = emit_copy_timestamp(lrc, dw, i);
378+ i = emit_copy_timestamp(xe, lrc, dw, i);
368379
369380 dw[i++] = preparser_disable(true);
370381 if (lacks_render)
@@ -406,12 +417,14 @@ static void emit_migration_job_gen12(struct xe_sched_job *job, · 35 unmodified lines
406417 struct xe_lrc *lrc, u32 *head,
407418 u32 seqno)
408419 {
420+ struct xe_gt *gt = job->q->gt;
421+ struct xe_device *xe = gt_to_xe(gt);
409422 u32 saddr = xe_lrc_start_seqno_ggtt_addr(lrc);
410423 u32 dw[MAX_JOB_SIZE_DW], i = 0;
411424
412425 *head = lrc->ring.tail;
413426
414− i = emit_copy_timestamp(lrc, dw, i);
427+ i = emit_copy_timestamp(xe, lrc, dw, i);
415428
416429 i = emit_store_imm_ggtt(saddr, seqno, dw, i);
417430
drivers/gpu/drm/xe/xe_rtp.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include "xe_configfs.h"
1313 #include "xe_gt.h"
1414 #include "xe_gt_topology.h"
15−#include "xe_macros.h"
1615 #include "xe_reg_sr.h"
1716 #include "xe_sriov.h"
1817
drivers/gpu/drm/xe/xe_sa.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include <drm/drm_managed.h>
1111
1212 #include "xe_bo.h"
13−#include "xe_device.h"
13+#include "xe_device_types.h"
1414 #include "xe_map.h"
1515
1616 static void xe_sa_bo_manager_fini(struct drm_device *drm, void *arg)
drivers/gpu/drm/xe/xe_sched_job.c+2−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 #include "xe_device.h"
1313 #include "xe_exec_queue.h"
14−#include "xe_gt.h"
14+#include "xe_gt_types.h"
1515 #include "xe_hw_engine_types.h"
1616 #include "xe_hw_fence.h"
1717 #include "xe_lrc.h"
@@ -110,6 +110,7 @@ struct xe_sched_job *xe_sched_job_create(struct xe_exec_queue *q, · 92 unmodified lines
110110 return ERR_PTR(-ENOMEM);
111111
112112 job->q = q;
113+ job->sample_timestamp = U64_MAX;
113114 kref_init(&job->refcount);
114115 xe_exec_queue_get(job->q);
115116
drivers/gpu/drm/xe/xe_sched_job_types.h+2−0
@@ -59,6 +59,8 @@ struct xe_sched_job { · 58 unmodified lines
5959 u32 lrc_seqno;
6060 /** @migrate_flush_flags: Additional flush flags for migration jobs */
6161 u32 migrate_flush_flags;
62+ /** @sample_timestamp: Sampling of job timestamp in TDR */
63+ u64 sample_timestamp;
6264 /** @ring_ops_flush_tlb: The ring ops need to flush TLB before payload. */
6365 bool ring_ops_flush_tlb;
6466 /** @ggtt: mapped in ggtt. */
drivers/gpu/drm/xe/xe_sriov_packet.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include "xe_bo.h"
77 #include "xe_device.h"
88 #include "xe_guc_klv_helpers.h"
9−#include "xe_printk.h"
109 #include "xe_sriov_packet.h"
1110 #include "xe_sriov_packet_types.h"
1211 #include "xe_sriov_pf_helpers.h"
drivers/gpu/drm/xe/xe_sriov_pf.c+1−3
@@ -90,7 +90,6 @@ bool xe_sriov_pf_readiness(struct xe_device *xe) · 89 unmodified lines
9090 */
9191 int xe_sriov_pf_init_early(struct xe_device *xe)
9292 {
93− struct xe_mert *mert = &xe_device_get_root_tile(xe)->mert;
9493 int err;
9594
9695 xe_assert(xe, IS_SRIOV_PF(xe));
@@ -112,8 +111,7 @@ int xe_sriov_pf_init_early(struct xe_device *xe) · 15 unmodified lines
112111
113112 xe_sriov_pf_service_init(xe);
114113
115− spin_lock_init(&mert->lock);
116− init_completion(&mert->tlb_inv_done);
114+ xe_mert_init_early(xe);
117115
118116 return 0;
119117 }
drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c+0−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #include "xe_sriov_pf_migration.h"
1717 #include "xe_sriov_pf_provision.h"
1818 #include "xe_sriov_pf_service.h"
19−#include "xe_sriov_printk.h"
2019 #include "xe_tile_sriov_pf_debugfs.h"
2120
2221 /*
drivers/gpu/drm/xe/xe_sriov_vf.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <drm/drm_debugfs.h>
77 #include <drm/drm_managed.h>
88
9−#include "xe_gt.h"
109 #include "xe_gt_sriov_vf.h"
1110 #include "xe_guc.h"
1211 #include "xe_sriov_printk.h"
drivers/gpu/drm/xe/xe_step.c+2−1
@@ -5,10 +5,11 @@ · 4 unmodified lines
55
66 #include "xe_step.h"
77
8+#include <drm/drm_print.h>
89 #include <kunit/visibility.h>
910 #include <linux/bitfield.h>
1011
11−#include "xe_device.h"
12+#include "xe_device_types.h"
1213 #include "xe_platform_types.h"
1314
1415 /*
drivers/gpu/drm/xe/xe_survivability_mode.c+1−2
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212
1313 #include "xe_configfs.h"
1414 #include "xe_device.h"
15−#include "xe_gt.h"
1615 #include "xe_heci_gsc.h"
1716 #include "xe_i2c.h"
1817 #include "xe_mmio.h"
@@ -321,7 +320,7 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev) · 302 unmodified lines
321320 if (ret)
322321 return ret;
323322
324− /* Make sure xe_heci_gsc_init() knows about survivability mode */
323+ /* Make sure xe_heci_gsc_init() and xe_i2c_probe() are aware of survivability */
325324 survivability->mode = true;
326325
327326 xe_heci_gsc_init(xe);
drivers/gpu/drm/xe/xe_svm.c+2−0
@@ -988,6 +988,8 @@ bool xe_svm_range_validate(struct xe_vm *vm, · 987 unmodified lines
988988 ret = (range->tile_present & ~range->tile_invalidated & tile_mask) == tile_mask;
989989 if (dpagemap)
990990 ret = ret && xe_svm_range_has_pagemap_locked(range, dpagemap);
991+ else
992+ ret = ret && !range->base.pages.dpagemap;
991993
992994 xe_svm_notifier_unlock(vm);
993995
drivers/gpu/drm/xe/xe_tile.c+1−2
@@ -9,9 +9,8 @@ · 8 unmodified lines
99 #include <drm/drm_pagemap_util.h>
1010
1111 #include "xe_bo.h"
12−#include "xe_device.h"
12+#include "xe_device_types.h"
1313 #include "xe_ggtt.h"
14−#include "xe_gt.h"
1514 #include "xe_memirq.h"
1615 #include "xe_migrate.h"
1716 #include "xe_pcode.h"
drivers/gpu/drm/xe/xe_tlb_inval.c+9−8
@@ -5,13 +5,10 @@ · 4 unmodified lines
55
66 #include <drm/drm_managed.h>
77
8−#include "abi/guc_actions_abi.h"
9−#include "xe_device.h"
8+#include "xe_device_types.h"
109 #include "xe_force_wake.h"
11−#include "xe_gt.h"
12−#include "xe_gt_printk.h"
1310 #include "xe_gt_stats.h"
14−#include "xe_guc.h"
11+#include "xe_gt_types.h"
1512 #include "xe_guc_ct.h"
1613 #include "xe_guc_tlb_inval.h"
1714 #include "xe_mmio.h"
@@ -94,7 +91,7 @@ static void xe_tlb_inval_fence_timeout(struct work_struct *work) · 76 unmodified lines
9491 xe_tlb_inval_fence_signal(fence);
9592 }
9693 if (!list_empty(&tlb_inval->pending_fences))
97− queue_delayed_work(system_wq, &tlb_inval->fence_tdr,
94+ queue_delayed_work(tlb_inval->timeout_wq, &tlb_inval->fence_tdr,
9895 timeout_delay);
9996 spin_unlock_irq(&tlb_inval->pending_lock);
10097 }
@@ -146,6 +143,10 @@ int xe_gt_tlb_inval_init_early(struct xe_gt *gt) · 45 unmodified lines
146143 if (IS_ERR(tlb_inval->job_wq))
147144 return PTR_ERR(tlb_inval->job_wq);
148145
146+ tlb_inval->timeout_wq = gt->ordered_wq;
147+ if (IS_ERR(tlb_inval->timeout_wq))
148+ return PTR_ERR(tlb_inval->timeout_wq);
149+
149150 /* XXX: Blindly setting up backend to GuC */
150151 xe_guc_tlb_inval_init_early(&gt->uc.guc, tlb_inval);
151152
@@ -240,7 +241,7 @@ static void xe_tlb_inval_fence_prep(struct xe_tlb_inval_fence *fence) · 88 unmodified lines
240241 list_add_tail(&fence->link, &tlb_inval->pending_fences);
241242
242243 if (list_is_singular(&tlb_inval->pending_fences))
243− queue_delayed_work(system_wq, &tlb_inval->fence_tdr,
244+ queue_delayed_work(tlb_inval->timeout_wq, &tlb_inval->fence_tdr,
244245 tlb_inval->ops->timeout_delay(tlb_inval));
245246 spin_unlock_irq(&tlb_inval->pending_lock);
246247
@@ -399,7 +400,7 @@ void xe_tlb_inval_done_handler(struct xe_tlb_inval *tlb_inval, int seqno) · 152 unmodified lines
399400 }
400401
401402 if (!list_empty(&tlb_inval->pending_fences))
402− mod_delayed_work(system_wq,
403+ mod_delayed_work(tlb_inval->timeout_wq,
403404 &tlb_inval->fence_tdr,
404405 tlb_inval->ops->timeout_delay(tlb_inval));
405406 else
drivers/gpu/drm/xe/xe_tlb_inval_types.h+2−0
@@ -109,6 +109,8 @@ struct xe_tlb_inval { · 108 unmodified lines
109109 struct workqueue_struct *job_wq;
110110 /** @tlb_inval.lock: protects TLB invalidation fences */
111111 spinlock_t lock;
112+ /** @timeout_wq: schedules TLB invalidation fence timeouts */
113+ struct workqueue_struct *timeout_wq;
112114 };
113115
114116 /**
drivers/gpu/drm/xe/xe_trace.h+0−5
@@ -228,11 +228,6 @@ DEFINE_EVENT(xe_exec_queue, xe_exec_queue_resubmit, · 227 unmodified lines
228228 TP_ARGS(q)
229229 );
230230
231−DEFINE_EVENT(xe_exec_queue, xe_exec_queue_lr_cleanup,
232− TP_PROTO(struct xe_exec_queue *q),
233− TP_ARGS(q)
234−);
235−
236231 DECLARE_EVENT_CLASS(xe_sched_job,
237232 TP_PROTO(struct xe_sched_job *job),
238233 TP_ARGS(job),
drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include "regs/xe_regs.h"
1818 #include "xe_bo.h"
1919 #include "xe_device.h"
20−#include "xe_gt.h"
2120 #include "xe_gt_printk.h"
2221 #include "xe_mmio.h"
2322 #include "xe_res_cursor.h"
drivers/gpu/drm/xe/xe_ttm_sys_mgr.c+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #include <drm/ttm/ttm_tt.h>
1414
1515 #include "xe_bo.h"
16−#include "xe_gt.h"
1716
1817 struct xe_ttm_sys_node {
1918 struct ttm_buffer_object *tbo;
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212
1313 #include "xe_bo.h"
1414 #include "xe_device.h"
15−#include "xe_gt.h"
1615 #include "xe_res_cursor.h"
1716 #include "xe_ttm_vram_mgr.h"
1817 #include "xe_vram_types.h"
drivers/gpu/drm/xe/xe_uc.c+0−2
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 #include "xe_assert.h"
99 #include "xe_device.h"
1010 #include "xe_gsc.h"
11−#include "xe_gsc_proxy.h"
1211 #include "xe_gt.h"
1312 #include "xe_gt_printk.h"
1413 #include "xe_gt_sriov_vf.h"
@@ -17,7 +16,6 @@ · 2 unmodified lines
1716 #include "xe_guc_engine_activity.h"
1817 #include "xe_huc.h"
1918 #include "xe_sriov.h"
20−#include "xe_uc_fw.h"
2119 #include "xe_wopcm.h"
2220
2321 static struct xe_gt *
drivers/gpu/drm/xe/xe_uc_debugfs.c+1−1
@@ -7,12 +7,12 @@ · 6 unmodified lines
77
88 #include <drm/drm_debugfs.h>
99
10−#include "xe_gt.h"
1110 #include "xe_gsc_debugfs.h"
1211 #include "xe_guc_debugfs.h"
1312 #include "xe_huc_debugfs.h"
1413 #include "xe_macros.h"
1514 #include "xe_uc_debugfs.h"
15+#include "xe_uc_types.h"
1616
1717 void xe_uc_debugfs_register(struct xe_uc *uc, struct dentry *parent)
1818 {
drivers/gpu/drm/xe/xe_uc_fw.c+10−4
@@ -14,9 +14,9 @@ · 13 unmodified lines
1414 #include "xe_device_types.h"
1515 #include "xe_force_wake.h"
1616 #include "xe_gsc.h"
17−#include "xe_gt.h"
1817 #include "xe_gt_printk.h"
1918 #include "xe_gt_sriov_vf.h"
19+#include "xe_gt_types.h"
2020 #include "xe_guc.h"
2121 #include "xe_map.h"
2222 #include "xe_mmio.h"
@@ -115,6 +115,7 @@ struct fw_blobs_by_type { · 92 unmodified lines
115115 #define XE_GT_TYPE_ANY XE_GT_TYPE_UNINITIALIZED
116116
117117 #define XE_GUC_FIRMWARE_DEFS(fw_def, mmp_ver, major_ver) \
118+ fw_def(NOVALAKE_S, GT_TYPE_ANY, mmp_ver(xe, guc, nvl, 70, 55, 4)) \
118119 fw_def(PANTHERLAKE, GT_TYPE_ANY, major_ver(xe, guc, ptl, 70, 54, 0)) \
119120 fw_def(BATTLEMAGE, GT_TYPE_ANY, major_ver(xe, guc, bmg, 70, 54, 0)) \
120121 fw_def(LUNARLAKE, GT_TYPE_ANY, major_ver(xe, guc, lnl, 70, 53, 0)) \
@@ -140,6 +141,7 @@ struct fw_blobs_by_type { · 19 unmodified lines
140141
141142 /* for the GSC FW we match the compatibility version and not the release one */
142143 #define XE_GSC_FIRMWARE_DEFS(fw_def, major_ver) \
144+ fw_def(PANTHERLAKE, GT_TYPE_ANY, major_ver(xe, gsc, ptl, 105, 1, 0)) \
143145 fw_def(LUNARLAKE, GT_TYPE_ANY, major_ver(xe, gsc, lnl, 104, 1, 0)) \
144146 fw_def(METEORLAKE, GT_TYPE_ANY, major_ver(i915, gsc, mtl, 102, 1, 0))
145147
@@ -738,7 +740,7 @@ static int uc_fw_request(struct xe_uc_fw *uc_fw, const struct firmware **firmwar · 592 unmodified lines
738740 return 0;
739741 }
740742
741− err = request_firmware(&fw, uc_fw->path, dev);
743+ err = firmware_request_nowarn(&fw, uc_fw->path, dev);
742744 if (err)
743745 goto fail;
744746
@@ -767,8 +769,12 @@ fail: · 22 unmodified lines
767769 XE_UC_FIRMWARE_MISSING :
768770 XE_UC_FIRMWARE_ERROR);
769771
770− xe_gt_notice(gt, "%s firmware %s: fetch failed with error %pe\n",
771− xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, ERR_PTR(err));
772+ if (err == -ENOENT)
773+ xe_gt_info(gt, "%s firmware %s not found\n",
774+ xe_uc_fw_type_repr(uc_fw->type), uc_fw->path);
775+ else
776+ xe_gt_notice(gt, "%s firmware %s: fetch failed with error %pe\n",
777+ xe_uc_fw_type_repr(uc_fw->type), uc_fw->path, ERR_PTR(err));
772778 xe_gt_info(gt, "%s firmware(s) can be downloaded from %s\n",
773779 xe_uc_fw_type_repr(uc_fw->type), XE_UC_FIRMWARE_URL);
774780
drivers/gpu/drm/xe/xe_validation.c+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 /*
33 * Copyright © 2024 Intel Corporation
44 */
5−#include "xe_bo.h"
65 #include <drm/drm_exec.h>
76 #include <drm/drm_gem.h>
87 #include <drm/drm_gpuvm.h>
drivers/gpu/drm/xe/xe_vm.c+20−8
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include "xe_preempt_fence.h"
3434 #include "xe_pt.h"
3535 #include "xe_pxp.h"
36−#include "xe_res_cursor.h"
3736 #include "xe_sriov_vf.h"
3837 #include "xe_svm.h"
3938 #include "xe_sync.h"
@@ -2209,7 +2208,7 @@ static void print_op(struct xe_device *xe, struct drm_gpuva_op *op) · 2169 unmodified lines
22092208 (ULL)xe_vma_start(vma), (ULL)xe_vma_size(vma));
22102209 break;
22112210 default:
2212− drm_warn(&xe->drm, "NOT POSSIBLE");
2211+ drm_warn(&xe->drm, "NOT POSSIBLE\n");
22132212 }
22142213 }
22152214 #else
@@ -2312,7 +2311,7 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_vma_ops *vops, · 96 unmodified lines
23122311 xe_bo_unlock(bo);
23132312 break;
23142313 default:
2315− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
2314+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
23162315 ops = ERR_PTR(-EINVAL);
23172316 }
23182317 if (IS_ERR(ops))
@@ -2584,7 +2583,7 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op) · 265 unmodified lines
25842583 op->flags |= XE_VMA_OP_COMMITTED;
25852584 break;
25862585 default:
2587− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
2586+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
25882587 }
25892588
25902589 return err;
@@ -2783,7 +2782,7 @@ static int vm_bind_ioctl_ops_parse(struct xe_vm *vm, struct drm_gpuva_ops *ops, · 192 unmodified lines
27832782
27842783 break;
27852784 default:
2786− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
2785+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
27872786 }
27882787
27892788 err = xe_vma_op_commit(vm, op);
@@ -2845,7 +2844,7 @@ static void xe_vma_op_unwind(struct xe_vm *vm, struct xe_vma_op *op, · 55 unmodified lines
28452844 /* Nothing to do */
28462845 break;
28472846 default:
2848− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
2847+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
28492848 }
28502849 }
28512850
@@ -3029,7 +3028,7 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm, · 177 unmodified lines
30293028 break;
30303029 }
30313030 default:
3032− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
3031+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
30333032 }
30343033
30353034 return err;
@@ -3268,7 +3267,7 @@ static void op_add_ufence(struct xe_vm *vm, struct xe_vma_op *op, · 232 unmodified lines
32683267 vma_add_ufence(gpuva_to_vma(op->base.prefetch.va), ufence);
32693268 break;
32703269 default:
3271− drm_warn(&vm->xe->drm, "NOT POSSIBLE");
3270+ drm_warn(&vm->xe->drm, "NOT POSSIBLE\n");
32723271 }
32733272 }
32743273
@@ -3405,6 +3404,7 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe, struct xe_vm *vm, · 130 unmodified lines
34053404 DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR;
34063405 u16 pat_index = (*bind_ops)[i].pat_index;
34073406 u16 coh_mode;
3407+ bool comp_en;
34083408
34093409 if (XE_IOCTL_DBG(xe, is_cpu_addr_mirror &&
34103410 (!xe_vm_in_fault_mode(vm) ||
@@ -3421,6 +3421,7 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe, struct xe_vm *vm, · 10 unmodified lines
34213421 pat_index = array_index_nospec(pat_index, xe->pat.n_entries);
34223422 (*bind_ops)[i].pat_index = pat_index;
34233423 coh_mode = xe_pat_index_get_coh_mode(xe, pat_index);
3424+ comp_en = xe_pat_index_get_comp_en(xe, pat_index);
34243425 if (XE_IOCTL_DBG(xe, !coh_mode)) { /* hw reserved */
34253426 err = -EINVAL;
34263427 goto free_bind_ops;
@@ -3451,6 +3452,8 @@ static int vm_bind_ioctl_check_args(struct xe_device *xe, struct xe_vm *vm, · 24 unmodified lines
34513452 op == DRM_XE_VM_BIND_OP_MAP_USERPTR) ||
34523453 XE_IOCTL_DBG(xe, coh_mode == XE_COH_NONE &&
34533454 op == DRM_XE_VM_BIND_OP_MAP_USERPTR) ||
3455+ XE_IOCTL_DBG(xe, comp_en &&
3456+ op == DRM_XE_VM_BIND_OP_MAP_USERPTR) ||
34543457 XE_IOCTL_DBG(xe, op == DRM_XE_VM_BIND_OP_MAP_USERPTR &&
34553458 !IS_ENABLED(CONFIG_DRM_GPUSVM)) ||
34563459 XE_IOCTL_DBG(xe, obj &&
@@ -3529,6 +3532,7 @@ static int xe_vm_bind_ioctl_validate_bo(struct xe_device *xe, struct xe_bo *bo, · 72 unmodified lines
35293532 u16 pat_index, u32 op, u32 bind_flags)
35303533 {
35313534 u16 coh_mode;
3535+ bool comp_en;
35323536
35333537 if (XE_IOCTL_DBG(xe, (bo->flags & XE_BO_FLAG_NO_COMPRESSION) &&
35343538 xe_pat_index_get_comp_en(xe, pat_index)))
@@ -3574,6 +3578,14 @@ static int xe_vm_bind_ioctl_validate_bo(struct xe_device *xe, struct xe_bo *bo, · 39 unmodified lines
35743578 return -EINVAL;
35753579 }
35763580
3581+ /*
3582+ * Ensures that imported buffer objects (dma-bufs) are not mapped
3583+ * with a PAT index that enables compression.
3584+ */
3585+ comp_en = xe_pat_index_get_comp_en(xe, pat_index);
3586+ if (XE_IOCTL_DBG(xe, bo->ttm.base.import_attach && comp_en))
3587+ return -EINVAL;
3588+
35773589 /* If a BO is protected it can only be mapped if the key is still valid */
35783590 if ((bind_flags & DRM_XE_VM_BIND_FLAG_CHECK_PXP) && xe_bo_is_protected(bo) &&
35793591 op != DRM_XE_VM_BIND_OP_UNMAP && op != DRM_XE_VM_BIND_OP_UNMAP_ALL)
drivers/gpu/drm/xe/xe_vm.h+1−1
@@ -382,7 +382,7 @@ static inline void xe_vm_set_validation_exec(struct xe_vm *vm, struct drm_exec * · 381 unmodified lines
382382 }
383383
384384 /**
385− * xe_vm_set_validation_exec() - Accessor to read the drm_exec object
385+ * xe_vm_validation_exec() - Accessor to read the drm_exec object
386386 * @vm: The vm we want to register a drm_exec object with.
387387 *
388388 * Return: The drm_exec object used to lock the vm's resv. The value
drivers/gpu/drm/xe/xe_vram.c+1−3
@@ -13,12 +13,10 @@ · 12 unmodified lines
1313 #include "regs/xe_gt_regs.h"
1414 #include "regs/xe_regs.h"
1515 #include "xe_assert.h"
16−#include "xe_bo.h"
1716 #include "xe_device.h"
1817 #include "xe_force_wake.h"
1918 #include "xe_gt_mcr.h"
2019 #include "xe_mmio.h"
21−#include "xe_module.h"
2220 #include "xe_sriov.h"
2321 #include "xe_tile_sriov_vf.h"
2422 #include "xe_ttm_vram_mgr.h"
@@ -155,7 +153,7 @@ static int tile_vram_size(struct xe_tile *tile, u64 *vram_size, · 130 unmodified lines
155153 *tile_offset = 0;
156154 } else {
157155 reg = xe_mmio_read32(&tile->mmio, SG_TILE_ADDR_RANGE(tile->id));
158− *tile_size = (u64)REG_FIELD_GET(GENMASK(14, 8), reg) * SZ_1G;
156+ *tile_size = (u64)REG_FIELD_GET(GENMASK(17, 8), reg) * SZ_1G;
159157 *tile_offset = (u64)REG_FIELD_GET(GENMASK(7, 1), reg) * SZ_1G;
160158 }
161159
drivers/gpu/drm/xe/xe_vram_freq.c+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 #include <linux/sysfs.h>
66 #include <drm/drm_managed.h>
77
8−#include "xe_gt_types.h"
98 #include "xe_pcode.h"
109 #include "xe_pcode_api.h"
1110 #include "xe_tile.h"
drivers/gpu/drm/xe/xe_vsec.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212
1313 #include "xe_device.h"
1414 #include "xe_device_types.h"
15−#include "xe_drv.h"
1615 #include "xe_mmio.h"
1716 #include "xe_platform_types.h"
1817 #include "xe_pm.h"
drivers/gpu/drm/xe/xe_wa.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include "regs/xe_regs.h"
2020 #include "xe_device_types.h"
2121 #include "xe_force_wake.h"
22−#include "xe_gt.h"
22+#include "xe_gt_types.h"
2323 #include "xe_hw_engine_types.h"
2424 #include "xe_mmio.h"
2525 #include "xe_platform_types.h"
drivers/gpu/drm/xe/xe_wait_user_fence.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <uapi/drm/xe_drm.h>
1212
1313 #include "xe_device.h"
14−#include "xe_gt.h"
1514 #include "xe_macros.h"
1615 #include "xe_exec_queue.h"
1716
drivers/gpu/drm/xe/xe_wopcm.c+1−1
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #include "regs/xe_guc_regs.h"
1111 #include "xe_device.h"
1212 #include "xe_force_wake.h"
13−#include "xe_gt.h"
13+#include "xe_gt_types.h"
1414 #include "xe_mmio.h"
1515 #include "xe_uc_fw.h"
1616
include/uapi/drm/xe_drm.h+0−4
@@ -1280,9 +1280,6 @@ struct drm_xe_vm_bind { · 1279 unmodified lines
12801280 * then a new multi-queue group is created with this queue as the primary queue
12811281 * (Q0). Otherwise, the queue gets added to the multi-queue group whose primary
12821282 * queue's exec_queue_id is specified in the lower 32 bits of the 'value' field.
1283− * If the extension's 'value' field has %DRM_XE_MULTI_GROUP_KEEP_ACTIVE flag
1284− * set, then the multi-queue group is kept active after the primary queue is
1285− * destroyed.
12861283 * All the other non-relevant bits of extension's 'value' field while adding the
12871284 * primary or the secondary queues of the group must be set to 0.
12881285 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY - Set the queue
@@ -1331,7 +1328,6 @@ struct drm_xe_exec_queue_create { · 42 unmodified lines
13311328 #define DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE 3
13321329 #define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_GROUP 4
13331330 #define DRM_XE_MULTI_GROUP_CREATE (1ull << 63)
1334−#define DRM_XE_MULTI_GROUP_KEEP_ACTIVE (1ull << 62)
13351331 #define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY 5
13361332 /** @extensions: Pointer to the first extension struct, if any */
13371333 __u64 extensions;