]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Move LNL scheduling WA to xe_device.h
authorNirmoy Das <nirmoy.das@intel.com>
Tue, 29 Oct 2024 12:01:15 +0000 (13:01 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 4 Nov 2024 16:12:30 +0000 (08:12 -0800)
Move LNL scheduling WA to xe_device.h so this can be used in other
places without needing keep the same comment about removal of this WA
in the future. The WA, which flushes work or workqueues, is now wrapped
in macros and can be reused wherever needed.

Cc: Badal Nilawar <badal.nilawar@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
cc: stable@vger.kernel.org # v6.11+
Suggested-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241029120117.449694-1-nirmoy.das@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit cbe006a6492c01a0058912ae15d473f4c149896c)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_device.h
drivers/gpu/drm/xe/xe_guc_ct.c

index 894f04770454f2df4e0683b7fae0726828822c1e..34620ef855c0cb9f7c30dbdc7572fbb4d52dfa7a 100644 (file)
@@ -178,4 +178,18 @@ void xe_device_declare_wedged(struct xe_device *xe);
 struct xe_file *xe_file_get(struct xe_file *xef);
 void xe_file_put(struct xe_file *xef);
 
+/*
+ * Occasionally it is seen that the G2H worker starts running after a delay of more than
+ * a second even after being queued and activated by the Linux workqueue subsystem. This
+ * leads to G2H timeout error. The root cause of issue lies with scheduling latency of
+ * Lunarlake Hybrid CPU. Issue disappears if we disable Lunarlake atom cores from BIOS
+ * and this is beyond xe kmd.
+ *
+ * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU.
+ */
+#define LNL_FLUSH_WORKQUEUE(wq__) \
+       flush_workqueue(wq__)
+#define LNL_FLUSH_WORK(wrk__) \
+       flush_work(wrk__)
+
 #endif
index 17986bfd881876275e9222a85e597a6a9f7ea6b5..9c505d3517cd1af753f32507ffb44651ccbc0e80 100644 (file)
@@ -897,17 +897,8 @@ retry_same_fence:
 
        ret = wait_event_timeout(ct->g2h_fence_wq, g2h_fence.done, HZ);
 
-       /*
-        * Occasionally it is seen that the G2H worker starts running after a delay of more than
-        * a second even after being queued and activated by the Linux workqueue subsystem. This
-        * leads to G2H timeout error. The root cause of issue lies with scheduling latency of
-        * Lunarlake Hybrid CPU. Issue dissappears if we disable Lunarlake atom cores from BIOS
-        * and this is beyond xe kmd.
-        *
-        * TODO: Drop this change once workqueue scheduling delay issue is fixed on LNL Hybrid CPU.
-        */
        if (!ret) {
-               flush_work(&ct->g2h_worker);
+               LNL_FLUSH_WORK(&ct->g2h_worker);
                if (g2h_fence.done) {
                        xe_gt_warn(gt, "G2H fence %u, action %04x, done\n",
                                   g2h_fence.seqno, action[0]);