Commit Graph

5570 Commits

Author SHA1 Message Date
Antony Clince Alex
16dd642366 gpu: nvgpu: Introduce error reporting callbacks for h/w units
This patch introduces error reporting hooks to each GPU hw unit like
host, gr, ltc etc. It also defines the various errors that each unit
is capable of reporting.

Jira NVGPU-1365

Change-Id: I7725acf8d514521884c5570e67558dd183c0b030
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1950667
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 12:54:28 -08:00
Alex Waterman
8cc819801c gpu: nvgpu: Move as.c to mm/as.c
This file, as.c, is an MM related source file. As
such it should be placed below mm/.

Note there's no relevant JIRA task for this.

Change-Id: Ie1062897e209bba2efb4ed4983fdd4966a688bfd
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1986177
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 11:55:14 -08:00
Nicolas Benech
0893309027 gpu: nvgpu: unit: Increase page_table coverage
Add extra test cases focusing on:
- error management (to check various branches)
- IPA-PA conversion

JIRA NVGPU-907

Change-Id: Ifd0e1a00f9c4ac0db68fefb82fc407c4cfd8cc5d
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972451
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 07:17:58 -08:00
Nicolas Benech
9841d10d80 gpu: nvgpu: page_table: fix PD if vzalloc fails
In case of a vzalloc failure, the pd structure could be
left in a inconsistent state. This patch fixes the issue
by overwritting the "num_entries" field when vzalloc fails.

JIRA NVGPU-907

Change-Id: I635e7c203094a43da9107bd8ef194ae67a2eb15a
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972431
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 07:17:41 -08:00
Nicolas Benech
76e5d6ab27 gpu: nvgpu: posix: expose nvgpu_mem operations
The nvgpu_mem operations were all static. This patch makes
them public so that they can be reused by other modules.

JIRA NVGPU-907

Change-Id: I17cd3934480bcd85d42c2bafbecc23194434ba79
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972429
Reviewed-by: svc-misra-checker <svc-misra-checker@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
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 07:17:32 -08:00
Sagar Kamble
48c0a239e7 gpu: nvgpu: create falcon private header
Add common/falcon/falcon_priv.h file that will contain declarations
private to Falcon unit. Clean up the falcon header files inclusion.
Rules followed:
1. Remove unneeded header file includes.
2. Falcon unit source files will only include falcon_priv.h.
3. Base architecture Falcon source (falcon_gk20a.c) will only
   include hw_falcon_*.h file.
4. Derived architecture source will include hw headers if needed.
5. Other units should not include hw headers for Falcon.
6. HAL source will include the Falcon unit header if needed.

JIRA NVGPU-1459

Change-Id: Ia9f03f7b577fe10b8c0f417e6302fa7ebd4131cc
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1961634
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 02:58:51 -08:00
Sagar Kamble
d2242ac909 gpu: nvgpu: make flcn queues struct nvgpu_falcon_queue*
To move struct nvgpu_falcon_queue members to falcon private header
convert falcon queues to be struct nvgpu_falcon_queue pointers.

JIRA NVGPU-1594

Change-Id: Icf8ef929f8256aadd46956164bd418958ba4756f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1968243
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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>
2019-01-03 02:58:42 -08:00
Sagar Kamble
5efc446a06 gpu: nvgpu: make all falcons struct nvgpu_falcon*
With intention to make falcon header free of private data we are making
all falcon struct members (pmu.flcn, sec2.flcn, fecs_flcn, gpccs_flcn,
nvdec_flcn, minion_flcn, gsp_flcn) in the gk20a, pointers to struct
nvgpu_falcon. Falcon structures are allocated/deallocated by
falcon_sw_init & _free respectively.

While at it, remove duplicate gk20a.pmu_flcn and gk20a.sec2_flcn,
refactor flcn_id assignment and introduce falcon_hal_sw_free.

JIRA NVGPU-1594

Change-Id: I222086cf28215ea8ecf9a6166284d5cc506bb0c5
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1968242
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 02:58:38 -08:00
Sagar Kamble
b8c8d627af gpu: nvgpu: update pmu, sec2 sw setup sequence
pmu.g & sec2.g were set in nvgpu_falcon_sw_init. They are now set
in nvgpu_early_init_pmu_sw & nvgpu_init_sec2_setup_sw. Pass gk20a
& pmu struct to nvgpu_init_pmu_fw_support like sec2.
pmu_fw_support & sec2_setup_sw are separated from respective init
sequence and now are called earlier since we need ->g member earlier
and most of the setup is sw only.
nvgpu_init_pmu_fw_ver_ops is now being exported.

JIRA NVGPU-1594

Change-Id: I6c71c6730ce06dad190159269e2cc60301f0237b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1968241
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 02:58:29 -08:00
Alex Waterman
8e8e40e66d gpu: nvgpu: Adjust MM unit test paths
Adjust the MM unit tests pd_cache and page_table to reflect
their new paths in the common nvgpu code.

JIRA NVGPU-1246

Change-Id: I01454f758bbf54864210c01f8bfe3750b26891ce
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1986121
Reviewed-by: Nicolas Benech <nbenech@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>
2019-01-02 21:34:34 -08:00
Vaikundanathan S
b947c8ea7b gpu:nvgpu: Setup initial values for clk_pos.
clk_pos should be 0 for master

JIRA NVGPU-1150

Change-Id: I2d17e479bdf4754f85b8db33b2f1e647e582d5ed
Signed-off-by: Vaikundanathan S <vaikuns@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1985169
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Abdul Salam <absalam@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>
2019-01-02 12:15:18 -08:00
Vaikundanathan S
89d421fb9c gpu:nvgpu: Enable VF point in change seqencer
Mark b_vf_point_check_ignore to false as VF point is working
and we can use FR instead of FFR

Update PMU version to enable VF point support.
PMU fw from CL 25467803

JIRA NVGPU-1152

Change-Id: Ie34068dd075ea8c9548f45d7d6bd253077ed4485
Signed-off-by: Vaikundanathan S <vaikuns@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972990
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Abdul Salam <absalam@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>
2019-01-02 12:15:01 -08:00
Vaikundanathan S
04a1fd312b gpu:nvgpu: Add freq to volt RPC.
Add RPC to get voltage required to meet a target frequency.

JIRA NVGPU-1150

Change-Id: I92c75ba047f0729f377969facffe47f35388a030
Signed-off-by: Vaikundanathan S <vaikuns@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1964024
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Tested-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-02 12:14:58 -08:00
Vaikundanathan S
56f736b4a5 gpu: nvgpu: Add VF Point boardobj set and get_status for PS3.5.
1. Update PMU VF interfaces for PS3.5
Added boardobjs for
nv_pmu_clk_clk_vf_point_volt_35_sec_boardobj_set
nv_pmu_clk_clk_vf_point_35_freq_boardobj_get_status
nv_pmu_clk_clk_vf_point_35_volt_pri_boardobj_get_status

2. Updated PERF Load commandfor TU104

nv_pmu_clk_clk_vf_point_35_volt_sec_boardobj_get_status

JIRA NVGPU-1152

Change-Id: Iefb39960038f2ef082450358da691699ba18fa2b
Signed-off-by: Vaikundanathan S <vaikuns@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1964927
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-02 12:14:54 -08:00
Deepak Nibade
ef580aee38 gpu: nvgpu: add new unit for GR global context buffers
Add new unit common/gr/global_ctx.c to manage GR global context buffers

This unit provides interfaces to allocate/free/map/unmap all the global
context buffers. It also provides APIs to get/set size of the buffers,
and to get memory handle of the buffers

Use interfaces exposed by this unit instead of directly accessing global
context buffers in common code

Add new header file include/nvgpu/gr/global_ctx.h to declare all the
interfaces.

Rename "struct gr_ctx_buffer_desc" to "struct nvgpu_gr_global_ctx_buffer_desc"
which holds all data for each global context
Remove void *priv since it is no longer used
Add size to the desc structure to store the requested size

Remove global_ctx_buffer_size from struct nvgpu_gr_ctx since it is no longer
used for any real purpose

Jira NVGPU-1625

Change-Id: I3feaf47bc2fdf192f36b136f2ef80a49d1782c5d
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977884
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>
2019-01-02 10:55:45 -08:00
Deepak Nibade
dcd3778b5e gpu: nvgpu: fix invalid TSG pointer
In gr_gp10b_set_cilp_preempt_pending() we already extract TSG pointer
by calling tsg_gk20a_from_ch() which safely returns correct TSG or
NULL in error case

But before calling g->ops.fifo.post_event_id() we again extract TSG
by directly accessing g->fifo.tsg array, and this could result in
getting invalid TSG pointer

Fix this by removing direct TSG extraction through g->fifo.tsg

Bug 2444819
Jira NVGPU-1601

Change-Id: I9d49b5309c74e162828e7cb7d97556aae939a07c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1984954
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Nitin Kumbhar <nkumbhar@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>
2019-01-02 09:45:23 -08:00
Deepak Nibade
2322cb131c gpu: nvgpu: fix channel reference leak in error case
In gr_gp10b_get_cilp_preempt_pending_chid(), we leak the channel
reference if tsg_gk20a_from_ch() returns NULL
Fix this by calling gk20a_channel_put() in error case

Bug 2444819
Jira NVGPU-1601

Change-Id: Ic5d036c6d043b0b95dd2a564afcc0add67c1ca02
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1984953
Reviewed-by: Konsta Holtta <kholtta@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-misra-checker <svc-misra-checker@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>
2019-01-02 09:45:20 -08:00
Seema Khowala
13aed4da44 gpu: nvgpu: remove log_fn prints in _gk20a_channel_from_id
Remove nvgpu_log_fn for _gk20a_channel_from_id as enabing log_fn
prints during debugging become very noisy due to these prints.

Change-Id: I52ef193d13af87924dbde59a55c892e98e95bc85
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1982263
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-02 08:35:28 -08:00
Deepak Nibade
bb677160e5 gpu: nvgpu: check tu104 specific timestamp buffer full error code
In gk20a_gr_handle_fecs_error(), we right now check the error code in
mailbox to identify if we hit timestamp buffer full error interrupt
This error code right now is hard coded to 0x26

But on Turing ucode this error code is set to 0x32

Add new HAL g->ops.fecs_trace.get_buffer_full_mailbox_val() to get
correct error code per platform and use this in
gk20a_gr_handle_fecs_error()

Bug 200471541
Bug 2469604

Change-Id: I7325354b39d35b1c8b218e554814316d22950469
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1978144
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-12-31 09:43:39 -08:00
Nitin Kumbhar
8a55a6066d gpu: nvgpu: check ce_app before deleting ce ctx
A null pointer is dereferenced while powering off dgpu. Check for
ce_app validity before accessing ce context.

[   84.379714] Unable to handle kernel NULL pointer dereference at
 virtual address 00000000
...
[   84.451065] Hardware name: e3550_t194a (DT)
[   84.454918] task: ffffffc7b209b600 task.stack: ffffffc7b2174000
[   84.460905] PC is at gk20a_ce_delete_context_priv+0x40/0x158 [nvgpu]
[   84.467181] LR is at gk20a_ce_delete_context_priv+0x40/0x158 [nvgpu]
...
[   84.572953] Call trace:
[   84.575627] [<ffffff80010aa098>] gk20a_ce_delete_context_priv+0x40/0x158 [nvgpu]
[   84.582600] [<ffffff800107f0a4>] nvgpu_remove_mm_ce_support+0x24/0x40 [nvgpu]
[   84.589318] [<ffffff800106a4ec>] gk20a_remove_support+0xa0/0x12c [nvgpu]
[   84.595629] [<ffffff8001086a04>] gk20a_free_cb+0x44/0x70 [nvgpu]
[   84.601227] [<ffffff8001087858>] gk20a_put+0x50/0x70 [nvgpu]
[   84.606567] [<ffffff800106de20>] nvgpu_pci_remove+0xc8/0x160 [nvgpu]
[   84.612430] [<ffffff800849ae54>] pci_device_remove+0x3c/0x104
[   84.617779] [<ffffff800869dbe4>] __device_release_driver+0x7c/0xfc
[   84.623634] [<ffffff800869dc88>] device_release_driver+0x24/0x38
[   84.629148] [<ffffff8008492f58>] pci_stop_bus_device+0x84/0xa4
[   84.635180] [<ffffff8008492f08>] pci_stop_bus_device+0x34/0xa4
[   84.641046] [<ffffff800849310c>] pci_stop_root_bus+0x48/0x70
[   84.646632] [<ffffff80084b0544>] dw_pcie_host_deinit+0x40/0x164
[   84.652516] [<ffffff8000c41aec>] tegra_pcie_attach_controller+0x1304/0x1c80 [pcie_tegra_dw]
[   84.660805] [<ffffff80086a6ce0>] pm_generic_runtime_suspend+0x28/0x48
[   84.667387] [<ffffff80086b2924>] genpd_runtime_suspend+0x90/0x218
[   84.673577] [<ffffff80086a8c44>] __rpm_callback+0x6c/0x94
[   84.678915] [<ffffff80086a8c90>] rpm_callback+0x24/0x78
[   84.684165] [<ffffff80086a9264>] rpm_suspend+0xf4/0x644
[   84.689329] [<ffffff80086a9a34>] rpm_idle+0x1b0/0x340
[   84.694581] [<ffffff80086a9c1c>] __pm_runtime_idle+0x58/0x90
[   84.700375] [<ffffff8000c3e19c>] tegra_pcie_detach_controller+0x30/0x267c [pcie_tegra_dw]
[   84.708669] [<ffffff800106f070>] nvgpu_pci_gpu_power_off+0x78/0x228 [nvgpu]
[   84.715671] [<ffffff800106f28c>] poweroff_store+0x6c/0xe0 [nvgpu]
[   84.721621] [<ffffff800869b020>] drv_attr_store+0x20/0x30
[   84.727153] [<ffffff800829ef74>] sysfs_kf_write+0x40/0x50
[   84.732656] [<ffffff800829e328>] kernfs_fop_write+0xb4/0x1d0
[   84.738334] [<ffffff80082162c4>] __vfs_write+0x40/0x140
[   84.743402] [<ffffff80082170b4>] vfs_write+0xa8/0x198
[   84.748581] [<ffffff800821852c>] SyS_write+0x5c/0xc4
[   84.753557] [<ffffff8008083480>] el0_svc_naked+0x34/0x38
...

JIRA NVGPU-1100
JIRA NVGPU-611

Change-Id: Ib539286668037f6e679c6c88e9afc40f53d9fe5b
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1980308
Reviewed-by: svc-misra-checker <svc-misra-checker@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
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-12-31 03:32:29 -08:00
Thomas Fleury
dcc9a8083b gpu: nvgpu: gv100: set min VBIOS version
nvgpu driver currently accepts any VBIOS version for GV100.
Set min VBIOS version to 88.00.59.00

Bug 2383514

Change-Id: Ia6ddc7c4ed2d9c26c8caec3beb3d9ff4cc5633a0
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1942194
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-31 03:31:58 -08:00
Nitin Kumbhar
bc0cf21cfb gpu: nvgpu: optimize dgpu gc off delays
Add separate delays for dgpu power off and reduce
those to 2ms.

JIRA NVGPU-1100

Change-Id: I08b2efb6d13f395e84b5c5de378288883294597f
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1947976
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-30 23:36:00 -08:00
Ranjanikar Nikhil Prabhakarrao
f0762ed483 gpu: nvgpu: add speculative barrier
Data can be speculativerly stored and
code flow can be hijacked.

To mitigate this problem insert a
speculation barrier.

Bug 200447167

Change-Id: Ia865ff2add8b30de49aa970715625b13e8f71c08
Signed-off-by: Ranjanikar Nikhil Prabhakarrao <rprabhakarra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972221
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-30 22:26:01 -08:00
Nitin Kumbhar
001dbdb2fc gpu: nvgpu: fix tegra_pcie_detach/attach_controller API for K4.14
For K4.14, the pci driver is enabled with CONFIG_PCIE_TEGRA=y. The
check of dummy APIs doesn't capture this config. Fix this to use
tegra_pcie_detach/attach_controller() APIs from the pci driver.

Bug 200480179
JIRA NVGPU-1100

Change-Id: I3a2b4f243dce6ead1174b12bc8ce2ffb6700c86b
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1982549
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:17:04 -08:00
Alex Waterman
5ac1e40296 gpu: nvgpu: MISRA rule 21.2 fixes in VM
Delete the '__' prefix from the following two functions:

  __nvgpu_vm_alloc_va()
  __nvgpu_vm_free_va()

JIRA NVGPU-1029

Change-Id: I02c6dcb9cbf744b830cacbd5b9ea621abe99e9a7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1974843
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@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
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:16:24 -08:00
Alex Waterman
1a611c9928 gpu: nvgpu: MISRA rule 21.2 fixes in VM
Rename misc static functions in vm.c to remove their '__' prefix.
This includes:

  __nvgpu_vm_free_entries() -> nvgpu_vm_do_free_entries()
  __nvgpu_vm_remove()       -> nvgpu_vm_remove()
  __nvgpu_vm_remove_ref()   -> nvgpu_vm_remove_ref()

JIRA NVGPU-1029

Change-Id: Id163a5e5437e94d87caeb74ef4c941907797cdc5
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1974842
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:16:16 -08:00
Alex Waterman
f4beed0eec gpu: nvgpu: MISRA rule 21.2 fixes in VM
Rename __nvgpu_vm_int() to nvgpu_vm_do_init().

JIRA NVGPU-1029

Change-Id: Iae8d8ff408d0721a8b7c5f3295875488fa8ccdc8
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1974841
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Long <scottl@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
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:16:13 -08:00
Alex Waterman
3417a3f5b6 gpu: nvgpu: MISRA rule 21.2 fixes in VM
Fix the unmap functions in the VM code. This renames:

  __nvgpu_vm_unmap()     -> nvgpu_vm_do_unmap()
  __nvgpu_vm_unmap_ref() -> nvgpu_vm_unmap_ref_internal()

JIRA NVGPU-1029

Change-Id: Ifc040d5d61a1214ef4ae076d090e585b3ae3d492
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1974840
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Long <scottl@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
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:16:09 -08:00
Alex Waterman
7b8f776822 gpu: nvgpu: MISRA rule 21.2 fixes in VM
Rename the __nvgpu_vm_find_mapped_buf*() functions to
nvgpu_vm_find_mapped_buf*(). This removes the '__' prefix.

JIRA NVGPU-1029

Change-Id: I7144e8705550c77d9169d5ac643b93507abbe56f
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1974839
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 16:16:05 -08:00
Thomas Fleury
78c513790a gpu: nvgpu: fix NVGPU_COND_WAIT_INTERRUPTIBLE
When called with timeout=0, NVGPU_COND_WAIT_INTERRUPTIBLE macro
ignores the return code from wait_event_interruptible. As a result
we do not detect when the call is interrupted, and the calling
process hangs.

Use wait_event_interruptible return code in case of infinite timeout.

Bug 200384829

Change-Id: I930f0d08c73a3b91ab20a6c8faaf633a3d7aee4d
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1982242
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Raghuram Kothakota <rkothakota@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@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-12-28 15:04:19 -08:00
Bharat Nihalani
99f36fba87 Restore "nvgpu: Change the path in the dependent files"
This reverts commit 98dca979d6.
The original commit was reverted because there was an issue
where commit "include: uapi: move nvhost user-interface headers" in
linux-nvidia repo caused DLA UMD driver to be exposed of including 
kernel headers directly.

Since then, DLA UMD driver has been fixed to use headers from
user-space code. And hence restore this change and commit
 "include: uapi: move nvhost user-interface headers" in linux-nvidia
repo.

Bug 200471393

Change-Id: Ic8627aca37422aad9b2549c9b7e6de1474d80af9
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1980596
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-28 02:34:01 -08:00
Anup Mahindre
49f2692bc0 gpu: nvgpu: Remove redundant warnings from gk20a_ctrl_dev_ioctl
Remove redundant warnings that are being generated when nvpgu is returning
proper error codes. Add nvgpu_warns instead.

Bug 200457091

Change-Id: Ida44cd6bd784ad4ce55b44a8cf974bb89a5f3301
Signed-off-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1980734
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
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-12-27 15:25:07 -08:00
Richard Zhao
f6874ca733 gpu: nvgpu: vgpu: remove gr_ctx handle
gr_ctx can be get from tsgid. RM server wouldn't have to maintain handle
of gr_ctx.

Jira GVSCI-179

Change-Id: Ie143fab1fce21b3f7bf468e12fab31af88d56d40
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977577
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aparna Das <aparnad@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-12-27 15:24:32 -08:00
Richard Zhao
3b75042842 gpu: nvgpu: vgpu: remove cmd TSG_BIND_GR_CTX
RM server only needed TSG_BIND_GR_CTX to set vm and tsg for gr_ctx. It
could be done when alloc gr_ctx, so removing TSG_BIND_GR_CTX.

Jira GVSCI-179

Change-Id: Ic7fdcceecd2fa0ea1f29a50b797c8261d6e0720b
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977576
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aparna Das <aparnad@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-12-27 15:24:28 -08:00
Richard Zhao
d37187f1f8 gpu: nvgpu: vgpu: remove cmd CHANNEL_BIND_GR_CTX
Since gr_ctx has been moved to tsg, channel bind gr_ctx does nothing on
RM server.

Jira GVSCI-179

Change-Id: I80025c66beb943e0fe0e4cbb84db1b16d3b34b5b
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977575
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aparna Das <aparnad@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-12-27 15:24:25 -08:00
Richard Zhao
e768a5b2ca gpu: nvgpu: vgpu: use tsgid to get gr_ctx for BIND_GR_CTXSW_BUFFERS
It's for getting rid of gr_ctx handle and gr_ctx management on RM
server. gr_ctx will be got from tsgid.

Jira GVSCI-179

Change-Id: Ifc82bac6941413c392c6e1994d5a79c961e05eb0
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977574
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Aparna Das <aparnad@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-12-27 15:24:21 -08:00
Nitin Kumbhar
7cec4ba326 gpu: nvgpu: add platform control for gc off
The GC-OFF feature shall be available only for selective
dGPUs like Volta, etc. To enable this, add a platform flag
to control GC-OFF feature for a given dGPU.

If GC-OFF is not enabled for a dGPU, EPERM error will be
returned by kernel interfaces.

JIRA NVGPU-1100

Change-Id: Ic9e4492b2bb8916d520e78ecb6a500ccd349b70c
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1923249
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-12-27 15:24:10 -08:00
Vaikundanathan S
4fcdc2771f gpu: nvgpu: Send Clock Load command to PMU
Clock command needs to be sent to PMU before
VFE computation.
Update Voltage step size to 6.25mV from 10mV

JIRA NVGPU-1150

Change-Id: I8f32313b2011050fdfeff7baba062239d620e51d
Signed-off-by: Vaikundanathan S <vaikuns@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972986
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-23 02:13:41 -08:00
Nicolas Benech
37bc782b46 gpu: nvgpu: Fix MISRA 17.7 in pmgr
MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch fixes the last violations in the pmgr module.

JIRA NVGPU-677

Change-Id: I4824fe73fefff802ae7bc4145049b4afd87eb222
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1978213
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
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-12-21 13:24:48 -08:00
Nicolas Benech
7dd186e754 gpu: nvgpu: Fix MISRA 17.7 pmu_wait_message_cond
MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. Most of the time, callers of pmu_wait_message_cond ignore the
return value. This patch changes the signature to return void, and adds
a new pmu_wait_message_cond_status for callers that need the return
information.

JIRA NVGPU-677

Change-Id: Ibaa15b04c4d40a7de73f39a7d6eb68f9e3da71f3
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1978211
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-21 13:24:44 -08:00
Alex Waterman
150905fff2 gpu: nvgpu: Combine else paths in nvgpu_assert()
The else path in the nvgpu_assert() call definition handles the
non-Linux kernel platforms. These platforms are generally safety
conscious and as a result care about MISRA scans and unit testing.
The static inline hides the BUG_ON() call from the unit test
branch analyzer and the MISRA analyzer. Note: the MISRA issue
still exists; however, it's just not seen when analyzing patches
that only use the nvgpu_assert() call.

This patch combines the __POSIX__ path with the general else path
to ensure that all non-Linux platforms use the aforementioned
static inline.

JIRA NVGPU-1246

Change-Id: I3f267224acd0b27429302118872c40ca6d7b9137
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1977276
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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-12-21 13:24:27 -08:00
Tejal Kudav
a307b6eb77 gpu: nvgpu: Move nvlink HAL files to common/nvlink
Move the nvlink HAL code to unit specific directory as part
of nvgpu restructing.
This move is done after removing usage of other unit's hardware
headers from nvlink. Also confirmed that no other unit files are
including nvlink hardware headers.

JIRA NVGPU-966

Change-Id: I301e3f8de37c5792a3e1e799b97e5fdfc131f058
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975259
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-21 13:24:19 -08:00
Scott Long
d5f26aa074 gpu: nvgpu: MISRA 10.1 fixes to pmu/sec2
MISRA Rule 10.1 states that operands shall not be of an
inappropriate essential type.

For example, the use of bitwise OR on signed values is not
permitted.

Both the pmu_read_message() and sec2_read_message() routines
do this in some cases when an error (or unexpected number of
bytes) is returned from the falcon queue pop/rewind routines.

This patch eliminates the MISRA violations by modifying these
cases to return the falcon queue operation error unmodified in the
corresponding status argument (or use -EINVAL in the event the
requested number of bytes isn't returned).

To reduce code duplication new pmu_falcon_queue_read() and
sec2_falcon_queue_read() routines are added here to wrap the
code that handles the error for the respective units.

Note that higher up in the call sequence (tu104_sec2_isr() in the
sec2_read_message() case and gk20a_pmu_isr() in the pmu_read_message()
case) the actual status value is only checked for non-zero or ignored
altogether.  So it appears no existing code would depend on the
bitwise OR result anyway.

JIRA NVGPU-650

Change-Id: Id303523ac096f1989e612044082e0a62ae8179c2
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972624
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-12-21 13:24:10 -08:00
Preetham Chandru R
9ad31113e8 gpu: nvgpu: RDMA implementation
This change adds RDMA supports for tegra iGPU.
1. Cuda Process allocates the memory and passes
   the VA and size to the custom kernel driver.
2. The custom kernel driver maps the user allocated
   buf and does the DMA to/from it.
3. Only supports iGPU + cudaHostAlloc sysmem
4. Works only for a given process.
5. Address should be sysmem page aligned and size should
   be multiple of sysmem page size.
6. The custom kernel driver must register a free_callback when get_page()
   function is called.

Bug 200438879

Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Change-Id: I43ec45734eb46d30341d0701550206c16e051106
Reviewed-on: https://git-master.nvidia.com/r/1953780
(cherry picked from commit d6278955f6)
Reviewed-on: https://git-master.nvidia.com/r/1821407
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-21 05:35:45 -08:00
Mahantesh Kumbar
18299e0f86 gpu: nvgpu: remove unnecessary error print of falcon queue
-For queue full there is pmu_dbg message & returned with
 EAGAIN error to end caller for retry, so intermediate error
 message is not correct print for queue full.

Bug 200477931
Bug 200475876

Change-Id: I263f66f7a8d8f1b98985f32f9daa49b09309c359
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1976889
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@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-12-20 21:46:55 -08:00
rmylavarapu
604170d30f gpu: nvgpu: Port nvgpu to support GV100 from r400
Changes
1. Corrected VF point boardobject get status offset in Super surface structure.
2. RPC command ID values for Perf unit is different from R400 firmware. Updated with the correct values.
3. Update the PMU firmware with version number: 25133717

PMU firmware can be taken from P4CL #25453641

JIRA NVGPU-1604

Change-Id: I307fa4b643cdf827a223ec0530fe4851b4592df5
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975886
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaikundanathan S <vaikuns@nvidia.com>
Tested-by: Vaikundanathan S <vaikuns@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-12-20 21:46:43 -08:00
tkudav
c6e021589e gpu: nvgpu: PS3.5 VFE VAR and EQU changes
Changes between GV100 and Turing VFE pstate tables-
1. PS3.5 ucode packs two sets of vfe boardobjgrp - primary and
   rppm in new struct whose name is appended with suffix pack. The
   rppm (runtime power and performance model) set is needed to
   achieve Max Q. The rppm set is not relevant to Automotive SKUs and
   entries are set to 'disabled'. But the turing ucode in R400 uses
   the 'pack' struct to calculate supersurface offset and size of
   vfe_var/equ boardobjgrp.
2. Header size has been increased to add RPPM related VFE variable
   and equation count.

VFE Variables boardobjgrp specific changes-
1. New var type 'single caller specified' had been added to represent
   generic type of variable which is not associated with voltage or
   frequency but identified by a Unique ID.
2. The frequency variable type can be associated with a clock domain,
   if the clock domain index availability flag is set.

VFE Equations boardobjgrp specific changes-
1. New entry type 'scalar' had been added to allow scaling equation
   pointed by 'equ_idx_to_scale'.
2. More ouput types are added to represent the equation evaluation
   results.

We modify the nvgpu Turing driver and GV100 ucode to adapt to these
changes.
This patch also fixes some MISRA defects in touched files.

JIRA NVGPU-1178

Change-Id: I90910ac8dccf0b98a588cbc442dc11ac4fbd2e61
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1928999
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaikundanathan S <vaikuns@nvidia.com>
Tested-by: Vaikundanathan S <vaikuns@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-12-20 21:46:29 -08:00
Seeta Rama Raju
49d3881f36 gpu: nvgpu: include: fix MISRA 10.4 Violations
Adding "U" at the end of the integer literals to have
same type of operands when an bitwise operation is performed.

JIRA NVGPU-1468

Change-Id: I283496e4973ae9567334d365d10a38d273355446
Signed-off-by: Seeta Rama Raju <srajum@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1964166
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
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-12-20 16:25:32 -08:00
tkudav
f6df40f945 gpu: nvgpu: Use device_info parsing HAL for nvlink
Nvlink related information like pri_base, reset and intr enum etc.
is present in device_info table under the engine_type = IOCTRL.
Update the nvlink code to use the HALs exposed by "Top" unit to get
the above described information.

JIRA NVGPU-966

Change-Id: Ie2247cfbcc42bf7b7e8280e2e678086ef06a474c
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1969401
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-12-20 09:26:04 -08:00
tkudav
3267530f22 gpu: nvgpu: Use device_info parsing HAL for Fifo
Update the fifo code to use the HALs exposed by "Top" unit to
read data from device_info table.

The information for GRAPHICS engine in device_info table is
now parsed using the get_device_info HAL from "Top" unit.

Copy engine(CE) has multiple entries in the device_info table
corresponding to each instance of the engine. Prior to Pascal, each
instance of an engine was denoted by different engine type.
For example in GM20B, there are engine types like COPY_ENGINE0,
COPY_ENGINE1 and so on. In Pascal and chips beyond, a new field
called "inst_id" is added and the engine_type is kept the same for
different instances of an engine. For example in GP10B, all copy
engine entries have same engine type i.e ENGINE_LCE, but different
inst_ids. So for Pascal and chips beyond, we use a different HAL to
get CE information from device_info table.

JIRA NVGPU-1053

Change-Id: Ib40a616d903a5dbef5730678c2ebc3454b8e900d
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1969400
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-12-20 09:26:01 -08:00