Commit Graph

3439 Commits

Author SHA1 Message Date
Chun Ng
b37344e9d7 gpu: nvgpu: Fix out-of-bound access
Make sure the index used to access gpc_tpc_physical_id_map does not
exceed the range.

Bug 4566775

Change-Id: I863f4b4d06c8ace3b58b8c3fdc60f9d466846072
Signed-off-by: Chun Ng <chunn@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3341829
Tested-by: Aasta Lin <aastal@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-17 15:09:05 -07:00
Shashank Singh
af45c11d05 gpu: nvgpu: make entries check robust for kernel submit
Check on the number of entries for kernel mode submit needs to be more
robust to avoid overflows. The overflow can make check useless.

Bug 5045127
Bug 5079301

Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Change-Id: I2247718097bad922ac38dd7574b0fc008b1e02e4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3283910
(cherry picked from commit 6ed9cc57b4ca77424da58c9a90d7a19ed6deb11c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3295258
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-02-03 20:23:51 -08:00
Kishan Palankar
2eabcdb8a4 gpu: nvgpu: Guard profiler_objects list operations with a lock
Both profiler and debugger device nodes access and update the list,
g->profiler_objects. List operations were currently not guarded by
lock thus leading to synchronisation issues. Stress-ng test attempts
to trigger repeated random open close sessions on all the device nodes
exposed by gpu. This results in kernel panic at random stages of test.

Failure signature - Profiler node receives a release call and as part
of it, nvgpu_profiler_free attempts to delete the prof_obj_entry and
free the prof memory. Simulataneously debugger node also receives a
release call and as part of gk20a_dbg_gpu_dev_release, nvgpu attempts
to access g->profiler_objects to check for any profiling sessions
associated with debugger node. There is a race to access the list which
results in kernel panic for address 0x8 because nvgpu tries to access
prof_obj->session_id which is at offset 0x8.

As part of this change, g->profiler_objects list access/update is
guarded with a mutex lock.

Bug 4858627

Change-Id: I1e2cf8d27d195bbc9c012cf511029de9eaadb038
Signed-off-by: Kishan Palankar <kpalankar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3239897
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
2024-11-07 08:53:58 -08:00
Divya
831a0f7712 gpu: nvgpu: init elcg idle filters just before gr init
- ENGINE_DELAY_BEFORE field value gets reset to 0x4 during
  nvgpu gr init path.
- Set the elcg_idle_filters just before nvgpu_gr_init_support
  so that till this point all the GR reset and hw init of GR
  has happened and we just have to do sw init of GR.
- This change helps to reatin the value of ENGINE_DELAY_BEFORE
  field to 0xA

Bug 4315638
Bug 3821730
Bug 4475968

Change-Id: Ieef38eb63e596f1f95f1c19a121fbbf5fca34ab7
Signed-off-by: Divya <dsinghatwari@nvidia.com>
(cherry picked from commit 5832c9884a079592beda7bb77c267903fda6d775)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3015609
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3097398
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Viresh Kumar <vireshk@nvidia.com>
2024-04-10 09:39:28 -07:00
Pruthav Sanwatsarkar
36d4739db5 nvgpu: Remove newline from warning statement
The ap_devtools_judy kernel warning test saw
consistent failrures because of empty newline
warns being reported as kernel failures. These
new line warnings were found to be reported
only from the changed kernel warning.

Since all other nvgpu warns dont have new line
endings, removing the new line ending for the
error causing warn in this case.

Change-Id: Iaaf415085708eb970ae74f01c18be989ca068776
Signed-off-by: Pruthav Sanwatsarkar <pruthavs@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3014285
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-17 02:39:27 -08:00
Kishan
9feb9ea742 nvgpu: hwpm: Correct PMA teardown programming sequence
When profiler session is terminated abnormally, PMA
control path is still in active/incorrect state with
existing teardown sequence.
This change ensures we clear PMA command slice
registers before we wait for routers to be idle.
Once PMM routers are idle, we clear PMA channel
registers to drain all the in-flight records.

Bug 4123716

Change-Id: I0659dc89b00f468c2f2df5af952ac68c70387746
Signed-off-by: Kishan <kpalankar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit 64bcf057bf0930f414a700a378d33ee098bdf2e2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2973882
Reviewed-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
2023-10-30 09:55:06 -07:00
Martin Radev
22e1608e72 gpu: nvgpu: support cpu unix timestamps for cpu-gpu correlation
This patch extends the CPU-GPU query interface to also support
CPU UNIX-based timestamps.

Bug 4059666

Change-Id: Iecb937df38d3913559499fed1027a7157ad8d151
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2973572
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-06 01:58:06 -07:00
vivekku
b426d710a2 gpu: nvgpu: gsp: move msg info logs to debug logs
Changes
- moved the message logs from info to gsp debug which can
be enabled on requirement.

Bug 4227016
Bug 4197632
Bug 4199856

Change-Id: I6067a9b37664d325d971ccc8e1a6c13c2d1b3bb7
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2967169
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
2023-08-24 06:14:13 -07:00
Prathap Kumar Valsan
321145b37e gpu: nvgpu: Enable raw mode for compression
In raw addressing mode of CBC backing storage, comptaglines are not
required to be allocated or need to programmed in the ptes. Introduce a
flag to detect if the hardware supports raw mode and use that to skip
all the comptagline allocations and respective page table programming.

JIRA NVGPU-9717

Change-Id: I0a16881fc3e897c3c408b30d1835f30564649dad
Signed-off-by: Prathap Kumar Valsan <prathapk@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2908278
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-13 00:19:33 -07:00
Dinesh T
c8ceef2d08 gpu: nvgpu: Enable GPU MMIO path
This is adding support for work submit through
GPU mmio for gpu-next.

Bug 3938139

Change-Id: I69c6b2865e5264e485d8ecec4239c759abdd63d5
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2903841
Tested-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-10 19:36:06 -07:00
Ramalingam C
ad320f60b9 gpu: nvgpu: sema based gpfifo submission tracking
Implement a hw semaphore which is used to track the gpfifo submission.
This is implementation used when the userd.gp_get() is not defined and
also the feature flag NVGPU_SUPPORT_SEMA_BASED_GPFIFO_GET is set.

At the end of each job submitted, submit a semaphore to write the
gpfifo get pointer at hw semaphore addr. At next job submission
processing we will read the gpfifo.get from the designated hw semaphore
location.

JIRA NVGPU-9588

Change-Id: Ic88ace1a3f60e3f38f159e1861464ebcaea04469
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2898143
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Tested-by: Martin Radev <mradev@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-08 10:44:37 -07:00
Ramalingam C
32f6f9c5d0 gpu: nvgpu: Init sema pool for sema gpfifo tracking
Initialize sema pool for the vm, when
NVGPU_SUPPORT_SEMA_BASED_GPFIFO_GET is set

JIRA NVGPU-9588

Change-Id: I3f21a09b9e4af3d1cca16a97d7c94bee605e3ed6
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2898142
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-08 10:44:31 -07:00
Ramalingam C
e46c1d2e10 gpu: nvgpu: func to set a value at hw semaphore addr
Add a function to set a value to the hw_sema addr offset.
This will be used by the semaphore based gpfifo tracking.

JIRA NVGPU-9588

Change-Id: I719196907b86723d22c0cda49b0612f0810ec9ef
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2898140
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-08 10:44:21 -07:00
Santosh BS
be5312cb9b gpu: nvgpu: falcon2/riscv update for multimedia
- Define falcon ID for OFA and NVJPG
- Initialize falcon sw for OFA and NVJPG
- Program boot_vector before riscv kick-start

Jira NVGPU-9429
Bug 3962979

Change-Id: If6e63cb1e99ada3742b708bb0f8f7edc64366318
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2913882
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-07 22:09:04 -07:00
Santosh BS
3407c01357 gpu: nvgpu: gops declaration for multimedia engines
- gops struct declaration for nvenc, ofa, nvdec and nvjpg
- minor refactoring with struct nvgpu_nvenc

Jira NVGPU-9429
Bug 3962979

Change-Id: I888c6bd571554f18f2e9ca2adfaaacd1a8286ed0
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2908521
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-29 04:01:46 -07:00
Dinesh T
8bae56a075 gpu: nvgpu: Disabling Global context buffers commit for Compute engine
Global context buffers are to be mapped and committed only
for engine supporting gfx. With MIG, all engines support
compute only hence skip that.

Bug 4016530

Change-Id: I9f9a01070776f5fa1b18287e62a3080a42c21c60
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2900314
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-26 12:34:33 -07:00
Santosh BS
a062676e71 gpu: nvgpu: log mask for multimedia engines
Introducing gpu_dbg_mme for multimedia debug prints.

Jira NVGPU-9429
Bug 3962979

Change-Id: I9c84c9336a10af864f61d314dc811d038d1d2d87
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2908237
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-25 09:22:05 -07:00
Rajesh Devaraj
ce22f1efb1 gpu: nvgpu: add functions to query vgpc config
This patch adds the following functions which can be used to set/query
skyline configuration:

nvgpu_gr_config_set_singleton_mask
nvgpu_gr_config_get_singleton_mask
nvgpu_gr_config_set_num_singletons
nvgpu_gr_config_get_num_singletons
nvgpu_gr_config_set_num_tpc_in_skyline
nvgpu_gr_config_get_num_tpc_in_skyline
nvgpu_gr_config_set_gpc_skyline
nvgpu_gr_config_get_gpc_skyline
nvgpu_gr_config_set_virtual_gpc_id
nvgpu_gr_config_get_virtual_gpc_id
nvgpu_gr_config_set_sm_info_virtual_gpc_index
nvgpu_gr_config_get_sm_info_virtual_gpc_index

JIRA NVGPU-9897

Change-Id: If80e19f709472d74b42cb9c4b47dc4ce4f9a54dc
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2888783
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-22 13:16:41 -07:00
prsethi
6f4b7d5cc2 gpu: nvgpu: fix the memory corruption issue
Memory for tpc_index in gpc_tpc_physical_id_map array is allocated only
for number of tpcs while it should be number of tpcs*size of index.

Change fixes the memory allocation to avoid memory corruption.

Bug 3994374

Change-Id: Ibc593b1d0baba980787ae50f02ea20072525888c
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2906890
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Kishan Palankar <kpalankar@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-20 07:32:57 -07:00
Santosh BS
54b01e881b gpu: nvgpu: multimedia engine enumeration changes
- Changes to fetch and expose supported multimedia engines to umd
- Unit and litter defines for multimedia engines
- Add functions to get runlist id

Jira NVGPU-9429
Bug 3962979

Signed-off-by: Santosh BS <santoshb@nvidia.com>
Change-Id: I072b4aac803c4a70d3659857cb0d804755c5dbd7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2900765
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: V M S Seeta Rama Raju Mudundi <srajum@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-18 23:40:19 -07:00
prsethi
24a533c9dc nvgpu: print the caller name with quiesce
Currently quiesce method does not print the caller name which makes it
difficult to find the reason behind the issue.

Change prints caller name and invocation line number.

Bug 4098984

Change-Id: I34a0f557c411f997022668e187060c1c1247b15f
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2900585
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-15 15:54:43 -07:00
Rajesh Devaraj
a321679a5d gpu: nvgpu: add is_gsp_supported flag
This patch adds is_gsp_supported flag and initializes it for GA10B,
TU104. Further, this flag is checked before initializaing GSP LITE
falcon.

JIRA NVGPU-9983

Change-Id: If0a4a3095c15cac113895f3d114e731f35211c5d
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2902651
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-15 01:19:26 -07:00
mpoojary
a9b995bc3f gpu: nvgpu: Copy correct struct from RPC payload for pmu acr
Size of nv_pmu_rpc_struct_acr_bootstrap_gr_falcons is copied from the
RPC payload for pmu acr instead of nv_pmu_rpc_header in pmu rpc handler.
This causes KSAN slab out-of-bounds error.

Bug 3727012

Change-Id: I633dac9167f9ed896dba956dc56e4081aaab6465
Signed-off-by: mpoojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2891392
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-09 16:08:42 -07:00
vivekku
bd5ab81ccc gpu: nvgpu: nvs: queue direction update
Changes:
-  update nvgpu_nvs_ctrl_queue to have queue direction as it is required
by gsp scheduler to erase queue individually
- queue direction is updated during ioctl call to create queue and is
used only by gsp scheduler. So no other moduler should be affected by
it.

- need to pass the size of struct which is u32 so downgrading it from
u64 to u32 is intentional, misra C violation 10.3 can be ignored here

Bug 4027512

Change-Id: I6ef6e4b06124e25da3d004a2d8822516c3ac2105
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2881804
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-08 23:37:56 -07:00
Rajesh Devaraj
01d3ed09b0 gpu: nvgpu: update get_access_map
This patch re-names the variables used in gr_init_get_access_map API:
whitelist - gr_access_map
num_entries - gr_access_map_num_entries
wl_addr_*[] - gr_access_map_*[]

JIRA NVGPU-9849

Change-Id: I3a0a59410af8983867af5bc2f9ff200e56e190c4
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2891567
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-05 02:31:10 -07:00
Shashank Singh
9512b9f1de gpu: nvgpu: remove user managed addr space capability flag
Remove NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED and
NVGPU_AS_ALLOC_USERSPACE_MANAGED flags which are used for supporting
userspace managed address-space. This functionality is not implemented
fully in kernel neither going to be implemented in near future.

Jira NVGPU-9832
Bug 4034184

Change-Id: I3787d92c44682b02d440e52c7a0c8c0553742dcc
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2882168
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:39:30 -07:00
Martin Radev
84bb919909 gpu: nvgpu: Setup GFX-capable TPCs
This patch dispatches to the appropriate HAL to
select the GFX-capable TPCs.

Bug 3944931

Change-Id: Ifb7338bea2cd59581133b7a2ba723f5d8bfa507c
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2891725
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:38:54 -07:00
Divya
c728f09c18 gpu: nvgpu: add sysfs node for golden img status
- Add a sysfs node "golden_img_status" to show
  if golden_image size and ptr are already initialized
  or not.
- This node helps to know golden image status before
  attempting to modify gpc/tpc/fbp masks.

Bug 3960290

Change-Id: I3c3de69b369bcaf2f0127e897d06e21cb8e2d68e
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2868729
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:36:37 -07:00
prsethi
c49ac865de gpu: nvgpu: init golden ctx image during nvgpu poweron
Safety build temporal requirement is that on FECS power up it should go
through entire initialization methods.
init_golden_image callback is being called from devctl/ioctl path and
triggers FECS method 10 and 11. As these methods are part of APP init,
not being called during resume and causing quiesce on safety build.
To fix this issue, calling the callback from poweron API.

Bug 4082813
Bug 4037712

Change-Id: I2d27203d3cb4326ae7d8bd6025693fd61d5237df
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2893218
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 03:14:19 -07:00
Divya
3e5424bee3 gpu: nvgpu: gv11b: ap_compute fix
- During nvgpu_poweron, PERFMON_INIT RPC and
  ACR_INIT_WPR_REGION command is sent to PMU in two different threads.
- For perfmon RPC method is used and for ACR, CMD-MSG queue is used.
- Since the pmu thread and poweron thread run in parallel, the
  pmu sequence acquired by both can have the same seq_id.
- For Perfmon RPC, nvgpu_pmu_seq_free_release() is called
  followed by nvgpu_pmu_seq_release().
- This causes clearing of sequence for the next command.
- To resolve this, instead of nvgpu_pmu_seq_free_release(),
  just free the rpc-payload after getting ack for perfmon and
  then do sequence release.
- This ensures that the ACR cmd sent just after perfmon RPC does
  not get the same seq_id and the sequence is not cleared.

Bug 4074021

Change-Id: Id9972cb719458062d8c7d9e226a25599026c052b
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2889840
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-28 03:32:42 -07:00
srajum
53941baa93 gpu: nvgpu: fixing unit tests for ga10b
- Add support for unit tests to run on orin platform.

JIRA NVGPU-9909 

Change-Id: I60a059840fd0d2733b0a1f2b3c1f722f8616868e
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2892228
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-28 02:08:14 -07:00
Sagar Kamble
4ee71f9852 gpu: nvgpu: guard ecc sysfs remove with NVGPU_DISABLE_ECC_STATS
Following error is seen on unloading nvgpu on platforms with
NVGPU_DISABLE_ECC_STATS set to true.

[ 3712.384639] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 3712.388479] pc : sysfs_remove_file_ns+0x28/0x50
[ 3712.389119] lr : sysfs_remove_file_ns+0x28/0x50
...
[ 3712.400640]  sysfs_remove_file_ns+0x28/0x50
[ 3712.401280]  device_remove_file+0x34/0x50
[ 3712.414720]  nvgpu_ecc_sysfs_remove+0x74/0xc0 [nvgpu]
[ 3712.428800]  nvgpu_ecc_remove_support+0x38/0x80 [nvgpu]
[ 3712.442240]  nvgpu_put+0xb8/0x160 [nvgpu]
[ 3712.456319]  nvgpu_pci_remove+0x168/0x250 [nvgpu]
[ 3712.456959]  pci_device_remove+0x4c/0x100

This is happening as ecc sysfs files are not created, however
their removal is attempted. Add NVGPU_DISABLE_ECC_STATS check
for ecc sysfs removal.

Bug 3495440

Change-Id: I9726cf43a740c2b591ca39bdc572e8f4ff5684d3
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2891876
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-by: Martin Radev <mradev@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-26 20:08:45 -07:00
Martin Radev
924dd58da0 gpu: nvgpu: remove IO_COHERENT flag
This patch removes the IO_COHERENT flag as IO
coherence is the default setting.

Bug 3959027

Change-Id: I9800c2b8b161f7bdc2d6856639dd03488881882d
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2887630
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-21 11:32:05 -07:00
Martin Radev
81d95456b9 gpu: nvgpu: Rename PLATFORM_ATOMIC to SYSTEM_COHERENT
To support current and future usecases, it would be
beneficial to select the SYSTEM_COHERENT aperture explicitly.

The benefits are:
- platform atomic code is cleaned-up.
- userspace can select the SYSTEM_COHERENT aperture for any
  specific usecases.

Bug 3959027

Change-Id: I6489ebe87fa75cc760930277bad5e0cacca80eb6
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2864177
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@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>
2023-04-21 11:31:53 -07:00
Shashank Singh
21cb70f58d gpu: nvgpu: remove kind control capability
Kind is controlled by nvgpu userspace library so related capability
flags can be removed from kernel and uapi interface.

Jira NVGPU-9832
Bug 4034184

Change-Id: Id2b0a4e1cd784638362116b8d99177467fba998b
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2880391
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-13 12:21:46 -07:00
Divya
7a4fff4b17 gpu: nvgpu: add hal for pmu sequence cleanup
- On older chips, PMU uses CMD-MSG queue method to
  communicate with NvGPU.
- From Turing onwards, PMU uses RPC method for this.
- During poweroff, we release pmu_sequence and reset the
  members of the structure.
- For chips that use RPC, we need to free the payload as well
  and then reset the members.
- Add pmu_seq_cleanup hal for this.

Bug 4019694
Bug 4059157

Change-Id: Ieb474fe4ed81f54d78480214cde53b51d45652c6
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2882267
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-12 16:28:52 -07:00
Divya
db9a411a06 gpu: nvgpu: sync free of rpc_payload
- During driver unload, shutdown or RG path as part of
  pmu destroy, pmu sequences have to be cleaned up to
  free payload memory and allocation info which is stored
  as part of pmu_sequence.
- While doing so there can be race condition with pmu_isr
  or nvgpu_pmu_rpc_execute path where it waits for fw ack.
- This race condition can lead to freeing of payload memory
  before nvgpu_pmu_sequences_cleanup() does.
- This can lead to memory corruption or double free issue
  when the cleanup code again tries to free the payload mem.
- To resolve this add a new function nvgpu_pmu_seq_free_release()
  which will check for seq->id in pmu seq tbl before freeing the
  memory and other info from pmu_sequence.
- Use this nvgpu_pmu_seq_free_release() in non-blocking RPC calls
  and also when fw ack fails or driver is dying scenario.
- For blocking call, synchronise freeing of rpc payload memory by
  using a new boolean seq_free_status.

Bug 4019694
Bug 4059157

Change-Id: Id45a6914a2d383a654539a87861c471a77fb6850
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2882210
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-12 16:28:41 -07:00
Prathap Kumar Valsan
d0ed86ab1e gpu: nvgpu: update PT lvl array to six levels
Increase the size of page table level array to index six levels.

Jira NVGPU-9760

Change-Id: I482639fd028ecd504ee8bc313c39f3bd710e81a9
Signed-off-by: Prathap Kumar Valsan <prathapk@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2868918
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-07 21:08:45 -07:00
Kishan
c6d5fb348c gpu: nvgpu: Capture thread name for every channel created
This change ensures that in scenarios where GPU enters a bad
state because of the work submitted by a misbehaved thread,
we should be able to capture thread name as part of our
1st set of failure logs.
Changes for QNX env is pending.

JIRA NVGPU-7783

Change-Id: I65d55a6ade749ff91739458e0642ed2dafaae5cc
Signed-off-by: Kishan <kpalankar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2879197
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-06 10:12:48 -07:00
Ramalingam C
af48120169 gpu: nvgpu: configure CWD sm id regs before ucode load
GPCCS ucode is expecting the SM ID programmed in GPM and CWD registers
to be in sync. So create a hal called gr.init.load_sm_id_config()
for the sm_id programming for the CWD registers and invoke them before
the ucode load.

Initialize this hal only for the required GPUs.

JIRA NVGPU-9757

Change-Id: Ib0984fd6326c37e0c2a06123041032575a23ec04
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2864999
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-06 10:09:14 -07:00
Sagar Kamble
821699d3a3 gpu: nvgpu: unset async subctx VM with correct index
On deleting the subcontext, tsg->subctx_vms[] entries are set to NULL as
per the subcontext id. For async subcontexts the index logic was used
from that of tsg->async_veids bitmask. However subctx_vms is an array
shared by all subcontexts hence index should be subcontext id aka veid.

Also update the description of function nvgpu_tsg_validate_ch_subctx_vm
as some of the functionality is now moved to another function
nvgpu_tsg_create_sync_subcontext_internal.

Bug 3979886

Change-Id: Ic290fb175b34988c6ffabe9c9dc4ec124d2c70af
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2879025
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-03-31 13:33:45 -07:00
Sagar Kamble
a5640d61bd gpu: nvgpu: free VEID if the channel is closed
In case of process crash or forceful closure of the channels, userspace
may not release the VEID. In that case, creating further subcontexts
may not be possible.

Hence, when the channel is closed forcibly (linux), release the VEID on
closure of the last channel in the subcontext.

With this, normally on linux, channel close will not relase the VEID
However, on qnx it will release the VEID. So delete subcontext devctl
call on qnx will be nop in normal case hence changed the error print
and error return to success.

Also added check in the subcontext delete ioctl fn that all channels
are unbound before deleting the subcontext. This is to ensure that
channels don't refer to dangling subcontext pointer.

Bug 3979886

Change-Id: I434944b01740720011abce3664394ae8cb0d4e2e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2858060
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-31 13:25:53 -07:00
Santosh BS
2a865e3aad gpu: nvgpu: NVENC support on TU104
This patch adds nvenc support for TU104
- Fetch engine/dev info for nvenc
- Falcon NS boot (fw loading) support
- Engine context creation for nvenc
- Skip golden image for multimedia engines
- Avoid subctx for nvenc as it is a non-VEID engine
- Job submission/flow changes for nvenc
- Code refactoring to scale up the support for other multimedia
  engines in future.

Bug 3763551

Change-Id: I03d4e731ebcef456bcc5ce157f3aa39883270dc0
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2859416
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-24 17:07:49 -07:00
Martin Radev
ac9a59075e gpu: nvgpu: Print flags after all flags are set
Without this change, nvgpu would print out some
flags as disabled in dmesg but enable them shortly after.
This leads to confusion when examining UMD and nvgpu
reporting in UMDs.

This patch adds code to print out the flags after
all flags are set.

Bug 4031904

Change-Id: I67b9a4567886fd5e076f7ac3b8f284b52c03d7e4
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2871606
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-21 09:45:13 -07:00
srajum
02834f8739 gpu: nvgpu: fix CERT-C issues
- CID 10165014
  Dereference before null check

- CID 10166579
  Unused value

Bug 3952896

Change-Id: I6a7f2b97b4a6519272607e560d09c138048bd665
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2872276
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-21 02:37:08 -07:00
Richard Zhao
f791adf880 gpu: nvgpu: move .runlist.hw_submit to use runlist_id
Use detailed function parameters runlist_id, iova/aperture and count, so
the HAL could be reused on server side.

Jira GVSCI-15773

Change-Id: I28f68682b9eea4e798af5c850c87840bd9b79970
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863444
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-21 02:31:29 -07:00
Richard Zhao
a587d94f5a gpu: nvgpu: init nvs scheduler for vf
nvs does not have a clean cut. runlist submit path uses nvs worker no
matter whether the feature is enabled.

Jira GVSCI-15773

Change-Id: I6f6db1e766b8079ad6ca4a6b530b3ec27094f840
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863443
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-03-21 02:31:21 -07:00
Richard Zhao
da1da8f563 gpu: nvgpu: move .preempt_trigger/.is_preempt_pending to IDs
.preempt_tsg uses .preempt_trigger/.is_preempt_pending, so they both
have to use runlist_id and tsgid too.

Jira GVSCI-15770

Change-Id: Ida24d160c362ea1348d7c19e6d0352bb390d0a64
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863442
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-21 02:30:57 -07:00
Richard Zhao
8f5adab299 gpu: nvgpu: .preempt_tsg move to use runlist_id/tsgid
It's for making .preempt_tsg reusable on server side.

Jira GVSCI-15770

Change-Id: Id9f477baa29cb63fb0e1d1650f4b1e6a2fa248c0
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863441
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-21 02:30:49 -07:00
Rajesh Devaraj
4f96f59c15 gpu: nvgpu: perform support_ls_pmu check
Perform support_ls_pmu check before dereferencing pmu from gpu struct g
to avoid the possibility of kernel panic when LS PMU support is not
enabled.

JIRA NVGPU-9283

Change-Id: I65caac449f884164d797dedc2041d6ee4292e326
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2868250
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-17 10:04:59 -07:00