treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / i915 / selftests / igt_flush_test.c
blob7b0939e3f00747f79ee91b1ccc7471a7f6cf7582
1 /*
2 * SPDX-License-Identifier: MIT
4 * Copyright © 2018 Intel Corporation
5 */
7 #include "gt/intel_gt.h"
8 #include "gt/intel_gt_requests.h"
10 #include "i915_drv.h"
11 #include "i915_selftest.h"
13 #include "igt_flush_test.h"
15 int igt_flush_test(struct drm_i915_private *i915)
17 struct intel_gt *gt = &i915->gt;
18 int ret = intel_gt_is_wedged(gt) ? -EIO : 0;
20 cond_resched();
22 if (intel_gt_wait_for_idle(gt, HZ / 5) == -ETIME) {
23 pr_err("%pS timed out, cancelling all further testing.\n",
24 __builtin_return_address(0));
26 GEM_TRACE("%pS timed out.\n",
27 __builtin_return_address(0));
28 GEM_TRACE_DUMP();
30 intel_gt_set_wedged(gt);
31 ret = -EIO;
34 return ret;