File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 8
8
#include <linux/nospec.h>
9
9
10
10
#include <drm/drm_device.h>
11
+ #include <drm/drm_drv.h>
11
12
#include <drm/drm_file.h>
12
13
#include <uapi/drm/xe_drm.h>
13
14
@@ -768,9 +769,11 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
768
769
*/
769
770
void xe_exec_queue_update_run_ticks (struct xe_exec_queue * q )
770
771
{
772
+ struct xe_device * xe = gt_to_xe (q -> gt );
771
773
struct xe_file * xef ;
772
774
struct xe_lrc * lrc ;
773
775
u32 old_ts , new_ts ;
776
+ int idx ;
774
777
775
778
/*
776
779
* Jobs that are run during driver load may use an exec_queue, but are
@@ -780,6 +783,10 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
780
783
if (!q -> vm || !q -> vm -> xef )
781
784
return ;
782
785
786
+ /* Synchronize with unbind while holding the xe file open */
787
+ if (!drm_dev_enter (& xe -> drm , & idx ))
788
+ return ;
789
+
783
790
xef = q -> vm -> xef ;
784
791
785
792
/*
@@ -793,6 +800,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
793
800
lrc = q -> lrc [0 ];
794
801
new_ts = xe_lrc_update_timestamp (lrc , & old_ts );
795
802
xef -> run_ticks [q -> class ] += (new_ts - old_ts ) * q -> width ;
803
+
804
+ drm_dev_exit (idx );
796
805
}
797
806
798
807
/**
You can’t perform that action at this time.
0 commit comments