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
@@ -762,9 +763,11 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
762
763
*/
763
764
void xe_exec_queue_update_run_ticks (struct xe_exec_queue * q )
764
765
{
766
+ struct xe_device * xe = gt_to_xe (q -> gt );
765
767
struct xe_file * xef ;
766
768
struct xe_lrc * lrc ;
767
769
u32 old_ts , new_ts ;
770
+ int idx ;
768
771
769
772
/*
770
773
* Jobs that are run during driver load may use an exec_queue, but are
@@ -774,6 +777,10 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
774
777
if (!q -> vm || !q -> vm -> xef )
775
778
return ;
776
779
780
+ /* Synchronize with unbind while holding the xe file open */
781
+ if (!drm_dev_enter (& xe -> drm , & idx ))
782
+ return ;
783
+
777
784
xef = q -> vm -> xef ;
778
785
779
786
/*
@@ -787,6 +794,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
787
794
lrc = q -> lrc [0 ];
788
795
new_ts = xe_lrc_update_timestamp (lrc , & old_ts );
789
796
xef -> run_ticks [q -> class ] += (new_ts - old_ts ) * q -> width ;
797
+
798
+ drm_dev_exit (idx );
790
799
}
791
800
792
801
/**
You can’t perform that action at this time.
0 commit comments