Skip to content

Commit 4e6de6b

Browse files
committed
Merge tag 'drm-xe-fixes-2025-05-01' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Eustall locking fix and disabling on VF - Documentation fix kernel version supporting hwmon entries - SVM fixes on error handling Signed-off-by: Dave Airlie <airlied@redhat.com> From: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/fqkoqvo62fbkvw6xoxoxutzozqksxxudbmqacjm3durid2pkak@imlxghgrk3ob
2 parents c13276a + e8e3a80 commit 4e6de6b

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ Description: RO. Package current voltage in millivolt.
111111

112112
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_input
113113
Date: March 2025
114-
KernelVersion: 6.14
114+
KernelVersion: 6.15
115115
Contact: intel-xe@lists.freedesktop.org
116116
Description: RO. Package temperature in millidegree Celsius.
117117

118118
Only supported for particular Intel Xe graphics platforms.
119119

120120
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_input
121121
Date: March 2025
122-
KernelVersion: 6.14
122+
KernelVersion: 6.15
123123
Contact: intel-xe@lists.freedesktop.org
124124
Description: RO. VRAM temperature in millidegree Celsius.
125125

drivers/gpu/drm/drm_gpusvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1469,9 +1469,9 @@ int drm_gpusvm_range_get_pages(struct drm_gpusvm *gpusvm,
14691469
}
14701470
i += 1 << order;
14711471
num_dma_mapped = i;
1472+
range->flags.has_dma_mapping = true;
14721473
}
14731474

1474-
range->flags.has_dma_mapping = true;
14751475
if (zdd) {
14761476
range->flags.has_devmem_pages = true;
14771477
range->dpagemap = dpagemap;

drivers/gpu/drm/xe/xe_eu_stall.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ struct xe_eu_stall_data_stream {
5252

5353
struct xe_gt *gt;
5454
struct xe_bo *bo;
55+
/* Lock to protect data buffer pointers */
56+
struct mutex xecore_buf_lock;
5557
struct per_xecore_buf *xecore_buf;
5658
struct {
5759
bool reported_to_user;
@@ -208,6 +210,9 @@ int xe_eu_stall_init(struct xe_gt *gt)
208210
struct xe_device *xe = gt_to_xe(gt);
209211
int ret;
210212

213+
if (!xe_eu_stall_supported_on_platform(xe))
214+
return 0;
215+
211216
gt->eu_stall = kzalloc(sizeof(*gt->eu_stall), GFP_KERNEL);
212217
if (!gt->eu_stall) {
213218
ret = -ENOMEM;
@@ -378,7 +383,7 @@ static bool eu_stall_data_buf_poll(struct xe_eu_stall_data_stream *stream)
378383
u16 group, instance;
379384
unsigned int xecore;
380385

381-
mutex_lock(&gt->eu_stall->stream_lock);
386+
mutex_lock(&stream->xecore_buf_lock);
382387
for_each_dss_steering(xecore, gt, group, instance) {
383388
xecore_buf = &stream->xecore_buf[xecore];
384389
read_ptr = xecore_buf->read;
@@ -396,7 +401,7 @@ static bool eu_stall_data_buf_poll(struct xe_eu_stall_data_stream *stream)
396401
set_bit(xecore, stream->data_drop.mask);
397402
xecore_buf->write = write_ptr;
398403
}
399-
mutex_unlock(&gt->eu_stall->stream_lock);
404+
mutex_unlock(&stream->xecore_buf_lock);
400405

401406
return min_data_present;
402407
}
@@ -511,11 +516,13 @@ static ssize_t xe_eu_stall_stream_read_locked(struct xe_eu_stall_data_stream *st
511516
unsigned int xecore;
512517
int ret = 0;
513518

519+
mutex_lock(&stream->xecore_buf_lock);
514520
if (bitmap_weight(stream->data_drop.mask, XE_MAX_DSS_FUSE_BITS)) {
515521
if (!stream->data_drop.reported_to_user) {
516522
stream->data_drop.reported_to_user = true;
517523
xe_gt_dbg(gt, "EU stall data dropped in XeCores: %*pb\n",
518524
XE_MAX_DSS_FUSE_BITS, stream->data_drop.mask);
525+
mutex_unlock(&stream->xecore_buf_lock);
519526
return -EIO;
520527
}
521528
stream->data_drop.reported_to_user = false;
@@ -527,6 +534,7 @@ static ssize_t xe_eu_stall_stream_read_locked(struct xe_eu_stall_data_stream *st
527534
if (ret || count == total_size)
528535
break;
529536
}
537+
mutex_unlock(&stream->xecore_buf_lock);
530538
return total_size ?: (ret ?: -EAGAIN);
531539
}
532540

@@ -583,6 +591,7 @@ static void xe_eu_stall_stream_free(struct xe_eu_stall_data_stream *stream)
583591
{
584592
struct xe_gt *gt = stream->gt;
585593

594+
mutex_destroy(&stream->xecore_buf_lock);
586595
gt->eu_stall->stream = NULL;
587596
kfree(stream);
588597
}
@@ -718,6 +727,7 @@ static int xe_eu_stall_stream_init(struct xe_eu_stall_data_stream *stream,
718727
}
719728

720729
init_waitqueue_head(&stream->poll_wq);
730+
mutex_init(&stream->xecore_buf_lock);
721731
INIT_DELAYED_WORK(&stream->buf_poll_work, eu_stall_data_buf_poll_work_fn);
722732
stream->per_xecore_buf_size = per_xecore_buf_size;
723733
stream->sampling_rate_mult = props->sampling_rate_mult;

drivers/gpu/drm/xe/xe_eu_stall.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define __XE_EU_STALL_H__
88

99
#include "xe_gt_types.h"
10+
#include "xe_sriov.h"
1011

1112
size_t xe_eu_stall_get_per_xecore_buf_size(void);
1213
size_t xe_eu_stall_data_record_size(struct xe_device *xe);
@@ -19,6 +20,6 @@ int xe_eu_stall_stream_open(struct drm_device *dev,
1920

2021
static inline bool xe_eu_stall_supported_on_platform(struct xe_device *xe)
2122
{
22-
return xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20;
23+
return !IS_SRIOV_VF(xe) && (xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20);
2324
}
2425
#endif

drivers/gpu/drm/xe/xe_guc_capture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void __fill_ext_reg(struct __guc_mmio_reg_descr *ext,
359359

360360
ext->reg = XE_REG(extlist->reg.__reg.addr);
361361
ext->flags = FIELD_PREP(GUC_REGSET_STEERING_NEEDED, 1);
362-
ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice_id);
362+
ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice_id);
363363
ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslice_id);
364364
ext->regname = extlist->name;
365365
}

drivers/gpu/drm/xe/xe_svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ xe_svm_range_alloc(struct drm_gpusvm *gpusvm)
7979

8080
range = kzalloc(sizeof(*range), GFP_KERNEL);
8181
if (!range)
82-
return ERR_PTR(-ENOMEM);
82+
return NULL;
8383

8484
INIT_LIST_HEAD(&range->garbage_collector_link);
8585
xe_vm_get(gpusvm_to_vm(gpusvm));

0 commit comments

Comments
 (0)