From 5de20ab81bec345b87cfecad17a723f1d56586c6 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 12 May 2021 16:25:08 +0530 Subject: [PATCH] gpu: nvgpu: Add gops for enable/disable PMASYS legacy mode Added a gops for enable/disable the PMASYS legacy mode. JIRA NVGPU-5656 Change-Id: I7f9d52d96d41ab38b201f857c492f10806453a7c Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2528423 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Antony Clince Alex Reviewed-by: svc_kernel_abi Reviewed-by: Rajesh Devaraj Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/profiler/pm_reservation.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/profiler/pm_reservation.c b/drivers/gpu/nvgpu/common/profiler/pm_reservation.c index dfe0f46b2..adf27d92d 100644 --- a/drivers/gpu/nvgpu/common/profiler/pm_reservation.c +++ b/drivers/gpu/nvgpu/common/profiler/pm_reservation.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -51,6 +51,15 @@ static void prepare_resource_reservation(struct gk20a *g, nvgpu_err(g, "Failed to reset PERFMON unit"); } nvgpu_cg_slcg_perf_load_enable(g, false); +#ifdef CONFIG_NVGPU_NEXT + /* + * By default, disable the PMASYS legacy mode for + * NVGPU_NEXT. + */ + if (g->ops.perf.enable_pmasys_legacy_mode != NULL) { + g->ops.perf.enable_pmasys_legacy_mode(g, false); + } +#endif } } else { nvgpu_atomic_dec(&g->hwpm_refcount);