diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_fw.c | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index 413db0a6..82f6a8d6 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -130,6 +130,10 @@ static int nvgpu_init_task_pg_init(struct gk20a *g) | |||
130 | 130 | ||
131 | nvgpu_log_fn(g, " "); | 131 | nvgpu_log_fn(g, " "); |
132 | 132 | ||
133 | if (nvgpu_thread_is_running(&pmu->pg_init.state_task)) { | ||
134 | return 0; | ||
135 | } | ||
136 | |||
133 | nvgpu_cond_init(&pmu->pg_init.wq); | 137 | nvgpu_cond_init(&pmu->pg_init.wq); |
134 | 138 | ||
135 | snprintf(thread_name, sizeof(thread_name), | 139 | snprintf(thread_name, sizeof(thread_name), |
@@ -525,13 +529,13 @@ static int nvgpu_pg_init_task(void *arg) | |||
525 | case PMU_STATE_LOADING_ZBC: | 529 | case PMU_STATE_LOADING_ZBC: |
526 | nvgpu_pmu_dbg(g, "loaded zbc"); | 530 | nvgpu_pmu_dbg(g, "loaded zbc"); |
527 | pmu_setup_hw_enable_elpg(g); | 531 | pmu_setup_hw_enable_elpg(g); |
528 | nvgpu_pmu_dbg(g, "PMU booted, thread exiting"); | 532 | nvgpu_pmu_dbg(g, "PMU booted"); |
529 | 533 | ||
530 | gk20a_gr_wait_initialized(g); | 534 | gk20a_gr_wait_initialized(g); |
531 | 535 | ||
532 | nvgpu_cg_elcg_enable_no_wait(g); | 536 | nvgpu_cg_elcg_enable_no_wait(g); |
533 | 537 | ||
534 | return 0; | 538 | break; |
535 | default: | 539 | default: |
536 | nvgpu_pmu_dbg(g, "invalid state"); | 540 | nvgpu_pmu_dbg(g, "invalid state"); |
537 | break; | 541 | break; |
@@ -560,8 +564,6 @@ int nvgpu_pmu_destroy(struct gk20a *g) | |||
560 | return 0; | 564 | return 0; |
561 | } | 565 | } |
562 | 566 | ||
563 | nvgpu_kill_task_pg_init(g); | ||
564 | |||
565 | nvgpu_pmu_get_pg_stats(g, | 567 | nvgpu_pmu_get_pg_stats(g, |
566 | PMU_PG_ELPG_ENGINE_ID_GRAPHICS, &pg_stat_data); | 568 | PMU_PG_ELPG_ENGINE_ID_GRAPHICS, &pg_stat_data); |
567 | 569 | ||
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c index da77f984..d71238a3 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c | |||
@@ -1651,6 +1651,8 @@ static void nvgpu_remove_pmu_support(struct nvgpu_pmu *pmu) | |||
1651 | 1651 | ||
1652 | nvgpu_dma_unmap_free(vm, &pmu->super_surface_buf); | 1652 | nvgpu_dma_unmap_free(vm, &pmu->super_surface_buf); |
1653 | 1653 | ||
1654 | nvgpu_kill_task_pg_init(g); | ||
1655 | |||
1654 | nvgpu_mutex_destroy(&pmu->elpg_mutex); | 1656 | nvgpu_mutex_destroy(&pmu->elpg_mutex); |
1655 | nvgpu_mutex_destroy(&pmu->pg_mutex); | 1657 | nvgpu_mutex_destroy(&pmu->pg_mutex); |
1656 | nvgpu_mutex_destroy(&pmu->isr_mutex); | 1658 | nvgpu_mutex_destroy(&pmu->isr_mutex); |