Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * SPDX-License-Identifier: MIT
0003  *
0004  * Copyright © 2018 Intel Corporation
0005  */
0006 
0007 #include "gt/intel_gt.h"
0008 #include "gt/intel_gt_requests.h"
0009 
0010 #include "i915_drv.h"
0011 #include "i915_selftest.h"
0012 
0013 #include "igt_flush_test.h"
0014 
0015 int igt_flush_test(struct drm_i915_private *i915)
0016 {
0017     struct intel_gt *gt = to_gt(i915);
0018     int ret = intel_gt_is_wedged(gt) ? -EIO : 0;
0019 
0020     cond_resched();
0021 
0022     if (intel_gt_wait_for_idle(gt, HZ * 3) == -ETIME) {
0023         pr_err("%pS timed out, cancelling all further testing.\n",
0024                __builtin_return_address(0));
0025 
0026         GEM_TRACE("%pS timed out.\n",
0027               __builtin_return_address(0));
0028         GEM_TRACE_DUMP();
0029 
0030         intel_gt_set_wedged(gt);
0031         ret = -EIO;
0032     }
0033 
0034     return ret;
0035 }