Commit Graph

8288 Commits

Author SHA1 Message Date
Seshendra Gadagottu
c021b18fb1 gpu: nvgpu: fb: update doxygen for BVEC checks
Update doxygen to have boundary value check info for
input params in common.fb.

Jira NVGPU-6183

Change-Id: Ic07a7688c457c68ba7e9ef96ca8b3bf4145b8236
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
(cherry picked from commit 84f7954eaf499f38af8590a4a1309e0c1f7448bf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2485995
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-18 23:44:26 -08:00
Seshendra Gadagottu
f5b6c012cb gpu: nvgpu: therm: update doxygen for BVEC checks
Update doxygen to have boundary value check info for
init_elcg_mode HAL.

Jira NVGPU-6183

Change-Id: Id0ebb8076a8a65319e40129308ded6ef6466c647
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2481046
(cherry picked from commit 89564f5d7f5371c35734c0eec5ad70edd71e3c17)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2483098
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-18 23:43:26 -08:00
Lakshmanan M
edf03baedd gpu: nvgpu: Enable SCG flag
* Enabled NVGPU_SUPPORT_SCG for tu104.
* Enabled NVGPU_SUPPORT_SCG if graphics support is enabled.

JIRA NVGPU-6532

Change-Id: I22175de6906a496127fef464f70a6521b2ad2ad2
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2485632
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-18 17:32:35 -08:00
shashank singh
019641e88c gpu: nvgpu: limit number of gpfifo entries
Limit number of gpfifo entries so that the size of gpfifo i.e.
num_entries * size of each entry fits in u32 data type.

Jira NVGPU-5846

Change-Id: I4d3560a6ed90044c88ee3a7acd2e6cb0591b7c5e
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2474118
(cherry picked from commit 02ab9e163f5b413b6eb9817ab8ac5581ce7ef427)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2483947
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-18 17:29:17 -08:00
prsethi
ed739cdba1 gpu: nvgpu: update doxygen for clock unit
Patch adds doxygen for get_maxrate

Jira NVGPU-6258

Change-Id: I7697134ca693bc14562c53b88e9aa2d44e871c9f
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2480512
(cherry picked from commit 610d52755f69cf74f74c1cb8e04985184f7f842c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2483391
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-17 11:12:27 -08:00
prsethi
8d55f14fc9 gpu: nvgpu: doxygen update for unit os_utils
Add range value details for various os_utils functions.

Jira NVGPU-6258

Change-Id: Ib930a24d2a4b8e98520d87fcc2f48bef81d26fbd
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2480205
(cherry picked from commit 210e1dd5360d29cad1a432e8de48669d51de134c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2483388
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-17 11:12:19 -08:00
Antony Clince Alex
bc0e81adda gpu: nvgpu: skip setting error notifier during deferred reset
Skip setting error notifier on MMUFAULT when a debugger is connected and
debugging is enabled(mmu_debug_mode=on). At present, error notifier causes
the application to teardown the channels and debugger will not be able to
collect any data.

Bug 200632771

Change-Id: Iec2ee07d7a923b2c79197c4c3a7b312d4db797b8
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2479825
Tested-by: mobile promotions <svcmobile_promotions@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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-02-06 05:20:49 -08:00
prsethi
09fb445878 gpu: nvgpu: remove ipa to pa conversion WAR
WAR assume 1:1 IPA to PA mapping when hyp_read_ipa_pa_info fails for
the syncpt address which falls into syncpt shim aperture. API
nvgpu_mem_phys_sgl_ipa_to_pa() is taking care of IPA to PA mapping for
the syncpts which makes this WAR invalid.

Patch removes the WAR.

Bug 200673604

Change-Id: I966711e11c2ff1b5b5dd3f5e09674bea66c5d04b
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2478068
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-03 13:54:45 -08:00
Deepak Nibade
a1cbe60bc0 gpu: nvgpu: fix common.gr doxygen typos
Jira NVGPU-6180

Change-Id: I499634aa407404474a6d3d7d3dfc6271eda21007
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2473441
(cherry picked from commit bdfb68b965b76b216e3a9782ef7f0d1f6cda2df0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2478885
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-02 23:34:32 -08:00
Deepak Nibade
bb43f11a61 gpu: nvgpu: update common.gr doxygen
Add below updates to common.gr doxygen:

- Add doxygen comments for APIs that are mentioned in RM SWAD and in
  RM-common.gr traceability document.
- Comment about valid ranges for input parameters of bunch of functions.
- Add nvgpu_assert() to ensure correct value is passed as input
  parameter to number of functions.
- Add references to relevant functions with @see.
- Update Targets field for unit tests to cover newly doxygenated
  functions.
- Update unit test test_gr_init_hal_pd_skip_table_gpc to take care of
  new asserts added into some APIs.

Jira NVGPU-6180

Change-Id: Ie889bed96b6428b1fd86dcf30b322944464e9d12
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2469397
(cherry picked from commit 5d7d7e9ce1c4efe836ab842d7962a3aee4e8972f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2469394
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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-02 23:34:27 -08:00
Deepak Nibade
27b321e1a9 gpu: nvgpu: fix header guards in common.gr unit
Fix header guard names as per convention for below common.gr headers :
common/gr/gr_falcon_priv.h
common/gr/zbc_priv.h
include/nvgpu/gr/ctx.h

Jira NVGPU-5005

Change-Id: I68947ea3e8f4ddbcd43be8d8717eb8ddcc6f5bcb
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2470072
(cherry picked from commit eb044acbafc6d9f735e066d9c7497156f1df13c7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2478884
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-02 23:34:21 -08:00
Deepak Nibade
ce206826f2 gpu: nvgpu: use explicit timeout to wait for SM lock down
gv11b_gr_wait_for_sm_lock_down() uses nvgpu_get_poll_timeout() to
get timeout value for polling of SM lock down status.
nvgpu_get_poll_timeout() returns -1 if timeouts are disabled by
debugger, and if SM lock down fails, nvgpu lands in an infinite loop.

Use g->poll_timeout_default instead of nvgpu_get_poll_timeout() so
that explicit timeout value is always used. This also means that
timeout value of ULONG_MAX will still be used on simulation platforms.

Bug 200676073

Change-Id: I5777e98efcd63f24ade244384cf7b157dcea991d
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2478255
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: Mikhail Filimonov <mfilimonov@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-01 19:20:34 -08:00
Antony Clince Alex
52b33022e7 gpu: nvgpu: gv11b: skip setting error notifier during deferred reset
Skip setting error notifier on MMUFAULT when a debugger is connected and
debugging is enabled(mmu_debug_mode=on). At present, error notifier causes
the application to teardown the channels and debugger will not be able to
collect any data.

Bug 200632771

Change-Id: Idc4141990d4e2fb4714de9bfd31cfea5e7dcd52a
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2477253
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-01 13:18:09 -08:00
Seshendra Gadagottu
ca477efc1e gpu: nvgpu: t21x: enable CTX_MMU_DEBUG_MODE
Enable support for NVGPU_SUPPORT_SET_CTX_MMU_DEBUG_MODE,
since latest gm20b firmware has support for MMU_DEBUG_CTRL.

Bug 2586406

Change-Id: I126c9ea516a8c60d4c66964dc1c8857a708f16a2
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2477047
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-02-01 05:55:36 -08:00
Alex Waterman
77c0b9ffdc gpu: nvgpu: Update runlist_update() to take runlist ptr
Update the nvgpu_runlist_update_for_channel() function:

  - Rename it to nvgpu_runlist_update()
  - Have it take a pointer to the runlist to update instead
    of a runlist ID. For the most part this makes the code
    better but there's a few places where it's worse (for
    now).

This starts the slow and painful process of moving away from
the non-runlist code using runlist IDs in many places it should
not.

Most of this patch is just fixing compilation problems with
the minor header updates.

JIRA NVGPU-6425

Change-Id: Id9885fe655d1d750625a1c8aceda9e67a2cbdb7a
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2470304
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-29 09:51:44 -08:00
Deepak Nibade
fae1f20ab7 gpu: nvgpu: update tu104 regops allowlist
Sync tu104 regops allowlist to latest allowed values.

Bug 200605637

Change-Id: I6287cf4deb74418d5d25aef5a19259cc4813c80c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2476116
Reviewed-by: Automatic_Commit_Validation_User
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: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-29 08:00:46 -08:00
Ramesh Mylavarapu
aad07971c0 gpu: nvgpu: Add pg post init rpc id
Add pg post init rpc id.

BUG-200689469

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: I1f7889573d19c8268619f3950800c24d68900ac4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2466346
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-29 07:53:11 -08:00
Sagar Kamble
5993b74351 gpu: nvgpu: gm20b: increase WDT timeout to 7s
Intermittently observing WDT during ap_cudnn on porg-b01-sku0.
Increasing the WDT timeout from 5s to 7s helps.

Bug 3223062

Change-Id: Ia94d931d301f3ec229e0e4fbd06876d326a4077e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2475066
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-28 17:30:53 -08:00
scottl
456a814db5 gpu: nvgpu: add linux MAPPING_MODIFY ioctl
Add new MAPPING_MODIFY ioctl to the linux nvgpu driver.

This ioctl is used (for example) by the NvRmGpuMappingModify API to
change the kind of an existing mapping.

For compressed mappings the ioctl can be used to do the following:

 * switch between two different compressed kinds
 * switch between compressed and incompressed kinds

For incompressed mappings the ioctl can be used to do the following:

 * switch between two different incompressed kinds

In order to properly update an existing mapping the nvgpu_mapped_buf
structure has been extended to cache the following state when the
mapping is first created:

 * the compression tag offset (if applicable)
 * the GMMU read/write flags
 * the memory aperture

The unused ctag_lines field in the nvgpu_ctag_buffer_info structure
has been replaced with a new ctag_offset field.

Jira NVGPU-6374

Change-Id: I647ab9c2c272e3f9b52f1ccefc5e0de4577c14f1
Signed-off-by: scottl <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468100
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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-28 17:27:31 -08:00
Seshendra Gadagottu
47f2e68013 gpu: nvgpu: update doxygen for gops_bus
Fix table format issue for bus interrupts list.
Fix typo in bar1_bind description.

Jira NVGPU-6243

Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459233
(cherry picked from commit d3464c8945297f2bbf5a5d9f9fdff58bd9672fdd)
Change-Id: I621f73d552744c9f732d3dcb700473c182cf8654
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461748
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-28 09:08:00 -08:00
Seshendra Gadagottu
deb9ad08b8 gpu: nvgpu: update doxygen for common.netlist unit
Moved description about APIs to be part of @brief.
This is also fixing unwanted line breaks in the description
where references are made to struct.

Jira NVGPU-6183

Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459231
(cherry picked from commit eef9e7ac5f626a0b8e77f6292979a5dd6cbd5b89)
Change-Id: I334917c22ad13f27ad2ac75fcd33eab29cf323b9
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461747
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-28 09:07:55 -08:00
Seshendra Gadagottu
0a82229932 gpu: nvgpu: update doxgen for common.therm gops
Update description for init_therm_support gops.

Jira NVGPU-6254

Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459232
(cherry picked from commit 0e358a0dbbd535e215146602736c7abf3916922a)
Change-Id: Iadb14c1a3a777460b32b9370c17dcd7a1a5f1afd
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461743
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-28 09:07:48 -08:00
dt
73f07366c3 gpu: nvgpu: Add doxygen update for common mm unit
This is adding some doxygen comments for common mm unit
that includes adding return values, description and
some format changes.

JIRA NVGPU-6381

Change-Id: Ibbe1af5b9e4356bf02bb591116e08735ce77b323
Signed-off-by: dt <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2472907
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: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-27 01:26:05 -08:00
Lakshmanan M
147ec67319 gpu: nvgpu: fix a typo in nvgpu_aperture_mask API
This patch fixes a typo in doxygen documentation of
nvgpu_aperture_mask API.

JIRA NVGPU-5932

Change-Id: I777b4f01bbd0bb6b440437aa4c90e35886261d8b
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2473559
(cherry picked from commit 7bdf55d268f98d4f235ecead447705966ad19a35)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2474119
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-22 11:55:14 -08:00
Lakshmanan M
8e91a9d598 gpu: nvgpu: update doxygen for some mm sub units
This patch updates the @retval and @param doxygen documentation
to address review comments for MM SWUD.
1) mm.h
2) nvgpu_mem.h
3) vm.h
4) vm_area.h

JIRA NVGPU-5932

Change-Id: I1616454bd5d7366d7a6e09afe844ac24f50b4890
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2472879
(cherry picked from commit 8bdcdb95e8cc8dd7b44eab65541328236a12c21b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2473534
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-22 07:05:43 -08:00
Vedashree Vidwans
df1c9c4640 gpu: nvgpu: remove trivial operations before BUG
Corrected ECC errors are not applicable to GV11B. Remove unnecesary
lines of code before invoking BUG().

Jira NVGPU-6272

Change-Id: I410d6463efd39584efdff7939ad66fae8ee63afc
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2473098
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-22 07:05:31 -08:00
Alex Waterman
7a1c65c65d gpu: nvgpu: Rename dbg_rec() to rec_dbg()
Since this is backwards compared to other examples (pte_dbg, etc)
this makes more of the dbg helper macros consistent in syntax.

Change-Id: I98e30fd8967b7a86b3902878fecbe91440afa9b3
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2472520
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-22 07:04:54 -08:00
deepak goyal
90e5950174 nvgpu: gpu: adds support for ACR dbg/prod.
ACR ucode is encrypted using different keys for prod/dbg boards.
This change adds a check to select ACR ucode based on board type.
Note: This support is added for t18x. In the sub-sequent CL, support
for T210 will be added.

Bug 2672836

Change-Id: Ib209f25463d05edae576cfd47b63f562cb8f61e6
Signed-off-by: deepak goyal <dgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2471590
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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-22 07:02:48 -08:00
Alex Waterman
11d3785faf gpu: nvgpu: Rename struct nvgpu_runlist_info, fields in fifo
Rename struct nvgpu_runlist_info to struct nvgpu_runlist; the
info is not necessary. struct nvgpu_runlist is soon to be a
first class object among the nvgpu object model.

Also rename the fields runlist_info and active_runlist_info to
simply runlists and active_runlists respectively. Again the info
text is just not necessary and somewhat misleading. These structs
_are_ the runlist representations in SW; they are not merely
informational.

Also add an rl_dbg() macro to print debug info specific to
runlist management and some debug prints specifying the runlist
topology for the running chip.

Change-Id: Id9fcbdd1a7227cb5f8c75cca4abbff94fe048e49
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2470303
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-20 21:56:33 -08:00
Divya Singhatwaria
2949b01491 gpu: nvgpu: update doxygen for power_features
update the doxygen comments for
common.power_features unit

Jira NVGPU-6242

Change-Id: Id5eea40e6281339eac6b2388a311e9cc53d7e8ea
Signed-off-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2470971
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-19 08:03:16 -08:00
Divya Singhatwaria
b77bc1000c gpu: nvgpu: update doxygen in ACR unit
The patch updates doxygen for APIs in ACR unit to enhance the
description to provide the clarity on the existence of a particular
API.

JIRA NVGPU-6242

Change-Id: I8aee3557fd0103772269774758c29440a439d9d0
Signed-off-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2469472
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-19 08:03:05 -08:00
Sagar Kamble
cf287a4ef5 gpu: nvgpu: retry tsg unbind if NEXT is set
The NEXT bit can remain set for the channel if timeslice expires before
scheduler clears it. Due to this nvgpu fails TSG unbind and in turn
nvrm_gpu fails channel close. In this case, checking the channel hw
state after some time can help see NEXT bit cleared by scheduler.

Reenable the tsg and return -EAGAIN to nvrm_gpu for it to retry again.

Bug 3144960

Change-Id: I35f417f02270e371a4e632986b73a00f8a4f921a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468391
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-18 23:11:57 -08:00
Vedashree Vidwans
2fa0e6fca1 gpu: nvgpu: resolve misra 5.7 violation
Rule 5.7 doesn't allow an identifier to be reused. This patch renames
variable "ops" to resolve this violation.

Jira NVGPU-6272

Change-Id: Ica8364a21d28dcf02d935a1b212e334b3f48c98a
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2471047
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: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-16 03:19:41 -08:00
Seshendra Gadagottu
2cc8fdfa81 gpu: nvgpu: skip clock queries for un-supported platforms
Skip clock queries in acquire_platform_clocks for
un-supported platforms. Only silicon and fpga has
clocks support.

Bug 3198706

Change-Id: Ie012525802ef6b66709527cac2d4186f5287818a
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2470284
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-14 16:13:54 -08:00
Jon Hunter
ddf8f12197 gpu: nvgpu: Add support for Linux v5.11
For Linux v5.11, commit 6619ccf1bb1d ("dma-buf: Use struct dma_buf_map
in dma_buf_vmap() interfaces") changes to the dma_buf_vmap() and
dma_buf_vunmap() APIs to pass a new parameter of type
'struct dma_buf_map'. Update the NVGPU to support these updated APIs
for Linux v5.11+.

Finally, the legacy dma_buf_vmap() API returns NULL on error and not an
error code and so correct the test of the return value in the function
gk20a_cde_convert().

Bug 200687525

Change-Id: Ie20f101e965fa0f2c650d9b30ff4558ce1256c12
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2469555
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-13 22:36:14 -08:00
Seeta Rama Raju
a03da4a077 gpu: nvgpu: compile out bsearch.c from safety build
- We are compiling “os/posix/bsearch.c” as part of safety-build,
  but we are not using bsearch.c file API from any safety file.

JIRA NVGPU-6172

Change-Id: Id0ebf00287f7564e629c28190f90edd68288dd70
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2424541
(cherry picked from commit ce822b1c8766faf5642079f0d5dde347ac2c5087)
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2447418
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-13 09:14:02 -08:00
dt
9b81c28dd3 gpu: nvgpu: Add PG199 support
This is adding the device id in pci id table to support
PG199.

JIRA NVGPU-6375

Change-Id: Ib87bf903a55f6256ffc61582b1b42fbce5ea8033
Signed-off-by: dt <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468622
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-12 12:36:36 -08:00
shashank singh
7096f0a5ac gpu: nvgpu: add doxygen documentation for common.rc unit
Jira NVGPU-6301

Change-Id: I9a3f46d97a11e329fbf692afd5b920d73f049583
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2458397
(cherry picked from commit 2803e8540557fbdccc5ce4e5b0c91735e885ce51)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468522
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-12 03:35:37 -08:00
Rajesh Devaraj
bf5fd03a10 gpu: nvgpu: update doxygen for error reporting
This patch updates the doxygen documentation for error reporting
related APIs to address review comments for SDL SWUD.

JIRA NVGPU-6181

Change-Id: Ic937492cd539bdb1bce6eb1bc7b02ec1c07b69e4
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2467194
(cherry picked from commit 5b188895c29895042bdd660ba5e10bf161bf21e4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2468255
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-11 06:26:51 -08:00
shashank singh
76f766d6ac gpu: nvgpu: add full documentation for gk20a header file
-Document all structure fields defined in gk20a.h.
-Add few missing documentation for gk20a struct.
-Add return value for the public APIs of common.nvgpu unit.

Jira NVGPU-6252

Change-Id: I6726d83f6d1a4db5f24c0d94093b2c00263d220a
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459287
(cherry picked from commit 9f6f1eddee9ac39918fca345917490e2063bc01e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2466601
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-07 11:15:08 -08:00
Jon Hunter
e7226ccb1b gpu: nvgpu: Fix stack frame size warning
When building NVGPU for Linux kernels where the CONFIG_FRAME_WARN is set
to 1024, the following build error is observed ...

 drivers/gpu/nvgpu/common/init/nvgpu_init.c: In function
     ‘nvgpu_finalize_poweron’:
 drivers/gpu/nvgpu/common/init/nvgpu_init.c:773:1: error: the frame size
     of 1280 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

The problem is that nvgpu_finalize_poweron() function defines a large
table of function pointers, nvgpu_init_table, and cannot be declared
statically. To allow NVGPU to be compiled for Linux kernels that by
default warn if the stack frame size exceeds 1024, always set the
-Wframe-larger-than to 2048 for NVGPU.

Bug 200689205

Change-Id: I59b202801a9e5fecda1a9a166cddf54775131dbe
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2465820
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-06 17:34:10 -08:00
Jon Hunter
849433f66c gpu: nvgpu: Fix sizeof warning for strncpy
When building NVGPU with the GCC -Werror=sizeof-pointer-memaccess
warning enabled, the following error is seen ...

 drivers/gpu/nvgpu/common/mm/as.c: In function ‘gk20a_vm_alloc_share’:
 drivers/gpu/nvgpu/common/mm/as.c:131:33: error: argument to ‘sizeof’
     in ‘strncpy’ call is the same expression as the source; did you
     mean to use the size of the destination?
     [-Werror=sizeof-pointer-memaccess]

  131 |  p = strncpy(name, "as_", sizeof("as_"));
      |                                 ^

This is caused because the source buffer is passed to sizeof instead of
the destination. This could cause a buffer overflow if the source is
larger than the destination buffer.

Looking at the code further, there is another problem and that is that
after copying the string 'as_' to the 'name' buffer, the pointer 'p'
returned by strncpy is then used as the address to append an unsigned
integer to the string 'as_'. However, the pointer returned by strncpy
is actually the same address as pointed to by 'name'. Therefore, the
prefix 'as_' is actually overwritten by the call to nvgpu_strnadd_u32.

Fix these issues by initialising 'name' buffer to 'as_' statically and
then set the pointer 'p' to the offset in the 'name' buffer that
follows the prefix 'as_'. This removes the need to use strncpy at all
and simplifies the code.

Bug 200689205

Change-Id: Ia9f0c634dc5a6dada088756cdae8c3dd688dcc48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2465814
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sagar Kamble <skamble@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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-06 17:33:58 -08:00
Deepak Nibade
cae88e7451 gpu: nvgpu: initialize cau data while binding HWPM in global mode
Add CAU initialization data in const array hwpm_cau_init_data[].
Add HAL API gops.gr.get_hwpm_cau_init_data() to retrieve this data
and implement it for TU104.

Add new HAL API gops.gr.init_cau() that uses above data and
initializes all cau units. Implement this HAL only for TU104.

Invoke above sequence from nvgpu_profiler_bind_hwpm() in case of
global HWPM mode.

Jira NVGPU-5360

Change-Id: I1c7a380e9d04d6cd45fb7f746c0a79fc56675244
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2463854
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-05 12:39:54 -08:00
mkumbar
ff2bfbd229 gpu: nvgpu: update doxygen comments for falcon
update the doxygen comments for falcon unit.

Jira NVGPU-6233

Change-Id: I04d5aa1f18a658c7f391ae3259deae0be45c2ad9
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2463948
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-05 12:39:38 -08:00
mkumbar
6e22ebf9f8 gpu: nvgpu: update doxygen comments for pmu
update the doxygen comments for pmu unit.

Jira NVGPU-6234

Change-Id: I7b06479208e93d5a8715b51d2dfacba7be60c186
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2463947
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-05 12:39:32 -08:00
mkumbar
5aa2311a88 gpu: nvgpu: update doxygen comments for acr
update the doxygen comments for acr unit.

Jira NVGPU-6232

Change-Id: Ie8ab6137f4902d7fd1aff864911e80359818d5ad
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461961
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-01-05 12:39:27 -08:00
Deepak Nibade
a0fb91846d gpu: nvgpu: set regop type based on per-resource ctxsw flag
New profiler APIs set regop type based on whether context is bound or
not in nvgpu_prof_get_regops_staging_data(). But it is possible that
ctxsw is not enabled for some particular HWPM resource even if context
is bound to profiler object.

Fix this by extracting regop type based on per-resource ctxsw flag
instead of bound context.

Add reg_op_type[] array in profiler object to track regop type for each
HWPM resource. Initialize the array based on resource ctxsw flag in
nvgpu_profiler_pm_resource_reserve().

Update profiler_obj_validate_reg_op_offset() to get regop type from
nvgpu_profiler_validate_regops_allowlist() and use this type and
prof->reg_op_type[] to get actual type that should be used for that
regop.

Update validate_reg_ops() to validate the offset first since regop
type is now determined in offset validation. Set ops[i].status to 0
for each validation iteration, and if op is valid set it to
REGOP(STATUS_SUCCESS) at the end of iteration.

Bug 2510974
Jira NVGPU-5360

Change-Id: Ib1f75d840d04d288789473adabda02cdc807eea0
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460003
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-05 12:38:17 -08:00
Deepak Nibade
7158db453c gpu: nvgpu: add test offsets to allowlist
Add ptimer register offsets to regops allowlist for testing. New
allowlist restricts regops only to reserved resources, this makes it
difficult to test the interface since only HWPM registers can be
accessed and that could have side effects on system.

Having ptimer registers as test offsets has advantage that the offsets
do not change across chips, registers are read-only, and values are
always incrementing so a test can verify read regops and test various
flags of interface.

Add gops.ptimer.get_timer_reg_offsets() HAL to return timer offsets.

Add static function add_test_range_to_map() that adds timer offsets to
allowlist always.

In nvgpu_profiler_validate_regops_allowlist() return success if timer
offsets are hit in range search.

Bug 2510974
Jira NVGPU-5360

Change-Id: I8b51bb92e43e8b1bbe903c874a429341659ef603
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460002
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: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-05 12:38:12 -08:00
Deepak Nibade
869735cda4 gpu: nvgpu: add dynamic allowlist support
Add gv11b and tu104 HALs to get allowed  HWPM resource register ranges,
offsets, and stride meta data.

Add new enum nvgpu_pm_resource_hwpm_register_type for HWPM register
type. Add new struct nvgpu_pm_resource_register_range_map to store all
the register ranges for HWPM resources. Add pointer of map in struct
nvgpu_profiler_object along with map entry count.

Add new API nvgpu_profiler_build_regops_allowlist() to build the regops
allowlist dynamically while binding the resources. Map entry count is
received with get_pm_resource_register_range_map_entry_count() and only
those resource ranges are added for which resource is reserved by
profiler object.

Add nvgpu_profiler_destroy_regops_allowlist() to destroy the allowlist
while unbinding the resources.

Add static functions allowlist_range_search() to search a register
offset in HWPM resource ranges. Add another static function
allowlist_offset_search() to search the offset in per-resource offset
list.

Add nvgpu_profiler_validate_regops_allowlist() that accepts an offset
value, checks if it is in allowed ranges using allowlist_range_search()
and then checks if offset is in allowlist using allowlist_offset_search().

Update gops.regops.exec_regops() to receive profiler object pointer as
a parameter.

Invoke nvgpu_profiler_validate_regops_allowlist() from
validate_reg_ops() if prof pointer is not-null. This will be true only
for new profiler stack and not legacy profilers.

In gr_exec_ctx_ops(), skip regops execution if offset is invalid.

Bug 2510974
Jira NVGPU-5360

Change-Id: I40acb91cc37508629c83106ea15b062250bba473
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460001
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: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-01-05 12:38:06 -08:00
Seema Khowala
6f2b2aa233 gpu: nvgpu: fifo: fix DOXYGEN_SHOULD_SKIP_THIS
"DOXYGEN_SHOULD_SKIP_THIS" string should not be present in
SWUD.

Jira NVGPU-6179

Change-Id: I1695dc96a6095276818f49c61823dae43b502f47
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459229
(cherry picked from commit a783c9169a0eed3aa7217c79c91227b33889a922)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2462216
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-29 10:45:07 -08:00