gpu: nvgpu: add check related to pmu_support

This patch performs the dereferncing of PMU from GPU driver struct only
when PMU is supported.

JIRA NVGPU-9283

Change-Id: I9a589cd999ff726220168cf108c7e419a5f52038
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2854013
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Rajesh Devaraj
2023-02-06 19:06:18 +00:00
committed by mobile promotions
parent 5d2f56f89f
commit e3e80f8d26

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2023, 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"),
@@ -1209,9 +1209,15 @@ int nvgpu_pmu_pg_buf_alloc(struct gk20a *g, struct nvgpu_pmu *pmu, u32 size)
int nvgpu_pmu_restore_golden_img_state(struct gk20a *g)
{
struct nvgpu_pmu *pmu = g->pmu;
struct nvgpu_pmu *pmu;
int err = 0;
if (!g->support_ls_pmu) {
return 0;
}
pmu = g->pmu;
if (!is_pg_supported(g, pmu->pg)) {
goto out;
}