Commit Graph

5320 Commits

Author SHA1 Message Date
tkudav
745e720089 gpu: nvgpu: gv100: Update PMU ucode version
The GV100 PMU ucode needs to be updated to add support
for PS3.5 Clock Programming boardobj.
The entrysize in GV100 PMU ucode is increased to match
that on Turing R400 PMU ucode.

JIRA NVGPU-1153

Change-Id: Ied3163522bf4e124849517e90bfa42fe4b320a96
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918174
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-22 00:45:03 -07:00
tkudav
f4bd7552b3 gpu: nvgpu: PS35: Clk Prog Boardobj changes
1. Add VBIOS PS3.5 Clk programming table parsing code.
2. Update pmuifclk.h to match R400 pmu ucode pmuifclk.h
3. New clk_prog boardobj types have been added to support
   PS3.5 and to match the pmu ucode side changes
4. Add PS3.5 related construct and pmudatainit fops
5. PS3.5 clk programming table has secondary VF curve entries.
   Though these entries are currently marked as invalid for
   all SKUs, we need to add them to match struct sizes on PMU.
6. The pmuifclk.h nvgpu<->pmu interface changes needed for
   Turing(PS3.5) are NOT compatible with GV100 branched ucode.
   The secondary VF curve entries added for PS3.5 increase the
   entrysize breaking compatibility with GV100.
7. This change is therefore dependant on GV100 PMU ucode changes
   which increase the entrysize on GV100 pmu side.

JIRA NVGPU-1153

Change-Id: I868e503f87731442aae6503872ade4c208831d34
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1842627
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-22 00:44:55 -07:00
Kyle Guo
69b46a6174 gpu: nvgpu: fix timeout check logic in sync-unmap
Fixed timeout checking flow in sync-unmap where timeout message could
be printed while there is not a timeout.

The original codeflow doesn't check refcount of a mapped_buffer again
after 10ms waiting. So if the buffer is released during the last
round of waiting, the timeout message will still be printed. The new
codeflow combines refcount and timeout checking. So that there won't
be an inconsistency between the two.

Bug 200434475

Change-Id: Id0a0aebcb24906a1ec7113e669227788e729564b
Signed-off-by: Kyle Guo <kyleg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930236
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-21 12:56:01 -07:00
Terje Bergstrom
7dc15d6d33 gpu: nvgpu: Move boardobj to common
Move boardobj unit to live under common. It's common code. Also moves
the header files to include/nvgpu/ to indicate that they're meant to
be called from outside boardobj unit.

JIRA NVGPU-596

Change-Id: I57758371c47083e3f666e0cc6d05c48c6d070529
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850419
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 17:24:58 -07:00
Konsta Holtta
e0c8a16c8d gpu: nvgpu: Add CHANNEL_SETUP_BIND IOCTL
For a long time now, the ALLOC_GPFIFO_EX channel IOCTL has done much
more than just gpfifo allocation, and its signature does not match
support that's needed soon. Add a new one called SETUP_BIND to hopefully
cover our future needs and deprecate ALLOC_GPFIFO_EX.

Change nvgpu internals to match this new naming as well.

Bug 200145225

Change-Id: I766f9283a064e140656f6004b2b766db70bd6cad
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1835186
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 17:24:49 -07:00
Nicolin Chen
0fd9c84f87 gpu: nvgpu: Define functions static if DEBUG_FS=n
When turning off CONFIG_DEBUG_FS, there are build errors:
drivers/gpu/nvgpu/os/linux/os_ops_gp106.o: In function `nvgpu_fecs_trace_init_debugfs':
os_ops_gp106.c:(.text+0x8): multiple definition of `nvgpu_fecs_trace_init_debugfs'
drivers/gpu/nvgpu/os/linux/os_ops_gp10b.o:os_ops_gp10b.c:(.text+0x0): first defined here

drivers/gpu/nvgpu/os/linux/os_ops_gv100.o: In function `gp106_therm_init_debugfs':
os_ops_gv100.c:(.text+0x0): multiple definition of `gp106_therm_init_debugfs'
drivers/gpu/nvgpu/os/linux/os_ops_gp106.o:os_ops_gp106.c:(.text+0x0): first defined here

drivers/gpu/nvgpu/os/linux/os_ops_tu104.o: In function `gv100_clk_init_debugfs':
os_ops_tu104.c:(.text+0x0): multiple definition of `gv100_clk_init_debugfs'
drivers/gpu/nvgpu/os/linux/os_ops_gv100.o:os_ops_gv100.c:(.text+0x10): first defined here

This is because those functions aren't marked as static.

So this patch just simply fixes the bug.

Bug 2284925

Change-Id: I1da39345c653dfb50c509adb0c822b4657646c56
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929355
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 08:39:43 -07:00
Philip Elcan
8465fc9266 gpu: nvgpu: unit: kmem fault injection unit test
This adds a unit test to exercise the kmem alloc and cache routines.

JIRA NVGPU-1235

Change-Id: I1baaa4b807504cb93db7e91bc5fb443a07cdad52
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919444
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 00:35:56 -07:00
Philip Elcan
a310dca7a7 gpu: nvgpu: add fault injection for kmem
This adds the ability to enable fault injection for the POSIX
implementation of the nvgpu kmem alloc routines.

JIRA NVGPU-1235

Change-Id: I22f2949cf63511cb021086ed49e603e8adc121ad
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919443
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 00:35:52 -07:00
Philip Elcan
c410ab5655 gpu: nvgpu: unit: fault injection for POSIX build
This adds a fault injection module to the POSIX build that can be added
to modules (for example k*alloc) then exercised in unit tests. The unit
tests can then verify that the driver units handle errors from the
modules.

JIRA NVGPU-1235

Change-Id: I9d9e443608e3d2026e165a62f7a7f011df96fd54
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1927455
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 00:35:48 -07:00
Philip Elcan
9fda4bc276 gpu: nvgpu: fix malloc return check in POSIX kmem
This fixes a bug in nvgpu_kmem_cache_create() where the return of
malloc() was incorrectly checked.

Bug found as a result of JIRA NVGPU-1235

Change-Id: I1c80f2035df980fd1193cf60dfe6132c1f9b693d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919442
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-19 00:35:45 -07:00
Anup Mahindre
2a465533ab gpu: nvgpu: Fix gv11b_gr_set_sm_debug_mode for gpus with more than 32 sms
For gpu's 32 <  number of sms <= 64, the hal uses integer type (which is usually
32 bit) for checking masks and left shifts the integer with values greater
than 32.
To avoid this is undefined behaviour, use u64 instead.

Bug 2418354

Change-Id: Ib447e9360fab128ec5e46805aae734ce6a165d7f
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1926890
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Tested-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@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>
2018-10-18 03:27:05 -07:00
Sai Nikhil
25aa0f33b1 gpu: nvgpu: pmu_perf: fix MISRA 10.4 Violations
MISRA Rule 10.4 only allows the usage of arithmetic operations on
operands of the same essential type category.

Adding "U" at the end of the integer literals to have same type of
operands when an arithmetic operation is performed.

This fixes violation where an arithmetic operation is performed on
signed and unsigned int types.

JIRA NVGPU-992

Change-Id: If80c848a47455e631187669b9a67f444dab1e5bc
Signed-off-by: Sai Nikhil <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921503
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@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>
2018-10-18 03:25:09 -07:00
Sai Nikhil
9de30e1f95 gpu: nvgpu: boardobj: fix MISRA 10.4 Violations
MISRA Rule 10.4 only allows the usage of arithmetic operations on
operands of the same essential type category.

Adding "U" at the end of the integer literals to have same type of
operands when an arithmetic operation is performed.

This fixes violation where an arithmetic operation is performed on
signed and unsigned int types.

JIRA NVGPU-992

Change-Id: I1e8659ee6759b05dec93bef83928bae77a9ee01b
Signed-off-by: Sai Nikhil <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1812198
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@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>
2018-10-18 03:22:42 -07:00
Nicolas Benech
0e367046e9 gpu: nvgpu: posix: Use nvgpu_mem_sgl for SGLs
Initially, SGL functions were using nvgpu_mem behind the scenes
which is inconvenient to actually use as a list. Instead, this
patch uses the nvgpu_mem_sgl.

JIRA NVGPU-1280

Change-Id: I251bf25e6133ac0d4ff8e44d86f634383978ea9a
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923712
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:41:15 -07:00
Nicolas Benech
44d3ef0ca2 gpu: nvgpu: posix: Implement nvgpu_writel_relaxed
The implementation for nvgpu_writel_relaxed was missing in
the POSIX layer.

JIRA NVGPU-1040

Change-Id: If178792af87d72fa811746f9e77d917e0df1c1fa
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923707
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:41:12 -07:00
Nicolas Benech
89125cb4f5 gpu: nvgpu: pramin: add error checking for SGLs
If the total size of SGLs is lower than the size to copy,
we will reach the end of the list so the sgl var will become NULL,
and calling nvgpu_sgt_get_length will cause a null pointer dereference.
This change will cause a BUG() which should be clearer than a NULL
pointer dereference. There is no easy way to add more advanced error
checking and handling, and an SGL bug would most likely be linked to
another bug in the OS or OS layer.

JIRA NVGPU-1279

Change-Id: Ide83f2b91ecae25f3a0f3202febfb115110315d7
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923706
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:41:08 -07:00
Nicolas Benech
fdba70425d gpu: nvgpu: unit: PRAMIN unit test
This new unit test covers 100% of the PRAMIN lines and almost
all branches.

JIRA NVGPU-916

Change-Id: Ib58d72fcd3efc2d86d8b80e16e48b6efc9c947c4
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919604
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:40:57 -07:00
Mahantesh Kumbar
e7d706ccaf gpu: nvgpu: ACR load split feature support
-Added method nvgpu_tu104_acr_ahesasc_sw_init()
 to set ACR-AHESASC properties.
-Added method nvgpu_tu104_acr_asb_sw_init() to
 set ACR-ASB properties.
-Modified method nvgpu_tu104_acr_sw_init() to
 call ACR AHESASC/ASB init & set bootstrap_owner
 to LSF_FALCON_ID_GSPLITE by removing older support
 of default ACR executing on SEC2.
-Added method tu104_bootstrap_hs_acr to execute
 ACR AHESASC & ASB ucode.
-Execute ACR-AHESASC(ACR hub encryption setter and
 signature checker) on SEC2 falcon to copy ucode
 blob from non-wpr to wpr & lockdown wpr then
 perform signature verification of LS falcon ucode
 whitout doing any LS flacon bootstrap.
-Once first stage of ACR is successful then execute
 ACR-ASB(ACR SEC2 booter) on GSP falcon to bootstrap
 SEC2-RTOS on sec2 falcon to perform PMU & GR
 falcons bootstrap.
-Enable SEC2 RTOS support by setting
 NVGPU_SUPPORT_SEC2_RTOS to true
-Added tu104 ACR remove support to clear
 allocated space

JIRA NVGPUT-134

Change-Id: I2d1777af83feda5e8f6845876177cce062c43ace
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918937
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:40:53 -07:00
Mahantesh Kumbar
ec2b3a748f gpu: nvgpu: load dbg mem_unlock bin for dbg board
-Renamed mem_unlock.bin to mem_unlock_dbg.bin
 for MEM_UNLOCK_DBG_BIN define to load debug bin
 for INT board based on debug signal
 SCP_CTL_STAT_DEBUG_MODE

JIRA NVGPUT-76

Change-Id: I054b187f91ee85b09695869e413e43deccd27e5f
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918080
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Tested-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 23:40:40 -07:00
Philip Elcan
1c7bb9b538 gpu: nvgpu: channel: make chid u32
The chid member of the channel_gk20a struct was being used as a unsigned
value. By being declared as an int, it was causing MISRA 10.3 violations
for implicit assignment of different types.

JIRA NVGPU-647

Change-Id: I7477fad6f0c837cf7ede1dba803158b1dda717af
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918470
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:47:17 -07:00
Philip Elcan
f5cac144a0 gpu: nvgpu: make tsgid a consistent type
Different units were declaring tsgid as int or u32. This makes everyone
use u32. This change resolves MISRA 10.3 violations for implicit
assingment to different types.

JIRA NVGPU-647

Change-Id: I78660e737acb0dad76dd538e5dd37f4527cf5acd
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918469
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:47:07 -07:00
Philip Elcan
000855d300 gpu: nvgpu: fifo_gk20a: add casts for MISRA 10.3
MISRA 10.3 rule disallows implicit assignments between different
essential types. This adds casts to address some of these violations
in fifo_gk20a.

This also removes unnecessary bar1 test in
gk20a_fifo_handle_sched_error() (rather than add messy casting).

JIRA NVGPU-647

Change-Id: Ic8700459e47a59dc03e0149f6efb060efa4d4e42
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917635
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:51 -07:00
Philip Elcan
a84e69d693 gpu: nvgpu: fifo_gk20: make pbdma_id type the same
The use of the pbdma_id value was not consistent. This caused MISRA 10.3
violations due to the assignment between different essential types.

JIRA NVGPU-647

Change-Id: I1d25748ee64bacf659bb5c3b65f26e5721c4670c
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917634
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:42 -07:00
Philip Elcan
901cf5ffcb gpu: nvgpu: fifo_gk20a: fix some declaration types
This fixes some declarations in fifo_gk20a that resulted in MISRA 10.3
violations. MISRA 10.3 prohibits implicit assignment between types.

JIRA NVGPU-647

Change-Id: I28df83a73c5530c37275cdd36c6c56d03a1ccadd
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917633
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:33 -07:00
Philip Elcan
1040a3a534 gpu: nvgpu: fix return for engine_enum_from_type()
Use an enum instead of an int as a return type for this function.

This resolves violations of MISRA 10.3 that prohibits implicit
assignment between types.

JIRA NVGPU-647

Change-Id: I2a3725b28c6db9c1540da25228df3da184dd2e6d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917632
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:24 -07:00
Philip Elcan
61a7a1a5e3 gpu: nvgpu: fix gk20a_fifo_preempt_timeout_rc call
This fixes calls to gk20a_fifo_preempt_timeout_rc that were using bool
params instead of the correct macros.

JIRA NVGPU-647

Change-Id: I7ec4d086d3abb4eab40cbea2bbf28ba08fbb0fa4
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917631
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:14 -07:00
Philip Elcan
8c2d7f5ff1 gpu: nvgpu: fifo_gk20a: MISRA 10.3 errs in consts
MISRA 10.3 forbids assigning an object with a narrower essential type
or of a different essential type.  This addresses the file
fifo_gk20a.c where constants were in violation.

JIRA NVGPU-647

Change-Id: I0ecf9b0ce40de76464efbde9e9c9b6aa69d80ec0
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917630
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:46:05 -07:00
Philip Elcan
ac2e423af8 gpu: nvgpu: add U*_MAX macros
Linux prefers U8_MAX, U16_MAX, etc to UCHAR_MAX, UINT_MAX, etc, so
define them for building nvgpu driver on non-Linux OSes.

JIRA NVGPU-647

Change-Id: I141f87d19a561de71762f7edfe0b41dff6ad31ec
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918214
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 16:45:56 -07:00
ddutta
80b5e2b8d6 gpu: nvgpu: remove os_fence dependency from channel_sync
Move the wait_cmd_buffer programming for channel_sync->wait_fd to
channel_sync.c.  nvgpu_os_fence->program_waits
interface is now removed. channel_sync can directly retrieve
syncpt/semaphore from the interfaces of struct nvgpu_os_fence_syncpt
and struct nvgpu_os_fence_sema and use it for the wait programming.

Also, change int to u32 for some variables such as num_fences,
max_wait_size and wait_cmd_size.

Jira NVGPU-1093

Change-Id: I19c1b10d676caff49ce57861091f7f0ea65e7676
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829719
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 15:34:13 -07:00
ddutta
9f948ed07f gpu: nvgpu: add accessor methods to underlying objects of nvgpu_os_fence
channel_sync->wait_fd depends upon nvgpu_os_fence->program_waits which
invokes a channel_sync method and this leads to a circular dependency.

In order to resolve the above, constructed struct nvgpu_os_fence_sema and
struct nvgpu_os_fence_syncpt with interfaces that support conversion
between struct nvgpu_os_fence to above. Also, added the following
interfaces for retrieving syncpts and semaphore from the above structs
respectively.

void nvgpu_os_fence_sema_extract_nth_semaphore(...)
int nvgpu_os_fence_sema_get_num_semaphores(...)

void nvgpu_os_fence_syncpt_extract_nth_syncpt(...)
int nvgpu_os_fence_syncpt_get_num_syncpoints(...)

These enable channel_sync code to directly program the cmd_bufs
based on the syncpts and semaphore received using the above APIs
instead of the current state of doing the wait programming from
within nvgpu_os_fence's interfaces.

Jira NVGPU-1093

Change-Id: Ie411f0ba60bca38f66a0024f5dfca03ef0b836eb
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1827475
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 15:34:09 -07:00
Karl Ding
ee0a987dfd gpu: nvgpu: vgpu: properly set dma mask
Properly set the dma_mask and coherent_dma_mask for vgpu instead of
using the default 32-bit mask. This fixes the dma_capable check that
was previously failing.

Bug 2412352

Change-Id: If1d5d74333f86855f8041cc199a04b4b8eb521b5
Signed-off-by: Karl Ding <kding@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924967
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aparna Das <aparnad@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-16 05:55:02 -07:00
Deepak
7e8ca5f5e7 gpu: nvgpu: Remove cyclic dependency PMU<->GR.
-Created & used HAL for dumping gr falcon stats.
-Trimmed the fecs_dump_falcon_stats to re-use code from
 generic falcon debug dump.

JIRA NVGPU-621

Change-Id: Ia008726915112b33f0aca68a48cb98b8ed2c3475
Signed-off-by: Deepak <dgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923353
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@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>
2018-10-16 05:54:55 -07:00
Debarshi Dutta
435892a784 gpu: nvgpu: initialize boolean to prevent UBScan bugs
UBSan flags the error "load of value 255 is not a valid value for
type '_Bool'". This is caused due to unitialized boolean value as given
in the UBSan specification i.e. the following check
-fsanitize=bool: Load of a bool value which is neither true nor
false.

Bug 200452078

Change-Id: I262320fd72960b41951f6b9c99f64400457d9790
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923241
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:12 +05:30
Deepak Nibade
0f68b79add gpu: nvgpu: gv100: update gating reglist
Current gating reglist includes both unicast and broadcast registers
Having unicast registers is unnecessary since corresponding broadcast
registers are already being written

Also some of the unicast registers were manually commented out in
auto generated file to avoid PRI timeouts

Re-generate gating reglist with new script which skips unicast
registers so that we don't have to manually update auto generated
file

Bug 2150883

Change-Id: I0b099d23049d8c7154a9b1fb709dd9e6709cdf38
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1922579
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:12 +05:30
matthewb
99ec61ebd5 gpu: nvgpu: Add tu104 pmm type-broadcast values
Add the Tu104 values for type-specific broadcast->unicast expansion.

Bug 200454109

Change-Id: I73f32c86c5e443d83bc42e2e84cae2d5bf3bf7db
Signed-off-by: Matthew Braun <matthewb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921685
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
matthewb
4b10960329 gpu: nvgpu: HAL-ify pmm type broadcast values
The PMM type-specific broadcast->unicast expansion calculation
was using incorrect values.  This caused the invalid register
accesses to be generated.

This change HAL-ifies the values, so that the expansion will be
performed correctly.

Bug 200454109

Change-Id: I96c15de27b5e16e4db2e788fd98e6bf7d6e7d564
Signed-off-by: Matthew Braun <matthewb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919476
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
Nitin Kumbhar
dcb2a34200 gpu: nvgpu: fix circular dep of ce2 and gk20a headers
struct gk20a from gk20a.h needs defination of struct gk20a_ce_app
and ce2_gk20a.h needs defination of struct gk20a. This creates
a circular dependency.

Fix this by making gk20a_ce_app a pointer to skip knowing the
complete type details and using forward declarations for struct
gk20a_ce_app and struct gk20a.

The gk20a_ce_app pointer is alloc'ed in gk20a_init_ce_support()
and free'ed in gk20a_ce_destroy.

JIRA NVGPU-611

Change-Id: I4d62d5f2b2d1492db73bae69f90a1fe5586fba76
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917945
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
6480e6bc12 gpu: nvgpu: gv100: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gv100 hw headers
by renaming them to follow the convention, 'NVGPU_HEADER_NAME'.

JIRA NVGPU-1028

Change-Id: I78945233d16e47483b3c1f03fc0c7ca5774c3e95
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850997
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
Amurthyreddy
c114b9e77e gpu: nvgpu: MISRA 14.4 err/ret/status as boolean
MISRA rule 14.4 doesn't allow the usage of integer types as booleans
in the controlling expression of an if statement or an iteration
statement

Fix violations where the integer variables err, ret, status are used
as booleans in the controlling expression of if and loop statements.

JIRA NVGPU-1019

Change-Id: Ia950828797b8eff4bc754269ea2d9fa272f59436
Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919111
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Scott Long <scottl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
8033d33982 gpu: nvgpu: gp10b: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gp10b hw headers
by renaming them to follow the convention, 'NVGPU_HEADER-NAME'.

JIRA NVGPU-1028

Change-Id: I82575d34c1d73542b93f95759e39d63a291514fb
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829945
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
f0506d28d6 gpu: nvgpu: gm20b: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gm20b hw headers
by renaming them to follow the convention, 'NVGPU_HEADER_NAME'.

JIRA NVGPU-1028

Change-Id: I49e4af38b83d54a5814ab3e9246a8af1f1e55fe8
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829976
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
56512f1f95 gpu: nvgpu: gp106: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gp106 hw headers
by renaming them to follow the convention, 'NVGPU_HEADER-NAME'.

JIRA NVGPU-1028

Change-Id: I280aed3ca6d903d95c8fd8261a621591fbe4411e
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829942
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
c657dde81e gpu: nvgpu: gv11b: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gv11b hw headers
by renaming them to follow the convention, 'NVGPU_HEADER-NAME'.

JIRA NVGPU-1028

Change-Id: Ifceda60d2fbd33bdb5d05bf1e484819d88dedd1e
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829718
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
e4f9bf5a47 gpu: nvgpu: tu104: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in tu104 hw headers
by renaming them to follow the convention, 'NVGPU_HEADER-NAME'.

JIRA NVGPU-1028

Change-Id: Id5f46c5cb50765f178379b23f660f759fa881e9b
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921250
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
smadhavan
09755bad2f gpu: nvgpu: gk20a: MISRA 21.2 header guard fixes
MISRA rule 21.2 doesn't allow the use of macro names which start with
an underscore. These leading underscores are to be removed from the
macro names. This patch will fix such violations in gk20a hw headers
by renaming them to follow the convention, 'NVGPU_HEADER-NAME'.

JIRA NVGPU-1028

Change-Id: Ib14774860a784bf066dd958ae1056ecc0115be71
Signed-off-by: smadhavan <smadhavan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1829809
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
Deepak Nibade
92c1949392 gpu: nvgpu: add separate unit for cyclestats_snapshot
Add new separate unit common/perf/cyclestats_snapshot.c and add
corresponding header file include/nvgpu/cyclestats_snapshot.h

This unit is h/w independent and simply calls gops.perf.* HALs
exposed by perf unit to do the h/w configurations

Also remove gv11b/css_gr_gv11b.* files as h/w specific sequence
implemented in them is already moved to perf unit

Rename all cyclestats_snapshot HALs in the form nvgpu_css_*()

Jira NVGPU-1103

Change-Id: I303f6becb313ac918e06c495a5fe299947a1f0b1
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916652
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
Alex Waterman
5c52444a42 gpu: nvgpu: Track num_user_mapped_buffers more clearly
This patch moves the increment and decrement of the user mapped
buffer count to the insert/remove mapped buffer functions since
this value should only ever change when these functions are called.

Bug 200105199

Change-Id: I5b0a86d00e9e948c48e313153a668eb2e10fca49
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917791
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:11 +05:30
Vaibhav Kachore
e029856559 gpu: nvgpu: enable FECS trace support for TU104
Bug 2137429

Change-Id: I6cd72f8e60ae33e1d5bf2d9725ea2ae66bb85e5c
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921015
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30
Nicolas Benech
9934cfdd72 gpu: nvgpu: posix: Change BUG() to raise signal
BUG() was causing a hang which would cause issues in
automated tests. Instead now BUG() will raise a signal
and kill the thread that called BUG().

JIRA NVGPU-1254

Change-Id: I74a7c74ee3c392a330fdaf49f3e1447f53c2b688
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1920220
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30
aalex
e00aafb135 Revert "Revert "gpu: nvgpu: vgpu: added tsg_release for gp10b hal""
This patch was revert as it was part of the following patch
https://git-master.nvidia.com/r/#/c/1837653, which was causing a
regression on Pascal platform as "set_sm_exception_type_mask" HAL
assignment was missing.

Bug 200447406

This reverts commit 84097d54f3.

Change-Id: I2e9511e122bcd89d5af132e7c40e7c56faece7a3
Signed-off-by: aalex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1852610
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Tested-by: Sandarbh Jain <sanjain@nvidia.com>
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30