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>
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;