From 1d8fdf56959240622073dd771dd9bfccf31b8f8e Mon Sep 17 00:00:00 2001 From: Bharat Nihalani Date: Fri, 29 May 2015 16:26:23 +0530 Subject: Revert "Revert "Revert "gpu: nvgpu: New allocator for VA space""" This reverts commit ce1cf06b9a8eb6314ba0ca294e8cb430e1e141c0 since it causes GPU pbdma interrupt to be generated. Bug 200106514 Change-Id: If3ed9a914c4e3e7f3f98c6609c6dbf57e1eb9aad Signed-off-by: Bharat Nihalani Reviewed-on: http://git-master/r/749291 --- drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c index 053550f6..04f61c58 100644 --- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c @@ -3,7 +3,7 @@ * * GK20A Semaphores * - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -44,10 +44,8 @@ struct gk20a_semaphore_pool *gk20a_semaphore_pool_alloc(struct device *d, if (gk20a_get_sgtable(d, &p->sgt, p->cpu_va, p->iova, p->size)) goto clean_up; - /* Sacrifice one semaphore in the name of returning error codes. */ - if (gk20a_allocator_init(&p->alloc, unique_name, - SEMAPHORE_SIZE, p->size - SEMAPHORE_SIZE, - SEMAPHORE_SIZE)) + if (gk20a_allocator_init(&p->alloc, unique_name, 0, + p->size)) goto clean_up; gk20a_dbg_info("cpuva=%p iova=%llx phys=%llx", p->cpu_va, @@ -165,8 +163,8 @@ struct gk20a_semaphore *gk20a_semaphore_alloc(struct gk20a_semaphore_pool *pool) if (!s) return NULL; - s->offset = gk20a_balloc(&pool->alloc, SEMAPHORE_SIZE); - if (!s->offset) { + if (pool->alloc.alloc(&pool->alloc, &s->offset, SEMAPHORE_SIZE, + SEMAPHORE_SIZE)) { gk20a_err(pool->dev, "failed to allocate semaphore"); kfree(s); return NULL; @@ -188,7 +186,8 @@ static void gk20a_semaphore_free(struct kref *ref) struct gk20a_semaphore *s = container_of(ref, struct gk20a_semaphore, ref); - gk20a_bfree(&s->pool->alloc, s->offset); + s->pool->alloc.free(&s->pool->alloc, s->offset, SEMAPHORE_SIZE, + SEMAPHORE_SIZE); gk20a_semaphore_pool_put(s->pool); kfree(s); } -- cgit v1.2.2