drm/i915: Remove livelock from "do_idle_maps" vtd w/a
A call to wait for the GT to idle from inside the put_pages fallback is prone to cause an uninterruptible livelock. As it does not provide adequate serialisation with new requests, simply fallback to a trivial sleep. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201209164008.5487-1-chris@chris-wilson.co.uk
This commit is contained in:
parent
338d58cf47
commit
63de1da147
@ -55,22 +55,17 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj,
|
||||
void i915_gem_gtt_finish_pages(struct drm_i915_gem_object *obj,
|
||||
struct sg_table *pages)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
|
||||
struct device *kdev = &dev_priv->drm.pdev->dev;
|
||||
struct i915_ggtt *ggtt = &dev_priv->ggtt;
|
||||
struct drm_i915_private *i915 = to_i915(obj->base.dev);
|
||||
struct i915_ggtt *ggtt = &i915->ggtt;
|
||||
|
||||
if (unlikely(ggtt->do_idle_maps)) {
|
||||
/* XXX This does not prevent more requests being submitted! */
|
||||
if (intel_gt_retire_requests_timeout(ggtt->vm.gt,
|
||||
-MAX_SCHEDULE_TIMEOUT)) {
|
||||
drm_err(&dev_priv->drm,
|
||||
"Failed to wait for idle; VT'd may hang.\n");
|
||||
/* Wait a bit, in hopes it avoids the hang */
|
||||
udelay(10);
|
||||
}
|
||||
}
|
||||
/* XXX This does not prevent more requests being submitted! */
|
||||
if (unlikely(ggtt->do_idle_maps))
|
||||
/* Wait a bit, in the hope it avoids the hang */
|
||||
usleep_range(100, 250);
|
||||
|
||||
dma_unmap_sg(kdev, pages->sgl, pages->nents, PCI_DMA_BIDIRECTIONAL);
|
||||
dma_unmap_sg(&i915->drm.pdev->dev,
|
||||
pages->sgl, pages->nents,
|
||||
PCI_DMA_BIDIRECTIONAL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user