Commit Graph

2340 Commits

Author SHA1 Message Date
David Nieto
5fb7f2a262 gpu: nvgpu: Propagate pmu initialization failures
During testing it was detected that a failure in loading the firmware
for the driver would not propagate, allowing some function pointers to
be left unitialized. This would cause a kernel-crash later on.

Bug 1866370

Change-Id: I66056a1d99229d10635293d4c1685f596f197255
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1295376
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-31 09:17:59 -08:00
Srikar Srimath Tirumala
c71346ad94 gpu: nvgpu: enb TEGRA_USE_NA_GPCPLL for T210 K4.4
T210 K4.4 uses common clock framework instead of Tegra Clock
Framework. Fix the config dependency to address this.

Bug 200233943

Change-Id: I2ed61153ca9475f895593ca7c22fd9cdcf6f3534
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1266180
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-30 16:34:52 -08:00
Srikar Srimath Tirumala
0efedacffd gpu: nvgpu: fix DEVFREQ init on T210 K4.4
Devfreq and gpcclk require GPU v/f tables for registering correctly.
Fix this by deferring the nvgpu_probe if GPU-DVFS is not completely
initialized. Change applicable to kernels with Common Clock Framework
enabled.

Bug 200233943

Change-Id: I82dadc1b0970d47e839d6bec935330966402e93b
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280832
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:52 -08:00
Srikar Srimath Tirumala
8aadf311d5 gpu: nvgpu: allow defer probing to work
Platform probe can return a EDEFER_PROBE, perform user init only if
platform probe is successful so that all the device objects are
created only once.

Bug 200233943

Change-Id: If6f41af13c29d070743896f26e6650228153027b
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280831
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:46 -08:00
Srikar Srimath Tirumala
2f74512a09 gpu: nvgpu: use gm20b.gbus instead of gpcclk
DVFS constraints for GPU are applied on gbus not on gpcclk. Make T210
K4.4 use gm20b.gbus to change the GPU clk rates and use its parent
clock gbus while querrying DVFS constraints for the GPU.

Bug 200233943

Change-Id: I2bad3266d6b8f8f3806a0d4249d9b40308c2ee6a
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1275926
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:41 -08:00
Srikar Srimath Tirumala
0aba2e99d0 gpu: nvgpu: fix gm20b round rate ops
Make the clk_round_rate ops consider the max rate supported by DVFS
while calculating the max frequency.

Bug 200233943

Change-Id: Ib36a40a29cb16231dd1442aa652a20819e0f4016
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1281552
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:35 -08:00
Srikar Srimath Tirumala
60c6621297 gpu: nvgpu: move gpcclk sw init to probe time
Move the sw initialization of gpcclk to probe time so that gpcclk is
ready to use before first rail ungate. Change is applicable only for
platforms with CCF enabled.

Bug 200233943

Change-Id: I7b322215041c0b88e9e2a37567af408fbbc31dc1
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280830
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:30 -08:00
Srikar Srimath Tirumala
fef62b02ab gpu: nvgpu: add missing header
Allow NA_GPCPLL to be enabled on T210 K4.4

Bug 200233943

Change-Id: I5ea0b9d1de51b510f5c6671339dee2953bf1ec80
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280829
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:24 -08:00
Srikar Srimath Tirumala
0bce5edd92 Revert "gpu: nvgpu: fix round_rate ops for CCF"
This reverts commit 34d8421ab4.

Bug 200233943

Change-Id: Id03b7922c955d252aff54e6bbd8163926bdc65fb
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280828
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:19 -08:00
Srikar Srimath Tirumala
702ed11f94 Revert "gpu: nvgpu: fix gpcclk for K4.4"
This reverts commit a918003694.

Change-Id: Idf39cc0946c5c4df82c7c4b6afa225b1f8d5a923
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1280827
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-30 16:34:12 -08:00
Terje Bergstrom
cf8d9ccf8e gpu: nvgpu: Base channel watchdog on gp_get
Instead of checking if a job is complete, only check that channel is
making progress by checking its gp_get is advancing.

This will make the watchdog conservative. Previously a whole job had
x seconds to complete. Now channel has x seconds to get host to
consume each push buffer segment.

Bug 1861838
Bug 200273419
Bug 200263100

Change-Id: I70adc1f50301bce8db7dac675771c251c0f11b70
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1294850
Reviewed-by: Automatic_Commit_Validation_User
2017-01-30 09:53:43 -08:00
Konsta Holtta
ed22056779 gpu: nvgpu: add disable_syncpoints debugfs node
To test semaphore-related bugs with igpus, add a debugfs node called
"disable_syncpoints" to override the "has_syncpoints" platform flag.
This makes job synchronization use semaphores, for example.

NVGPU_GPU_FLAGS_HAS_SYNCPOINTS is still reported in gpu characteristics
if the platform supports that, because it is filled in during boot.

Jira NVGPU-18

Change-Id: I58c815f896a6054df472f571012c239f1478bf07
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1293972
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-27 13:54:41 -08:00
seshendra Gadagottu
88ce7a98c8 gpu: nvgpu: update zcull and pm context pointers
Update zcull and perfmon buffer pointers in context
header through function pointers.

JIRA GV11B-48

Change-Id: Iaa6dd065128cb0c39e308cecf17b9d68a826d865
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1291850
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-27 12:23:01 -08:00
Terje Bergstrom
fa3f8cc101 gpu: nvgpu: Remove circular dependency in PMU includes
Remove including gk20a.h from pmu_gk20a.h. This causes a fallout
as some #includes were missing.

gr_gp10b.h uses mem_desc, but did not include mm_gk20a.h. Add the
include.

Including mm_gk20a.h in gr_gp10b.h causes recursive include, as
mm_gk20a.h has some gr defines. Move the defines to gr_gk20a.h to
remove the dependency.

gr_ctx_gk20a.h used struct gk20a pointers, but did not forward
declare it. Add a forward declaration.

gr_gk20a.h uses dbg_session_gk20a, but was missing forward
declaration.

gr_gk20a.h did not include nvgpu.h but it uses preemption types from
that header. Add include.

Change-Id: I2168e2303b55e0d187b816bcb26f37c8af1649ba
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1283717
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
2017-01-27 10:53:25 -08:00
Terje Bergstrom
c05cfcb576 gpu: nvgpu: gp106: Generate new gp106 headers
Hardware headers have been outdated. Regenerate with newest tool.
At the same time correct the incorrect usage of fuse fields.

JIRA DNVGPU-172

Change-Id: If190bf0cf2e41d525e6ea374a30efd1f63963e5e
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1294267
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-26 14:12:22 -08:00
Terje Bergstrom
e52c6ac1f2 gpu: nvgpu: Bump semaphore timeout
Semaphore acquire timeout is configured to half of watchdog timeout.
This is too short, so bump it to 80% of watchdog timeout.

Bug 200261389

Change-Id: Ie906ea3d3520c2e3f547cff7ffbb1e37459e6d2f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1283623
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-26 12:52:55 -08:00
Terje Bergstrom
a2d7dfdfb4 gpu: nvgpu: Skip checking for null in error path
vfe_var_construct_single_sensed_fuse() first constructs boardobj and
then does further validity checks. If the checks fail, it calls exit
label. The exit label checks if boardobj is NULL and calls destructor
if it is.

As there is no path to get to exit label with boardobj NULL, skip
the check.

Coverity ID 2011368

Change-Id: Ifea931113a7b862830b4b3f9852d9c16310a1549
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291685
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-26 10:53:06 -08:00
Terje Bergstrom
52ecd593c2 gpu: nvgpu: Skip checking for null in error path
clk_prog_construct_1x_master_table() first constructs boardobj and
then allocates further structures. If the further allocation fails,
it calls exit label. The exit label checks if boardobj is NULL and
calls destructor if it is.

As there is no path to get to exit label with boardobj NULL, skip
the check.

Coverity ID 2011367

Change-Id: Ic157397ca42d26b7640f7b28f6a9fb929d517412
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291684
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-26 10:53:06 -08:00
Terje Bergstrom
8fa68aeb04 gpu: nvgpu: Free nvgpu_clk_dev in case of error
If nvgpu_clk_arb_install_fd() gets an error from
nvgpu_clk_notification_queue_alloc(), it fails to free the
nvgpu_clk_dev that it allocated earlier.

Direct the error case to call an appropriate fail label.

Coverity ID 1862040

Change-Id: I1d804d4f5261ec64831938f997f9efc3f2700b60
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291683
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-26 10:53:06 -08:00
Terje Bergstrom
29400cbbae gpu: nvgpu: Free board_obj_ptr in case of error
If construct_clk_prog() gets an error reported in status, it returns
NULL instead of the constructed board_obj_ptr.

Call a destructor to prevent leaking any possibly constructed
board_obj_ptr.

Coverity ID 490171

Change-Id: Icf359da6511b108a03dd86d4556c5cbb288e90de
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291682
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-01-26 10:53:06 -08:00
David Nieto
6343e96f37 gpu: nvgpu: Disable ECC sysfs in GP106
The current wiring causes an attempt to re-create the
stats on dGPU re-bind

bug 1816516

Change-Id: Idb9aea08c9f80325f6ce860b2e0e482e42e973f8
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1291822
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-26 07:18:15 -08:00
Deepak Nibade
b11cc77414 Revert "Revert "gpu: nvgpu: gp10b: fix freq rounding""
This reverts commit 28fb1de00a.

Instability on Quill-B00 is now resolved, and hence restore
original patch reviewed on http://git-master/r/#/c/1284302/

Bug 1864117
Bug 1863013

Change-Id: Ie5aa5a5f0184f3aa4db2d08f041f623de92b3dea
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1291513
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-01-25 02:41:03 -08:00
Deepak Nibade
74948b73e3 Revert "nvgpu: gp10b: remove EMC floor when GPU Fmin"
This reverts commit c58da17d13.

With original patch, we request 0 emc for minimum GPU
frequency, and this causes instability on Quill-B00

Hence revert this patch

Original patch : http://git-master/r/#/c/1284572/

Bug 1864117
Bug 1863013

Change-Id: I45aadba4614286f04b29a5abb7432d03d99ed6c1
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1291512
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-01-25 02:41:03 -08:00
Deepak Nibade
8613119529 gpu: nvgpu: add target refcount for gk20a_wait_for_idle()
API gk20a_wait_for_idle() right now always waits for
0 usage count

But in case railgating is disabled through sysfs,
usage count will never get to 0
Hence in this case we should wait for usage count
of 1

If platform->user_railgate_disabled is set,
keep target usage count of 1, otherwise keep
target usage count as 0

Bug 200260926

Change-Id: I1a80621ca61babbd6566989dc09a7b20670c649c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1291421
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-25 02:41:02 -08:00
Aparna Das
bad0572cb1 gpu: nvgpu: vgpu: retrieve gpu load
Add support to send command to RM server to retrieve
GPU load.

Bug 200261903

Change-Id: Ie3d0ba7ec91317e9a2911f71613ad78d20f9c1fb
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: http://git-master/r/1275045
(cherry picked from commit 5a6c1de1e6997bfd803b4b95b3e44e282ba32f67)
Reviewed-on: http://git-master/r/1283279
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-24 16:24:12 -08:00
Alex Waterman
4feb078717 gpu: nvgpu: Make driver rebind work
Make the GPU bind and rebind operations work when the driver
is idle. This required two changes.

1. Reset the GPU before doing SW init for PCI GPUs. This clears
the SW state which may be stale in the case of a rebind attempt.

2. Cleanup the interrupt enable/disables. Firstly there was one
place where nvgpu would accidentally disable the stalling
interrupt twice when the stalling interrupt and non-stalling
interrupt are the same. Secondly make sure when exiting nvgpu
that the interrupt enable/disables are balanced. Leaving the
interrupt in the -1 disable state means that next time the
driver runs interrupts never quite get enabled.

Bug 1816516

Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1287643
Reviewed-on: http://git-master/r/1287649
(cherry picked from commit aa15af0aae5d0a95a8e765469be4354ab7ddd9f8)
Change-Id: I945e21c1fbb3f096834acf850616b71b2aab9ee3
Reviewed-on: http://git-master/r/1292700
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 15:15:22 -08:00
Alex Waterman
6715361156 gpu: nvgpu: Add GPU reset for gp106 XVE
Resets the GPU without resetting the XVE/XP interfaces. This allows
the GPU to stay attached to the PCI bus but still resets all the rest
of the GPU's internal state.

Bug 1816516

Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1287644
Reviewed-on: http://git-master/r/1287650
(cherry picked from commit c14efaee5d03a053d5bf229425a7594e1c6bfad0)
Change-Id: If7aba3cc8109e30bd6b6aa145836e812d50b35c5
Reviewed-on: http://git-master/r/1292699
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 15:15:22 -08:00
Alex Waterman
efe3266431 gpu: nvgpu: Add GPU reset to XVE
Add a full GPU reset function to the XVE block. This allows
the driver to reset the GPU (except the XVE and XP interfaces)
to clear the GPU's state.

This is necessary for the GPU rebind to work. The state of the
GPU needs to be cleared before the new driver instance can work.

Bug 1816516

Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1287642
Reviewed-on: http://git-master/r/1287648
(cherry picked from commit 7e751c0eb2c0f7d9d0b2020600c33fc8b4381878)
Change-Id: Ie2b721bf1b40acbab34de2436dea4e70d33b5611
Reviewed-on: http://git-master/r/1292698
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 15:15:22 -08:00
Alex Waterman
d2b851533b gpu: nvgpu: Use correct class for driver de-init
When removing the driver nodes make sure to use the correct class
to free the dev-node.

Bug 1816516

Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1287641
Reviewed-on: http://git-master/r/1287647
(cherry picked from commit acf97306b4950d8397bb511784b3391a3530ff77)
Change-Id: I983a2106eff6f4839c52a2e16bdd036facb501c0
Reviewed-on: http://git-master/r/1292697
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 15:15:22 -08:00
Alex Waterman
90cfbc530e gpu: nvgpu: Add t19x nvgpu include path
This is necessary for building t19x with the new header
file organization.

Bug 1799159

Change-Id: I722146219ef22f79aa2f22614d11d44555fc9e5e
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1284432
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-24 15:15:11 -08:00
Mihir Thakkar
bbc2342331 gpu: nvgpu: Debug spew for context priority & Gfxp
Prints out Timeslice value, Interleave level, Graphics preemption
mode and compute preempt mode along with chid, tsgid, pid.

Enable it with setting dbg_mask with 8192

Bug 1855710

Change-Id: I60efef9810587f8fedd4e2ba62ba67d06d84faea
Signed-off-by: Mihir Thakkar <mthakkar@nvidia.com>
Reviewed-on: http://git-master/r/1287141
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 14:06:06 -08:00
Seema Khowala
16bf1e9416 gpu: nvgpu: Add null check for g->host1x_dev
gk20a_tegra_dump_debug() is set in a platform where host1x support
is not enabled.

Change-Id: Ic57f9081d75be976a092827b253cb2a195d8f16d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1284336
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-24 14:05:54 -08:00
Thomas Fleury
a86122e01a gpu: nvgpu: read overcurrent policy from VBIOS
Since pwr_sensors, pwr_topology_ and pwr_policy_* tables in bios.h
are not defined as packed, nvgpu driver is not able to find hw
threshold pwr_policy table in VBIOS and ends up hard coding the HW
thershold policy.
Changed definitions to packed, and explicitly unpack structures
when parsing the power policy table. Removed the function that
did the hard coding.

Jira DNVGPU-206

Change-Id: Idc2b5b5c86ddfe735631190dda10218cc462be3b
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1290303
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
2017-01-23 05:53:55 -08:00
seshendra Gadagottu
8b4aadaadd gpu: nvgpu: restore golden context without bind
Copy and restore golden context correctly with
context header. Removed parallel fecs bind method,
which can cause issues for context in execution.

Also added function pointer to freeing context
header during channel context free.

Bug 1834201

Change-Id: I7962d68338d5144f624375ab81436e86cb31051e
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1275201
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-20 10:54:17 -08:00
Deepak Nibade
d0e3e66885 gpu: nvgpu: compare rounded freq to last value
We right now compare requested value to the last
freq value. Last freq value is always a rounded
value, whereas requested value need not be a
rounded value

Hence it is incorrect to compare requested value
to last freq value

Fix this by comparing rounded value to last_freq

Change-Id: I7c6ea7c4e57105598c9af75efe70016b7fa8038b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1287360
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-20 09:45:19 -08:00
Shardar Shariff Md
a470647ad7 gpu: nvgpu: use soc/tegra/chip-id.h for soc header
The soc tegra headers are unified and moved all the content of
linux/tegra-soc.h to the soc/tegra/chip-id.h to have the
single soc header for Tegra.

Change-Id: I281e19dd3eb1538b8dfbea4eb0779fb64d1fcffa
Signed-off-by: Shardar Shariff Md <smohammed@nvidia.com>
Reviewed-on: http://git-master/r/1288365
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-20 08:24:01 -08:00
Laxman Dewangan
9e5208f634 drivers: gpu: nvgpu: Use soc/tegra/fuse.h for fuse header
The fuse headers are unified and moved all the content of
linux/tegra-fuse.h to the soc/tegra/fuse.h to have the
single fuse header for Tegra.

Use unified fuse header soc/tegra/fuse.h.

bug 200260692

Change-Id: Icab3ba5c3dbcd3fa831455c2f336942d356ff5ac
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1287498
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-19 00:04:59 -08:00
Vijayakumar
54534ee1a9 gpu: nvgpu: pmu version update
bug 200269171

Updating PMU firmware to fix voltage raise when switching mclk to 810mhz
with CLFC and MSCG enabled. The fix is to make sure that clock domain is
not evaluated in CLFC if MSCG has engaged anytime after the previous
evaluation

Change-Id: I2b6979ed3361f47273f2643c27c005deac49dc8b
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1286437
(cherry picked from commit dbfccb42614ec9361628b3c3427a65d3fe908597)
Reviewed-on: http://git-master/r/1287461
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 22:26:34 -08:00
David Nieto
d505e7f685 gpu: nvgpu: fix failures in VF table update
The variable indicating the size of the buffer for GPC vf points
was not reset before the query, thus sporadic failures could
happen if the number of available VF points changed on an update

Maximum number of points increased to 256. This is the maximum
that can fit in the boardobj table

bug 200269804

Change-Id: Icb4ae386135a9bb40d4345eb73c5584fecd79147
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1286028
Reviewed-on: http://git-master/r/1287589
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-18 16:47:42 -08:00
Konsta Holtta
bf0a666be0 gpu: nvgpu: fix dev_info typo in refcount tracking
The recently added refcount tracking support had a slight mishap in
refactoring some printks. Fix a typo to make the support compile again
when enabled.

Bug 1826754

Change-Id: Ifd76d644932fa219751db82a0beb3c8482ea68c3
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1285922
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:47:32 -08:00
Deepak Goyal
bbea338b44 nvgpu: pmu: Update perfmon unit ID for T19x.
update perfmon id for t19x in get_perfmon_id().

JIRA GV11B-30

Change-Id: I7c76b49cc47f8de1e6fa9492e2986830dcff901f
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1284763
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:47:25 -08:00
Deepak Goyal
fbc713e22a nvgpu: gp10b: Use gops to call pmu_bootstrap().
gops should be used to call non-secure pmu boot
functions instead of using direct func() names.

JIRA GV11B-30

Change-Id: I27da3b84b61eb978965ae9325ba58e2d02bc6ede
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1282552
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:55 -08:00
Deepak Goyal
a69fa0e96c nvgpu: pmu: Use ops to get PMU queue HEAD/TAIL.
pmu_queue_head() & pmu_queue_tail() are updated
to use gops to include chip specific PMU queue
head/tail registers.

JIRA GV11B-30

Change-Id: I9c3d6a4601ba2767f9ada95642052044e2b79747
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1283266
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:50 -08:00
Alex Waterman
8e53d79090 gpu: nvgpu: Use timer API in gm20b code
Use the timer API instead of Linux specific APIs for handling
timeouts.

Also, lower the L2 timeout from 1 second (absurdly long) to 5ms.

Bug 1799159

Change-Id: I27dbc35b12e9bc22ff2207bb87543f76203e20f1
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1273825
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:38 -08:00
Alex Waterman
6e2237ef62 gpu: nvgpu: Use timer API in gk20a code
Use the timers API in the gk20a code instead of Linux specific
API calls.

This also changes the behavior of several functions to wait for
the full timeout for each operation that can timeout. Previously
the timeout was shared across each operation.

Bug 1799159

Change-Id: I2bbed54630667b2b879b56a63a853266afc1e5d8
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1273826
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:33 -08:00
Alex Waterman
8f5a42c4bf gpu: nvgpu: Add include to t19x
Add the general drivers/gpu/nvgpu/include path to the t19x search
list for include files.

Bug 1799159

Change-Id: I832a65afbbf3176cc14e28cade615af67bb0ceaf
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1280889
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-18 16:46:27 -08:00
Deepak Goyal
eba4aba00c nvgpu: pmu: Add support for new PMU ucode.
-GV11B PMU ucode is added in nvgpu supported
 ucodes.
-PMU INIT msg structure(v4) is added

JIRA GV11B-30

Change-Id: Ifced87b1ca2692c277ae11f562cb36b328da3fe4
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1259274
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:27 -08:00
Seema Khowala
911dcedb48 gpu: nvgpu: support t19x zbc
Added infrastructure for supporting
new zbc features

JIRA GV11B-9

Change-Id: Id8408348759488e8b0393dd89dd0faacfb111f01
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1235525
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-01-18 16:46:15 -08:00
Alexander Van Brunt
28fb1de00a Revert "gpu: nvgpu: gp10b: fix freq rounding"
This reverts commit 157ff622f3.

Bug 1863013

Change-Id: I38abeb4ff729d9d7b9a7e8dc2fde708f8ace6feb
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/1287613
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Tested-by: Juha Tukkinen <jtukkinen@nvidia.com>
2017-01-18 13:24:02 -08:00
Deepak Nibade
72f27f7747 gpu: nvgpu: serialize debug session IOCTLs
Hold debug_s->ioctl_lock for all debug session
IOCTLs to prevent multi-threaded user space
IOCTL calls

debug session IOCTL calls are not thread-safe
and hence this serialization is required

Bug 1832267

Change-Id: I847ac951601d4f0093546b592bdb8c8f00185317
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1286436
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-17 10:44:20 -08:00