diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 2ff8bfbf1..034347fa2 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -628,8 +628,8 @@ static void gk20a_free_cb(struct nvgpu_ref *refcount) nvgpu_ltc_remove_support(g); - if (g->free != NULL) { - g->free(g); + if (g->gfree != NULL) { + g->gfree(g); } } diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index e8402c684..b02756a63 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1315,11 +1315,9 @@ struct gpu_ops { */ int (*secure_alloc)(struct gk20a *g, struct nvgpu_mem *desc_mem, size_t size, - void (**)(struct gk20a *g, struct nvgpu_mem *mem)); + void (**fn)(struct gk20a *g, struct nvgpu_mem *mem)); struct { - void (*exit)(struct gk20a *g, struct nvgpu_mem *mem, - struct nvgpu_sgl *sgl); u32 (*data032_r)(u32 i); } pramin; struct { @@ -1891,7 +1889,7 @@ struct nvgpu_gpu_params { }; struct gk20a { - void (*free)(struct gk20a *g); + void (*gfree)(struct gk20a *g); struct nvgpu_nvhost_dev *nvhost_dev; /* @@ -2214,8 +2212,10 @@ void gk20a_busy_noresume(struct gk20a *g); void gk20a_idle_nosuspend(struct gk20a *g); int __must_check gk20a_busy(struct gk20a *g); void gk20a_idle(struct gk20a *g); -int __gk20a_do_idle(struct gk20a *g, bool force_reset); -int __gk20a_do_unidle(struct gk20a *g); +#ifdef CONFIG_PM +int gk20a_do_idle_impl(struct gk20a *g, bool force_reset); +int gk20a_do_unidle_impl(struct gk20a *g); +#endif int nvgpu_can_busy(struct gk20a *g); int gk20a_wait_for_idle(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h index 34660516b..ff057d7f6 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,7 +29,7 @@ struct class; int nvgpu_probe(struct gk20a *g, const char *debugfs_symlink, const char *interface_name, - struct class *class); + struct class *device_class); void nvgpu_kernel_restart(void *cmd); diff --git a/drivers/gpu/nvgpu/os/linux/driver_common.c b/drivers/gpu/nvgpu/os/linux/driver_common.c index 0160645b7..9015d6f15 100644 --- a/drivers/gpu/nvgpu/os/linux/driver_common.c +++ b/drivers/gpu/nvgpu/os/linux/driver_common.c @@ -243,7 +243,7 @@ static void nvgpu_init_mm_vars(struct gk20a *g) int nvgpu_probe(struct gk20a *g, const char *debugfs_symlink, const char *interface_name, - struct class *class) + struct class *device_class) { struct device *dev = dev_from_gk20a(g); struct gk20a_platform *platform = dev_get_drvdata(dev); @@ -275,7 +275,7 @@ int nvgpu_probe(struct gk20a *g, nvgpu_init_mm_vars(g); /* platform probe can defer do user init only if probe succeeds */ - err = gk20a_user_init(dev, interface_name, class); + err = gk20a_user_init(dev, interface_name, device_class); if (err) return err; @@ -317,5 +317,5 @@ static void nvgpu_free_gk20a(struct gk20a *g) void nvgpu_init_gk20a(struct gk20a *g) { - g->free = nvgpu_free_gk20a; + g->gfree = nvgpu_free_gk20a; } diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 27f9c9ff7..153a09fe9 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -495,15 +495,15 @@ MODULE_DEVICE_TABLE(of, tegra_gk20a_of_match); #ifdef CONFIG_PM /** - * __gk20a_do_idle() - force the GPU to idle and railgate + * gk20a_do_idle_impl() - force the GPU to idle and railgate * - * In success, this call MUST be balanced by caller with __gk20a_do_unidle() + * In success, this call MUST be balanced by caller with gk20a_do_unidle_impl() * * Acquires two locks : &l->busy_lock and &platform->railgate_lock * In success, we hold these locks and return * In failure, we release these locks and return */ -int __gk20a_do_idle(struct gk20a *g, bool force_reset) +int gk20a_do_idle_impl(struct gk20a *g, bool force_reset) { struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct device *dev = dev_from_gk20a(g); @@ -601,7 +601,7 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset) * if GPU is now idle, call prepare_poweroff() to save the * state and then do explicit railgate * - * __gk20a_do_unidle() needs to unrailgate, call + * gk20a_do_unidle_impl() needs to unrailgate, call * finalize_poweron(), and then call pm_runtime_put_sync() * to balance the GPU usage counter */ @@ -630,7 +630,7 @@ fail_timeout: } /** - * gk20a_do_idle() - wrap up for __gk20a_do_idle() to be called + * gk20a_do_idle() - wrap up for gk20a_do_idle_impl() to be called * from outside of GPU driver * * In success, this call MUST be balanced by caller with gk20a_do_unidle() @@ -639,13 +639,14 @@ static int gk20a_do_idle(void *_g) { struct gk20a *g = (struct gk20a *)_g; - return __gk20a_do_idle(g, true); + return gk20a_do_idle_impl(g, true); } /** - * __gk20a_do_unidle() - unblock all the tasks blocked by __gk20a_do_idle() + * gk20a_do_unidle_impl() - unblock all the tasks blocked by + * gk20a_do_idle_impl() */ -int __gk20a_do_unidle(struct gk20a *g) +int gk20a_do_unidle_impl(struct gk20a *g) { struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct device *dev = dev_from_gk20a(g); @@ -680,13 +681,13 @@ int __gk20a_do_unidle(struct gk20a *g) } /** - * gk20a_do_unidle() - wrap up for __gk20a_do_unidle() + * gk20a_do_unidle() - wrap up for gk20a_do_unidle_impl() */ static int gk20a_do_unidle(void *_g) { struct gk20a *g = (struct gk20a *)_g; - return __gk20a_do_unidle(g); + return gk20a_do_unidle_impl(g); } #endif diff --git a/drivers/gpu/nvgpu/os/linux/sysfs.c b/drivers/gpu/nvgpu/os/linux/sysfs.c index 40f9c60a7..868f08f55 100644 --- a/drivers/gpu/nvgpu/os/linux/sysfs.c +++ b/drivers/gpu/nvgpu/os/linux/sysfs.c @@ -769,7 +769,7 @@ static ssize_t force_idle_store(struct device *dev, if (g->forced_idle) return count; /* do nothing */ else { - err = __gk20a_do_idle(g, false); + err = gk20a_do_idle_impl(g, false); if (!err) { g->forced_idle = 1; nvgpu_info(g, "gpu is idle : %d", @@ -780,7 +780,7 @@ static ssize_t force_idle_store(struct device *dev, if (!g->forced_idle) return count; /* do nothing */ else { - err = __gk20a_do_unidle(g); + err = gk20a_do_unidle_impl(g); if (!err) { g->forced_idle = 0; nvgpu_info(g, "gpu is idle : %d",