gpu: nvgpu: gsp: disabling multiple gsp firmware read

Changes:
- disabled gsp firmware release during railgating
- firmware read happen only during power on

Bug 3935433

Change-Id: I9156c015ab7f90ab640c33ca99dc7f3e289b7659
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2870170
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
vivekku
2023-03-13 12:16:13 +00:00
committed by mobile promotions
parent eb52414f22
commit ce4293ab20
4 changed files with 22 additions and 15 deletions

View File

@@ -32,21 +32,17 @@
#include <nvgpu/gsp/gsp_test.h>
#endif
static void gsp_release_firmware(struct gk20a *g, struct nvgpu_gsp *gsp)
void gsp_release_firmware(struct gk20a *g, struct nvgpu_gsp *gsp)
{
if (gsp->gsp_ucode.manifest != NULL) {
nvgpu_release_firmware(g, gsp->gsp_ucode.manifest);
}
if (gsp->gsp_ucode.code != NULL) {
nvgpu_release_firmware(g, gsp->gsp_ucode.code);
}
if (gsp->gsp_ucode.data != NULL) {
nvgpu_release_firmware(g, gsp->gsp_ucode.data);
}
nvgpu_release_firmware(g, gsp->gsp_ucode.manifest);
gsp->gsp_ucode.manifest = NULL;
nvgpu_release_firmware(g, gsp->gsp_ucode.code);
gsp->gsp_ucode.code = NULL;
nvgpu_release_firmware(g, gsp->gsp_ucode.data);
gsp->gsp_ucode.data = NULL;
}
static int gsp_read_firmware(struct gk20a *g, struct nvgpu_gsp *gsp,
struct gsp_fw *gsp_ucode)
{
@@ -56,22 +52,27 @@ static int gsp_read_firmware(struct gk20a *g, struct nvgpu_gsp *gsp,
nvgpu_log_fn(g, " ");
if ((gsp_ucode->manifest != NULL) && (gsp_ucode->code != NULL)
&& (gsp_ucode->data != NULL)) {
return 0;
}
gsp_ucode->manifest = nvgpu_request_firmware(g,
manifest_name, NVGPU_REQUEST_FIRMWARE_NO_WARN);
manifest_name, 0);
if (gsp_ucode->manifest == NULL) {
nvgpu_err(g, "%s ucode get failed", manifest_name);
goto fw_release;
}
gsp_ucode->code = nvgpu_request_firmware(g,
code_name, NVGPU_REQUEST_FIRMWARE_NO_WARN);
code_name, 0);
if (gsp_ucode->code == NULL) {
nvgpu_err(g, "%s ucode get failed", code_name);
goto fw_release;
}
gsp_ucode->data = nvgpu_request_firmware(g,
data_name, NVGPU_REQUEST_FIRMWARE_NO_WARN);
data_name, 0);
if (gsp_ucode->data == NULL) {
nvgpu_err(g, "%s ucode get failed", data_name);
goto fw_release;
@@ -237,8 +238,11 @@ int nvgpu_gsp_bootstrap_ns(struct gk20a *g, struct nvgpu_gsp *gsp)
err = nvgpu_falcon_wait_for_nvriscv_brom_completion(flcn);
if (err != 0) {
nvgpu_err(g, "gsp BROM failed");
goto exit;
}
return err;
exit:
gsp_release_firmware(g, gsp);
return err;

View File

@@ -62,6 +62,7 @@ void nvgpu_gsp_sw_deinit(struct gk20a *g, struct nvgpu_gsp *gsp)
nvgpu_falcon_dbg_buf_destroy(gsp->gsp_flcn);
#endif
gsp_release_firmware(g, gsp);
nvgpu_kfree(g, gsp);
gsp = NULL;
}

View File

@@ -59,6 +59,7 @@ void nvgpu_gsp_sched_suspend(struct gk20a *g, struct nvgpu_gsp_sched *gsp_sched)
}
gsp_sched->gsp_ready = false;
nvgpu_gsp_queues_free(g, g->gsp_sched->queues);
nvgpu_gsp_suspend(g, gsp);
}

View File

@@ -57,6 +57,7 @@ struct nvgpu_gsp {
int nvgpu_gsp_debug_buf_init(struct gk20a *g, u32 queue_no, u32 buffer_size);
void nvgpu_gsp_suspend(struct gk20a *g, struct nvgpu_gsp *gsp);
void gsp_release_firmware(struct gk20a *g, struct nvgpu_gsp *gsp);
void nvgpu_gsp_sw_deinit(struct gk20a *g, struct nvgpu_gsp *gsp);
void nvgpu_gsp_isr_mutex_acquire(struct gk20a *g, struct nvgpu_gsp *gsp);
void nvgpu_gsp_isr_mutex_release(struct gk20a *g, struct nvgpu_gsp *gsp);