}
}
+static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
+{
+ struct xe_device *xe = arg;
+
+ if (atomic_read(&xe->wedged.flag))
+ xe_pm_runtime_put(xe);
+}
+
int xe_device_probe(struct xe_device *xe)
{
struct xe_tile *tile;
detect_preproduction_hw(xe);
+ err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
+ if (err)
+ goto err_unregister_display;
+
return devm_add_action_or_reset(xe->drm.dev, xe_device_sanitize, xe);
err_unregister_display:
return address & GENMASK_ULL(xe->info.va_bits - 1, 0);
}
-static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
-{
- struct xe_device *xe = arg;
-
- xe_pm_runtime_put(xe);
-}
-
/**
* DOC: Xe Device Wedging
*
return;
}
- xe_pm_runtime_get_noresume(xe);
-
- if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
- drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
- return;
- }
-
if (!atomic_xchg(&xe->wedged.flag, 1)) {
xe->needs_flr_on_fini = true;
+ xe_pm_runtime_get_noresume(xe);
drm_err(&xe->drm,
"CRITICAL: Xe has declared device %s as wedged.\n"
"IOCTLs and executions are blocked. Only a rebind may clear the failure\n"