Lines Matching +full:max +full:- +full:rpm

1 // SPDX-License-Identifier: MIT
22 struct i915_ggtt *ggtt = gt->ggtt; in __igt_reset_stolen()
23 const struct resource *dsm = &gt->i915->dsm.stolen; in __igt_reset_stolen()
29 long max, count; in __igt_reset_stolen() local
34 if (!drm_mm_node_allocated(&ggtt->error_capture)) in __igt_reset_stolen()
43 return -ENOMEM; in __igt_reset_stolen()
47 err = -ENOMEM; in __igt_reset_stolen()
52 wakeref = intel_runtime_pm_get(gt->uncore->rpm); in __igt_reset_stolen()
62 if (!(mask & engine->mask)) in __igt_reset_stolen()
83 dma_addr_t dma = (dma_addr_t)dsm->start + (page << PAGE_SHIFT); in __igt_reset_stolen()
87 ggtt->vm.insert_page(&ggtt->vm, dma, in __igt_reset_stolen()
88 ggtt->error_capture.start, in __igt_reset_stolen()
89 i915_gem_get_pat_index(gt->i915, in __igt_reset_stolen()
94 s = io_mapping_map_wc(&ggtt->iomap, in __igt_reset_stolen()
95 ggtt->error_capture.start, in __igt_reset_stolen()
98 if (!__drm_mm_interval_first(&gt->i915->mm.stolen, in __igt_reset_stolen()
100 ((page + 1) << PAGE_SHIFT) - 1)) in __igt_reset_stolen()
111 ggtt->vm.clear_range(&ggtt->vm, ggtt->error_capture.start, PAGE_SIZE); in __igt_reset_stolen()
117 if (mask & engine->mask) in __igt_reset_stolen()
122 max = -1; in __igt_reset_stolen()
125 dma_addr_t dma = (dma_addr_t)dsm->start + (page << PAGE_SHIFT); in __igt_reset_stolen()
130 ggtt->vm.insert_page(&ggtt->vm, dma, in __igt_reset_stolen()
131 ggtt->error_capture.start, in __igt_reset_stolen()
132 i915_gem_get_pat_index(gt->i915, in __igt_reset_stolen()
137 s = io_mapping_map_wc(&ggtt->iomap, in __igt_reset_stolen()
138 ggtt->error_capture.start, in __igt_reset_stolen()
147 !__drm_mm_interval_first(&gt->i915->mm.stolen, in __igt_reset_stolen()
149 ((page + 1) << PAGE_SHIFT) - 1)) { in __igt_reset_stolen()
154 max = page; in __igt_reset_stolen()
160 ggtt->vm.clear_range(&ggtt->vm, ggtt->error_capture.start, PAGE_SIZE); in __igt_reset_stolen()
164 msg, count, max); in __igt_reset_stolen()
166 if (max >= I915_GEM_STOLEN_BIAS >> PAGE_SHIFT) { in __igt_reset_stolen()
169 err = -EINVAL; in __igt_reset_stolen()
176 intel_runtime_pm_put(gt->uncore->rpm, wakeref); in __igt_reset_stolen()
201 err = __igt_reset_stolen(gt, engine->mask, engine->name); in igt_reset_engines_stolen()
219 wakeref = intel_runtime_pm_get(gt->uncore->rpm); in igt_global_reset()
221 reset_count = i915_reset_count(&gt->i915->gpu_error); in igt_global_reset()
225 if (i915_reset_count(&gt->i915->gpu_error) == reset_count) { in igt_global_reset()
227 err = -EINVAL; in igt_global_reset()
230 intel_runtime_pm_put(gt->uncore->rpm, wakeref); in igt_global_reset()
234 err = -EIO; in igt_global_reset()
247 wakeref = intel_runtime_pm_get(gt->uncore->rpm); in igt_wedged_reset()
254 intel_runtime_pm_put(gt->uncore->rpm, wakeref); in igt_wedged_reset()
257 return intel_gt_is_wedged(gt) ? -EIO : 0; in igt_wedged_reset()
276 for (p = igt_atomic_phases; p->name; p++) { in igt_atomic_reset()
279 GEM_TRACE("__intel_gt_reset under %s\n", p->name); in igt_atomic_reset()
282 p->critical_section_begin(); in igt_atomic_reset()
286 p->critical_section_end(); in igt_atomic_reset()
290 pr_err("__intel_gt_reset failed under %s\n", p->name); in igt_atomic_reset()
319 if (intel_uc_uses_guc_submission(&gt->uc)) in igt_atomic_engine_reset()
330 struct tasklet_struct *t = &engine->sched_engine->tasklet; in igt_atomic_engine_reset()
332 if (t->func) in igt_atomic_engine_reset()
336 for (p = igt_atomic_phases; p->name; p++) { in igt_atomic_engine_reset()
338 engine->name, p->name); in igt_atomic_engine_reset()
339 if (strcmp(p->name, "softirq")) in igt_atomic_engine_reset()
342 p->critical_section_begin(); in igt_atomic_engine_reset()
344 p->critical_section_end(); in igt_atomic_engine_reset()
346 if (strcmp(p->name, "softirq")) in igt_atomic_engine_reset()
351 engine->name, p->name); in igt_atomic_engine_reset()
357 if (t->func) { in igt_atomic_engine_reset()
391 return -EIO; /* we're long past hope of a successful reset */ in intel_reset_live_selftests()