Commit Graph

9027 Commits

Author SHA1 Message Date
mkumbar
d00a8fd09a gpu: nvgpu: Disable TSG before unbinding channel
Disable TSG before unbinding channel to fix the ap_systemsw
nvgpu_ctxsw_trace_twod test failure with AELPG power feature
enabled.

Bug 3695626

Change-Id: I55939b6b352da5f3f38b31440366a17d89ff7c20
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2740027
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: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-08-22 14:51:34 -07:00
Debarshi Dutta
42beb7f4db gpu: nvgpu: simplify the runlist update sequence
Following changes are added here to simplify the overall
sequence.

1) Remove deferred update for runlists. NVS worker thread
shall submit the updated runlist.

2) Moved Runlist mem swap inside update itself. Protect
the swap() and hw_submit() path with a spinlock. This
is temporary till GSP.

3) Enable Control-Fifo mode from nvgpu driver.

Jira NVGPU-8609

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Icc52e5d8ccec9d3653c9bc1cf40400fc01a08fde
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2757406
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-08-20 23:33:45 -07:00
Debarshi Dutta
1d4b7b1c5d gpu: nvgpu: modify priority of NVS worker thread
In linux threaded interrupts run with a Realtime priority
of 50. This bumps up the priority of bottom-half handlers
over regular kernel/User threads even during process
context.

In the current implementation scheduler thread still
runs in normal kernel thread priority. In order to
allow a seamless scheduling experience, the worker
thread is now created with a Realtime priority of 1.
This allows for the Worker thread to work at a priority
lower than interrupt handlers but higher than the regular
kernel threads.

Linux kernel allows setting priority with the help of
sched_set_fifo() API. Only two modes are supported
i.e. sched_set_fifo() and sched_set_fifo_low().

For more reference, refer to this article
https://lwn.net/Articles/818388/.

Added an implementation of nvgpu_thread_create_priority()
for linux thread using the above two APIs.

Jira NVGPU-860

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I0a5a611bf0e0a5b9bb51354c6ff0a99e42e76e2f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2751736
Reviewed-by: Prateek Sethi <prsethi@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-08-20 23:33:34 -07:00
Debarshi Dutta
13699c4c15 gpu: nvgpu: ensure worker thread is disabled during rg
A previous commit ID 44b6bfbc1 added a hack to prevent
the worker thread from calling nvgpu_runlist_tick()
in post_process if the next domain matches the previous.

This could potentially still face issues with multi-domains
in future.

A better way is to synchronize the thread to suspend/resume
alongwith the device's common OS agnostic suspend/resume
operations. This shall emulate the GSP as well.
This shall also take care of the power constraints
i.e. the worker thread can be expected to always work
with the power enabled and thus we can get rid of the complex
gk20a_busy() lock here for good.

Implemented a state-machine based approach for suspending/
resuming the NVS worker thread from the existing callbacks.

Remove support for NVS worker thread creation for VGPU.
hw_submit method is currently set to NULL for VGPU. VGPU
instead submits its updates via the runlist.reload() method.

Jira NVGPU-8609

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I51a20669e02bf6328dfe5baa122d5bfb75862ea2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2750403
Reviewed-by: Prateek Sethi <prsethi@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-08-20 23:33:29 -07:00
Debarshi Dutta
21ab579341 gpu: nvgpu: don't skip setting same clk in arbiter
In the current setting, clock arbiter skips setting
the clock if its already set previously. The value
set by the arbiter is stored in
"struct nvgpu_clk_arb->actual" whenever the clock is
updated via the arbiter. However, DVFS might also
update the clock and the updates are not synchronized
with the arbiter. Hence, ensure that any clock
requests are always updated i.e. the requested rate is
set even if the previous rate remains the same.

In the devfreq scale() part, scale emc when clk_arb
is active and skip setting of clocks.

Bug 3666615

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I32bf4dbf81b19fdd6fa0bdec3a6c9a9312b78eca
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2727787
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-08-19 21:28:46 -07:00
Prasun Kumar
4194c35e17 gpu: nvgpu: Err injection utility support
Update callback registration with error inject utility.
Add callback de-registration with error injection utility
when CIC_MON is removed.

Bug 3413214

Signed-off-by: Prasun Kumar <prasunk@nvidia.com>
Change-Id: Iab682cd522a96fd6af136485c4f3b73f81f723b8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2755178
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-17 19:22:17 -07:00
Dinesh T
4e78d478c3 gpu: nvgpu: Add mutex lock to synchronise isr threads
This is adding a mutex lock to synchronise between
stall isr threads.
Orin(t234) has three interrupt lines and three ISR
threads to handle bottom half of the ISR. The threads
sharing same data between them without proper synchronization.
When multiple interrupts trigger simeltaneously, causing the
threads running in parallell like below traces

#0  nvgpu_cic_mon_intr_stall_isr (g=g@entry=0x5ed62a9318)
    at /home/dt/automotive-dev-main-20220802T015100095/kernel/nvgpu/drivers/gpu/nvgpu/common/cic/mon/mon_intr.c:158
#1  0x00000013758cae30 in nvgpu_intr_stall (arg=0x5ed62a9120)
    at /home/dt/automotive-dev-main-20220802T015100095/qnx/src/resmgrs/nvrm/nvgpu_rmos/os/intr.c:140
#2  0x00000013758ec090 in nvgpu_posix_thread_wrapper (data=<optimized out>)
    at /home/dt/automotive-dev-main-20220802T015100095/kernel/nvgpu/drivers/gpu/nvgpu/os/posix/thread.c:77
#3  0x0000001375b01000 in pthread_attr_setdetachstate ()
   from /home/dt/automotive-dev-main-20220802T015100095/out/embedded-qnx-t186ref-debug-none/target_rootfs/lib/libc.so.5
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

This is causing some race in shared data access and causing
multiple issues.

Bug 3647988

Change-Id: If40e581635b52cce288d8f4b00af6a040f7f9a6e
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2755874
Reviewed-by: Tejal Kudav <tkudav@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: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-13 05:18:56 -07:00
Jon Hunter
59f7a9e318 gpu: nvgpu: Fix crash if tegra_bpmp_get() fails
The function tegra_bpmp_get() returns an error pointer on failure and
so if the call to tegra_bpmp_get() fails, because the device-tree
property is missing, then this is not detected and leads to a crash when
trying to dereference the pointer to the bpmp handle. Fix this by
correctly checking the return value from tegra_bpmp_get().

Bug 3752030

Change-Id: I944063ab7e116fc81769c9dbbfefe6b6dc4bf0f4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2759251
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-12 15:51:55 -07:00
Jon Hunter
34f478fca6 gpu: nvgpu: Add host1x support for Tegra234
Add support for the upstream host1x driver in NVGPU for Tegra234.

Bug 3724727
Bug 3752030

Change-Id: I529b731ea3feb3c8c435e7433772af82004ea208
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2759207
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-12 15:51:50 -07:00
Dinesh T
68976fbd22 gpu: nvgpu: gv11b+: set live pes mask
This change is reading the live pes from the register
"gr_gpc0_gpm_pd_live_physical_pes_r" and set it to
"gr_gpc0_swdx_pes_mask_r".

Every PES needs at least a TPC to work. If any of the TPCs
are floorswept,the live PES mask is read from
"gr_gpc0_gpm_pd_live_physical_pes_r" and  the corresponding
active PES mask is updated in "gr_gpc0_swdx_pes_mask_r".

Bug 3677421

Change-Id: I899ac41c4a82beb3ce75c84ad57dcad262a49ba1
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2736560
(cherry picked from commit 85f2ceb3db6eeef925b49553f445d8cc31ec39da)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2759135
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-12 11:05:35 -07:00
Debarshi Dutta
8cb147aa88 gpu: nvgpu: add a soft dependency on podgov module
The present implementation of podgov driver doesn't
export any symbols and as a result, the dependency
between NVGPU driver and podgov is not established
by depmod. Fix that by adding a soft dependency.

MODULE_SOFTDEP("pre: governor_pod_scaling");

This allows loading the podgov governor before
nvgpu driver.

Bug 3674235

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Id1959639399042f488cdaa30372feb65d8f21aaa
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2740446
(cherry picked from commit e4b3499850)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2741188
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-12 11:01:32 -07:00
Sagar Kamble
7085934303 gpu: nvgpu: update channel TSG unbind fail paths
On tsg.unbind_channel hal failure, channel teardown was being done
again that was done already as part of the function
nvgpu_tsg_unbind_channel_common.

Just abort the TSG and return err in that case. Also, decrement
the TSG ch_count in the fail path.

Bug 3677982

Change-Id: I466f2b2c693d43ed64dc531b08bf740bf00f28a6
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2749970
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
2022-08-10 15:42:34 -07:00
Dinesh T
b1d7c77d8e gpu: nvgpu: Create unique share id
This is fixing a race in address space identifier
creation by making atomic variable increment.

Bug 3684734

Change-Id: I864e8f61257569e35f926822c2a5260532d41360
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2742206
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: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-09 21:56:46 -07:00
atanand
eae4593343 gpu: nvgpu: add ioctl to configure implicit ERRBAR
Add ioctl support to configure implicit ERRBAR by setting/unsetting
NV_PGRAPH_PRI_GPCS_TPCS_SM_SCH_MACRO_SCHED register.

Add gpu characteritics flag: NVGPU_SCHED_EXIT_WAIT_FOR_ERRBAR_SUPPORTED
to allow userspace driver to determine if implicit ERRBAR ioctl is
supported.

Bug: 200782861

Change-Id: I530a4cf73bc5c844e8d73094d3e23949568fe335
Signed-off-by: atanand <atanand@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2718672
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-05 23:10:18 -07:00
Rajesh Devaraj
faf18009cb gpu: nvgpu: fix criticality info for pfifo_ctxsw_timeout_err
In Drive 6.x, GPU_HOST_PFIFO_CTXSW_TIMEOUT_ERROR is updated as an
uncorrected error and the same has been documented in error code list.
However, in look-up table, it has been stored as a corrected error
(since it was marked as a corrected error in Drive 5.x and the look-up
table was carry-forwarded from 5.x). This patch fixes this issue by
updating the criticality of GPU_HOST_PFIFO_CTXSW_TIMEOUT_ERROR.

Bug 3690950

Change-Id: I3c1ef0e67557c4d1db373f86662183c0e27bd078
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2755756
Reviewed-by: V M S Seeta Rama Raju Mudundi <srajum@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-05 16:42:04 -07:00
Kishan
282be07995 gpu: nvgpu: Fix leaf and top interrupt disabling logic
There are 2 issues here:
1. top_en register is being masked for each leaf level
interrupt disable operation. top_en bit should be disabled
as part of top level stall operation only.
2. Wrong mask is being calculated to disable the leaf_en bits
for a unit which inturn affects the entire subtree.
Subtree_mask_restore for a subtree stores the last state
of interrupts that are enabled. As part of disable operation,
we only need to update subtree_mask_restore and not reupdate
subtree_mask for that subtree. Same logic applies to enable
operation.

Renamed the apis to better reflect their operation. The
interrupt disabling is done at unit level and not subtree level.

Bug 3712884

Change-Id: Id840c77f612021a303cfe0e8dca69386bc570273
Signed-off-by: Kishan <kpalankar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2752541
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: Deepak Goyal <dgoyal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-05 16:38:38 -07:00
Richard Zhao
b83d4ed668 gpu: nvgpu: fix build errors using arm toolchain
- fix duplicated typedef
- fix type conversion in atomics
- skip unalignment check for standard build

Jira HYP-12253

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I5e23e7b173bb1c8192e419cf77dd9e0ba59924b1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2754184
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Prateek Sethi <prsethi@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-05 06:24:58 -07:00
Debarshi Dutta
3d95f2b803 gpu: nvgpu: add support for event queue observers
Add support for accessing Event Queue for non-exclusive
users. Allows, non-exclusive users to open Event Queues
before exclusive users. Non-Exclusive users can only
use the Event Queue in a read-only mode.

Add VM_SHARED for Event Queues across all users instead of just
Read-Only users. Event queues are shared with multiple processes
and as such require VM_SHARED across all users(exclusive and
observers).

Jira NVGPU-8608

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Id9733c2511ded6f06dd9feea880005bdc92e51a0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2745083
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-29 00:04:51 -07:00
Richard Zhao
1f9fbc85fe gpu: nvgpu: add nvgpu_hvrtos build
- nvgpu_hvrtos disabled bellow configs:
  - CONFIG_NVGPU_IVM_BUILD
  - CONFIG_NVGPU_TRACE
  - CONFIG_NVGPU_SYSFS
  - CONFIG_NVGPU_DGPU
  - CONFIG_NVGPU_IGPU_VIRT
  - CONFIG_NVGPU_NVLINK
  - CONFIG_NVGPU_CLK_ARB
  - CONFIG_NVGPU_MIG
- nvgpu_hvrtos re-uses posix bitmap.c
- add nvgpu_hvrtos specific headers
- add static check of vgpu ivc frame
- fix build errors caused by new CFLAGS

Jira GVSCI-9976

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I5f65fda9444d0cbfe6008ac4ab8262b44d1a4f56
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2653745
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Austin Tajiri <atajiri@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-28 23:59:10 -07:00
Martin Radev
cb768ff133 gpu: nvgpu: Consume L3 map flag even if L3 not supported
This patch fixes a bug where GPU mappings with the L3 hint
would fail. The failure happens because the L3 map flag does
not get consumed if L3 allocations are disabled. The fix
is to consume the flag.

Bug 3717951
Bug 3486025

Change-Id: Ib10ee58cc060318c810f86013de7311f73c25729
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2750419
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-26 14:36:04 -07:00
Debarshi Dutta
44b6bfbc1d gpu: nvgpu: skip post_process() operations for single domain.
There is a possible deadlock that gets triggered when
device is being resumed() and NVS worker thread tries to submit
the data as part of the post_process() operation.

The NVS worker thread works asynchronously in the post_process() part
w.r.t the USER threads and thus an initial implementation requires
acquiring the busy lock() arriving at a deadlock scenario.

This quick change shall disallow post_process() from executing
during the case where we have only one scheduling domain present(legacy)
Any submits meant to be updated are handled via the synchronous
wakeup_process_item() callback.

This implementation is being modified to allow the worker thread
to be suspended/resumed during GPU railgate/unrailgate in upcoming
releases and currently is in a state of flux.

Bug 3723127

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I318cda0fbdd5651884cf21f748c86687679e6fdb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2750293
Reviewed-by: Prateek Sethi <prsethi@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-25 18:41:43 -07:00
Divya
ee5053f7be gpu: nvgpu: ga10b: Add new RPC for AELPG
- Add AP_INIT RPC to initialize the AELPG feature.
- Add AP_CTRL_INIT_AND_ENABLE RPC to program some
  APCTRL values for Adaptive ELPG.
- Add AP_CTRL_ENABLE and AP_CTRL_DISABLE RPCs to
  send AELPG enable/disable request to PMU via sysfs
  node.
- Re-structure the rpc handler based on PG_LOADING
  and PG unit id. This is needed to handle different
  types of new RPCs from PMU.

JIRA NVGPU-7182

Change-Id: If00b00730507f17ff1883a67094f7e16da5b81ea
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2728286
(cherry picked from commit fffb58703bd718600e8c983dcd1c81d9abe83802)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603161
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-19 21:51:15 -07:00
Sagar Kamble
3fb2a2e209 gpu: nvgpu: track gr_ctx init state
On successful obj_ctx allocation, set ctx_initialized member in gr_ctx
to true and when it is true then only invoke free_gr_ctx.

With this we can get rid of tsg->vm check while calling free_gr_ctx.
tsg->vm will go away with multiple address spaces support in TSG.

Bug 3677982

Change-Id: I4a64842411ce4ab157010808e4e8e4d5cd254a7f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2746803
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: Scott Long <scottl@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-19 10:32:35 -07:00
shashank singh
b1802085f2 gpu: nvgpu: reduce CCM for "nvgpu_rc_pbdma_fault"
- This API has CCM of 12, it should be <= 10.

JIRA NVGPU-7057

Change-Id: I42f1972c29aaa179760a4fb7c6d1f7112456520e
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2602678
(cherry picked from commit c601f8b6bb07a504e01b57c42c1964b885744cbf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2745517
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: svcacv <svcacv@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-18 11:07:46 -07:00
shashank singh
2ca87051e1 gpu: nvgpu: add detailed documentation for common.rc unit
- Add detailed documentation for common.rc unit as per new guidance.

Jira NVGPU-6995

Change-Id: Id1ec052022e8ffb3d3f73bb79c388c01490c4bab
Signed-off-by: shashank singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2587869
(cherry picked from commit 5b75e43f8c97e53131f466bb4b420dd6e17921b1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2672030
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-18 11:07:40 -07:00
Debarshi Dutta
1bdca92c50 gpu: nvgpu: modify rl_domain member
KMD needs to send the domain id and GPU_VA corresponding
to the struct runlist_domains to GSP. In the current
implementation, struct nvgpu_runlist_domain contains
the domain name instead of domain id. This requires
an additional search by name everytime an update
is needed to be submitted to the GSP.

Modify the struct nvgpu_runlist_domain to store domain id
instead of domain name. This simplifies the flow and avoids
unnecessary search.

Removed the conditional check for existence of shadow domain
as its a deadcode. Shadow Domain is not searchable in the list
of domains inside the struct nvgpu_runlist.

Jira NVGPU-8610

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I0d67cfa93d89186240290e933aa750702b14f4f0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2744890
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-15 15:15:30 -07:00
rmylavarapu
00fd453830 gpu: nvgpu: pmu: pmgr: fix taint parameter
using nvgpu_memcpy() instead of downcasting the parameter to assign.

CID 10074974

Change-Id: I5ce333735dca5fc4e34dd42c9fca432223989bf2
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2744418
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-15 15:14:50 -07:00
Sagar Kamble
d75473a115 gpu: nvgpu: fix unit test traceability issues
Some of the functions with no traceability to unit tests are already
covered by callee API functions. Skip these functions in SWVR by
skipping doxygen for them.

Some of the functions are non-fusa like those in profile.h and
bsearch.h. Those were included as the header was included in
Doxygen sources. Mark then non-safe.

Some of the nvgpu functions were not added to Targets entries for
respective tests. Fix those.

JIRA NVGPU-7211

Change-Id: Iacf22dccdd9340100cf93814566d3979734c455d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2612982
(cherry picked from commit a40f62654747102cc8ef53ddbd9f953c21c2b745)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2737672
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-15 07:15:34 -07:00
rmylavarapu
bd5ade293d gpu: nvgpu: gsp: msg: remove event handle support
Changes:
- Currently we are not using any event handling between NVGPU and GSP.
  So removing the event handler function and directly calling response
  handler.
- This change will fix the respective coverity issue.

CID 10138010

Change-Id: I12ddb0012ad9f54bf99f707ab2123598065561d8
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2732628
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-15 07:12:52 -07:00
Sagar Kamble
f95cb5f4f8 gpu: nvgpu: maintain ctx buffers mappings separately from ctx mems
In order to maintain separate mappings of GR TSG and global context
buffers for different subcontexts, we need to separate the memory
struct and the mapping struct for the buffers. This patch moves
the mappings of all GR ctx buffers to new structure
nvgpu_gr_ctx_mappings.

This will be instantiated per subcontext in the upcoming patches.

Summary of changes:
  1. Various context buffers were allocated and mapped separately.
     All TSG context buffers are now stored in gr_ctx->mem[] array
     since allocation and mapping is unified for them.
  2. Mapping/unmapping and querying the GPU VA of the context
     buffers is now handled in ctx_mappings unit. Structure
     nvgpu_gr_ctx_mappings in nvgpu_gr_ctx holds the maps.
     On ALLOC_OBJ_CTX this struct is instantiated and deleted
     on free_gr_ctx.
  3. Introduce mapping flags for TSG and global context buffers.
     This is to map different buffers with different caching
     attribute. Map all buffers as cacheable except
     PRIV_ACCESS_MAP, RTV_CIRCULAR_BUFFER, FECS_TRACE, GR CTX
     and PATCH ctx buffers. Map all buffers as privileged.
  4. Wherever VM or GPU VA is passed in the obj_ctx allocation
     functions, they are now replaced by nvgpu_gr_ctx_mappings.
  5. free_gr_ctx API need not accept the VM as mappings struct
     will hold the VM. mappings struct will be kept in gr_ctx.
  6. Move preemption buffers allocation logic out of
     nvgpu_gr_obj_ctx_set_graphics_preemption_mode.
  7. set_preemption_mode and gr_gk20a_update_hwpm_ctxsw_mode
     functions need update to ensure buffers are allocated
     and mapped.
  8. Keep the unit tests and documentation updated.

With these changes there is clear seggregation of allocation and
mapping of GR context buffers. This will simplify further change
to add multiple address spaces support. With multiple address
spaces in a TSG, subcontexts created after first subcontext
just need to map the buffers.

Bug 3677982

Change-Id: I3cd5f1311dd85aad1cf547da8fa45293fb7a7cb3
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2712222
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-15 07:10:11 -07:00
Sagar Kamble
931e5f8220 gpu: nvgpu: update gr_ctx patch and pm setup functions
set_patch_addr parameter to nvgpu_gr_ctx_set_patch_ctx was redundant.
Remove it.

Prepare new functions nvgpu_gr_ctx_set_hwpm_pm_mode to set PM mode,
nvgpu_gr_ctx_set_hwpm_ptr to set PM ptr in gr_ctx. Rename subctx
function to nvgpu_gr_subctx_set_hwpm_ptr.

This simplifies the logic in gr_gk20a_update_hwpm_ctxsw_mode to set
the PM mode and PM ptr. Channel loop is needed only for subcontexts.

Bug 3677982

Change-Id: I44acb09f6296ba8d510e278910188864f39e7157
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2743724
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: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-15 07:10:00 -07:00
Debarshi Dutta
7a956cf5a2 gpu: nvgpu: implement domain scheduler characteristics ioctl
Added the NVGPU_GPU_QUERY_CTRL_FIFO_SCHEDULER_CHARACTERISTICS
ioctl as part of the ctrl device node.

Jira NVGPU-8129

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I651bd1958b6a27dc17687dee663bb93c2f807b68
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2723871
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-07-15 07:08:37 -07:00
Debarshi Dutta
e7f9de6567 gpu: nvgpu: add control-fifo queues
Added implementation for following IOCTLs
NVGPU_NVS_CTRL_FIFO_CREATE_QUEUE
NVGPU_NVS_CTRL_FIFO_RELEASE_QUEUE

The above ioctls are supported only for users with
R/W permissions.

1) NVGPU_NVS_CTRL_FIFO_CREATE_QUEUE constructs a memory region
via the nvgpu_dma_alloc_sys() API and creates the corresponding
GPU and kernel mappings. Upon successful creation, KMD exports
this buffer to the userspace via a dmabuf fd that the UMD
can use to mmap it into its process address space.

2) Added plumbing to store VMA's corresponding to different users
for event queue in future.

3) Added necessary validation checks for the IOCTLs

4) NVGPU_NVS_CTRL_FIFO_RELEASE_QUEUE is used to clear the queues.

5) Using a global queue lock to protect access to the queues. This
could be modified to be more fine-grained in future when there
is more clarity on GSP's implementation and access of queues.

6) Added plumbing to enable user subscription to queues.
NVGPU_NVS_CTRL_FIFO_RELEASE_QUEUE is used to unsubscribe
the user from the queue. Once, the last user is deleted,
all the queues will be cleared. User must ensure that
any mappings are removed before calling release queue.

7) Set the default queue_size for event queues to
PAGE_SIZE. This can be modified later. For event
queues, UMD shall fetch the queue_size.

Jira NVGPU-8129

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I31633174e960ec6feb77caede9d143b3b3c145d7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2723198
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-15 07:08:32 -07:00
Debarshi Dutta
ee8403175d gpu: nvgpu: add generic mmap handler API for sysmem
Add a function nvgpu_dma_mmap_sys that enables
mapping nvgpu allocated memory into a valid
user VMA for linux.

Jira NVGPU-8129

Change-Id: Ic758b7a708c9851b39aedd066ee956ba74eb5bf2
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2731976
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-07-15 07:08:27 -07:00
Debarshi Dutta
62c03dfaef gpu: nvgpu: add support for nvs control_fifo
Add a device node for management of nvs control fifo buffers for
scheduling domains. The current design consists of a master structure
struct nvgpu_nvs_domain_sched_ctrl for management of users as well
as control queues. Initially all users are added as non-exclusive users.

Subsequent changes will add support for IOCTLS to manage opening of
Send/Receive and Event buffers, querying characteristics etc.

In subsequent changes, a user that tries to open a Send/Receive queue
will first try to reserve itself as an exclusive user and only if that
succeeds can proceed with creation of both Send/Receive queues.

Exclusive users will be reset to non-exclusive users just before they
close their device node handle.

Jira NVGPU-8128

Change-Id: I15a83f70cd49c685510a9fd5ea4476ebb3544378
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2691404
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-15 07:08:22 -07:00
Sagar Kamble
e083bd0df2 gpu: nvgpu: fix syncpt increment logic in host1x syncpt_set_minval
On host copy engine PBDMA interrupt, channel is aborted as part of the
recovery and its syncpt value is set to the max threshold.

Syncpoint may then get incremented by PBDMA (incr cmd gets processed)
after this interrupt is handled leading to syncpoint value becoming
greater than the max threshold.

Again while unbinding the channel, syncpoint value is incremented until
it reaches max threshold. Since syncpoint value is already greater than
max threshold, host1x version of nvgpu_nvhost_syncpt_set_minval will
loop for entire u32 range until it reaches max threshold and this
will hang the channel unbind.

nvgpu_nvhost_syncpt_set_minval can ensure the syncpoint value is greater
than or equal to max threshold. Hence update the check for syncpoint
value from not equal to less than.

Bug 3681100

Change-Id: I96e7a1f53d4037e9ed858a2e90dd5a8d17ed6bb0
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2742604
(cherry picked from commit f246facd01)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2742603
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-14 09:09:37 -07:00
Sagar Kamble
4b73eb8a43 gpu: nvgpu: add BVEC test for LTC isr
Add BVEC tests for following common.ltc unit API:
gops_ltc_intr.isr

Add unit test for boundary value check for ltc parameter of
the LTC isr.

JIRA NVGPU-6398

Change-Id: I0e075a3244d969d11faa4fd99e7e364218da6e30
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2549802
(cherry picked from commit 3133a7173b0853a699e4ebf2fc50e866e3ac6211)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623636
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-14 08:58:47 -07:00
Sagar Kamble
04587333ca gpu: nvgpu: fix MISRA Rule 10.3 and 10.4 violations
BVEC changes for nvgpu_rc_pbdma_fault and nvgpu_rc_mmu_fault
started reporting below MISRA issue.

kernel/nvgpu/drivers/gpu/nvgpu/common/fifo/tsg.c:522:
  1. misra_c_2012_rule_10_4_violation: Essential type of the left hand
     operand "error_notifier" (unsigned) is not the same as that of
     the right operand "NVGPU_ERR_NOTIFIER_INVAL"(enum).

kernel/nvgpu/drivers/gpu/nvgpu/common/fifo/tsg.c:541:
  1. misra_c_2012_rule_10_3_violation: Implicit conversion of
     "NVGPU_ERR_NOTIFIER_FIFO_ERROR_MMU_ERR_FLT" from essential type
     "anonymous enum" to different or narrower essential type
     "unsigned 32-bit int".

Change the enum nvgpu_err_notif values to u32 values declared using
the #define macro.

JIRA NVGPU-6772

Change-Id: Icac7f567cea52cde07ca200b21eb3e7dd2b9e645
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2584153
(cherry picked from commit 2f073f341bd55242c857c6c6d35d6015495025e2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623634
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-14 08:58:42 -07:00
Sagar Kamble
bcbccbe083 gpu: nvgpu: add BVEC test for nvgpu_rc_mmu_fault
Update nvgpu_rc_mmu_fault to return error on invalid params and
add BVEC test for it.

JIRA NVGPU-6772

Change-Id: If44d80888c665ca3b528c9937de8a66ccce29f57
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2551618
(cherry picked from commit 229727512a1facc33ef9f16cc1831405e960ab2a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623626
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-14 08:58:36 -07:00
Sagar Kamble
80efe558b1 gpu: nvgpu: add BVEC test for nvgpu_rc_pbdma_fault
Update nvgpu_rc_pbdma_fault with invalid checks and add BVEC test
for it.

Make ga10b_fifo_pbdma_isr static.

NVGPU-6772

Change-Id: I5485760c53e1fff1278557a5b25659a1fc0e4eaf
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2551617
(cherry picked from commit e917042d395d07cb902580bad3d5a7d0096cc303)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623625
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-14 08:58:31 -07:00
Debarshi Dutta
d8e8eb65d3 nvgpu: gpu: separate runlist submit from construction
This patch primary separates runlist modification from
runlist submits.

Instead of submitting the runlist(domain) immediately after
modification, a worker thread interface is now being used to
synchronously schedule runlist submits. If the runlist being
scheduled is currently active, the submit happens instantly,
otherwise, it will happen in the next iteration when the nvs
thread will schedule the domain. This external interface uses
a condition variable to wait for the completion of the
synchronous submits.

A pending_update variable is used to synchronize domain memory
swaps just before being submitted.

To facilitate faster scheduling via the NVS thread, nvgpu_dom
itself contains an array of rl_domain pointers. This can then
be used to select the appropriate rl_domain directly for scheduling
as against the earlier approach of maintaining nvs domains and rl
domains in sync everytime.

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I1725c7cf56407cca2e3d2589833d1c0b66a7ad7b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2739795
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-13 16:36:19 -07:00
Sagar Kamble
c99819ffd8 gpu: nvgpu: acquire platforms clocks on floorsweeping gpc
bpmp will floorsweep GPCs as per parameters to tpc_pg_mask sysfs.
While doing that corresponding GPC clocks are also disabled.
nvgpu should re-initialize the clocks every time the
GPC/TPC pg_masks are passed to bpmp mrq.

Also print error when clk_prepare_enable fails.

Introduce platform->clks_lock to protect access to platform->clks
and platform->num_clks done from unrailgate/railgate and bpmp
mrq set calls from sysfs.

Acquire static_pg_lock in railgate path to synchronize railgate
with sysfs.

Bug 3688506

Change-Id: I3203d78b87289e7a847d78b3117e2d3119be3425
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2738920
(cherry picked from commit 28ddb0996f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2741029
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-08 06:08:20 -07:00
Dinesh T
fb466b5b25 gpu: nvgpu: Enable ptimer
This is enabling ptimer in mme_config and
mme_fe1_config by setting the corresponding
field.
Debugger is expected to make use of ptimer.
So this is required for nvgpu to enable ptimer
in the register.

Bug 3637441

Change-Id: Id596a87081753bcaf945e54444a8abbd025b3f76
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710632
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-07 07:30:52 -07:00
Scott Long
ac4d8b9bff gpu: nvgpu: fix remap page size flag handling
When destroying a virtual memory pool the associated page size must
be set in the nvgpu_vm_remap_op structure.

This patch adds a new nvgpu_vm_remap_page_size_flag() routine that
converts the page size derived from the vm/vm_area structs to the
corresponding NVGPU_VM_REMAP_OP_FLAGS_PAGESIZE bit.

Bug 3669908

Change-Id: Idca77cc36d353777b399c872f68a1f5231ddb8dd
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2734822
Tested-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 868b723b16)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2740035
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
2022-07-07 01:25:25 -07:00
mkumbar
ff3823eeb4 gpu: nvgpu: ga10b: LSPMU interrupt update
Enable/disable LSPMU interrupt in MC, as required LSPMU
interrupts are configured as part of LSPMU ucode init and
don't need any additional PMU IRQ register to set/clear as
part of GPU power-on/off sequence.

Bug 3681561

Change-Id: Ifb47bc9cc83e16e46649b0eef5f257acb02f302c
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2739476
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-06 19:01:22 -07:00
Antony Clince Alex
cc19bc8ac9 gpu: nvgpu: disable NVGPU_ERRATA_3288192 on non-auto platforms
NVGPU_ERRATA_3288192 is only applicable for automotive platforms, so have
it disabled on other platforms.

Bug 3604690

Change-Id: Id45622a629ebf9e2dfc10365981c3e1bde1e2941
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2700380
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Tested-by: Sagar Kamble <skamble@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-06 12:41:53 -07:00
Ramesh Mylavarapu
951ad46819 gpu: nvgpu: gsp: sched: domain management apis
Changes:
- Added Domain management APIs with interfaces to communicate with
  GSP scheduler.
- Domain creation shall be done inside NVGPU and respective Domain
  and runlist info are sent to GSP for scheduling.

Design: https://confluence.nvidia.com/display/TGS/GSP+Scheduler+Interface+Specifications

NVGPU-7371

Signed-off-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Change-Id: Icba7f1ed3b9b2f409aac346084dd9a123c9d3779
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2682686
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-05 14:27:00 -07:00
Tejal Kudav
5828594de1 gpu: nvgpu: Avoid err_inj CB registration for dGPU
Error injection is not supported on dGPU and dGPU's probe should not
attempt any error injection callback function registration.
Disable NvGPU's error injection support on dGPU by checking
CONFIG_NVGPU_DGPU.

Bug 3703060

Change-Id: Ie6f5af2636396e51000e8c2553d4e58a61c902d6
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2739265
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Chandra Meduri <msekhar@nvidia.com>
Tested-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
2022-07-05 00:16:06 -07:00
Tejal Kudav
494dc19ee8 gpu: nvgpu: Err injection utility support
The HSI error injection utility is an on-bench debug and test utility
which can be used by customers and SQA to test end-to-end error
detection and reporting path.
Inplement callback function to integrate with this utility and allow
injecting GPU HSI related errors.
As part of callback function hsierrrpt_inj(), invoke the driver's
error-reporting logic which uses the EPD MISC_EC APIs. In future,
we can enhance the callback function to trigger driver's error
handling logic incrementally for different errors.

Bug 3413214

Change-Id: I2d050b6c850d6151b40095f243a6733b4ba74f47
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2727198
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-07-01 08:11:45 -07:00
Sagar Kamble
8b4bc0e51c gpu: nvgpu: tu104: init subctx pdb in ramfc setup
Subctx pdb setup removed from AS_IOCTL_BIND_CHANNEL, is to be done
done during ramfc setup. tu104 hal was missing the subctx pdb
setup. Add it.

Bug 3677982

Change-Id: I48d2ac243691ab54e374d1058cdc6e1118216d8f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2684060
Reviewed-by: Scott Long <scottl@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-06-28 23:33:36 -07:00