]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix erroneous dereference of batch_obj inside reset_status
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Dec 2013 11:37:09 +0000 (11:37 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Dec 2013 09:49:05 +0000 (10:49 +0100)
commitd58771138732ae988692f5b6909f280775612327
tree6491769be6090a1e3ae93a564e1bcd9951b6f861
parent08abd3cf65b97df4c8ed4327876adacf28acb382
drm/i915: Fix erroneous dereference of batch_obj inside reset_status

As the rings may be processed and their requests deallocated in a
different order to the natural retirement during a reset,

/* Whilst this request exists, batch_obj will be on the
 * active_list, and so will hold the active reference. Only when this
 * request is retired will the the batch_obj be moved onto the
 * inactive_list and lose its active reference. Hence we do not need
 * to explicitly hold another reference here.
 */

is violated, and the batch_obj may be dereferenced after it had been
freed on another ring. This can be simply avoided by processing the
status update prior to deallocating any requests.

Fixes regression (a possible OOPS following a GPU hang) from
commit c80682a3934a980219e6b2b40bb1e5c4a645c391
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Wed Jun 12 15:13:20 2013 +0300

    drm/i915: find guilty batch buffer on ring resets

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
[danvet: Add the code comment Chris supplied.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c