Commit Graph

9535 Commits

Author SHA1 Message Date
Sagar Kamble
a776f7b1d9 gpu: nvgpu: make global allowlist and range arrays static const
Allowlist and register ranges are declared global. Sparse throws warning
for them as:

 - allowlist_ga100.c:351:5: warning: symbol
   'ga100_cau_register_offset_allowlist' was not declared.
   Should it be static?
 - allowlist_ga100.c:389:47: warning: symbol
   'ga100_hwpm_pma_trigger_register_ranges' was not declared.
   Should it be static?

Make these arrays static global const.

Bug 3528472

Change-Id: I319f36c1579c630632b994295677c5831c1bff6b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2676591
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-03 01:41:25 -08:00
mkumbar
6609a05683 gpu: nvgpu: Move ACR WPR init region cmd to LSFM
Move ACR WPR init region cmd from ISR to LSFM as part of LSF bootstrap
request to execute the ACR commands sequentially as well as a blocking
call by polling is_wpr_init_done status till set to true. Needed to
add dealy after each ACR command for ga10b LSPMU due to nvriscv priv
lockdown for ACR commands asynchronously from the nvgpu as detailed
below,

LSPMU engages priv lockdown whenever ACR commands needs to be
processed, and nvgpu polls for interrupt status by polling
pwr_falcon_irqstat_r registers once command is sent to PMU to
process the ACK message from LSPMU if priv lockdown is not
engaged. During NVRISCV priv lockdown couple of register are
not accessible including irqstat register, priv lockdown is
done by LSPMU upon ACR command receive and its asynchronous
to nvgpu which cause nvgpu irqstat read data to be 0xbadf*
during polling at corner cases even though priv lockdown
check is present and interpreting wrongly the irq stat
register.

Add delay of 5ms after ACR command sent to LSPMU(LSPMU takes
~3.5msec to complete the command process) and before polling
the irqstat register in nvgpu to engage priv lockdown in LSPMU.
This additional delay will help to skip reading the irqstat at
corner case during the priv lockdown process.

Bug 3464141
Bug 3482947

Change-Id: I494493a92f6ede5dcb876aeb0d76d54969f0f59e
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673246
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>
GVS: Gerrit_Virtual_Submit
2022-03-02 18:07:03 -08:00
Sagar Kamble
1528170f1c gpu: nvgpu: ga10b: update pri_hub and ptimer error handling
Replace ga10b_ptimer_isr with gk20a_ptimer_isr.

Remove GPU_PRI_ACCESS_VIOLATION reporting from gp10b hal as only
ga10b should be reporting these errors.

GPU_PRI_TIMEOUT_ERROR was only reported from ptimer ISR. However,
it is to be reported when error code is 0xbadf10xx that can be
seen through priv_ring ISR as well. Hence report this error
from ga10b_priv_ring_decode_error_code called from both bus
and priv_ring isr.

For other error cases GPU_PRI_ACCESS_VIOLATION is reported.

Other updates for priv_ring error handling are given below:

1. Add extra info decode functions for error codes:
 - 0xbad001xx, 0xbad002xx, 0xbad0daxx - decode_host_pri_error
 - 0xbadf13xx - decode_fecs_floorsweep_error
 - 0xbadf24xx, 0xbadf25xx, 0xbadf26xx - decode_gcgpc_error &
					decode_pri_local_decode_error
 - 0xbadf20xx, 0xbadf22xx - decode_fecs_pri_orphan_error
 - 0xbadf52xx - decode_pri_indirect_access_violation
 - 0xbadf60xx - decode_pri_lock_sec_sensor_violation

2. Add more info prints to decode_pri_falcom_mem_violation.

3. Add entry for extra info corresponding to 0x41 to
pri_client_error_extra_4x.

4. Separate extra info decode function for error 0xbadf50xx.

JIRA NVGPU-7986

Change-Id: I519a66e8a7a158de23ced5a092a2ebfd62c305be
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2671337
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 11:59:25 -08:00
srajum
d19fd554b2 gpu: nvgpu: fixing MISRA 8.6 violation
- misra_c_2012_rule_8_6_violation:
 "gp10b_ltc_set_enabled" is declared but never defined.

JIRA NVGPU-7057

Change-Id: I981e9bbf1c9dcc864ea2404110567c28593880d3
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2610727
(cherry picked from commit 0aabd261f24846d8da7b90afbf7f2363368a0b82)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673695
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 06:08:06 -08:00
srajum
8e56c73eab gpu: nvgpu: fixing MISRA Rule 21.2 violation
- "va_start", "time" a reserved identifiers or macro names described
  in Section 7, "Library", of the C standard, shall not be declared.

JIRA NVGPU-6536

Change-Id: I868362819dd7178eb7b165f243fb6d36322d8372
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2582291
(cherry picked from commit 29c2c55b184cf16aee51614da895747750217885)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674867
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 06:08:00 -08:00
srajum
41a1212744 gpu: nvgpu: fixing MISRA 10.1 and 10.3 violations
- MISRA Rule 10.1
  The expression "g->syncpt_size" of non-boolean essential type is
  being interpreted as a boolean value for the operator "? :".

- MISRA Rule 10.3
  Implicit conversion of "(tmp <= 4294967295UL) ? tmp : 4294967295UL"
  from essential type "unsigned 64-bit int" to different or narrower
  essential type "unsigned 32-bit int"

JIRA NVGPU-6536

Change-Id: I56f01a13f3a8877317213d6fc846330ff3dfd700
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2582289
(cherry picked from commit 4a51cad9b016a17ddec00cd6b35ec6c931a3c5c4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674865
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: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 06:07:53 -08:00
srajum
a1ad3ccc83 gpu: nvgpu: remove unused function declarations
- "gv11b_ltc_get_err_desc", "gv11b_ltc_inject_ecc_error" API's
  are declared but not defined, so removing these

JIRA NVGPU-7119

Change-Id: Id2ef6bffbaf62c7e41be4bdc8b7f6b2354bc58b3
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603822
(cherry picked from commit ae01e11e087a8a7fde18be765330ed90a8db3ae8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673520
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 06:07:10 -08:00
Debarshi Dutta
5c0dc7e39d gpu: nvgpu: add support for disabling l3 via DT
On volta the GPU determines whether to do L3 allocation for a mapping by
checking bit 36 of the physical address. So if a mapping should allocate
lines in the L3 this bit must be set.

However, when the physical addresses for 64GB of RAM uses the 36th bit
resulting in a conflict. Thus, add support for disabling l3 support
for SKUs having 64GB of physical memory.

Bug 3486025
Bug 3469094

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Ic540e754274cf1d9e6625493962699d21509e540
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2661548
(cherry picked from commit 46b43d2b24)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2661542
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
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: Bibek Basu <bbasu@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 06:05:58 -08:00
Konsta Hölttä
2ab6184955 gpu: nvgpu: debug dump tsg domain name
Include the scheduling domain name in the channel debug dump. The domain
name of a channel is the domain name of its parent TSG, if any. Copy
just the name into the dump info to avoid refcounting concerns.

While at it, reword the deterministic flag for less ambiguity.

Jira NVGPU-6791

Change-Id: I06041277f938e20f23de9aa419cfffbaa028035e
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673101
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-03-01 00:09:12 -08:00
Konsta Hölttä
f10ee4ab0e gpu: nvgpu: add domain name API
Add nvgpu_nvs_domain_get_name() to minimize messing up with nvs
internals and to help code organization when nvs is not built in yet. A
stub to help compilation returns NULL because no domains can exist when
the stub is built in, and thus it won't be used.

Jira NVGPU-6788

Change-Id: If663f7c0e8434ef00dd3a3f40f6404a35b477f2b
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673120
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: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:09:01 -08:00
Konsta Hölttä
2a8914619d gpu: nvgpu: bind sched domains as fds
Replace id-based lookup with fd-based lookup when binding a TSG to a
domain. The device node based domain interface naturally provides access
control; this way userspace tools can limit which uid/gid can access
each domain.

Also, explicitly disallow binding channels to a TSG that has no runlist
domain yet. Normally a TSG is in the default domain if nothing else has
been specified, but the default domain can be deleted.

Jira NVGPU-6788

Change-Id: I2af96dfc002367d894eaf0c175006332f790c27f
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2651165
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>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:08:55 -08:00
Konsta Hölttä
3a64fdefc4 gpu: nvgpu: domains as files for access control
Create device nodes for user-created scheduling domains. This helps
leverage filesystem based access control: domains can be chosen to be
available for a limited set of users on a system.

The device nodes are dynamic: they can be removed while the driver is
running normally. This is a bit different from the nodes that exist
until the driver is unloaded, so the devno/domain mapping is stored in a
separate list. The usual container_of pattern would suffer from an
unavoidable race condition if a domain file was opened while the same
domain would get removed.

As usual, domain refcounting prevents a domain from being removed. Now
the open device files hold refs and thus any open domain files prevent a
domain from getting removed, in addition to the userspace-invisible ref
that is taken when a TSG is bound to a domain.

While at it, make the query ioctl guarded by the sched domain mutex, as
domains might technically get added or removed during the querying code.

Jira NVGPU-6788

Change-Id: Ief2a09a442c4e70f1f2be8a32359341071d74659
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2651164
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:08:49 -08:00
Konsta Hölttä
beed6d3c2b gpu: nvgpu: add nvgpu_get_v2_user_class()
Add a function to find the nvgpu_class of the v2 user device nodes. This
is the last entry in the class list, as the devices are created in that
order.

The v2 user class is not defined when MIG is enabled because there are
multiple logical devices; bigger changes would be needed for this.

Jira NVGPU-6788

Change-Id: I2177c1e5b4d0bbec77a4e258391859242b4f20d6
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674427
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:08:43 -08:00
Konsta Hölttä
f11ca4c300 gpu: nvgpu: expose device creation
Allow gk20a_create_device() to happen outside the main ioctl logic and
rename it to have the modern nvgpu_ prefix. Add a separate function to
do cdev allocation and refactor the existing two callers slightly to
avoid repetition on the cdev struct initialization.

As a side effect, this modification fixes the error path that used to
not return an error if adding a device fails and also leaked the
allocated cdev memory.

Jira NVGPU-6788

Change-Id: Ia1f018b88d78fafdfcf4e95f6aa66e2368e58974
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674426
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:08:37 -08:00
Konsta Hölttä
82df5b0219 gpu: nvgpu: track cdev minor numbers
The existing Linux character device nodes are statically configured
once. For other dynamically created devices, track the next minor number
in nvgpu_os_linux as a rudimentary allocator.

Only a small number of increments are expected at this time; in the
future, a bitmap might be more appropriate for tracking out-of-order
deallocations too.

Jira NVGPU-6788

Change-Id: I016ee8471313086620f9ab371583d6763848b0e2
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2651163
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:08:31 -08:00
Sagar Kamble
79b37d7832 gpu: nvgpu: dump debug info on semaphore acquire timeout
Channel RAMFC has details about the semaphore operation the channel
is performing. Getting this can be helpful in debugging the semaph-
ore acquire timeout.

Add gk20a_debug_dump to pbdma interrupt handler for this case.

Bug 3430929

Change-Id: Ia5e3b191a77a7e54d02f45ed2d1beb266905b564
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2675344
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: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-28 17:38:19 -08:00
Konsta Hölttä
086909ddd0 gpu: nvgpu: use correct err from device_create
When device_create fails, take PTR_ERR from the subdev that was
returned. Commit e8bac374c0 ("gpu: nvgpu: Use device instead of
platform_device") refactored this code but forgot to rename the error
retrieval.

Change-Id: Id01adac431da77a71c8e71e1b01a065826f5ebcf
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673712
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-28 10:53:30 -08:00
srajum
ad74b20cca gpu: nvgpu: uniform approach for both quiesce state exit and BUG()
- We are using exit() API to exit the process when gpu goes to
  quiesce state, but MISRA not allowing to use exit() API.

JIRA NVGPU-7056

Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2588005
(cherry picked from commit 219c172da5b6ae330121009765f7eb090b87e054)
Change-Id: Id5b927693cc684931bd4aa56e66543b673d0c493
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674411
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-27 18:12:32 -08:00
srajum
ee670a0afd gpu: nvgpu: allowlist violations wrt RFD
- Rule 21.3
  The memory allocation and deallocation functions of <stdlib.h>
  shall not be used

- Rule 4.12
  Dynamic memory allocation shall not be used.

- These are approved RFD's
  https://jirasw.nvidia.com/browse/TID-1129
  https://jirasw.nvidia.com/browse/TID-1131

JIRA NVGPU-5955

Change-Id: I1bff5d63b406d91f61a333da59cf43b9fb0a3a92
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2572086
(cherry picked from commit c8840abab61a50c7afb561eac884a40a1338397d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674342
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: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-27 18:12:20 -08:00
srajum
d1b3a9359a gpu: nvgpu: fixing MISRA Violations
- MISRA C-2012 Rule 10.5
  The values of an expression should not be cast to an
  inappropriate essential type.

- MISRA C-2012 Rule 21.18
  The size_t argument passed to any function <string.h>
  shall have an appropriate value.

JIRA NVGPU-7056

Change-Id: I6a9f0de0b2e235cef3a9550a318a106d89a9ab49
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2583109
(cherry picked from commit 65c73e71e65849a3af8e6c87811e24134d00dfb5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673651
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-27 18:12:14 -08:00
srajum
f45762d032 gpu: nvgpu: remove whitelisting for wrongly reported violation by tool
- Earlier we whitelisted wrongly reported static analysis violations
  by tool, raised coverity tool bugs for these cases.

- These bugs are fixed with new version of tool, so no need fo whitelisting.

Change-Id: I9ba19e9907905a71ca0eb06c168a061a5f248f84
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2617012
(cherry picked from commit 4aa2d531d3fd851806b1eb7e2c36cb75923da79c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673012
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: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-27 18:12:09 -08:00
Dinesh T
ef2a2be44f gpu: nvgpu: Add compression support with added contig memory pool
This is adding compression support for Ampere gpus by
the given contig memory pool.

Bug 3426194

Change-Id: I1c2400094296eb5448fe18f76d021a10c33ef861
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673581
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-27 18:10:41 -08:00
Seshendra Gadagottu
a4537182a7 gpu: nvgpu: posix: Update doxygen for nvgpu_posix_bug
Updated nvgpu_posix_bug doxygen to indicate SIGSEGV
raised with and without quiesce callback.

Jira PLCF-2828
Bug 3470581

Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Change-Id: I18e8b5c918e6f2509070892fca57b71e1ee944e6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2642373
(cherry picked from commit 39952fe52229a8bae531cebd5fe84d2e26f96483)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2643156
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Shashank Singh <shashsingh@nvidia.com>
2022-02-23 11:08:38 -08:00
shashank singh
29019dff6e gpu: nvgpu: remove round_up usage in safety build
- In function gv11b_tsg_init_eng_method_buffers() PAGE_ALIGN can be used
  instead of round_up macro.
- In function nvgpu_posix_find_next_bit() rounding up of start does not
  seem to serve any purpose.

JIRA NVGPU-7057

Change-Id: I4a3a21e95a0f3aa38f7007de1f6959f1d878e511
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2614326
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2672107
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-23 11:08:31 -08:00
shashank singh
6c46173be3 gpu: nvgpu: add detailed documentation for some common.nvgpu APIs
Add detailed documentation for common.nvgpu APIs as per the new
guidance.

Jira NVGPU-6973

Change-Id: I914dd4e4ead6a9d86ddd7c18a43d6c66d35da5d1
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2573169
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2672104
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-23 11:08:24 -08:00
shashank singh
fb0ebef0a7 gpu: nvgpu: compile out ununsed code on safety build for common.nvgpu
Jira NVGPU-7052

Change-Id: Idab4f9d56c0748f54fd08fc5fd01d96a66f94700
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2581247
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2670885
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-23 11:08:05 -08:00
Divya
05a1f927f8 gpu: nvgpu: add golden image check for tpc_pg_mask
- Setting different tpc_pg_mask value leads to GPU crash.
- It is observed that with GPU railgating disabled, if
  tpc_pg_mask is set, "the gpu is powered on" error is
  reported and it won't allow to set the tpc_pg_mask, which
  is expected.
- With GPU railgating enabled, the different tpc_pg_mask
  value is set and the GPU is crashed.
- So, add check for golden image initialized before setting the
  TPC, GPC and FBP PG mask.
- This check won't allow to update TPC, GPC and FBP mask after
  golden image initialization and thus no GPU crash happens.

Bug 3544499

Change-Id: Ia003beaaec9dead22da74ea5862a81986780966b
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2672202
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Ninad Malwade <nmalwade@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-22 05:57:37 -08:00
mkumbar
930c218810 gpu: nvgpu: ga10b: fix priv error for nvriscv bcr reg read
Read nvriscv bcr regsiter only if priv lockdown is released.

Reading bcr during priv lockdown triggers priv violation error.

Bug 3541062

Change-Id: Ib63f1ad634a945e0f9c573b4703217dbf887a776
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2672196
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-22 05:57:31 -08:00
mpoojary
3da5e1515f gpu: nvgpu: Add support to pass platform data to ACR
This patch passes an extra byte(23:16) value to 'mode' variable of ACR interface,
value depends on func 'nvgpu_platform_is_simulation'.
This will let ACR ucode to identify whether a platform is simulation(VDK)
or not(VSP & Silicon).

Change-Id: I78efe9cd748c023dd17e80f498c3b8b34edd18e5
Signed-off-by: mpoojary <mpoojary@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673063
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-22 05:53:46 -08:00
Shashank Singh
5ec241a1d8 gpu: nvgpu: remove non stall intr from top handler for safety
On safety nonstall interrupt is not used and should be compiled out to
rule out any chance of interference with safety code. Remove top handler
support of nonstall interrupt for safety which is currently not
applicable to linux.

Jira NVGPU-7066
Jira NVGPU-4078

Change-Id: I278efc8da6ddd0f22c128af6630cfd1b20ba4784
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2589006
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2671586
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-21 02:31:38 -08:00
Antony Clince Alex
ca27a7d841 gpu: nvgpu: ga10b: move grmgr.load_timestamp_prod HAL
The timestamp control register in the SMCARB should be configured to have
the NV_PSMCARB_TIMESTAMP_CTRL_DISABLE_TICK field cleared, otherwise the PTIMER
ticks will not be sent to GR engine.  Hence, remove the pre-processor checks
around grmgr.load_timestamp_prod call.

Bug 3510460
Bug 3500065

Change-Id: I223cea1aca28a9215287f540eb961a16e3fe6626
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2671021
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-17 05:03:01 -08:00
Shashank Singh
19a3b86f06 gpu: nvgpu: remove unused code from common.nvgpu on safety build
- remove unused code from common.nvgpu unit on safety build. Also,
remove the code which uses them in other places.
- document use of compiler intrinsics as mandated in code inspection
  checklist.

Jira NVGPU-6876

Change-Id: Ifd16dd197d297f56a517ca155da4ed145015204c
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2561584
(cherry picked from commit 900391071e9a7d0448cbc1bb6ed57677459712a4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2561583
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-17 04:58:32 -08:00
Antony Clince Alex
94255220f7 gpu: nvgpu: ga10b: add TPC interleaved priv segment support
The ctxsw ucode saves all the ctxsw'ed TPC priv registers in the TPC
priv segment of the ctxsw image. In ga10b, these registers can be stored
in either of the two arrangements:
- INTERLEAVED: means the format is sorted by address first, then by TPC number
- MIGRATION: exact opposite of interleaved.

Update HAL functions gr_ga10b_process_context_buffer_priv_segment,
gr_ga10b_find_priv_offset_in_buffer to detect the register layout and
calculate the register offset accordingly.

Bug 200737000
Bug 3532165

Change-Id: I305509cf89498cb0c2c5bfa1d867272bdf5f42b3
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2665491
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-17 00:07:12 -08:00
Antony Clince Alex
39db69a2dc gpu: nvgpu: ga10b: update final netlist to NETC
Update final netlist name to NETC for the ctxsw ucode with
HWCL: 52777872

Bug 200737000

Change-Id: I5699426c498235d33f7106b85fbffee30c35defc
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2654052
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
2022-02-17 00:06:35 -08:00
Rajesh Devaraj
0699220b85 gpu: nvgpu: compile-out unused apis from safety build
This patch does the following changes:
- Compiles-out unused error reporting APIs and the related
  data structures from safety build. For this purpose, it
  introduces the new flag: CONFIG_NVGPU_INTR_DEBUG
- Updates nvgpu_report_err_to_sdl() API with one more argument,
  hw_unit_id. This aids in finding whether an error to be reported
  is corrected or uncorrected from LUT.
- Triggers SW quiesce, if an uncorrected error is reported to
  Safety_Services, in safety build.
- Renames files in cic folder by replacing gv11b with ga10b,
  since error reporting for gv11b is not supported in dev-main.

JIRA NVGPU-8002

Change-Id: Ic01e73b0208252abba1f615a2c98d770cdf41ca4
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2668466
Reviewed-by: Tejal Kudav <tkudav@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
2022-02-14 22:00:33 -08:00
Konsta Hölttä
81c220b95b gpu: nvgpu: use %pS for function pointers
%pF is obsolete. Use %pS when debug printing function symbols. (One
print in kmem was already using this.)

Bug 3532466

Change-Id: Id3994abbcb0dc2495e69f3c872149c6ea5e3b5cb
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2667999
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-11 18:27:39 -08:00
Debarshi Dutta
10c3c0ddbb gpu: nvgpu: add FBP index conversion infra for MIG
Add a mapping between local ids and logical ids for FBPs.
This is enabled to support conversion for FBP local ids to
logical ids when memory partition is enabled for SMC.

Bug 200712091

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Iba33327a98bf427b21f37cbf7f2d5ee5619e7ae5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2651964
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-11 13:29:14 -08:00
Debarshi Dutta
01dccf163d gpu: nvgpu: add logic for index conversion of GPCs/FBPs
For SMC mode, userspace is expected to use local indexing
for accessing GPC/FBP specific perf registers where local indexing
refers to indexes localized to a given SMC instance. H/W however expects
logical id based indexing for these registers. Currently, nvgpu driver maintains
a mapping between local <-> logical/physical ids of the GPCs for SMC specific
configurations/instances.

These register accesses are performed by the Debugger/Profiler interfaces and uses regops
for read/writes. In their current state, regops simply validates register addresses and performs
the required operation on them. These registers are currently indexed using local ids
and there is a need to convert them to use logical ids for supporting SMC modes. For non-SMC case
local ids are equivalent to logical ids and hence the conversion would have no effect on them.

Following changes are added to facilitate the above conversion from
local ids to logical ids in the regops path.

1) nvgpu_profiler_allowlist_range_search is modified to update
a nvgpu_pm_resource_register_range_map entry instead of just the
type.

2) added two APIs, one meant for profiler V2 based interfaces
and the other for legacy profiler interface. The logic for
legacy profiler interface extends into the more generic profiler
V2 logic to help retain future compatibility. These APIs are added
just after the validation stage for nvgpu_exec_regops.

3) The above APIs return an error if the local ids exceed the number
of GPCs/FBPs for a particular instance.

Bug 200712091

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I060c2408a798f2f4e058aba266fa1ea9cebc2682
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2644956
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-11 13:29:07 -08:00
Debarshi Dutta
7db5f0d339 gpu: nvgpu: add perfmon Hals
Add following HALs for Ga100 and Ga10b. These will
be used for calculating chiplet offsets corresponding
to GPC/FBP perf register.

get_pmmgpcrouter_per_chiplet_offset
get_pmmfbprouter_per_chiplet_offset

get_hwpm_fbp_perfmon_regs_base
get_hwpm_gpc_perfmon_regs_base
get_hwpm_fbprouter_perfmon_regs_base
get_hwpm_gpcrouter_perfmon_regs_base

Bug 200712091

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Iec1a16ef4a3c26dca054c30d95bef991983dc2b7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2648832
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-11 13:29:02 -08:00
Debarshi Dutta
3d01b89e68 gpu: nvgpu: expose physical masks for GPCS/FBPs for MIG
Following changes are added
1) nvgpu_gr_config->gpc_tpc_mask_physical is now indexed by physical
gpc id instead of logical id.
2) Removed the conversion of logical fbp ids and replace them with
physical ids.
3) nvgpu_gpu_instance->fbp_en_mask now contains the mask of physical fbp ids.
4) gk20a_ctrl_ioctl_gpu_characteristics returns gpu.gpc_mask returns mask
of physical ids.

Bug 200712091

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I0e066df76e07203ff4a5be5bfff2cef8566b425d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2648831
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-11 13:28:50 -08:00
Deepak Nibade
2373a87048 gpu: nvgpu: set compute regs only for compute class
In safety build, gops.gr.init.set_default_compute_regs() is invoked in
nvgpu_gr_obj_ctx_alloc() for all classes. Before enabling graphics
classes in safety this was executed only for compute class. But since
graphics classes are supported in safety now this call should be made
only for compute classes.

Add gops.gpu_class.is_valid_compute() check before calling this
function.

Bug 3482988

Change-Id: If3722be36e779195122f54925ad122871cf13317
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2667324
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: Sagar Kamble <skamble@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-10 20:36:06 -08:00
Richard Zhao
d07b0be8af gpu: nvgpu: move tu104 cbc/ltc files of CONFIG_NVGPU_DGPU
hal/cbc/cbc_tu104.c
hal/ltc/ltc_tu104.c

The patch moves the above files out of CONFIG_NVGPU_DGPU, since the
below symbols are also used by iGPU (ga10b for example).

tu104_cbc_ctrl
tu104_ltc_pri_is_lts_tstg_addr
tu104_set_l2_sector_promotion

Jira GVSCI-9976

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: Ic0e749608cf4426f0fb1210b21a6d4a4c6a6068d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2663781
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-10 20:33:09 -08:00
Martin Radev
3e4fb49270 gpu: nvgpu: Exit early on VAB_ERROR MMU fault
This patch updates the interaction between the VAB
packet polling code and the VAB_ERROR MMU fault handling
code. A shared atomic flag is used to determine if a
VAB_ERROR MMU fault has happened while polling, which will
result in polling be terminated immediately instead of
waiting on a timeout to happen. This allows testing VAB_ERROR
MMU fault handling in environments where a timeout may never
happen or happen very slowly.

The sequence for this to work is the following:
1) before requesting a VAB dump, which may trigger a fault,
   the atomic flag is atomically reset to 0.
2) polling eventually starts which atomically checks the flag
   in the loop. If flag is set, polling exits because the VAB
   result will never be available.
3) If a VAB_ERROR MMU fault is raised, this sets the flag to 1
   atomically.

Note that while there could be a race in this sequence if the
VAB_ERROR MMU fault handling is somehow delayed, the chance is
extremely slim because:
1) the race could only happen if the VAB dump code is re-entered
   before the earlier VAB_ERROR MMU fault is still pending.
2) the polling code has a large timeout
3) re-entering means a new ioctl/devctl

Bug 3425981

Change-Id: I422b15b581b0c3417abd4c66fbcdde9a0ff8cd9b
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2664103
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@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>
GVS: Gerrit_Virtual_Submit
2022-02-10 20:31:10 -08:00
srajum
852717ccc1 gpu: nvgpu: add GPLv2 license to OS-specific code for linux
Bug 3384871

Change-Id: Ibc7be6d0a8985a87f70b352f2d9e5c233015c2a2
Signed-off-by: srajum <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2632438
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: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-09 20:50:21 -08:00
srajum
a2d0b11b98 gpu: nvgpu: use MIT license for OS agnostic source code
Bug 3384871

Signed-off-by: srajum <srajum@nvidia.com>
Change-Id: I51241d025560496e5ab8b2c1a6b7b7b7611bdd54
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2632374
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-09 20:50:14 -08:00
Rajesh Devaraj
7dc013d242 gpu: nvgpu: merge error reporting apis
In DRIVE 6.0, NvGPU is allowed to report only 32-bit metadata to
Safety_Services. So, there is no need to have distinct APIs for
reporting errors from units like GR, MM, FIFO to SDL unit. All
these error reporting APIs will be replaced with a single API. To
meet this objective, this patch does the following changes:
- Replaces nvgpu_report_*_err with nvgpu_report_err_to_sdl.
- Removes the reporting of error messages.
- Replaces nvgpu_log() with nvgpu_err(), for error reporting.
- Removes error reporting to Safety_Services from nvgpu_report_*_err.

However, nvgpu_report_*_err APIs and their related files are not
removed. During the creation of nvgpu-mon, they will be moved under
nvgpu-rm, in debug builds.

Note:
- There will be a follow-up patch to fix error IDs.
- As discussed in https://nvbugs/3491596 (comment #12), the high
level expectation is to report only errors.

JIRA NVGPU-7450

Change-Id: I428f2a9043086462754ac36a15edf6094985316f
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2662590
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-09 00:41:18 -08:00
Ramesh Mylavarapu
2a98d20263 nvgpu: ga10b: gsp: implement runlist submit apis
- implemented device info cmd to send device info to the gsp for
  runlist submission. Currently GSP scheduler support only GR
  engine '0' instance.
- implemented runlist submit cmd. GSP firmware will submit the
  corresponding runlist by writing into submit registers. This
  command is direct replacement of hw_submit ga10b hal for GR engine.

NVGPU-6790

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: I5dc573a6ad698fe20b49a3466a8e50b94cae74df
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2608923
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-09 00:38:56 -08:00
rmylavarapu
6c1a77dfa9 gpu: nvgpu: gsp: add cmdq/msgq init check
- Instead of waiting for mailbox update waiting for cmdq/msgq
  initialization request would be the better way to check the
  communication between NVGPU and GSP before sending any cmd.

NVGPU-7342

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: I6d20764516cee14ad84da7cc9a06c9370675786f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2650148
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-09 00:38:45 -08:00
Ramesh Mylavarapu
e5fd0453cf gpu: nvgpu: gsp: add priv lockdown release check
- NVGPU need to check for priv lockdown release before configuring
  any priv registers. In current GSP bootstrap sequence has irq
  configuration after GSP engine reset which is causing priv errors.
  So irq configuration should be done after GSP firmware releases
  priv lockdown.
- Removed clearing irq mask and dest registers before configuring
  them as GSP firmware would have done partial irq configuration
  before releasing the priv.

NVGPU-7342

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: I4b6e83452c051654253e02bfb72330b3d6aec3fd
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2649826
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-09 00:38:32 -08:00
Ramesh Mylavarapu
9302b2efee gpu: nvgpu: gsp units separation
Separated gsp unit into three unit:
- GSP unit which holds the core functionality of GSP RISCV core,
  bootstrap, interrupt, etc.
- GSP Scheduler to hold the cmd/msg management, IPC, etc.
- GSP Test to hold stress test ucode specific support.

NVGPU-7492

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: I12340dc776d610502f28c8574843afc7481c0871
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2660619
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-02-09 00:38:21 -08:00