mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
Query the num_perfmon requires golden context to be ready. Accessing golden context might require gr_instance_id, specific to a GR engine. On TOT, get_num_hwpm_perfmon() called from perfmon HAL which might require to call nvgpu_gr_exec_with_err_for_instance(). It internally calls nvgpu_grmgr_config_gr_remap_window() to change gr_window_remap register points to a current gr_instance_id for MIG. This approach indirectly mandates to call nvgpu_gr_exec_with_err_for_instance() which can be completely avoided. get_num_hwpm_perfmon() is just a query call which can be moved after the golden context creation. Using this logic, we can avoid unnecessary invocation of nvgpu_gr_exec_with_err_for_instance() during perform specific HAL accesses. 1) Moved get_num_hwpm_perfmon() after golden context creation. 2) Added nvgpu_assert() if (g->num_sys_perfmon == 0U). JIRA NVGPU-5656 Change-Id: I59a6ab4df93763adbc0765fa5e4d1712b2477521 Signed-off-by: Lakshmanan M <lm@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2542438 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>