summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 51384933..721c44e3 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -22,7 +22,6 @@
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/cdev.h> 23#include <linux/cdev.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/firmware.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/irq.h> 26#include <linux/irq.h>
28#include <linux/export.h> 27#include <linux/export.h>
@@ -706,8 +705,6 @@ void gk20a_remove_support(struct device *dev)
706 if (g->sim.remove_support) 705 if (g->sim.remove_support)
707 g->sim.remove_support(&g->sim); 706 g->sim.remove_support(&g->sim);
708 707
709 release_firmware(g->pmu_fw);
710
711 /* free mappings to registers, etc */ 708 /* free mappings to registers, etc */
712 709
713 if (g->regs) { 710 if (g->regs) {
@@ -2047,60 +2044,6 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
2047 return 0; 2044 return 0;
2048} 2045}
2049 2046
2050static const struct firmware *
2051do_request_firmware(struct device *dev, const char *prefix, const char *fw_name)
2052{
2053 const struct firmware *fw;
2054 char *fw_path = NULL;
2055 int path_len, err;
2056
2057 if (prefix) {
2058 path_len = strlen(prefix) + strlen(fw_name);
2059 path_len += 2; /* for the path separator and zero terminator*/
2060
2061 fw_path = kzalloc(sizeof(*fw_path) * path_len, GFP_KERNEL);
2062 if (!fw_path)
2063 return NULL;
2064
2065 sprintf(fw_path, "%s/%s", prefix, fw_name);
2066 fw_name = fw_path;
2067 }
2068
2069 err = request_firmware(&fw, fw_name, dev);
2070 kfree(fw_path);
2071 if (err)
2072 return NULL;
2073 return fw;
2074}
2075
2076/* This is a simple wrapper around request_firmware that takes 'fw_name' and
2077 * applies an IP specific relative path prefix to it. The caller is
2078 * responsible for calling release_firmware later. */
2079const struct firmware *
2080gk20a_request_firmware(struct gk20a *g, const char *fw_name)
2081{
2082 struct device *dev = g->dev;
2083 const struct firmware *fw;
2084
2085 /* current->fs is NULL when calling from SYS_EXIT.
2086 Add a check here to prevent crash in request_firmware */
2087 if (!current->fs || !fw_name)
2088 return NULL;
2089
2090 BUG_ON(!g->ops.name);
2091 fw = do_request_firmware(dev, g->ops.name, fw_name);
2092
2093#ifdef CONFIG_TEGRA_GK20A
2094 /* TO BE REMOVED - Support loading from legacy SOC specific path. */
2095 if (!fw) {
2096 struct gk20a_platform *platform = gk20a_get_platform(dev);
2097 fw = do_request_firmware(dev, platform->soc_name, fw_name);
2098 }
2099#endif
2100
2101 return fw;
2102}
2103
2104int gk20a_read_ptimer(struct gk20a *g, u64 *value) 2047int gk20a_read_ptimer(struct gk20a *g, u64 *value)
2105{ 2048{
2106 const unsigned int max_iterations = 3; 2049 const unsigned int max_iterations = 3;