From 24e1c7e0a729158be36d63b821550d206a8a0436 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 17:08:50 -0800 Subject: gpu: nvgpu: Use new kmem API functions (misc) Use the new kmem API functions in misc gk20a code. Some additional modifications were also made: o Add a struct gk20a pointer to gk20a_fence to enable proper kmem free usage. o Add gk20a pointer to alloc_session() in dbg_gpu_gk20a.c to use kmem API for allocating a session. o Plumb a gk20a pointer through the fence creation and deletion. o Use statically allocated buffers for names in file creation. Bug 1799159 Bug 1823380 Change-Id: I3678080e3ffa1f9bcf6934e3f4819a1bc531689b Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1318323 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index bae5c2d8..aabe673a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -26,6 +26,8 @@ #include +#include + #include "gk20a.h" #include "pmu_gk20a.h" #include "clk_gk20a.h" @@ -364,7 +366,7 @@ void gk20a_scale_init(struct device *dev) if (!platform->devfreq_governor && !platform->qos_notify) return; - profile = kzalloc(sizeof(*profile), GFP_KERNEL); + profile = nvgpu_kzalloc(g, sizeof(*profile)); profile->dev = dev; profile->dev_stat.busy = false; @@ -415,7 +417,7 @@ void gk20a_scale_init(struct device *dev) return; err_get_freqs: - kfree(profile); + nvgpu_kfree(g, profile); } void gk20a_scale_exit(struct device *dev) @@ -436,7 +438,7 @@ void gk20a_scale_exit(struct device *dev) g->devfreq = NULL; } - kfree(g->scale_profile); + nvgpu_kfree(g, g->scale_profile); g->scale_profile = NULL; } -- cgit v1.2.2