From 697fe17dd612769633f8c93e37b65cc51966d7e7 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 20 Sep 2016 08:48:16 -0700 Subject: gpu: nvgpu: Suppress error msg from VBIOS overlay Suppress error message when nvgpu tries to load VBIOS overlay, but one is not found. This situation is normal. This is done by moving gk20a_request_firmware() to be nvgpu generic function nvgpu_request_firmware(), and adding a NO_WARN flag to it. Introduce also a NO_SOC flag to suppress attempt to load firmware from SoC specific directory in addition to the chip specific directory. Use it for dGPU firmware files. Bug 200236777 Change-Id: I0294d3308f029a6a6d3c2effa579d5f69a91e418 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1223840 (cherry picked from commit cca44c3f010f15918cdd2259c15170ba1917828a) Reviewed-on: http://git-master/r/1233353 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/gk20a.c | 57 ----------------------------------------- 1 file changed, 57 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') 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 @@ #include #include #include -#include #include #include #include @@ -706,8 +705,6 @@ void gk20a_remove_support(struct device *dev) if (g->sim.remove_support) g->sim.remove_support(&g->sim); - release_firmware(g->pmu_fw); - /* free mappings to registers, etc */ if (g->regs) { @@ -2047,60 +2044,6 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) return 0; } -static const struct firmware * -do_request_firmware(struct device *dev, const char *prefix, const char *fw_name) -{ - const struct firmware *fw; - char *fw_path = NULL; - int path_len, err; - - if (prefix) { - path_len = strlen(prefix) + strlen(fw_name); - path_len += 2; /* for the path separator and zero terminator*/ - - fw_path = kzalloc(sizeof(*fw_path) * path_len, GFP_KERNEL); - if (!fw_path) - return NULL; - - sprintf(fw_path, "%s/%s", prefix, fw_name); - fw_name = fw_path; - } - - err = request_firmware(&fw, fw_name, dev); - kfree(fw_path); - if (err) - return NULL; - return fw; -} - -/* This is a simple wrapper around request_firmware that takes 'fw_name' and - * applies an IP specific relative path prefix to it. The caller is - * responsible for calling release_firmware later. */ -const struct firmware * -gk20a_request_firmware(struct gk20a *g, const char *fw_name) -{ - struct device *dev = g->dev; - const struct firmware *fw; - - /* current->fs is NULL when calling from SYS_EXIT. - Add a check here to prevent crash in request_firmware */ - if (!current->fs || !fw_name) - return NULL; - - BUG_ON(!g->ops.name); - fw = do_request_firmware(dev, g->ops.name, fw_name); - -#ifdef CONFIG_TEGRA_GK20A - /* TO BE REMOVED - Support loading from legacy SOC specific path. */ - if (!fw) { - struct gk20a_platform *platform = gk20a_get_platform(dev); - fw = do_request_firmware(dev, platform->soc_name, fw_name); - } -#endif - - return fw; -} - int gk20a_read_ptimer(struct gk20a *g, u64 *value) { const unsigned int max_iterations = 3; -- cgit v1.2.2