kernel-drm: remove ttm_bo_reserve for TTM_PL_SYNCCPU_OP_RELEASE ioctl.
authorFei Jiang <fei.jiang@intel.com>
Sun, 6 May 2012 15:27:07 +0000 (23:27 +0800)
committerbuildbot <buildbot@intel.com>
Tue, 8 May 2012 20:53:35 +0000 (13:53 -0700)
BZ: 34332

Some time ttm_bo_reserver will fail, then will not decrease cpu_writers,
while pool_releasefromcpu and wsbmBOReleaseFromCpu will not handle the return error.
ttm_ref_object_base_unref will only access the bo->write_counter with atomic_dec_and_test, which is atomic operation.

Change-Id: Ie831fad02699ec1875d73e238edaf3b2ff10f4d9
Reviewed-on: http://android.intel.com:8080/47556
Reviewed-by: Jiang, Fei <fei.jiang@intel.com>
Reviewed-by: Ding, Haitao <haitao.ding@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/staging/mrst/imgv/psb_ttm_placement_user.c

index 019d7f2..bb18859 100644 (file)
@@ -489,21 +489,8 @@ int ttm_pl_synccpu_ioctl(struct ttm_object_file *tfile, void *data)
                ttm_base_object_unref(&base);
                break;
        case TTM_PL_SYNCCPU_OP_RELEASE:
-               bo = ttm_buffer_object_lookup(tfile, arg->handle);
-               if (unlikely(bo == NULL)) {
-                       printk(KERN_ERR "Could not find buffer object for synccpu release\n");
-                       ret = -EINVAL;
-                       goto out;
-               }
-               ret = ttm_bo_reserve(bo, true, true, false, 0);
-               if (unlikely(ret != 0)) {
-                       ttm_bo_unref(&bo);
-                       return ret;
-               }
                ret = ttm_ref_object_base_unref(tfile, arg->handle,
                                                TTM_REF_SYNCCPU_WRITE);
-               ttm_bo_unreserve(bo);
-               ttm_bo_unref(&bo);
                break;
        default:
                ret = -EINVAL;