Skip to content

Commit ffbedb4

Browse files
tomitamoekogregkh
authored andcommitted
Revert "drm/xe/devcoredump: Update handling of xe_force_wake_get return"
This reverts commit 9ffd6ec. The reverted commit updated the handling of xe_force_wake_get to match the new "return refcounted domain mask" semantics introduced in commit a7ddcea ("drm/xe: Error handling in xe_force_wake_get()"). However, that API change only exists in 6.13 and later. In 6.12 stable kernel, xe_force_wake_get still returns a status code. The update incorrectly treats the return value as a mask, causing the return value of 0 to be misinterpreted as an error Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Himal Prasad Ghimiray <[email protected]> Cc: Nirmoy Das <[email protected]> Cc: Badal Nilawar <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Signed-off-by: Tomita Moeko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5a276d3 commit ffbedb4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ static void xe_devcoredump_deferred_snap_work(struct work_struct *work)
197197
struct xe_devcoredump_snapshot *ss = container_of(work, typeof(*ss), work);
198198
struct xe_devcoredump *coredump = container_of(ss, typeof(*coredump), snapshot);
199199
struct xe_device *xe = coredump_to_xe(coredump);
200-
unsigned int fw_ref;
201200

202201
/*
203202
* NB: Despite passing a GFP_ flags parameter here, more allocations are done
@@ -211,12 +210,11 @@ static void xe_devcoredump_deferred_snap_work(struct work_struct *work)
211210
xe_pm_runtime_get(xe);
212211

213212
/* keep going if fw fails as we still want to save the memory and SW data */
214-
fw_ref = xe_force_wake_get(gt_to_fw(ss->gt), XE_FORCEWAKE_ALL);
215-
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL))
213+
if (xe_force_wake_get(gt_to_fw(ss->gt), XE_FORCEWAKE_ALL))
216214
xe_gt_info(ss->gt, "failed to get forcewake for coredump capture\n");
217215
xe_vm_snapshot_capture_delayed(ss->vm);
218216
xe_guc_exec_queue_snapshot_capture_delayed(ss->ge);
219-
xe_force_wake_put(gt_to_fw(ss->gt), fw_ref);
217+
xe_force_wake_put(gt_to_fw(ss->gt), XE_FORCEWAKE_ALL);
220218

221219
xe_pm_runtime_put(xe);
222220

@@ -243,9 +241,8 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump,
243241
u32 width_mask = (0x1 << q->width) - 1;
244242
const char *process_name = "no process";
245243

246-
unsigned int fw_ref;
247-
bool cookie;
248244
int i;
245+
bool cookie;
249246

250247
ss->snapshot_time = ktime_get_real();
251248
ss->boot_time = ktime_get_boottime();
@@ -268,7 +265,8 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump,
268265
}
269266

270267
/* keep going if fw fails as we still want to save the memory and SW data */
271-
fw_ref = xe_force_wake_get(gt_to_fw(q->gt), XE_FORCEWAKE_ALL);
268+
if (xe_force_wake_get(gt_to_fw(q->gt), XE_FORCEWAKE_ALL))
269+
xe_gt_info(ss->gt, "failed to get forcewake for coredump capture\n");
272270

273271
ss->ct = xe_guc_ct_snapshot_capture(&guc->ct, true);
274272
ss->ge = xe_guc_exec_queue_snapshot_capture(q);
@@ -286,7 +284,7 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump,
286284

287285
queue_work(system_unbound_wq, &ss->work);
288286

289-
xe_force_wake_put(gt_to_fw(q->gt), fw_ref);
287+
xe_force_wake_put(gt_to_fw(q->gt), XE_FORCEWAKE_ALL);
290288
dma_fence_end_signalling(cookie);
291289
}
292290

0 commit comments

Comments
 (0)