drm/i915: Store a permanent error in obj->mm.pages
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Mar 2017 13:20:31 +0000 (13:20 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Mar 2017 21:25:38 +0000 (21:25 +0000)
commit4e5462ee843c883790e9609cf560d88960ea4227
tree10271157bf236efc7e82badfdb03d0df2d389965
parente1cd3325b7a7b57717b6e84028edb33164a83bab
drm/i915: Store a permanent error in obj->mm.pages

Once the object has been truncated, it is unrecoverable. To facilitate
detection of this state store the error in obj->mm.pages.

This is required for the next patch which should be applied to v4.10
(via stable), so we also need to mark this patch for backporting. In
that regard, let's consider this to be a fix/improvement too.

v2: Avoid dereferencing the ERR_PTR when freeing the object.

Fixes: 1233e2db199d ("drm/i915: Move object backing storage manipulation to its own locking")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.10+
Link: http://patchwork.freedesktop.org/patch/msgid/20170307132031.32461-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_gem.c