summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-01-02 07:31:44 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-05 12:13:30 -0500
commit7f55cfb6e92eb56565fb62684b02664c9cf05c40 (patch)
tree3c0621964b1176ad1934874e3cbfd162d5e054df /drivers/gpu/nvgpu/gm20b/acr_gm20b.c
parentea5a2147229e32f0524827af82cb7a880aca6296 (diff)
gpu: nvgpu: return error on pmu_ucode_details() failure
In lsfm_discover_ucode_images(), we currently collect pmu ucode details with API pmu_ucode_details() But if this API fails, we still continue loading other firmwares In case loading of pmu firmware fails due to some reason, we should actually bail out immediately with error Also, remove unnecessary chekc (ucode_img.lsf_desc != NULL) since pmu_ucode_details() ensures that this cannot be NULL Bug 200265373 Change-Id: I68e7f9575e2a07b473ceacc528a5d172b58d6fb6 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1276555 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/acr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 1d0379c5..1dda2d47 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -473,33 +473,32 @@ static int lsfm_discover_ucode_images(struct gk20a *g,
473 /* Obtain the PMU ucode image and add it to the list if required*/ 473 /* Obtain the PMU ucode image and add it to the list if required*/
474 memset(&ucode_img, 0, sizeof(ucode_img)); 474 memset(&ucode_img, 0, sizeof(ucode_img));
475 status = pmu_ucode_details(g, &ucode_img); 475 status = pmu_ucode_details(g, &ucode_img);
476 if (status == 0) { 476 if (status)
477 if (ucode_img.lsf_desc != NULL) { 477 return status;
478 /* The falon_id is formed by grabbing the static base 478
479 * falon_id from the image and adding the 479 /* The falon_id is formed by grabbing the static base
480 * engine-designated falcon instance.*/ 480 * falon_id from the image and adding the
481 pmu->pmu_mode |= PMU_SECURE_MODE; 481 * engine-designated falcon instance.*/
482 falcon_id = ucode_img.lsf_desc->falcon_id + 482 pmu->pmu_mode |= PMU_SECURE_MODE;
483 ucode_img.flcn_inst; 483 falcon_id = ucode_img.lsf_desc->falcon_id +
484 484 ucode_img.flcn_inst;
485 if (!lsfm_falcon_disabled(g, plsfm, falcon_id)) { 485
486 pmu->falcon_id = falcon_id; 486 if (!lsfm_falcon_disabled(g, plsfm, falcon_id)) {
487 if (lsfm_add_ucode_img(g, plsfm, &ucode_img, 487 pmu->falcon_id = falcon_id;
488 pmu->falcon_id) == 0) 488 if (lsfm_add_ucode_img(g, plsfm, &ucode_img,
489 pmu->pmu_mode |= PMU_LSFM_MANAGED; 489 pmu->falcon_id) == 0)
490 490 pmu->pmu_mode |= PMU_LSFM_MANAGED;
491 plsfm->managed_flcn_cnt++; 491
492 } else { 492 plsfm->managed_flcn_cnt++;
493 gm20b_dbg_pmu("id not managed %d\n", 493 } else {
494 ucode_img.lsf_desc->falcon_id); 494 gm20b_dbg_pmu("id not managed %d\n",
495 } 495 ucode_img.lsf_desc->falcon_id);
496 } 496 }
497 497
498 /*Free any ucode image resources if not managing this falcon*/ 498 /*Free any ucode image resources if not managing this falcon*/
499 if (!(pmu->pmu_mode & PMU_LSFM_MANAGED)) { 499 if (!(pmu->pmu_mode & PMU_LSFM_MANAGED)) {
500 gm20b_dbg_pmu("pmu is not LSFM managed\n"); 500 gm20b_dbg_pmu("pmu is not LSFM managed\n");
501 lsfm_free_ucode_img_res(&ucode_img); 501 lsfm_free_ucode_img_res(&ucode_img);
502 }
503 } 502 }
504 503
505 /* Enumerate all constructed falcon objects, 504 /* Enumerate all constructed falcon objects,