Commit Graph

8927 Commits

Author SHA1 Message Date
Debarshi Dutta
5d42343cbf gpu: nvgpu: use appropriate permissions for debugfs entries
SW Profiler's debugfs entry "enable" has both RW permissions set
however the corresponding read operation is set to NULL.

Similarly, the other entries i.e. "percentiles", "raw_entries" and
"basic_stats" only have a read operation defined and write is set to
NULL.

To enable correct permissions, set permission for "enable" to "W"
and set permissions for others as "R" only.

Bug 200747304

Change-Id: I296a0ff08a871f752988c9b0a671c080695d5eab
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2566322
(cherry picked from commit 8542dd388da536ee693610acd0bb3a679ff52881)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2628035
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-19 08:08:11 -08:00
Antony Clince Alex
cce1d7ad84 gpu: nvgpu: update device management framework to remove unusable engines
On certain platforms, not all copy engine instances are usable. The user
shouldn't submit any work to these engines. To enforce this, remove
these engines from active/host_engine list, this should ensure that these
engines do not get advertised to userspace. In order to accomplish this
introduce the following functions:
- nvgpu_engine_remove_one_dev: This function removes the specified device
  entry from following device lists: fifo->host_engines, fifo->active_engines,
  runlist->rl_dev_list, runlist->eng_bitmask.

Replace iteration over LCE device type entries using
nvgpu_device_for_each(g, dev, NVGPU_DEVTYPE_LCE), along with this introduce
macro nvgpu_device_for_each_safe.

Introduce gpu_dbg_ce flag for CE debugging.

Bug 3370462

Change-Id: I2e21f18363c6e53630d129da241c8fece106cd33
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2616711
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-18 09:18:55 -08:00
Tejal Kudav
79ee724b04 gpu: nvgpu: Add knob to control dbg/prof support
On production boards, there is requirement to disable GPU
profiler and debugger support. Add DT property 'support-gpu-tools'
which can be modified to enable/disable debugger/profiler support.
The default behavior is to enable the debugging features and set
'support-gpu-tools' to 1. This property is chosen to be u32 value
to be in sync with GPU vserser property by same name.
The debugger/profiler support is disabled by skipping the creation
of below nodes under /dev/nvgpu/:
1. ctxsw
2. dbg
3. prof
4. prof-dev
5. prof-ctx

Bug 200773450
JIRA NVGPU-7109

Change-Id: I86d72d17fa7f5492e117a4c1cd1144623e9b6132
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2592012
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
2021-11-18 03:57:18 -08:00
Seshendra Gadagottu
c2901b6835 gpu: nvgpu: correct debug messages for fecs ecc errors
Following error message is getting printed even when there are no fecs
ecc errors:
nvgpu: 17000000.ga10x gv11b_gr_intr_handle_fecs_ecc_error:114
 [ERR]  error count corrected: 0, uncorrected 0

To avoid confusion, print error messages only when fecs errors
are reported.

Bug 3417834

Change-Id: I96317555b11e1976f33add4b1dc8d84c936c26fb
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2625723
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-17 17:31:52 -08:00
Sagar Kamble
430b9bef58 gpu: nvgpu: fix the naming of L2 cache ecc_control register
L2 cache ecc_control register wasn't named correctly. Fix it.

JIRA NVGPU-7054

Change-Id: I08d76aefb38663cb699c50c07a92af8a756d142d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603699
(cherry picked from commit 04a5d798f6948c34536dc02391e7da8464f5a7bf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623623
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-11-17 12:50:20 -08:00
Prateek sethi
b4528cac93 gpu: nvgpu: fix the return sequence
API nvgpu_get_timestamps_zipper() returning with power reference in case
of failure. Patch corrects the sequence.

Bug 3412554

Change-Id: Id5bd027fd9861d2b04341b5045326278cef5c5d1
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2551274
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@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-11-14 13:07:44 -08:00
Vedashree Vidwans
6cf7b9a4b2 gpu: nvgpu: enable dbn_fn only if feature is supported
Currently, on non-secureboot with power features disabled, debug logs
contain elpg enable/disable function prints. To lower confusion, move
elpg enable and disable dbg_fn prints to after can_elpg check.

Jira NVGPU-7183

Change-Id: Ib6a1fb93330042a90c6d87b153b26aff7907ab7d
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2624661
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-14 09:33:05 -08:00
Sagar Kamble
48d17e9c53 gpu: nvgpu: fix the unit test traceability
gk20a_tsg_unbind_channel_check_hw_next was not added to Targets
in unit test specification. Add it.  __attribute__ in debug.h
is captured by Doxygen as function with no tests. However it
is not really a function and applies to non-fusa function so
skip it in Doxygen.

JIRA NVGPU-7211

Change-Id: I2adadaebbf4e43768eb408dd10aaa20b1e13eccc
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2615256
(cherry picked from commit e829afb55a17dc0dacf17c71633f5689324171d7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623629
Reviewed-by: svcacv <svcacv@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-11-14 04:24:17 -08:00
Sagar Kamble
cdfbd4313b gpu: nvgpu: add BVEC tests for common.mc unit
Add BVEC tests for following common.mc unit APIs:
1. nvgpu_mc_intr_stall_unit_config
2. nvgpu_mc_intr_nonstall_unit_config
3. mc.reset_mask

Changed the WARN to nvgpu_err in mc.reset_mask. Invalid inputs are
handled properly.

Updated the MC unit test logic w.r.t mc_intr_en_r, mc_intr_en_set_r
and mc_intr_en_clear_r semantics.

JIRA NVGPU-6399

Change-Id: I6a3ae42ac37cd6b586f6c71de338595e6cb04a37
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2542591
(cherry picked from commit b9908c979e8964a216141cc6ed475c7de2f2cc0b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623631
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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-14 01:30:25 -08:00
Sagar Kamble
e8ba95c74b gpu: nvgpu: address common.bus code inspection issue
Fix bus_gk20a.h and bus_gv11b.h header guards as they are not as per
conventions.

JIRA NVGPU-6901

Change-Id: Ie1197c90ebc4a1c2635bf8a4dadbac08f394c964
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2606515
(cherry picked from commit bcd0e1c910ce146d72f103315313eed431dc2fbd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623624
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-11-14 01:30:20 -08:00
Sagar Kamble
e00eabcbd3 gpu: nvgpu: reset ltc_ltc0_lts0_intr3 register
LTC INTR3 register is not reset after handling.
Reset it.

JIRA NVGPU-6982

Change-Id: I6ab9e6de515e3dd2b45240d1a6953ffef171e1c0
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2586573
(cherry picked from commit bc754e5b0494d3ea2da71f186126f19ef5686c08)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623622
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: svcacv <svcacv@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-14 01:30:14 -08:00
Martin Radev
64d2e25382 gpu: nvgpu: Expose cbc status and ctrl debug nodes
This patch adds two new debug nodes:
- cbc_status to retrieve cbc state information
- cbc_ctrl to flush and mmap cbc

These two nodes are to be used for purpose of testing
and debugging. One immediate goal is to use them for
verifying if CBC is programmed correctly via a user
space test.

Bug 3402817

Change-Id: I4046fb45ebfb48cb4644f88621429e1e323972c0
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2620184
Reviewed-by: Konsta Holtta <kholtta@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-11-14 01:29:53 -08:00
Seshendra Gadagottu
7194fe5f1f nvgpu: ga10b: disable errata NVGPU_ERRATA_200601972
To avoid priv access error, disable errata NVGPU_ERRATA_200601972
Enable this errata back once, Bug 3414399 is fixed.

Bug 3414399

Change-Id: I3a5277e6f109d319744499bc9898bec4ed292a49
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2620254
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-13 11:29:55 -08:00
Seshendra Gadagottu
319f4f6fe1 gpu: nvgpu: t234: update gating registers to avoid priv errors
Generated clock gating registers list with updated skip list to
avoid priv access violation errors. This change will be reverted,
once proper fix in place.

Bug 3414399

Change-Id: I0e6c877a98978256096b28b7427663fd59de3d32
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2620191
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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-13 11:29:43 -08:00
Sagar Kamble
0394aef90d gpu: nvgpu: cast bvec test
Add BVEC tests for following functions:
nvgpu_safe_cast_u64_to_u32, nvgpu_safe_cast_u64_to_u16,
nvgpu_safe_cast_u64_to_u8, nvgpu_safe_cast_u64_to_s64,
nvgpu_safe_cast_u64_to_s32, nvgpu_safe_cast_s64_to_u64,
nvgpu_safe_cast_s64_to_u32, nvgpu_safe_cast_s64_to_s32,
nvgpu_safe_cast_u32_to_u16, nvgpu_safe_cast_u32_to_u8,
nvgpu_safe_cast_u32_to_s32, nvgpu_safe_cast_u32_to_s8,
nvgpu_safe_cast_s32_to_u64, nvgpu_safe_cast_s32_to_u32,
nvgpu_safe_cast_s8_to_u8, nvgpu_safe_cast_bool_to_u32

JIRA NVGPU-6412

Change-Id: Ic97e45051570a7133045de6cb4345c5f935cf9f6
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2555469
(cherry picked from commit be2ba5f1a7ead4c062eab74c7587c32797a651df)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623637
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-11-12 21:37:01 -08:00
Antony Clince Alex
3e7643bb9c gpu: nvgpu: update gops.mssnvlink
Introduce HAL function gops.mssnvlink.get_links, this function retrieves
the number of nvlinks supported by the chip along with their base
addresses.

Update ga10b_mssnvlink_init_soc_credits to call mssnvlink.get_links.

Jira NVGPU-6641

Change-Id: I4ff857925f126bf41dc83eebc5723403244f66b0
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2618368
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-12 07:31:27 -08:00
Antony Clince Alex
1bcc22ab19 gpu: nvgpu: make mssnvlink programming OS agnositc
Make ga10b_init_nvlink_soc_credits OS agnostic by replacing OS
specific functions with corresponding nvgpu wrappers. This function is now
assigned to gops.mssnvlink.init_soc_credits HAL.

Introduce nvgpu wrapper, nvgpu_io_map/unmap to map/unmap specified
physical address range.

Jira NVGPU-6641

Change-Id: I337bc75b8ec36552fe471bf5e42f62c19f67ed4a
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2618237
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-12 07:31:15 -08:00
Sagar Kamble
83dbb711bb gpu: nvgpu: make buffer metadata support independent of compression
Earlier, buffer metadata support was made dependent on compression.
However that is not required.

Update the enabled flag NVGPU_SUPPORT_BUFFER_METADATA setup for
various hals. Enable it for all from linux characteristics init.

Update REGISTER_BUFFER and GET_BUFFER_INFO ioctls to seggregate
the compile/runtime compression functionality.

If compression is disabled, return error in case comptags are
required else don't fail the REGISTER_BUFFER ioctl.

Bug 200767700

Change-Id: I3850ccc879f180c97b830fb3d652c094b9d28a5b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2614378
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-12 07:30:33 -08:00
Divya
c347b6e4ff gpu: nvgpu: print riscv pmu pc trace
- To print pmu RISCV PC trace, create a new flag
  which will be set to true after PMU is initialised.
- This flag is then used to used to print RISCV trace
  buffer when pmu halt occurrs.

JIRA NVGPU-7261

Change-Id: Ib3ad2f40efd1458d22b21e99ab151c11cfeb43be
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2624073
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-12 02:55:56 -08:00
Deepak Nibade
5d51872620 Revert "gpu: nvgpu: support SW methods in safety temporarily"
This reverts commit e0db40c3a5.

CUDA change to stop using SW methods in safety is integrated and this
temporary patch can be reverted now.

Bug 200748548

Change-Id: Ibdfd42b1fbfbfdf24455426e1b8001ad8b6218d5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623433
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-11-12 02:54:20 -08:00
Jon Hunter
aa44d0e041 gpu: nvgpu: Fix build for Linux v5.16-rc1
Building NVGPU against the current upstream mainline kernel is failing
and errors such as the following are seen.

ERROR: modpost: module nvgpu uses symbol dma_buf_map_attachment from
	namespace DMA_BUF, but does not import it.
ERROR: modpost: module nvgpu uses symbol dma_buf_detach from namespace
	DMA_BUF, but does not import it.
ERROR: modpost: module nvgpu uses symbol dma_buf_vmap from namespace
	DMA_BUF, but does not import it.

Following upstream commit 16b0314aa746 ("dma-buf: move dma-buf symbols
into the DMA_BUF module namespace"), it is now necessary to import the
DMA_BUF module namespace into the NVGPU driver to fix this.

Change-Id: I901b74cea692a5e0d66a190d01fe74a55aaf4431
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621641
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-12 02:51:30 -08:00
Konsta Hölttä
6cff904dc3 gpu: nvgpu: use runlist obj for wait_pending
Change the gops_runlist::wait_pending API to take a runlist pointer
instead of a runlist ID to better match with the rest of that interface.

Jira NVGPU-6425

Change-Id: I96c4f49df8e2613498e0a09cc75a950824828bed
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621214
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: 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-11-11 20:39:47 -08:00
Konsta Hölttä
9be8fb80a2 gpu: nvgpu: make tsgs domain aware
Start transitioning from an assumption of a single runlist buffer to the
domain based approach where a TSG is a participant of a scheduling
domain that then owns has a runlist buffer used for hardware scheduling.

Concretely, move the concept of a runlist domain up to the users of the
runlist code. Modifications to a runlist need to specify which domain is
modified.

There is still only the default domain that is created at boot.

Jira NVGPU-6425

Change-Id: Id9a29cff35c94e0d7e195db382d643e16025282d
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621213
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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-11 20:39:42 -08:00
Konsta Hölttä
c8fa7f57f6 gpu: nvgpu: track runlist domains in list
There will be multiple scheduling domains managed dynamically. Move from
strictly one domain to a list of domains and still only one default
domain in practice. This facilitates future changes on many domains.

Jira NVGPU-6425

Change-Id: I6760c651be6c01791708740a821aa564d7a6b7b8
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621212
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>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-11 20:39:35 -08:00
Divya
6885071c64 gpu: nvgpu: bring all supported GRs out of reset
- The hardware is designed in such a way that
  if GR engine is not out of reset, it still takes clock.
- This causes ELCG feature to not engage correctly.
- So for iGPU, SW should bring all supported GR
  engines out of reset during gpu boot, if MIG feature
  is not enabled.
- This will help low power feature like elcg to
  engage correctly and improve dynamic power savings.
- For dGPU, all GRs are out of reset by default by dev init.

Bug 200778542

Change-Id: I5f3519f73b4aaf1804fd112f28fe980f58181cd8
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2613718
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>
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-11-11 20:37:45 -08:00
Sagar Kamble
688a6aa17d gpu: nvgpu: change set_err_notifier error message to info type for forced channel reset
Below error notifier message is not really warning/error as that
is user triggered reset and the notifier value set is already
consumed by userspace hence limit this message to INFO type.

nvgpu: 17000000.gp10b     nvgpu_set_err_notifier_locked:142  [ERR]  error notifier set to 43 for ch 460

Bug 3344409

Change-Id: Ia41cc85f30111ef72994f3ce8e5113e881c06b1b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2620974
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
2021-11-08 15:08:32 -08:00
Mahantesh Kumbar
7b29872bc4 gpu: nvgpu: swap the sequence of ACR & PERFMON
Swap the command sequence of ACR WPR init and PERFMON init sent
to PMU ucode upon init message, because perfmon init command read
is failing in PMU ucode when ACR WPR init command is processed
and accessed WPR info from system during un-rail-gate sequence.

And also flushing the FB-Q's for rail-gate and un-rail-gate sequence.

Bug 3400166

Change-Id: I23c38588d0ddc4e1621e83a72d5e232cf65371dc
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2617398
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-08 15:08:05 -08:00
Konsta Hölttä
c0473460ea gpu: nvgpu: don't check ch activity on bind
Delete an unnecessary check of the active_channels bitmap when
attempting to bind a channel to a TSG. There is already a verification
that the channel must not be a part of a TSG; if it's not, it cannot be
set in the bitmap. All channels become active via a parent TSG, but the
activity check predates this design.

A channel is bound to a TSG early before setting up its gpfifo etc. and
mandatory membership of a TSG is one of the setup_bind prechecks.

Jira NVGPU-6425

Change-Id: Id34686f198db0a0265ffd6a49a0b2e47c37fd5f7
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2621211
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: 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-11-04 12:47:54 -07:00
Konsta Hölttä
3cf796b787 gpu: nvgpu: move active bitmaps to domain
Move the active_channels and active_tsgs bitmaps from struct
nvgpu_runlist to struct nvgpu_runlist_domain. A TSG and its channels are
currently active as part of a runlist; in the future, a runlist may be
switched from multiple domains that each are a collection of TSGs.

The changes are still internal to the runlist code. Users of runlists
need no modifications.

Jira NVGPU-6425

Change-Id: I2d0e98e97f04b9716bc3f4890cf881735d0ab664
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2618387
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-03 20:55:08 -07:00
Konsta Hölttä
1d23b8f13a gpu: nvgpu: introduce internal runlist domain
The current runlist code assumes a single runlist buffer to hold all TSG
and channel entries. Create separate RL domain and domain memory types
to hold data that is related to only a scheduling domain and not
directly to the runlist hardware; in the future, more than one domains
may exist and one of them is enabled at a time.

The domain is used only internally by the runlist code at this point and
is functionally equivalent to the current runlist memory that houses the
round robin entries.

The double buffering is still kept, although more domains might benefit
from some cleverness. Although any number of created domains may be
edited in runtime, nly one runlist memory is accessed by the hardware at
a time. To spare some contiguous memory, this should be considered an
opportunity for optimization in the future.

Jira NVGPU-6425

Change-Id: Id99c55f058ad56daa48b732240f05b3195debfb1
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2618386
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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-03 20:54:48 -07:00
Debarshi Dutta
e616b2ba4d gpu: nvgpu: fix access-out-of-bounds issue
As part of the function gp10b_clk_get_freqs, the code walksthrough
the H/W frequency table and populates the gp10b_freq_table by picking
only GP10B_NUM_SUPPORTED_FREQS =
 GP10B_MAX_SUPPORTED_FREQS/GP10B_FREQ_SELECT_STEP frequencies at max.

The access-out-of-bounds happen when sel_freq_count reaches
GP10B_NUM_SUPPORTED_FREQS and new_rate equals max_rate, resulting
in one additional update that is beyond the size of gp10b_freq_table
table.

Also, removed the warning as it will never be true.

Bug 3407276

Change-Id: Ic496ccdda1784130e7139bd93d068be58eb60a35
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2617850
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-02 14:04:47 -07:00
Vedashree Vidwans
d60bcde892 gpu: nvgpu: ga10x: remove channel status debug print
Remove the channel status print added for debugging purposes.

Bug 200779340

Change-Id: I9b3ae6dd9dd0f37f5046a3efa69f9d9ae26c725b
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2617543
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-29 15:00:30 -07:00
Debarshi Dutta
fdc967d6a2 gpu: nvgpu: change macros to inline functions
The macros defined within the C file in the form

	(\
	 fb_mmu_l2tlb_ecc_status_corrected_err_l2tlb_sa_data_m() |\
	 fb_mmu_l2tlb_ecc_status_corrected_err_l2tlb1_sa_data_m() \
	)

are difficult to detect correctly in libclang based static analyzers.

As a consequence, Hal Checker might be missing some coverage.
Such masks are converted into a static function format to help
mitigate this issue.

Change-Id: Id43e25abda8db4c79f7f6fc604eb6e76e9f6282c
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2598063
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-10-28 12:05:08 -07:00
Seshendra Gadagottu
a70df981e6 gpu: nvgpu: ga10b: handling gpcclk requests with GPC floor-swept
ga10b supports floor-sweeping of GPCs. Check for tegra soc
fuse info, before making gpcclk requests to BPMP for available
GPCs.

Bug 3362403

Change-Id: I3f5e2d85b785098ce3a8c8d7d8a5621446e94c15
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2616898
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-27 21:18:19 -07:00
Konsta Hölttä
f4ec400d5f gpu: nvgpu: simplify nvgpu_timeout_init
nvgpu_timeout_init() returns an error code only when the flags parameter
is invalid. There are very few possible values for flags, so extract the
two most common cases - cpu clock based and a retry based timeout - to
functions that cannot fail and thus return nothing. Adjust all callers
to use those, simplfying error handling quite a bit.

Change-Id: I985fe7fa988ebbae25601d15cf57fd48eda0c677
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2613833
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-26 13:47:32 -07:00
Pyarelal Knowles
99a664bda0 gpu: nvgpu: enable stencil zbc
The implementation already exists. This change
adds NVGPU_GR_ZBC_TYPE_STENCIL and plumbs through
the stencil value from NvRmGpuDeviceZbcAddStencil
through NVGPU_GPU_IOCTL_ZBC_SET_TABLE.

Adds cases for querying the stencil values,
enabling NvRmGpuDeviceZbcGetStencilTableEntry.

Bug 3403523
Bug 3395601

Change-Id: I42c9a2967d0433e0bb08343aabeff0fe465f231e
Signed-off-by: Pyarelal Knowles <pknowles@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2554963
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-26 09:47:17 -07:00
Vedashree Vidwans
d90c5ed371 gpu: nvgpu: update docs for fifo api
Add more detailed documentation for the fifo api in fifo.h as per the
new guidelines. Add documentation for related fifo hals.

Jira NVGPU-6997

Change-Id: Ibad7b0567dddfb780cf9e3cb053ea4ffc248fdf6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2588419
(cherry picked from commit id 736ad1b4249a22955d41564d298757e6d60f21ac)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2614743
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-22 19:08:52 -07:00
Vedashree Vidwans
8a254279e5 gpu: nvgpu: ga10x: update channel status string
Chram channel status value is deprecated and should not be used. Change
channel status string construct logic to use other fields of
runlist_chram_channel_r() instead.
Add nvgpu_str_join() to concatenate multiple strings.

Bug 200779340

Change-Id: I4eda16f4d7ff99b11d9ee484e636dd68e8418f57
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2607400
(cherry picked from commit 18df0020857597f103f00fdf703e1fd2b5e9204b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2607370
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-22 19:07:53 -07:00
Divya
4331c5f121 gpu: nvgpu: Add ELPG_MS protected call for TLB invalidate
- if TLB invalidate is done when ELPG_MS feature is engaged
  then it can cause some of the signals to go non-idle.
  This can cause idle snap in ELPG_MS.
- To avoid the idle snap, add elpg_ms protected call before
  TLB invalidate operation

Bug 200763448

Change-Id: I33435a70c3a4946cc157d5c9c001a17edb133573
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2576984
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: 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-10-22 06:21:20 -07:00
Divya
d538737ba1 gpu: nvgpu: Add ELPG_MS protected call for L2 flush
- if L2 flush is done when ELPG_MS feature is engaged
  then it can cause some of the signals to go non-idle.
  This can cause idle snap in ELPG_MS.
- To avoid the idle snap, add elpg_ms protected call before
  L2 flush operation

Bug 200763448

Change-Id: I651875bc051c3b7d26d2bb0b593083512a5765b2
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2599459
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: 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-10-22 06:20:13 -07:00
Divya
727a2573dc gpu: nvgpu: add wrapper for MS_LTC disallow/allow
- add separate wrapper function for sending ALLOW
  and DISALLOW RPCs for MS_LTC engine
- add separate SW blocker function for MS_LTC

Bug 200763448

Change-Id: I80b6c59f6acaec03ab9fcd2e1ce82817f55124b2
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603122
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-10-22 06:20:00 -07:00
Tejal Kudav
d61a84c8d1 gpu: nvgpu: ga10b: Set GPU clocks to max rate
Max GPU clk supported by BPMP is 1.275GHz. Remove the hard-coded
default value of 1GHz and pass an arbitrary high value to BPMP
API to set the clocks to max rate. Use UINT_MAX instead of a
hardcoded clk max_rate value (like 1.275GHz) to ensure that the max
clock rate supported by BPMP is chosen during clk_set_rate().

Bug 200779751

Change-Id: I08719c3348e7e5c86aa45b423bac3a099cead005
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2612146
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-10-19 07:59:43 -07:00
Divya Singhatwaria
c482effaf9 gpu: nvgpu: ga10b: Enable ELPG
Enable ELPG for ga10b.

Bug 200774890

Change-Id: Iec6e74954fe83dd823b927d44a225eec1bb42d9a
Signed-off-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2589915
Reviewed-by: svcacv <svcacv@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-10-14 17:02:44 -07:00
Antony Clince Alex
dc52b24512 gpu: nvgpu: ga10b: update PMM litter values
Fix PMM litter values for ROP and LTC units.

The ROP unit has been moved from FBP to GPC, hence, introduce new litter
constants:
- GPU_LIT_PERFMON_PMMGPC_ROP_DOMAIN_START
- GPU_LIT_PERFMON_PMMGPC_ROP_DOMAIN_COUNT
Previous PMMFBP_ROP litter constants are removed.

Update GPU_LIT_PERFMON_PMMFBP_LTC_DOMAIN_COUNT to 4.

Jira NVGPU-7204

Change-Id: If3b5e278099ac0d503a3535f1b9b328dc105488b
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2607544
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-14 12:03:33 -07:00
Konsta Hölttä
189ab6bd9a gpu: nvgpu: fix nvgpu_locate_pte for unmapped entries
nvgpu_locate_pte() can be attempted on an address that is not mapped
yet. When the address is just right, it's possible that the pd entries
haven't been allocated yet; return an error in such case before
accessing the indexed entry.

Bug 200778663

Change-Id: I4f062531d30aec746d6828c2d05c046bc912bd2a
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2606175
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-10-13 13:51:48 -07:00
Konsta Hölttä
4c93cca451 gpu: nvgpu: clear leftover ptes after failed map
The gmmu mapping code forgot to clear the already written gmmu entries
if a PD allocation failed in the middle. If nvgpu_set_pd_level() fails
when attempting to map, call it again with the same virt addr but unmap.
This may fail again if we're low on memory, but the already updated
entries are guaranteed to exist and get cleared again.

Ensure that TLB is invalidated even in error conditions since the GPU
may have already accessed the partially written data that is now
unmapped again. Likewise, flush L2 too because unmap happened.

Unify the unmap call a bit so that the gmmu attrs for an unmap are now
in only one place, including the unnecessary cbc_comptagline_mode
assignment as it's not used for unmap.

Bug 200778663

Change-Id: I5cbeb2d3fe445b4660eab7f34b04f6c257699b6d
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2599545
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-10-13 13:51:43 -07:00
Konsta Hölttä
5e7d459927 gpu: nvgpu: restructure gmmu cache maintenance
Move the logic that manages tlb invalidation and l2 flushes to separate
functions to keep the complexity manageable and to help reuse the logic.

Bug 200778663

Change-Id: Ib9dd79c1ec92933a59dc2c8e4cd3fa8355433bbe
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2604939
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-10-13 13:51:37 -07:00
Tejal Kudav
243e52a771 gpu: nvgpu: ga10b: Disable compression on Av+L/Q
GPU HW expects physically contiguous addresses when clearing
the compression bit store in memory. Currently on hypervisor setup,
the DMA_ATTR_FORCE_CONTIGUOUS flag ensures contiguous IPA, but it
is not possible to ensure contiguous physical memory.Disable
compression on virtualized environments until physically contiguous
memory is feasible.

Buffer Metadata support is dependent on compression support.
Move the initialization of NVGPU_SUPPORT_BUFFER_METADATA flag to
common code where NVGPU_SUPPORT_COMPRESSION is initialized.

Bug 200780546

Change-Id: Id94bffc878e275a80948880f0475162d0bb4ddae
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2607830
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-11 17:01:06 -07:00
Konsta Hölttä
a28612220a gpu: nvgpu: return -ENOSYS if no host1x
The callers of nvgpu_get_nvhost_dev() expect that if all goes well,
nvhost and syncpoint support exists. Thus if the device tree entry is
not found, return -ENOSYS instead of 0.

Bug 3394386

Change-Id: I4617aa2cfc240ade53294c26b3e8c2ce50b66913
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2608549
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-10-11 12:29:09 -07:00
Deepak Nibade
b8e24b749e gpu: nvgpu: update common.gr doxygen
Update doxygen formatting for gops.gr.init.set_default_compute_regs
as current format is not aligned in rendered HTML version.

Add doxygen for gops.gr.intr.record_sm_error_state since this function
is being referred from SWUD.

Jira NVGPU-6735

Change-Id: Iacedf4b0653be939b715a8bd0d912ce50c4494ac
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2565889
(cherry picked from commit 545942c41c9d44abc5a26213d097ecba7014015d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2605470
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-11 12:28:17 -07:00