mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 07:36:37 +07:00
drm/i915: Don't mix srcu tag and negative error codes
While srcu may use an integer tag, it does not exclude potential error codes and so may overlap with our own use of -EINTR. Use a separate outparam to store the tag, and report the error code separately. Fixes:2caffbf117
("drm/i915: Revoke mmaps and prevent access to fence registers across reset") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190912160834.30601-1-chris@chris-wilson.co.uk (cherry picked from commiteebab60f22
) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
282b7fd5f5
commit
fda9fa19b0
@ -245,11 +245,9 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
|
|||||||
|
|
||||||
wakeref = intel_runtime_pm_get(rpm);
|
wakeref = intel_runtime_pm_get(rpm);
|
||||||
|
|
||||||
srcu = intel_gt_reset_trylock(ggtt->vm.gt);
|
ret = intel_gt_reset_trylock(ggtt->vm.gt, &srcu);
|
||||||
if (srcu < 0) {
|
if (ret)
|
||||||
ret = srcu;
|
|
||||||
goto err_rpm;
|
goto err_rpm;
|
||||||
}
|
|
||||||
|
|
||||||
ret = i915_mutex_lock_interruptible(dev);
|
ret = i915_mutex_lock_interruptible(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1214,10 +1214,8 @@ void intel_gt_handle_error(struct intel_gt *gt,
|
|||||||
intel_runtime_pm_put(>->i915->runtime_pm, wakeref);
|
intel_runtime_pm_put(>->i915->runtime_pm, wakeref);
|
||||||
}
|
}
|
||||||
|
|
||||||
int intel_gt_reset_trylock(struct intel_gt *gt)
|
int intel_gt_reset_trylock(struct intel_gt *gt, int *srcu)
|
||||||
{
|
{
|
||||||
int srcu;
|
|
||||||
|
|
||||||
might_lock(>->reset.backoff_srcu);
|
might_lock(>->reset.backoff_srcu);
|
||||||
might_sleep();
|
might_sleep();
|
||||||
|
|
||||||
@ -1232,10 +1230,10 @@ int intel_gt_reset_trylock(struct intel_gt *gt)
|
|||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
}
|
}
|
||||||
srcu = srcu_read_lock(>->reset.backoff_srcu);
|
*srcu = srcu_read_lock(>->reset.backoff_srcu);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
return srcu;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void intel_gt_reset_unlock(struct intel_gt *gt, int tag)
|
void intel_gt_reset_unlock(struct intel_gt *gt, int tag)
|
||||||
|
@ -38,7 +38,7 @@ int intel_engine_reset(struct intel_engine_cs *engine,
|
|||||||
|
|
||||||
void __i915_request_reset(struct i915_request *rq, bool guilty);
|
void __i915_request_reset(struct i915_request *rq, bool guilty);
|
||||||
|
|
||||||
int __must_check intel_gt_reset_trylock(struct intel_gt *gt);
|
int __must_check intel_gt_reset_trylock(struct intel_gt *gt, int *srcu);
|
||||||
void intel_gt_reset_unlock(struct intel_gt *gt, int tag);
|
void intel_gt_reset_unlock(struct intel_gt *gt, int tag);
|
||||||
|
|
||||||
void intel_gt_set_wedged(struct intel_gt *gt);
|
void intel_gt_set_wedged(struct intel_gt *gt);
|
||||||
|
Loading…
Reference in New Issue
Block a user