diff --git a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_seq.c b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_seq.c index 230c60b1c..4b270d3fc 100644 --- a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_seq.c +++ b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_seq.c @@ -20,6 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include #include @@ -91,7 +92,7 @@ void nvgpu_pmu_sequences_cleanup(struct gk20a *g, struct nvgpu_pmu *pmu, for (i = 0; i < PMU_MAX_NUM_SEQUENCES; i++) { if (sequences->seq[i].cb_params != NULL) { - nvgpu_pmu_seq_free_release(g, sequences, + g->ops.pmu.pmu_seq_cleanup(g, sequences, &sequences->seq[i]); nvgpu_pmu_dbg(g, "sequences cleanup done"); } diff --git a/drivers/gpu/nvgpu/hal/init/hal_ga100.c b/drivers/gpu/nvgpu/hal/init/hal_ga100.c index 34daf5752..878ae1d53 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_ga100.c +++ b/drivers/gpu/nvgpu/hal/init/hal_ga100.c @@ -30,6 +30,7 @@ #include #ifdef CONFIG_NVGPU_LS_PMU #include +#include #endif #include #include @@ -1382,6 +1383,7 @@ static const struct gops_pmu ga100_ops_pmu = { .setup_apertures = tu104_pmu_setup_apertures, .secured_pmu_start = gm20b_secured_pmu_start, .pmu_clear_bar0_host_err_status = gm20b_clear_pmu_bar0_host_err_status, + .pmu_seq_cleanup = nvgpu_pmu_seq_free_release, }; #endif diff --git a/drivers/gpu/nvgpu/hal/init/hal_ga10b.c b/drivers/gpu/nvgpu/hal/init/hal_ga10b.c index 25ccd84f8..d9b383c93 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_ga10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_ga10b.c @@ -31,6 +31,7 @@ #include #ifdef CONFIG_NVGPU_LS_PMU #include +#include #endif #include #include @@ -1407,6 +1408,7 @@ static const struct gops_pmu ga10b_ops_pmu = { .pmu_isr = gk20a_pmu_isr, .handle_ext_irq = ga10b_pmu_handle_ext_irq, #ifdef CONFIG_NVGPU_LS_PMU + .pmu_seq_cleanup = nvgpu_pmu_seq_free_release, .get_inst_block_config = ga10b_pmu_get_inst_block_config, /* Init */ .pmu_rtos_init = nvgpu_pmu_rtos_init, diff --git a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c index 1078f30c1..b0c202af4 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gm20b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gm20b.c @@ -53,6 +53,7 @@ #include #ifdef CONFIG_NVGPU_LS_PMU #include +#include #endif #include #ifdef CONFIG_NVGPU_CLK_ARB @@ -876,6 +877,7 @@ static const struct gops_pmu gm20b_ops_pmu = { .setup_apertures = gm20b_pmu_setup_apertures, .secured_pmu_start = gm20b_secured_pmu_start, .handle_swgen1_irq = NULL, + .pmu_seq_cleanup = nvgpu_pmu_seq_release, }; #endif diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index f412c5c55..b8a63ecbd 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -29,6 +29,7 @@ #include #ifdef CONFIG_NVGPU_LS_PMU #include +#include #endif #include #ifdef CONFIG_NVGPU_CLK_ARB @@ -1191,6 +1192,8 @@ static const struct gops_pmu gv11b_ops_pmu = { .pmu_queue_head = gk20a_pmu_queue_head, .pmu_queue_tail = gk20a_pmu_queue_tail, .pmu_msgq_tail = gk20a_pmu_msgq_tail, + /* pmu sequence */ + .pmu_seq_cleanup = nvgpu_pmu_seq_release, /* mutex */ .pmu_mutex_size = gv11b_pmu_mutex__size_1_v, .pmu_mutex_owner = gk20a_pmu_mutex_owner, diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index 857fe37b6..eb2184b83 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -223,6 +223,7 @@ #include #ifdef CONFIG_NVGPU_LS_PMU #include +#include #endif #include #include @@ -1266,6 +1267,7 @@ static const struct gops_pmu tu104_ops_pmu = { .setup_apertures = tu104_pmu_setup_apertures, .secured_pmu_start = gm20b_secured_pmu_start, .pmu_clear_bar0_host_err_status = gm20b_clear_pmu_bar0_host_err_status, + .pmu_seq_cleanup = nvgpu_pmu_seq_free_release, }; #endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/gops/pmu.h index fc2dd30ca..ad8d25151 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops/pmu.h @@ -304,6 +304,9 @@ struct gops_pmu { int (*pmu_destroy)(struct gk20a *g, struct nvgpu_pmu *pmu); int (*pmu_pstate_sw_setup)(struct gk20a *g); int (*pmu_pstate_pmu_setup)(struct gk20a *g); + void (*pmu_seq_cleanup)(struct gk20a *g, + struct pmu_sequences *sequences, + struct pmu_sequence *seq); #endif struct nvgpu_hw_err_inject_info_desc * (*get_pmu_err_desc)