Commit Graph

9138 Commits

Author SHA1 Message Date
Lakshmanan M
35e28884ec gpu: nvgpu: unit: Fix 'Targets' for mm_cache_api
This patch adds a correct path for mm_cache_api.

JIRA NVGPU-5932

Change-Id: Ie8376179ee703d129fd6dac553bc32491cdb1c30
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2469974
(cherry picked from commit 8bb7f38c8406f4dd9cd583e6e1f2eed218009957)
Change-Id: If0858dcdb44bddcd6a455e579aaa049d534e7655
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2471554
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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
2021-01-18 08:24:17 -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
srajum
2fcfabed90 gpu: nvgpu: Add correct path in SWUTS source
The path added in SWUTS source file is corrected.

JIRA NVGPU-5932

Change-Id: Idc3f637734a20164e1ab095efca5c4853f2d85d9
Signed-off-by: Dinesh <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2467862
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>
2021-01-12 12:35:35 -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
Lakshmanan M
f3ee39505c gpu: nvgpu: unit: update 'Targets' for test_nvgpu_sgt_basic_apis
* This patch adds a missing 'Targets' field (nvgpu_sgt_get_length())
in the SWUTS of common.mm nvgpu_sgt unit.

* Added nvgpu_sgt_get_length() api validation sequence in
test_nvgpu_sgt_basic_apis().

JIRA NVGPU-5932

Change-Id: Id079b2ec012e6a7cc4973ff47ac19c877e21bf87
Signed-off-by: Lakshmanan M <lm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2466697
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@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-07 06:44:49 -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
14a8b86d43 gpu: nvgpu: unit: update sync SWUTS for sync_ro_map
Add gops_sync_syncpt.get_sync_ro_map to sync SWUTS.

JIRA NVGPU-6179

Change-Id: I8e1915d6650366b8891d048f0c09fd3c6f62f5b1
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459327
(cherry picked from commit 9d05700527f00a33ed9cf17519bbd04fb09ded20)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2462218
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-29 10:45:20 -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
Prateek sethi
58fdf128a6 nvgpu: userspace: Update 'Targets' for common.sync APIs
common.sync unit was added as part of 5.2 scope and APIs from this unit
was not added into test's Targets causing warning in swud. Patch updates
the Targets in the respective tests.

Jira NVGPU-6345

Change-Id: I70c0a0d086f66a0e0c153626c59e6df9d4eec147
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459841
(cherry picked from commit 627e7fc7e1fa3976d9d61137b8a48c9be2fb8d44)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2463908
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
2020-12-28 13:04:37 -08:00
Prateek sethi
a0ee546ad7 gpu: nvgpu: doxygen update for os_utils
Update the doxygen comments for firmware and intr APIs.

Jira NVGPU-6258

Change-Id: I035be3ed249b0766d27cefeb8fc573859069f0d5
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457814
(cherry picked from commit 9a09e754aacb0b87ab61e39e5966da46fd85481c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2463906
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
2020-12-28 13:04:25 -08:00
ajesh
4303579e38 gpu: nvgpu: update doxygen comments for posix
Update the doxygen comments for various posix units.

Jira NVGPU-6253

Change-Id: Iedada7e344b51f2075c783598ba2f32102c1b8c9
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457340
(cherry picked from commit 7ae2fbae2fa3759393339bf1b30b196b2f525215)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461963
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-28 09:53:04 -08:00
Deepak Nibade
9221b01968 gpu: nvgpu: implement HWPM streamout teardown sequence
Implement below functions:

- nvgpu_profiler_quiesce_hwpm_streamout_resident
Teardown sequence when context is resident or in case profiling
session is a device level session.

- nvgpu_profiler_quiesce_hwpm_streamout_non_resident
Teardown sequence when context is non resident

- nvgpu_profiler_quiesce_hwpm_streamout
Generic sequence to call either of above API based on whether
context is resident or not.

Trigger HWPM streamout teardown sequence while unbinding resources
in nvgpu_profiler_unbind_hwpm_streamout()

Add a new HAL gops.gr.is_tsg_ctx_resident to call
gk20a_is_tsg_ctx_resident() from common code.

Implement below supporting HALs for resident teardown sequence:
- gops.perf.pma_stream_enable()
- gops.perf.disable_all_perfmons()
- gops.perf.wait_for_idle_pmm_routers()
- gops.perf.wait_for_idle_pma()
- gops.gr.disable_cau()
- gops.gr.disable_smpc()

Jira NVGPU-5360

Change-Id: I304ea25d296fae0146937b15228ea21edc091e16
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461333
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 15:26:21 -08:00
Deepak Nibade
ce8358ef2b gpu: nvgpu: update common.gr doxygen to match swud
Update doxygen comments for common.gr functions used in initialization,
context creation, and interrupt handling usecases to closely match
design description in SWUD.

Add details on why those APIs are needed.

Jira NVGPU-6180

Change-Id: I6f987a797eb9412a0a8853b37c9f13f18d9717c2
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459526
(cherry picked from commit 0dffeb056656b403ef3bc2ef2c54732da5de2bd9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461159
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:29:30 -08:00
Deepak Nibade
462853ab71 gpu: nvgpu: update common.gr doxygen
- Use retval keyword instead of return keyword for return values.
- Add note to refer gops_class to get valid classes. Also add a note
  that graphics classes are treated as invalid classes in safety.
- Note specific preemption modes that are allowed by API to set
  preemption modes.
- Fix typos.

Jira NVGPU-6180

Change-Id: Ida0a78ba3e70e83f0f091f16b90b7cb9636d2468
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2456706
(cherry picked from commit 5e583a44dee4ead74438d49f8f674189ff4803c0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461158
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:29:22 -08:00
Deepak Nibade
1e76f468ff gpu: nvgpu: remove unused member of nvgpu_gr_ctx struct
virt_ctx variable of struct nvgpu_gr_ctx is not being used anywhere.
Remove it.

Jira NVGPU-6180

Change-Id: Ia9ee2e0afefe6cbff31e13f3f988ac8116244c51
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2456455
(cherry picked from commit c734e2690c075d8ab5fb3bbf816210fb23b01074)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461157
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:29:17 -08:00
ajesh
e49c5a5cce gpu: nvgpu: move macros under NON_FUSA flag
Move macros in posix unit that are not used by safety code
under NON_FUSA flag.

Jira NVGPU-6253

Change-Id: If4227b4a5d8c35652e324e0cf5276293e29fa3f2
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459298
(cherry picked from commit 86c1b4ca98f9ff7104a1c2e6ce5512a44aafa832)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461111
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:29:04 -08:00
ajesh
147dbf4d7c gpu: nvgpu: update targets field for sizes UT
Update the targets field for the test test_size_defines in
posix sizes unit test.

Jira NVGPU-6253

Change-Id: I98d41ba87b7981ded794379da85f78e9df61d25d
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459323
(cherry picked from commit e627e1a8acde6389b8cd28d943d3aafbe1721cfc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2461110
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:28:59 -08:00
ajesh
d0e76cc4a3 gpu: nvgpu: update doxygen comments for utils
Update the doxygen comments for common utils unit.

Jira NVGPU-6236

Change-Id: I2d842baaf2efea66673f700b6926c6a16b468bbd
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457841
(cherry picked from commit 88b83544696c350933082c8c88bce985837213ac)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459913
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-18 03:28:16 -08:00
mkumbar
65111b64f2 gpu: nvgpu: Add RISCV LS PMU support
-Add RISCV LS PMU support by adding RISCV LS PMU ucode to the blob.
-Modify the PMU RTOS sequence based on NEXT CORE enable flag.

JIRA NVGPU-6303

Change-Id: I4e2b989f9903b72a6327c931eb3c02f8cef2aa75
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2447388
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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>
2020-12-17 18:36:44 -06:00
Prateek sethi
5767c36312 nvgpu: compile out g->max_comptag_mem from safety build
max_comptag_mem is being used only for CBC unit which is not a part of
safety build. Remove max_comptag_mem from safety build.

Jira NVGPU-6258

Change-Id: I4773468174ca261ec90a09ffaadb853acc4352f0
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455874
(cherry picked from commit 1262f7b268df8d64c91d5960a26a5ab9a58749d5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460386
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rajesh Devaraj <rdevaraj@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>
2020-12-17 18:36:44 -06:00
Prateek sethi
fe3e6a00b5 gpu: nvgpu: compile out NON FUSA IO APIs
Patch removes declarations for IO NON FUSA APIs.

Jira NVGPU-6238

Change-Id: Iea52d6c0a54b65bebe92b6abfeb8e585963631d0
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2451361
(cherry picked from commit 66446f0ce2d9b65e48201400ca09eaa625026384)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460379
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@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>
2020-12-17 18:36:44 -06:00
Prateek sethi
9a618aaef3 nvgpu: update details of return types
Patch updates the doxygen for APIs nvgpu_enable_irqs and
nvgpu_init_soc_vars and adds describe the error codes which can be
returned by these APIs.

Jira NVGPU-6258

Change-Id: I002d25865eec6e3fa52250fd25880bf259358f1d
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455856
(cherry picked from commit 01c7f3398622047bdf3d46024c1b51223461cba7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460377
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rajesh Devaraj <rdevaraj@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>
2020-12-17 18:36:44 -06:00
dt
ec4e8c7613 gpu: nvgpu: Doxygen: Change the return value format
This is changing the return value format.

JIRA NVGPU-6259

Change-Id: Ic889328e5aaf6716837e594d6b9876e0cf8a5d56
Signed-off-by: dt <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457892
(cherry picked from commit 707cdaf7600300cd1612cac53714a3118b4b3b6f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2459284
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
shashank singh
e13f0db093 gpu: nvgpu: add doxygen comments for missing gk20a fields
Many fields of struct gk20a is missing documentation and not all
non-safety fields are skipped. Document all safety fields and skip
non-safety fields of struct gk20a.

Jira NVGPU-6252

Change-Id: I5c280e812f6398c0984db11f9ad144b67a532ab3
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457268
(cherry picked from commit 85d47e3e7f3708f0403ff3810b168862432c29e0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457263
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
Antony Clince Alex
b285fb33ee gpu: nvgpu: update regops ctxsw address types
Update the below two regops ctxsw address types to fix misnomers:
- CTXSW_ADDR_TYPE_ROP:
  This address type is used to access the PMM config registers and does not
  belong to the ROP unit. Hence, rename it to CTXSW_ADDR_TYPE_PMM_FBPGS_ROP.

- CTXSW_ADDR_TYPE_BE:
  This address type is used to access registers exclusively in ROP unit and not
  the entire BE unit. Hence, its more appropriate to rename it to
  CTXSW_ADDR_TYPE_ROP.

In addition, rename the following functions:
- pri_is_be_addr_shared => pri_is_rop_addr_shared
- pri_be_shared_addr => pri_rop_shared_addr
- pri_is_be_addr => pri_is_rop_addr
- pri_get_be_num => pri_get_rop_num

Bug 3146324

Change-Id: I8613f0972936699b2ef8f7dbe3de78582af2a35f
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2429885
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:48 -06:00
Sagar Kamble
17d1ecc43c gpu: nvgpu: remove bpmp powergate calls for t186 and t194 and update is_railgated
With Generic Power Domains (genpd), bpmp driver will manage the GPU
powergating. With the nvgpu idle/unidle flows updated for VPR with
genpd/RPM, the usage of the below tegra bpmp calls can be removed
from nvgpu from railgate APIs for t186 and t194. Note that genpd
is available in k4.14 onwards, so this will work on current
downstream kernel.

tegra_bpmp_running
tegra_powergate_is_powered
tegra_powergate_partition
tegra_unpowergate_partition

Runtime suspended state indicates that the device is railgated.
Update the t186 and t194 is_railgated handlers with this. t210
railgate/unrailgate will be still managed by nvgpu as bpmp
support is not present.

Bug 200602747
JIRA NVGPU-5356

Change-Id: Iadfd794cb51bc41ca927b84fc212ac766d60094d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2376642
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
Sagar Kamble
bd7bda4f98 gpu: nvgpu: do_idle/unidle handling with runtime PM after probe
Extend the runtime suspend/resume based idle/unidle logic in the
probe case to handling done in gk20a_do_idle/unidle for nvgpu
after the probe completion.

If the railgating is disabled, setting autosuspend_delay to 0 will
enable the suspend. If railgating is enabled, autosuspend delay
will be > 0. Setting it to 0 will enable the immediate suspend.

With this approach based on RPM, forced_reset logic is removed.
force_reset_in_do_idle is also removed as railgating is
supported.

Bug 200602747
JIRA NVGPU-5356

Change-Id: Iaf6d5ab651b8200f0547b45d90f812110cf63c0e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2375941
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
Sagar Kamble
4012a97640 gpu: nvgpu: enable runtime PM before secure_alloc init during probe
With genpd based runtime PM, the device railgating is managed by the PM
core and the nvgpu manages the clocks. To suspend/resume the device for
idling/unidling while initializing secure alloc, runtime PM is to be
enabled during probe.

nvgpu platform railgate handlers will be only managing the clocks.
During probe, the nvgpu driver poweroff/poweron are not to be
invoked as part of driver runtime suspend/resume hence probe
state is added.

After platform probe initializes the clock, explicit runtime resume of
the device is required to sanely suspend it during gk20a_do_idle.

Runtime PM configuration differs based on the NVGPU_CAN_RAILGATE
capability, hence the runtime PM is enabled ("truly") only for
the duration of nvgpu_probe and then the state is reverted at
the beginning of gk20a_pm_late_init.

Bug 200602747
JIRA NVGPU-5356

Change-Id: I1fbd03d3f49da07ccbee9714387e00ffc688864e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2375939
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
Sagar Kamble
5a5f082d24 gpu: nvgpu: move init_secure_alloc to platform late_probe
With genpd based runtime PM, the device railgating is managed by the PM
core and the nvgpu manages the clocks. To suspend/resume the device for
idling/unidling while initializing secure alloc, runtime PM will be
enabled before init_secure_alloc.

nvgpu platform railgate handlers will be only managing the clocks. The
clocks and secure alloc initialization was done in platform probe
(applicable to tegra).

To suspend (railgate and clks disable) and resume cleanly during secure
alloc init, the platform probe should happen first that initializes the
clocks. Post that device runtime PM will handle the device idle/unidle
properly.

Hence, move gk20a_tegra_init_secure_alloc to platform late_probe.

Runtime PM changes are introduced in the later patches.

Bug 200602747
JIRA NVGPU-5356

Change-Id: I5130ff43f7b75ddc51cb7096ba6532b3f5397258
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2375938
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
Mayur Poojary
160c6c16bd gpu: nvgpu: Add auto-generated regops allowlist
Add auto-generated regops allowlist files for gv11b and tu104.
Update Makefiles accordingly.

Bug 2510974
Bug 200668999
Jira NVGPU-5360

Change-Id: I5bc6a220ef6f90838e0ba735b1ee8e97d8f9215f
Signed-off-by: Mayur Poojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2423637
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:13:48 -06:00
smadhavan
d3509af0f5 gpu: nvgpu: add next-core selection flag for acr
NVGPU_ACR_NEXT_CORE_ENABLED indicates which core to
use for acr bootstrap. This flag will be set based on PMU
and GSP core selection fuses in case of non-safety
and safety builds respectively

Change-Id: Id8daca20ba56648c1d7074ea2dd2384739c88704
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455895
Reviewed-by: svcguardwords <svcguardwords@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Deepak Goyal <dgoyal@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>
2020-12-15 14:13:48 -06:00
Antony Clince Alex
7930404740 gpu: nvgpu: update hwmp map to account for checksum entries
Starting with nvgpu-next, the ctxsw ucode computes the checksum for each
ctxsw'ed register list, this checksum is saved at the end of the same list;
This entry will be given a special placeholder address 0x00ffffff, which can
be used to distinguish it from other entries in the register list.

There is only one checksum per list, even if it has multiple subunits. Hence,
update "add_ctxsw_buffer_map_entries_subunits" to avoid adding checksum
entires for each subunit within a list.

Bug 2916121

Change-Id: Ia7abedc7467ae8158ce3e791a67765fb52889915
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457579
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: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:48 -06:00
tkudav
05e3482106 gpu: nvgpu: Enhance doxygen for common.ptimer APIs
Add details about the purpose served by the common.ptimer APIs.

JIRA NVGPU-6235

Change-Id: I4e4716135649aa611646e63c1b4e9b37eacde60b
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2456005
(cherry picked from commit 7b8907a0e8445d7b97fd0fdd2ca763e039b5893c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457621
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:48 -06:00
tkudav
2ee6a0f554 gpu: nvgpu: Add details to common.class APIs
Add more details about the purpose served by the common.class
APIs.

JIRA NVGPU-6244

Change-Id: I16e4d62175a05ff6f71b7148d1ea7874d1fe01ac
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455939
(cherry picked from commit 5ad0a0b6fdc1b68fea6570bf434bf479f8bd05ea)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457393
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:48 -06:00
tkudav
882e418d1b gpu: nvgpu: Add details to common.fbp API retval
Add doxygen comments to describe the possible return values from
common.fbp API in case of error.

JIRA NVGPU-6237

Change-Id: Ifff997f18d61f855fc83914fbbe4ea09c5fafbaf
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2455034
(cherry picked from commit 5d646ef5d3f18c91f2d60c0abf4cecb84154bf4a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457392
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:48 -06:00
Antony Clince Alex
c36af00e55 gpu: nvgpu: fix lookup of engine_id from mmu_fault_id
The function "nvgpu_engine_mmu_fault_id_to_eng_id_and_veid" updates only
the veid field and leaves the engine_id as invalid. This can cause the
recovery to be skipped in certain instances of MMUFAULT; For example,
the MMUFAULT when a unbind is done on a channel which is currently active
on the engine. In this case, the ch_id associated with the fault is -1 and
the function "gv11b_mm_mmu_fault_handle_non_replayable" will not set the
rc_type correctly causing recovery to be skipped and leaving the engine in
a bad state.

Bug 3163660

Change-Id: Ic99c47771a4002c153ac77ab0473b11d01cfd54a
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2457259
Reviewed-by: Rajesh Devaraj <rdevaraj@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: Seshendra Gadagottu <sgadagottu@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
2020-12-15 14:13:48 -06:00