Lines Matching refs:engine

104 hang_create_request(struct hang *h, struct intel_engine_cs *engine)  in hang_create_request()  argument
157 rq = igt_request_alloc(h->ctx, engine); in hang_create_request()
226 intel_gt_chipset_flush(engine->gt); in hang_create_request()
228 if (rq->engine->emit_init_breadcrumb) { in hang_create_request()
229 err = rq->engine->emit_init_breadcrumb(rq); in hang_create_request()
238 err = rq->engine->emit_bb_start(rq, i915_vma_offset(vma), PAGE_SIZE, flags); in hang_create_request()
288 struct intel_engine_cs *engine; in igt_hang_sanitycheck() local
299 for_each_engine(engine, gt, id) { in igt_hang_sanitycheck()
303 if (!intel_engine_can_store_dword(engine)) in igt_hang_sanitycheck()
306 rq = hang_create_request(&h, engine); in igt_hang_sanitycheck()
310 engine->name, err); in igt_hang_sanitycheck()
317 intel_gt_chipset_flush(engine->gt); in igt_hang_sanitycheck()
333 engine->name, err); in igt_hang_sanitycheck()
343 static bool wait_for_idle(struct intel_engine_cs *engine) in wait_for_idle() argument
345 return wait_for(intel_engine_is_idle(engine), IGT_IDLE_TIMEOUT) == 0; in wait_for_idle()
352 struct intel_engine_cs *engine; in igt_reset_nop() local
363 for_each_engine(engine, gt, id) { in igt_reset_nop()
367 ce = intel_context_create(engine); in igt_reset_nop()
370 pr_err("[%s] Create context failed: %d!\n", engine->name, err); in igt_reset_nop()
381 engine->name, err); in igt_reset_nop()
396 pr_err("[%s] GT is wedged!\n", engine->name); in igt_reset_nop()
403 engine->name, i915_reset_count(global), reset_count, count); in igt_reset_nop()
410 pr_err("[%s] Flush failed: %d!\n", engine->name, err); in igt_reset_nop()
428 struct intel_engine_cs *engine; in igt_reset_nop_engine() local
436 for_each_engine(engine, gt, id) { in igt_reset_nop_engine()
442 if (intel_engine_uses_guc(engine)) { in igt_reset_nop_engine()
450 ce = intel_context_create(engine); in igt_reset_nop_engine()
452 pr_err("[%s] Create context failed: %pe!\n", engine->name, ce); in igt_reset_nop_engine()
457 reset_engine_count = i915_reset_engine_count(global, engine); in igt_reset_nop_engine()
460 st_engine_heartbeat_disable(engine); in igt_reset_nop_engine()
466 if (!wait_for_idle(engine)) { in igt_reset_nop_engine()
468 engine->name); in igt_reset_nop_engine()
480 intel_engine_dump(engine, &p, in igt_reset_nop_engine()
483 engine->name); in igt_reset_nop_engine()
487 engine->name); in igt_reset_nop_engine()
498 err = intel_engine_reset(engine, NULL); in igt_reset_nop_engine()
501 engine->name, err); in igt_reset_nop_engine()
511 if (i915_reset_engine_count(global, engine) != in igt_reset_nop_engine()
514 engine->name); in igt_reset_nop_engine()
520 st_engine_heartbeat_enable(engine); in igt_reset_nop_engine()
522 pr_info("%s(%s): %d resets\n", __func__, engine->name, count); in igt_reset_nop_engine()
534 static void force_reset_timeout(struct intel_engine_cs *engine) in force_reset_timeout() argument
536 engine->reset_timeout.probability = 999; in force_reset_timeout()
537 atomic_set(&engine->reset_timeout.times, -1); in force_reset_timeout()
540 static void cancel_reset_timeout(struct intel_engine_cs *engine) in cancel_reset_timeout() argument
542 memset(&engine->reset_timeout, 0, sizeof(engine->reset_timeout)); in cancel_reset_timeout()
548 struct intel_engine_cs *engine; in igt_reset_fail_engine() local
556 for_each_engine(engine, gt, id) { in igt_reset_fail_engine()
563 if (intel_engine_uses_guc(engine)) in igt_reset_fail_engine()
566 ce = intel_context_create(engine); in igt_reset_fail_engine()
568 pr_err("[%s] Create context failed: %pe!\n", engine->name, ce); in igt_reset_fail_engine()
572 st_engine_heartbeat_disable(engine); in igt_reset_fail_engine()
576 force_reset_timeout(engine); in igt_reset_fail_engine()
577 err = intel_engine_reset(engine, NULL); in igt_reset_fail_engine()
578 cancel_reset_timeout(engine); in igt_reset_fail_engine()
587 if (!wait_for_idle(engine)) { in igt_reset_fail_engine()
589 engine->name); in igt_reset_fail_engine()
601 intel_engine_dump(engine, &p, in igt_reset_fail_engine()
604 engine->name); in igt_reset_fail_engine()
608 engine->name); in igt_reset_fail_engine()
626 err = intel_engine_reset(engine, NULL); in igt_reset_fail_engine()
629 engine->name, err); in igt_reset_fail_engine()
635 force_reset_timeout(engine); in igt_reset_fail_engine()
636 err = intel_engine_reset(engine, NULL); in igt_reset_fail_engine()
637 cancel_reset_timeout(engine); in igt_reset_fail_engine()
640 engine->name, err); in igt_reset_fail_engine()
652 intel_engine_dump(engine, &p, in igt_reset_fail_engine()
655 engine->name); in igt_reset_fail_engine()
659 engine->name); in igt_reset_fail_engine()
669 pr_info("%s(%s): %d resets\n", __func__, engine->name, count); in igt_reset_fail_engine()
672 st_engine_heartbeat_enable(engine); in igt_reset_fail_engine()
687 struct intel_engine_cs *engine; in __igt_reset_engine() local
703 for_each_engine(engine, gt, id) { in __igt_reset_engine()
706 bool using_guc = intel_engine_uses_guc(engine); in __igt_reset_engine()
712 if (active && !intel_engine_can_store_dword(engine)) in __igt_reset_engine()
715 if (!wait_for_idle(engine)) { in __igt_reset_engine()
717 engine->name); in __igt_reset_engine()
723 reset_engine_count = i915_reset_engine_count(global, engine); in __igt_reset_engine()
725 st_engine_heartbeat_disable(engine); in __igt_reset_engine()
734 err = intel_selftest_modify_policy(engine, &saved, in __igt_reset_engine()
737 pr_err("[%s] Modify policy failed: %d!\n", engine->name, err); in __igt_reset_engine()
742 rq = hang_create_request(&h, engine); in __igt_reset_engine()
746 engine->name, err); in __igt_reset_engine()
758 intel_engine_dump(engine, &p, in __igt_reset_engine()
759 "%s\n", engine->name); in __igt_reset_engine()
768 err = intel_engine_reset(engine, NULL); in __igt_reset_engine()
771 engine->name, err); in __igt_reset_engine()
781 engine->name, rq->fence.context, in __igt_reset_engine()
797 if (i915_reset_engine_count(global, engine) != in __igt_reset_engine()
800 engine->name); in __igt_reset_engine()
809 err2 = intel_selftest_restore_policy(engine, &saved); in __igt_reset_engine()
811 pr_err("[%s] Restore policy failed: %d!\n", engine->name, err); in __igt_reset_engine()
818 st_engine_heartbeat_enable(engine); in __igt_reset_engine()
820 engine->name, count, active ? "active" : "idle"); in __igt_reset_engine()
827 pr_err("[%s] Flush failed: %d!\n", engine->name, err); in __igt_reset_engine()
856 struct intel_engine_cs *engine; member
877 rq->engine->name, in active_request_put()
882 intel_gt_set_wedged(rq->engine->gt); in active_request_put()
895 struct intel_engine_cs *engine = arg->engine; in active_engine() local
902 ce[count] = intel_context_create(engine); in active_engine()
906 engine->name, count, arg->result); in active_engine()
922 pr_err("[%s] Create request #%d failed: %d!\n", engine->name, idx, err); in active_engine()
929 if (engine->sched_engine->schedule && arg->flags & TEST_PRIORITY) { in active_engine()
934 engine->sched_engine->schedule(rq[idx], &attr); in active_engine()
939 pr_err("[%s] Request put failed: %d!\n", engine->name, err); in active_engine()
950 pr_err("[%s] Request put #%ld failed: %d!\n", engine->name, count, err); in active_engine()
967 struct intel_engine_cs *engine, *other; in __igt_reset_engines() local
993 for_each_engine(engine, gt, id) { in __igt_reset_engines()
996 bool using_guc = intel_engine_uses_guc(engine); in __igt_reset_engines()
1000 if (!intel_engine_can_store_dword(engine)) in __igt_reset_engines()
1005 if (!wait_for_idle(engine)) { in __igt_reset_engines()
1007 engine->name, test_name); in __igt_reset_engines()
1019 if (other == engine && !(flags & TEST_SELF)) in __igt_reset_engines()
1022 if (other != engine && !(flags & TEST_OTHERS)) in __igt_reset_engines()
1025 threads[tmp].engine = other; in __igt_reset_engines()
1033 engine->name, err); in __igt_reset_engines()
1044 st_engine_heartbeat_disable_no_pm(engine); in __igt_reset_engines()
1052 err = intel_selftest_modify_policy(engine, &saved, in __igt_reset_engines()
1055 pr_err("[%s] Modify policy failed: %d!\n", engine->name, err); in __igt_reset_engines()
1060 rq = hang_create_request(&h, engine); in __igt_reset_engines()
1064 engine->name, err); in __igt_reset_engines()
1076 intel_engine_dump(engine, &p, in __igt_reset_engines()
1077 "%s\n", engine->name); in __igt_reset_engines()
1084 intel_engine_pm_get(engine); in __igt_reset_engines()
1088 err = intel_engine_reset(engine, NULL); in __igt_reset_engines()
1091 engine->name, test_name, err); in __igt_reset_engines()
1101 engine->name, rq->fence.context, in __igt_reset_engines()
1110 engine->name, test_name, in __igt_reset_engines()
1127 engine->name, test_name, in __igt_reset_engines()
1130 intel_engine_dump(engine, &p, in __igt_reset_engines()
1131 "%s\n", engine->name); in __igt_reset_engines()
1144 intel_engine_pm_put(engine); in __igt_reset_engines()
1146 if (!(flags & TEST_SELF) && !wait_for_idle(engine)) { in __igt_reset_engines()
1152 engine->name, test_name); in __igt_reset_engines()
1153 intel_engine_dump(engine, &p, in __igt_reset_engines()
1154 "%s\n", engine->name); in __igt_reset_engines()
1161 err2 = intel_selftest_restore_policy(engine, &saved); in __igt_reset_engines()
1163 pr_err("[%s] Restore policy failed: %d!\n", engine->name, err2); in __igt_reset_engines()
1170 st_engine_heartbeat_enable_no_pm(engine); in __igt_reset_engines()
1173 engine->name, test_name, count); in __igt_reset_engines()
1177 reported = i915_reset_engine_count(global, engine); in __igt_reset_engines()
1178 reported -= threads[engine->id].resets; in __igt_reset_engines()
1181 engine->name, test_name, count, reported); in __igt_reset_engines()
1208 if (other->uabi_class != engine->uabi_class && in __igt_reset_engines()
1233 pr_err("[%s] Flush failed: %d!\n", engine->name, err); in __igt_reset_engines()
1299 struct intel_engine_cs *engine; in igt_reset_wait() local
1306 engine = intel_selftest_find_any_engine(gt); in igt_reset_wait()
1308 if (!engine || !intel_engine_can_store_dword(engine)) in igt_reset_wait()
1317 pr_err("[%s] Hang init failed: %d!\n", engine->name, err); in igt_reset_wait()
1321 rq = hang_create_request(&h, engine); in igt_reset_wait()
1324 pr_err("[%s] Create hang request failed: %d!\n", engine->name, err); in igt_reset_wait()
1336 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_reset_wait()
1431 struct intel_engine_cs *engine; in __igt_reset_evict_vma() local
1443 engine = intel_selftest_find_any_engine(gt); in __igt_reset_evict_vma()
1445 if (!engine || !intel_engine_can_store_dword(engine)) in __igt_reset_evict_vma()
1452 pr_err("[%s] Hang init failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1459 pr_err("[%s] Create object failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1474 pr_err("[%s] VMA instance failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1478 rq = hang_create_request(&h, engine); in __igt_reset_evict_vma()
1481 pr_err("[%s] Create hang request failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1493 pr_err("[%s] VMA pin failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1509 pr_err("[%s] Move to active failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1525 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1536 pr_err("[%s] Thread spawn failed: %d!\n", engine->name, err); in __igt_reset_evict_vma()
1548 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1556 fake_hangcheck(gt, rq->engine->mask); in __igt_reset_evict_vma()
1621 struct intel_engine_cs *engine; in wait_for_others() local
1624 for_each_engine(engine, gt, id) { in wait_for_others()
1625 if (engine == exclude) in wait_for_others()
1628 if (!wait_for_idle(engine)) in wait_for_others()
1639 struct intel_engine_cs *engine; in igt_reset_queue() local
1652 for_each_engine(engine, gt, id) { in igt_reset_queue()
1657 bool using_guc = intel_engine_uses_guc(engine); in igt_reset_queue()
1659 if (!intel_engine_can_store_dword(engine)) in igt_reset_queue()
1663 err = intel_selftest_modify_policy(engine, &saved, in igt_reset_queue()
1666 pr_err("[%s] Modify policy failed: %d!\n", engine->name, err); in igt_reset_queue()
1671 prev = hang_create_request(&h, engine); in igt_reset_queue()
1674 pr_err("[%s] Create 'prev' hang request failed: %d!\n", engine->name, err); in igt_reset_queue()
1686 rq = hang_create_request(&h, engine); in igt_reset_queue()
1689 pr_err("[%s] Create hang request failed: %d!\n", engine->name, err); in igt_reset_queue()
1706 err = wait_for_others(gt, engine); in igt_reset_queue()
1709 __func__, engine->name); in igt_reset_queue()
1722 __func__, engine->name, in igt_reset_queue()
1724 intel_engine_dump(engine, &p, in igt_reset_queue()
1725 "%s\n", engine->name); in igt_reset_queue()
1769 engine->name, count); in igt_reset_queue()
1772 intel_gt_chipset_flush(engine->gt); in igt_reset_queue()
1778 int err2 = intel_selftest_restore_policy(engine, &saved); in igt_reset_queue()
1782 __func__, __LINE__, engine->name, err2); in igt_reset_queue()
1791 pr_err("[%s] Flush failed: %d!\n", engine->name, err); in igt_reset_queue()
1811 struct intel_engine_cs *engine; in igt_handle_error() local
1817 engine = intel_selftest_find_any_engine(gt); in igt_handle_error()
1824 if (!engine || !intel_engine_can_store_dword(engine)) in igt_handle_error()
1829 pr_err("[%s] Hang init failed: %d!\n", engine->name, err); in igt_handle_error()
1833 rq = hang_create_request(&h, engine); in igt_handle_error()
1836 pr_err("[%s] Create hang request failed: %d!\n", engine->name, err); in igt_handle_error()
1848 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_handle_error()
1859 intel_gt_handle_error(gt, engine->mask, 0, NULL); in igt_handle_error()
1876 static int __igt_atomic_reset_engine(struct intel_engine_cs *engine, in __igt_atomic_reset_engine() argument
1880 struct tasklet_struct * const t = &engine->sched_engine->tasklet; in __igt_atomic_reset_engine()
1884 engine->name, mode, p->name); in __igt_atomic_reset_engine()
1892 err = __intel_engine_reset_bh(engine, NULL); in __igt_atomic_reset_engine()
1904 engine->name, mode, p->name); in __igt_atomic_reset_engine()
1909 static int igt_atomic_reset_engine(struct intel_engine_cs *engine, in igt_atomic_reset_engine() argument
1916 err = __igt_atomic_reset_engine(engine, p, "idle"); in igt_atomic_reset_engine()
1920 err = hang_init(&h, engine->gt); in igt_atomic_reset_engine()
1922 pr_err("[%s] Hang init failed: %d!\n", engine->name, err); in igt_atomic_reset_engine()
1926 rq = hang_create_request(&h, engine); in igt_atomic_reset_engine()
1929 pr_err("[%s] Create hang request failed: %d!\n", engine->name, err); in igt_atomic_reset_engine()
1937 err = __igt_atomic_reset_engine(engine, p, "active"); in igt_atomic_reset_engine()
1940 __func__, engine->name, in igt_atomic_reset_engine()
1942 intel_gt_set_wedged(engine->gt); in igt_atomic_reset_engine()
1949 intel_wedge_on_timeout(&w, engine->gt, HZ / 20 /* 50ms */) in igt_atomic_reset_engine()
1951 if (intel_gt_is_wedged(engine->gt)) in igt_atomic_reset_engine()
1982 struct intel_engine_cs *engine; in igt_reset_engines_atomic() local
1985 for_each_engine(engine, gt, id) { in igt_reset_engines_atomic()
1986 err = igt_atomic_reset_engine(engine, p); in igt_reset_engines_atomic()