Commit Graph

9734 Commits

Author SHA1 Message Date
prsethi
144f548552 gpu:nvgpu: fix for shadow domain submission
There are three issues with shadow domain submission:
1. runlist mem is not being swapped with mem_hw for shadow domain when
there is non-shadow domain being bound to tsg which does not allow runlist
to have all the tsgs. To fix this nvgpu_runlist_swap_mem() is being called
for shadow domain as well.
2. tsg num_active_channels is being set as part of non-shadow domain which
does happen after shadow domain. Due to this, runlist tsg length is not
being set as part of runlist reconstruct and leaving tsg length 0 for last
tsg. To fix this, tsg num_active_channels always get set for shadow domain
as it gets configured first.
3. NV_BUILD_CONFIGURATION_VARIANT_IS_EMBEDDED is not solving the purpose
to differentiate l4t and embedded_linux builds so using
NV_BUILD_SYSTEM_TYPE in place of this to find out the build type.

L4t is using round robin scheduling and this issue coming with manual mode
scheduling so adding the fix only for manual mode scheduling support.

Bug 3884011

Change-Id: Ic55da8f75294eb32c8df6e35fb1fa47df78db8f8
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2833880
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-01-09 12:26:00 -08:00
srajum
6567a4e048 nvgpu: gpu: Enable strict warnings check flag
- Enable strict warnings check flag for nvgpu unit tests

Bug 3920734

Change-Id: I3c136e6486e953abadfddf369334a8ea5b659d28
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2837289
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-05 05:47:54 -08:00
Rajesh Devaraj
b9e771ecfc gpu: nvgpu: split capture_ram_dump api
This patch splits capture_ram_dump into two parts to separate out
NV_RAMFC_TOP_LEVEL_GET/NV_RAMFC_TOP_LEVEL_GET_HI into a new api. This
split helps in reducing duplication of capture_ram_dump in future chips.

JIRA NVGPU-9325

Change-Id: I4dba2db7c08406af1569e28037b2aa2f2abfc782
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2836197
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: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-05 05:45:15 -08:00
Sagar Kadamati
132f9bdab2 nvgpu: scripts: update runlist interrupt mask
hw register checker detects and error on local setup by nvdvms team.
register readout in GVS and nvdvms team setup is different.

On Finial System, Checker is expected to run after init
But on GVS, Checker runs as a test case along with test other GPU tests.
This lead to mismatch between local and gvs testing.

register missmatch detected by an hw register checker is not really
an error, its related to information.

There are two cases for updating mask value
1. These interrupts are mainly for sw information not any errors
2. These are temporary values ready from board
   We will update these values again once we get finial list from HW team

so, we can avoid checking bits 4:7, which represents
 * NV_RUNLIST_INTR_0_RUNLIST_IDLE 4U:4U /* RWIVF */
 * NV_RUNLIST_INTR_0_RUNLIST_AND_ENG_IDLE 5U:5U /* RWXVF */
 * NV_RUNLIST_INTR_0_RUNLIST_ACQUIRE 6U:6U /* RWXVF */
 * NV_RUNLIST_INTR_0_RUNLIST_ACQUIRE_AND_ENG_IDLE 7U:7U /* RWXVF */

Bug 3912656

Change-Id: I75d1d4737897ef44e78329ed708e86637e8bcf48
Signed-off-by: Sagar Kadamati <skadamati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2831273
Reviewed-by: svcacv <svcacv@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-01-04 06:53:51 -08:00
Ramalingam C
1dc067c86b gpu: nvgpu: Reuse warp_esr_error functions
Mark gr_gv11b_handle_warp_esr_error_mmu_nack and
gr_gv11b_handle_all_warp_esr_errors as extern for reusage in
upcoming chips

JIRA NVGPU-9073

Change-Id: Id443ff457628835cc0fde819eb68cbdcabce144e
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2821787
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-01-04 06:50:08 -08:00
Rajesh Devaraj
2e36ad9e35 gpu: nvgpu: add null check for gp_get, pb_get
This patch adds NULL check for gp_get and pb_get.

JIRA NVGPU-9325

Change-Id: If41c1c526c58a18cc91a95686e71bdfae9edb328
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2836366
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: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-03 19:10:11 -08:00
Rajesh Devaraj
2d3745810b gpu: nvgpu: add support flag for gsp stress test
Add support flag for GSP stress test.

JIRA NVGPU-9347

Change-Id: I6b93e085b4e25798f1227297fd1baba8c1380604
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2833485
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: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-03 19:09:17 -08:00
srajum
594c8da356 gpu: nvgpu: Add MIT license to gsp_test.c file
Change-Id: Ie2f73175917d1358f9c31d056b68b1ef61935266
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2835301
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-02 01:15:32 -08:00
srajum
f29f0050a8 nvgpu: enable strict warnings check flag
Bug 3920734

Change-Id: Ice20536e68ca675bbc0977378ea26cb0c0005b40
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2834705
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-02 01:10:58 -08:00
Rajesh Devaraj
95c5d3d776 gpu: nvgpu: add flag to disable static pg
This patch introduces the flag NVGPU_DISABLE_STATIC_POWERGATE. Further,
static pg related initialization APIs have been updated to check whether
this newly added flag is enabled. If this flag is enabled, then static
pg init gets skipped.

JIRA NVGPU-9350

Change-Id: I450b6dd2c541d31fc40fb5540e557b5db730fee2
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2834021
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-01-02 01:09:34 -08:00
Rajesh Devaraj
536ff1001e gpu: nvgpu: add flag to disable ecc stats
This patch adds the flag NVGPU_DISABLE_ECC_STATS to disable the creation
of sysfs nodes that will be used to provide ECC counter values. Further,
this patch adds a check on whether NVGPU_DISABLE_ECC_STATS flag is
disabled before performing ECC sysfs initialization.

JIRA NVGPU-9349

Change-Id: I99bc3895d3a5ffcf73035351f55c63ed5c46356b
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2833907
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: svcacv <svcacv@nvidia.com>
Reviewed-by: Prathap Kumar Valsan <prathapk@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-01-02 01:09:13 -08:00
Alex Waterman
a9e21b487a nvgpu: Fixes for QNX build structure changes
Minor updates in the path to header files.

Change-Id: I6fe1db8f050d9b168a1662f0cb65e15bc13c2195
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2810665
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sagar Kadamati <skadamati@nvidia.com>
Reviewed-by: Tejal Kudav <tkudav@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-28 06:56:34 -08:00
Ramalingam C
2c8cfde803 gpu: nvgpu: use hals for perfmon_regs_base
Use hals for the perfmon_regs_base at
	gr_gv11b_pri_pmmgpcrouter_addr
	gr_gv11b_pri_pmmfbprouter_addr

This helps to reduce the code duplications for upcoming chips

JIRA NVGPU-9073

Change-Id: I36ded2cb618249df555181cceeb81c524c78d587
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2828585
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-21 22:24:57 -08:00
Ramalingam C
4c22d5c35d gpu: nvgpu: Add hals for router_perfmon_regs_base
gv11b onwards add hals
        get_hwpm_gpcrouter_perfmon_regs_base
        get_hwpm_fbprouter_perfmon_regs_base

And remove the ga10b version of same as that is redundant.

This is preparatory patch to update the gr_gv11b_pri_pmmgpcrouter_addr
and gr_gv11b_pri_pmmfbprouter_addr with the hals

JIRA NVGPU-9073

Change-Id: I8b04f9b61784ca2c09b248655435ea7a7ab92926
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2828584
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 22:24:45 -08:00
Rajesh Devaraj
d255876fe9 gpu: nvgpu: update profiler init/deinit
Update profiler init and deinit functions to check whether the flag
g->support_gpu_tools is enabled.

JIRA NVGPU-9283
JIRA NVGPU-9286

Change-Id: Idefecb888b5a00cab1f1aca8a7db9ec43778cc39
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2817374
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 16:36:49 -08:00
vivekku
7d87c7efc5 gpu: nvgpu: nvs: use gsp vm for control fifo
Changes:
- changed system vm from pmu to gsp.

NVGPU-8686

Change-Id: I00a285691ab7900c2d3c2d198ae97b55d4fa87d7
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826279
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-21 12:00:17 -08:00
vivekku
470c1738b5 gpu: nvgpu: gsp: host routed interrupt handling
Changes:
- support for watchdog timer interrupt handling
- code modified to support gsp scheduler interrupts for ecc errors
directed to host
- interrupts like IMEM, DMEM, EMEM, Delayed Lock Step and incorrect
Register access

NVGPU-9273

Change-Id: I93a2ef0961aaa40e76ca7efe8450ce07a6709453
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2818202
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: Ankur Kishore <ankkishore@nvidia.com>
Tested-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 11:59:25 -08:00
Ramalingam C
f5f13778ad gpu: nvgpu: Use hals for getting strides
Get the gpc stride and ppc in gpc stride from get_litter_value hal.

JIRA: NVGPU-9073

Change-Id: Id7cea2dacd8210836ce016e6f84d5c34eac267d8
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2831031
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 06:32:14 -08:00
rmylavarapu
7bbf10b04a gpu: nvgpu: gsp: bootstrap gsp scheduler firmware
This change will call nvgpu_gsp_sched_bootstrap_hs which will bootstrap
the gsp with gsp scheduler firmware.

NVGPU-9297

Change-Id: If5de945dc7994666fd87ecf99e15ca2014c13573
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826165
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-18 11:43:14 -08:00
mpoojary
e9c6bcaf5c gpu: nvgpu: acr: Add support for t234 safety with dgpu ACR stack
This change is to adapt to shift of ACR t234 safety code from
iGPU to dGPU.
Required changes consists of:
Adding support for new LSB, WPR and ACR descriptor structures
which are more aligned with what dGPU currently uses.

Change old riscv LSB header to version 1, as version 2 will
be used for new header to align with dGPU header nomenclature.

Jira NVGPU-9298

Change-Id: Id75f7d0a03dc65c1983822ead428b330a83481a1
Signed-off-by: mpoojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2811116
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>
2022-12-18 11:41:25 -08:00
rmylavarapu
81ba21f031 gpu: nvgpu: enable gsp scheduler on embedded linux profile
Currently the gsp scheudler is enabled for all linux configurations and
this change will enable the gsp scheduler on embedded linux profile and
will disable on l4t.
One of the gsp ga10b hal funcion is used by nvgpu-next so the defination
is moved out of gsp scheduler flag

NVGPU-9297

Change-Id: If457db46e26d8f5be01f643c75a22aafb86bd7f3
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826152
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-17 11:44:36 -08:00
Dinesh T
b05341134b gpu: nvgpu: Read device tree to get the supported syncpoints
The patch is adding a OS specific call to get the supported
syncpoints from the DT entry. The syncpoints is used to
initialize the number of supported channels while GPU
initialization.

The error path is taken care with the default value 256.

As device tree entries not available in upstream, the path
handled with the default value 256.

Change-Id: I9ac949d68a9f93f0e56fdbf8c8cd33b7dc903298
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826280
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-17 11:42:52 -08:00
Mikko Perttunen
6953c61a1b gpu: nvgpu: linux/host1x: Allocate syncpoints from GPU pool
On systems with GPU syncpoint pools, pass the flag to allocate
from it.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I184196f1876e59e492a2cc71d7f190416ce9061f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826199
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Sanif Veeras <sveeras@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
2022-12-17 11:42:47 -08:00
Sanif Veeras
f19d5ef3c0 nvgpu-linux: alloc syncpt from gpu pool
- Modify the syncpoint allocation logic in Linux code to
  use the interface to allocate from GPU specific pool

Jira HOSTX-4515

Change-Id: If2be840ba7ba3b63df73edd3cb2875ca0986eec3
Signed-off-by: Sanif Veeras  <sveeras@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2820454
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-17 11:42:08 -08:00
Tejal Kudav
ee81e3ee34 nvgpu: Disable gsp func ISR when mon is present
On QNX safety builds, when Mon is present, SWGEN0 intr will be handled
as part of devctl DCMD_NOTIFY_GSP_INTR.

JIRA NVGPU-7442

Change-Id: Ibe3526526821c81c9abaadf74f3d35da9708bfb3
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826149
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-17 06:26:13 -08:00
prsethi
6337e0e272 gpu:nvgpu: clear domain response memory
Same receive queue memory allocated for the domain gets used to send
the response to userspace. So it is needed to clear the memory before
updating it.

Bug 3884011

Change-Id: I23270f9b5796ac1f4cc8f8f180da7b8abd527f77
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2828818
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-17 02:24:28 -08:00
Seeta Rama Raju
e0a9553533 gpu: nvgpu: Add magic value at instance block
This is adding magic value in instance block while
initializing instance block for a context. This will
be verified by FECS firmware.

Bug 3638810

Change-Id: I7d304c1b622b3c9f50a7443e9fadce9bac869258
Signed-off-by: Seeta Rama Raju <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2786274
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-17 02:21:07 -08:00
Jon Hunter
a8e38dd72d gpu: nvgpu: Fix OOT build for Linux v5.14
For building NVGPU as an out-of-tree we support Linux v5.14+ kernels.
NVGPU is no longer building as an out-of-tree module for v5.14 because
the tegra-ivc.h header is not found. Update the driver for use the
appropriate header for Linux v5.14.

Bug 3812973

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I268ca8a56d04f1801200ff7fb6838b670a0c48d5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2828088
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-16 03:34:42 -08:00
Tejal Kudav
31b2738f6a gpu: nvgpu: Add Epl Init
EPL lib constructor is replaced by NvEplInit() by safety services.
NvGPU, being an EPL user, needs to call NvEplInit before using EPL
API to report errors.
NvEplInit() usage is limited to user space in Linux, so NvGPU is not
expected to call NvEplInit on Linux.

Bug 3863536

Change-Id: I7fc9b33d3443bd39a6367a0c691bddb80b9edb68
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2817245
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-15 20:55:54 -08:00
prsethi
7c7295f2c0 gpu:nvpgu: avoid checks for MINOR and PATCH version
The NVS protocol is supposed to follow the semantic versioning scheme as
said in the header docs. This means backwards compatibility within the
same major version.
Patch removed the client MINOR and PATCH version comparison with KMD
version.
Patch also returns KMD version irrespective of version compatibility.

Bug 3884011

Change-Id: I756a0f87e911d8549efda8e8f5671f9c6d6a76c9
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2826431
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: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-15 15:15:13 -08:00
Atul Anand
5db14f3bfb nvgpu: Fix pm resource release sequence
The memory leak issue was due to nvgpu_profiler_unbind_context() calling
nvgpu_profiler_pm_resource_release() for all resources which clears the
flag required by nvgpu_profiler_free_pma_stream() to release the memory
for perf_buf instance block.
Fixing this issue by splitting nvgpu_profiler_unbind_context() to release
all the pm resources at a later time separately.

Bug 3510455
Change-Id: Ibab8d071693e600c46f7e7f16575e36e6f62af3c
Signed-off-by: atanand <atanand@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2825013
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-15 15:13:29 -08:00
mpoojary
9b73378362 gpu: nvgpu: Add support for loading ctxsw encrypted binaries
Add checks to load encrypted CTXSW binaries for T234,
when executing in silicon; else load the non encrypted
binaries.

Jira NVGPU-9303

Change-Id: Icf55ed76b1a7340006b00d1c24472d26462a880c
Signed-off-by: mpoojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2819642
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dinesh Kamalakannan <dineshka@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
2022-12-14 23:48:10 -08:00
Dinesh T
2509287e71 gpu: nvgpu: enable NVGPU on OOT
This patch is required for
 - enabling NVGPU driver on OOT by enabling various
   configs required.
 - replacing new APIs for some deprecated APIs by
   guarding with linux version for soc.c.
 - CONFIG_TEGRA_HV_MANAGER is enabled by default in OOT kernel,
   removing CONFIG_TEGRA_HV_MANAGER check from various places.

Bug 3812973

Change-Id: I07f0b738ca95d4a3996e7f3ee5e895463db0626b
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822434
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-13 16:56:58 -08:00
Dinesh Kamalakannan
19f44e0421 gpu: nvgpu: ls ucode decryption support
On T234 theCTXSW LS ucodes are encrypted. ACR will perform the
decryption and the decrypted content will be written back
into the same WPR location. So on recovery with LSPMU absence
and on warm boot case, to perform the authentication , the ucode
blob needs to be copied into the WPR from sysmem always.
Below are the LS ucodes authentication type
	* LSPMU - Only Signed ( Only for non-safety build, for safety LSPMU is NA)
	* CTXSW FECS/GPCCS - Encrypted and Signed (on both safety and non-safety build)

ACR FW P4 Change : 32110924

JIRA NVGPU-7903

Change-Id: If447148c02b9cf310102cfb9c688eef402699409
Signed-off-by: Dinesh Kamalakannan <dineshka@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822656
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: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-13 06:24:55 -08:00
vivekku
a92bca9772 gpu: nvgpu: gsp: created cmd for GSP to bind ctx reg
Changes
- create command for GSP firmware to bind ctx register.

NVGPU-8730

Change-Id: If92bbbc0169b6466e55f3dff05828b2b649ad3de
Signed-off-by: vivekku <vivekku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2815472
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-13 06:22:02 -08:00
Sagar Kadamati
f853536eac nvgpu: scripts: add checker data generator
For ASIL-D decomposision we need hw register checker to validate
potential register configurations done at init phase

This is the tool used to generate hw registers table that needs to be
validated on the target.

* Generate register list
   - register addresses are picked from hw headers
   - register value masks are hardcoded for validation

Jira NVGPU-8885

Change-Id: I875735b6ae6b5e94eb85e67ca802a23b7d250598
Signed-off-by: Sagar Kadamati <skadamati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2823929
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2022-12-12 15:12:18 -08:00
Sagar Kamble
9726ae3ba8 gpu: nvgpu: register pm_qos min & max frequency notifiers
nvpmodel updates the devfreq frequency limits as per power requirements
for specific chip. Clock arbiter ignored these limits and set clock
to maximum supported frequency which may lead to leaking power and
over heating.

Add support to get the devfreq limits by registering PM_QOS notifiers.
Note that with this patch we enable CONFIG_GK20A_PM_QOS when PM_DEVFREQ
is enabled. So it will be enabled for all supported kernels (4.9, 4.14
kernels continue to support this. For 5.10+ kernels notifiers added in
this patch will be used. Thermal framework related notifiers for kernels
after 4.14 will not be registered as those use downstream interfaces
that are not available.)

We maintain devfreq min/max limits in the scale profile and update those
in the notifier calls. We use these limits to clamp the frequency in the
clock arbiter.

Bug 3852824

Change-Id: I734a9fb080fee1a91e9b5da071b662dbd9a18682
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822686
(cherry picked from commit eacaf8cec2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822682
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-12 15:09:56 -08:00
rmylavarapu
01eb416745 gpu: nvgpu: gsp sched: enable gsp sw init for safety build
Changes
1. Remove dGPU flag dependency on calling gsp sw init on tot.
2. Created Enable flag for gsp scheduler to enable them on ga10b
platforms.
3. Engine config flag is only enabled for dGPU enabled platforms, as gsp
is using engine functions it need to be enabled for all gsp sched
enabled builds.
4. Changes in gsp_sequence_init/de_init where on qnx we are seeing
issues.

NVGPU-9297

Change-Id: Ia4bce85ae8fd2794da1553e9ea418c76845a10ac
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822537
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-12 06:06:09 -08:00
rmylavarapu
398a30a546 gpu: nvgpu: gsp sched: get the binary file names as per debug fuse
Changes
 1. Created gsp hal function to read the hardware config register
    to tell whether the board is debug fused.
 2. Created function to get the binary file names as per debug fuse.

NVGPU-9295
Bug 3897331

Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Change-Id: Ia8462aa6f3d8d0d538c06f35245c965e106b3d37
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2822443
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>
2022-12-11 19:09:29 -08:00
Tejal Kudav
1840b95aca gpu: nvgpu: Change dependency for err inj CONFIG
HSI Error injection utility on QNX is compiled only when
NV_BUILD_CONFIGURATION_IS_DEBUG or NV_BUILD_CONFIGURATION_IS_VLTEST
build options are enabled. Remove the NvGPU error injection support
dependency on CONFIG_TEGRA_HSIERRRPTINJ as it is used only on Linux.

Also, the safety build support will be moved to Mon, so enable
CONFIG_NVGPU_FSI_ERR_INJECTION only on regular build.

JIRA NVGPU-7440

Change-Id: Ibbdd0aabfa7c5a4f3aee51cdf6bdadbb814bdfeb
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2820579
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-11 19:08:40 -08:00
prsethi
204285e03f gpu: nvpgu: remove check for reserved2
Variable reserved2 is updated to array and 0 check will not make much
sense now. Removing the check.

Bug 3884011

Change-Id: If6f256d06ea8e692fae2c8c8b0eaf1214cd915fb
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2823871
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-09 15:20:41 -08:00
prsethi
b4494a4b86 gpu:nvgpu: fix the nvs mmap issues
- As part of mmap call handler mmap_sem is being acquired which is
causing an BUG: scheduling while atomic:. This is happening because
mmap callback gets called with mmap_sem held. The mmap file handler
is called via call_mmap() via mmap_region() via do_mmap(), and the
caller of do_mmap() must hold down_write(&current->mm->mmap_sem).
To fix this issue removing the mmap_sem locking from nvs mmap handler.

- If remap_vmalloc_range() is used to map the pages to userspace then
allocated pages should be mapped into virtually contiguous space by
passing VM_USERMAP flag to vmap(). Passing VM_USERMAP to vmap() call
if API nvgpu_dma_alloc_flags_sys() is called with flag
NVGPU_DMA_VM_USERMAP_ADDRESS.

Bug 3884011

Change-Id: I64264f6f6e0dd75b1f828dc58355d740e6ef5ccb
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2820781
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-09 15:19:07 -08:00
Austin Tajiri
0e6c8bb521 gpu: nvgpu: set gpc_mask via HAL when possible
Update gr_config_set_gpc_mask() to always set gpc_mask via the HAL when
possible and not just when CONFIG_NVGPU_DGPU is set. In GA10B, logical
GPC ID does not necessarily equal physical GPC ID.

Jira GVSCI-14589

Change-Id: I8785b6a8a7c21a9d4401137aed5135f150697e88
Signed-off-by: Austin Tajiri <atajiri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2823541
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-09 15:13:26 -08:00
Rajesh Devaraj
3b2b225c73 gpu: nvgpu: update pmu_early_init
Move the setting of power features related enable flags to separate
static function. Invoke this function when PMU is not supported.

JIRA NVGPU-9283

Change-Id: I429504c09d40c2cb115fce7550555f06b1e384ed
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2817658
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: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-07 01:51:30 -08:00
Dinesh T
373398a46b gpu: nvgpu: Add os specific call to initialize the channels
Add OS specific function to return the number of syncpoints
available to the GPU. This is required for making the
syncpoints as configurable.

Linux: The default number of syncpoints is 512.

Bug 3644504

Change-Id: Iddbc38cb25480876d6d8f39f039218a1b2b22605
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2820152
Reviewed-by: Alex Waterman <alexw@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: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-06 04:47:24 -08:00
Debarshi Dutta
8e60795b9c gpu: nvgpu: Add correct nomenclature for NVS ioctls
Its preferable to use the following naming convention
NVGPU_<group>_IOCTL_<function>.

The IOCTL interfaces are updated accordingly.

Also, all KMD based defines as part of the UAPI need
to be prefixed by NVGPU.

Jira NVGPU-8619

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I2210336536cbcc0415885f3f92a2f7fa982fa39c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2814484
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-06 04:40:05 -08:00
Shashank Singh
eb60e7f1f1 gpu: nvgpu: fix memory leak in pd cache
Fix memory leak in case dma allocation fails in function
nvgpu_pd_cache_alloc_direct_lock(). This one got introduced by the patch
https://git-master.nvidia.com/r/c/linux-nvgpu/+/2735657.

Bug 3461002

Change-Id: Ia8c6138179cc9bb2adc53bff32dd81fb2b6ee54a
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2821684
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
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: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-05 20:48:24 -08:00
prsethi
bd134326f8 gpu: nvgpu: reset the nvs user mask before resetting the queue
user->active_used_queues mask should be unset before the queue->mask
gets reset as part of queue->free calls otherwise user will be
considered as active and will avoid the proper cleanup.

Bug 3884011

Change-Id: I7a9d620a5dae057df2eb41fced8c801e14639e61
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2818962
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-05 20:41:14 -08:00
Rajesh Devaraj
469ad373b4 gpu: nvgpu: update clk arbiter init
Initialize clk arbiter only when NVGPU_CLK_ARB_ENABLED flag is set.

JIRA NVGPU-9283

Change-Id: I69dcfab349af7293ce3b3edb588a30a101a36e94
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2814780
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: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-02 08:06:10 -08:00
Divya
b4b98aba02 gpu: nvgpu: reorder elpg and elpg_ms flags check
- In rmmod path, gr struct is freed first and then
  info_mem_destroy is called which calls elpg_ms
  protected call. This in turn waits for gr init
  where gr struct is accessed. This could lead to
  NULL access.
- move elpg and elpg_ms flag check before checking
  pg initialized and gr wait conditions to avoid
  the NULL access issue.

Bug 3848290

Change-Id: I088d89d7876405cc7abedb777884b442726e992f
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2811131
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: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-01 11:03:05 -08:00