mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 10:24:11 +07:00
5d904e3c5d
Where the function, or code segment, operates on intel_gt, we need to start passing it instead of i915 to for_each_engine(_masked). This is another partial step in migration of i915->engines[] to gt->engines[]. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20191017094500.21831-2-tvrtko.ursulin@linux.intel.com
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2018 Intel Corporation
|
|
*/
|
|
|
|
#include "igt_reset.h"
|
|
|
|
#include "gt/intel_engine.h"
|
|
#include "gt/intel_gt.h"
|
|
|
|
#include "../i915_drv.h"
|
|
|
|
void igt_global_reset_lock(struct intel_gt *gt)
|
|
{
|
|
struct intel_engine_cs *engine;
|
|
enum intel_engine_id id;
|
|
|
|
pr_debug("%s: current gpu_error=%08lx\n", __func__, gt->reset.flags);
|
|
|
|
while (test_and_set_bit(I915_RESET_BACKOFF, >->reset.flags))
|
|
wait_event(gt->reset.queue,
|
|
!test_bit(I915_RESET_BACKOFF, >->reset.flags));
|
|
|
|
for_each_engine(engine, gt, id) {
|
|
while (test_and_set_bit(I915_RESET_ENGINE + id,
|
|
>->reset.flags))
|
|
wait_on_bit(>->reset.flags, I915_RESET_ENGINE + id,
|
|
TASK_UNINTERRUPTIBLE);
|
|
}
|
|
}
|
|
|
|
void igt_global_reset_unlock(struct intel_gt *gt)
|
|
{
|
|
struct intel_engine_cs *engine;
|
|
enum intel_engine_id id;
|
|
|
|
for_each_engine(engine, gt, id)
|
|
clear_bit(I915_RESET_ENGINE + id, >->reset.flags);
|
|
|
|
clear_bit(I915_RESET_BACKOFF, >->reset.flags);
|
|
wake_up_all(>->reset.queue);
|
|
}
|
|
|
|
bool igt_force_reset(struct intel_gt *gt)
|
|
{
|
|
intel_gt_set_wedged(gt);
|
|
intel_gt_reset(gt, 0, NULL);
|
|
|
|
return !intel_gt_is_wedged(gt);
|
|
}
|