Commit Graph

2396 Commits

Author SHA1 Message Date
Thomas Fleury
0a6b585dbf gpu: nvgpu: skip power device programming if missing
Monitoring INA3221 is currently missing on some customer
designs. If power device is missing, skip programming
of power device and power policy in PMU. Also clear
related features in GPU characterictics (get voltage,
current and power features are not supported).

Bug 1903258

Change-Id: Ibd9d89e5833afb350c52b76527c54923055aee5e
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1459919
(cherry picked from commit e7e21c451843bddb8e8ac9e3db3b1d4b4a4c272c)
Reviewed-on: http://git-master/r/1463105
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-18 12:44:21 -07:00
Thomas Fleury
90a249b598 gpu: nvgpu: missing power sensor detection
Monitoring INA3221 is currently missing on some customer designs.
Use PCI vendor/device ids and VBIOS version to identify such device,
and set power_sensor_missing flag. This flag is subsequently used
to skip power device and power policy programming in PMU.

Bug 1903258

Change-Id: Ia6b5ce563b5cc3593e138635639025b830e4535e
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1460936
(cherry picked from commit 42f236c210931d28d2699858bb0663b91cf11046)
Reviewed-on: http://git-master/r/1463104
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-18 12:44:21 -07:00
Deepak Nibade
07b15f68c7 gpu: nvgpu: use nvgpu rbtree for kmem allocator
Use nvgpu rbtree instead of linux rbtree for kmem allocator
Move to use nvgpu_rbtree_node structure and
nvgpu_rbtree_* APIs

Jira NVGPU-13

Change-Id: I3403f93bc32fd1b05f35c46ee6a77e9375b62a2f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1457860
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-04-18 01:15:13 -07:00
Deepak Nibade
e65893db0c gpu: nvgpu: use nvgpu rbtree for bitmap allocator
Use nvgpu rbtree instead of linux rbtree for bitmap allocator
Move to use nvgpu_rbtree_node structure and
nvgpu_rbtree_* APIs

Jira NVGPU-13

Change-Id: I25543cd737ed16728a67b42f70c4d233b8cc2a63
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1457859
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-04-18 01:15:12 -07:00
Deepak Nibade
486173a000 gpu: nvgpu: use nvgpu rbtree for page allocator
Use nvgpu rbtree instead of linux rbtree for page allocator
Move to use nvgpu_rbtree_node structure and
nvgpu_rbtree_* APIs

Jira NVGPU-13

Change-Id: I3faf843762652c6005186cbe715377050f65ee2c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1457858
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2017-04-18 01:15:12 -07:00
Deepak Nibade
26deb61b3b gpu: nvgpu: Add wrapper nvgpu/kref.h
Add wrapper header file nvgpu/kref.h.
It #includes <linux/kref.h> in Linux.

JIRA NVGPU-13

Change-Id: Ib8b002268b1960646986551ecb9f286e1e21e7f6
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1463770
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-17 17:36:20 -07:00
Terje Bergstrom
001f19af43 gpu: nvgpu: Remove the old error macros
Remove old gk20a_err() and gk20a_warn as they're no longer
used.

JIRA NVGPU-16

Change-Id: Id07aae20648631ef5aa0ee47d6a935055ce784dd
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457358
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-17 17:36:08 -07:00
Peter Boonstoppel
278b765836 gpu: nvgpu: Fix submit profiling stat reporting
The debugfs submit profiling stats report the distribution of submit
times at different percentiles. The original code reports the lowest
entry in every percentile-bin as being representative for that
bin. This means that where debugfs reports the 50th percentile, it
actually reports the ~45.001th percentile. This is especially
inconveniant when looking at the 100th percentile, which does not in
fact reflect the maximum.

This patch changes the code to instead report the highest entry in
every percentile-bin.

Change-Id: Ibde3aaf6445e08af09a4a96156f8421cbeb8bae5
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-on: http://git-master/r/1461658
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-17 08:14:22 -07:00
Deepak Goyal
4ba206aacc gpu: nvgpu: Use PMU ver to check ZBC support.
From Volta onwards, new DSS ZBC registers are
added for ZBC feature and save/restore of new
ZBC reglist is taken care by ctxsw firmware.
Therefore, PMU should save ZBC reglist only
for PRE-volta chips.

JIRA GPUT19X-20

Change-Id: I7d92274208ca42cc77bf57ea3cc416b5ecf32842
Signed-off-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-on: http://git-master/r/1460244
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-17 08:14:17 -07:00
Seema Khowala
59d2c753a0 gpu: nvgpu: remove *channel_poll_timeouts* debug print
uart is littered with gk20a_channel_poll_timeouts prints if nvgpu_dbg_mask
has gpu_dbg_fn bit set. This function is looping every living kernel
so removing this print in order to not keep uart busy printing it.

Change-Id: I0a02f32140573ee088e46bf6869bff7ffcb1a429
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1455081
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-16 17:54:20 -07:00
Seema Khowala
f927fcd945 gpu: nvgpu: fix sparse errors
add static keyword for functions/arrays not being used outside
fifo_gk20a.c

Bug 200067946

Change-Id: I016f60fa7925c1bc07620fa1e851a904b2403923
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1463155
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-16 16:45:49 -07:00
Seema Khowala
c8821f49ba gpu: nvgpu: fpga: set gr_idle_timeout_default
set gr_idle_timeout_default to 100000 ms instead of MAX_SCHEDULE_TIMEOUT,
and enable timeouts_enabled

Change-Id: I0b4d014dc6f3fc3c365214f7ffad7af054f771b9
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1458178
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-16 16:45:49 -07:00
Thomas Fleury
1d95b96652 gpu: nvgpu: fix pid mapping for dGPU FECS traces
For dGPU, instance block is in vidmem, and context_ptr
was not properly computed, leading to reporting pid=0 in
FECS traces.
Use gk20a_mm_inst_block_addr, which handles all cases
to determine instance block physical address.

Bug 1899195

Change-Id: If003d9f00aff66d808e66c06baf6ded38699981a
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1461646
(cherry picked from commit 0a58c5ace0)
Reviewed-on: http://git-master/r/1462396
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-14 12:14:24 -07:00
Richard Zhao
4aec9b0233 gpu: nvgpu: early return in gk20a_pm_shutdown for vgpu
vgpu currently has nothing to clean up for shutdown.

Jira VFND-3987

Change-Id: I94b55b37c39642d4b0478b8a4018d2a35fe65c2d
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1460800
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-14 11:04:12 -07:00
Terje Bergstrom
69297c0932 gpu: nvgpu: gp106: Use new delay APIs
Use platform agnostic delay functions instead of Linux kernel APIs.
This allows removing dependency to Linux header linux/delay.h. At the
same time remove #include lines for other unused Linux headers.

JIRA NVGPU-16

Change-Id: I54db15d9abf578ec334b100635baec214fe22af5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460116
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2017-04-13 13:44:41 -07:00
Terje Bergstrom
a32ec94eb4 gpu: nvgpu: gm206: Use new delay APIs
Use platform agnostic delay functions instead of Linux kernel APIs.
This allows removing dependency to Linux header linux/delay.h. At the
same time remove #include lines for other unused Linux headers.

JIRA NVGPU-16

Change-Id: I4099070fecde3f55ee1c99ee1b991e67742e2629
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460115
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-13 13:44:41 -07:00
Terje Bergstrom
947a236063 gpu: nvgpu: gm20b: Use new delay APIs
Use platform agnostic delay functions instead of Linux kernel APIs.
This allows removing dependency to Linux header linux/delay.h. At the
same time remove #include lines for other unused Linux headers.

JIRA NVGPU-16

Change-Id: I05df9d72edaf4bb061febe0cb40fc8a7cf9f51c7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460114
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2017-04-13 13:44:41 -07:00
Terje Bergstrom
22426a5452 gpu: nvgpu: gk20a: Use new delay APIs
Use platform agnostic delay functions instead of Linux kernel APIs.
This allows removing dependency to Linux header linux/delay.h. At the
same time remove #include lines for other unused Linux headers.

JIRA NVGPU-16

Change-Id: I46b9ccb80e0b67efb86ec85676e5a55ff835c0ec
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460113
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2017-04-13 13:44:41 -07:00
Terje Bergstrom
a0fa2b0258 gpu: nvgpu: Add wrapper nvgpu/bug.h
Add wrapper header file nvgpu/bug.h. It #includes <linux/bug.h>
in Linux.

JIRA NVGPU-13

Change-Id: I7bf02ba554333f7cbd79d72bd1cb423c81ebcb49
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1461545
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-13 08:56:06 -07:00
Terje Bergstrom
7ef1eb8a10 gpu: nvgpu: Add wrapper nvgpu/sort.h
Add wrapper header file nvgpu/sort.h. It #includes <linux/sort.h>
on Linux.

JIRA NVGPU-13

Change-Id: I2393db830a15d5fbf0aa1fb9d55721a06061c09d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1461544
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-13 08:56:01 -07:00
Terje Bergstrom
ea24da728f gpu: nvgpu: Add wrapper nvgpu/bsearch.h
Add wrapper header file nvgpu/bsearch.h. It #includes <linux/bsearch.h>
on Linux.

JIRA NVGPU-13

Change-Id: I5893f91f2e1bcda99c68f94d9298d87ad4591c8f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1461543
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-13 08:55:55 -07:00
Terje Bergstrom
d2e36374b8 gpu: nvgpu: Bump mem scrubbing timeout
There is a very rare intermittent memory scrubbing timeout. Double the
timeout to try to get rid of the problem.

Bug 1903521

Change-Id: I1520fadd87c548d54438f43144286a73b4610051
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460664
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-13 08:55:55 -07:00
Konsta Holtta
7e273a943e gpu: nvgpu: make gk20a_channel_worker_enqueue static
This function is local to the file it lives in, so mark it static.

Bug 200067946

Change-Id: I5cbd466b16edd089092f74af6ca4547bd0bd3614
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1461380
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-13 00:56:28 -07:00
Konsta Holtta
bd660acd40 gpu: nvgpu: include ioctl_tsg.h in ioctl_tsg.c
Bring tsg ioctl function declarations to where they are implemented.

Bug 200067946

Change-Id: Ifc28601d4728e2fe6c8c74755d14c9e996aed4a2
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1461379
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-13 00:56:22 -07:00
Konsta Holtta
ee168385aa gpu: nvgpu: include ioctl_as.h in ioctl_as.c
Bring as ioctl function declarations to where they are implemented.

Bug 200067946

Change-Id: Ia8ec47e9449d69ce1957fb235229a2822e3bb86d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1461378
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>
2017-04-13 00:56:17 -07:00
Deepak Nibade
e846d39668 gpu: nvgpu: add INFO log type
nvgpu_info() currently prints "DEBUG" in its message
whereas we need "INFO" to be printed

Add new type INFO to enum nvgpu_log_type and log_types[]
strings
Add a case for INFO in __nvgpu_really_print_log()
which uses pr_info() for INFO messages

Change-Id: I1a0205b3f8665decab686d290a559b5c05e34d4a
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1461134
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:53 -07:00
Deepak Nibade
8b5e78dab2 gpu: nvgpu: use nvgpu list for semaphore lists
Use nvgpu list APIs instead of linux list APIs
for list of semaphore pools and h/w semaphores

Jira NVGPU-13

Change-Id: I7ad3ec2db568eb4ab7e207e3109084391c9c0ee7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460578
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:42 -07:00
Deepak Nibade
776bab70c3 gpu: nvgpu: remove unused variable
list node unmap_list in struct mapped_buffer_node
is unused and hence remove it

Jira NVGPU-13

Change-Id: Ie81a30691e45095ac72bd9ab8a8ebb88d5ea47c1
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460577
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:36 -07:00
Deepak Nibade
50f5fd2cb0 gpu: nvgpu: use nvgpu list for dynamic joblist
Use nvgpu list APIs instead of linux list APIs
for dynamic joblist

Jira NVGPU-13

Change-Id: I53779037589b1b6260d877d3bc9bd611ea9831ba
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460576
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:31 -07:00
Deepak Nibade
a6adaaab7a gpu: nvgpu: use nvgpu list for channel worker item
Use nvgpu list APIs instead of linux list APIs
to store channel worker items

Jira NVGPU-13

Change-Id: I01d214810ca2495bd0a644dd1a2816ab8e526981
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460575
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:25 -07:00
Deepak Nibade
f474a9e0e4 gpu: nvgpu: use nvgpu list for event id list
Use nvgpu list APIs instead of linux list APIs
to store event IDs into channel and TSGs

Jira NVGPU-13

Change-Id: I51e4b6ab3b38c845a870901b4d498927ca404a78
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460574
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:34:20 -07:00
Seema Khowala
c3c3a3c571 gpu: nvgpu: add fifo ops for handling pbdma intr_0
This is needed to handle bit 20 (clear_faulted_error) and
bit 24 (eng_reset) of t19x pbdma_intr_0 interrupt.

JIRA GPUT19X-47

Change-Id: I07c603eff96344c0104579e339e5cf7f675128ef
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1306556
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:33:50 -07:00
Seema Khowala
3867db86bc gpu: nvgpu: fifo ops for handling sched error and ctxsw timeout
For t19x, ctxsw timeout is not handled as part of fifo sched error
interrupt. A new fifo interrupt, ctxsw_timeout is added.

Bug 1856152
JIRA GPUT19X-74

Change-Id: I5a2ed15d967e5b14fbbb51b074080f1562bca84c
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1317599
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-12 15:33:44 -07:00
Terje Bergstrom
4c5feb1f72 gpu: nvgpu: Stop using linux/nvgpu.h
The include file does not exist in nvgpu project. Stop #including it.

JIRA NVGPU-16

Change-Id: I6d13b7a711a148de57adfe97de77e5d060da2973
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460793
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
2017-04-12 07:01:13 -07:00
Terje Bergstrom
44d5fb76aa gpu: nvgpu: Add wrapper nvgpu/atomic.h
Add wrapper header file nvgpu/atomic.h. It #includes <linux/atomic.h>
on Linux.

JIRA NVGPU-13

Change-Id: I6f2b3a04c964e7664b1f61b6073b643629bd99c5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460792
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
2017-04-12 07:01:12 -07:00
Terje Bergstrom
7665421874 gpu: nvgpu: Replace use of bitops.h and kernel.h
Remove use of linux/kernel.h and linux/compiler.h. We don't use
anything in those headers.

Also replace use of linux/bitops.h with new wrapper nvgpu/bitops.h.

JIRA NVGPU-13

Change-Id: Iefa6b4598d5a5e7fc386c0a7a554e778a87010d6
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1460777
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
2017-04-12 07:01:12 -07:00
Alex Waterman
fb1f604f41 gpu: nvgpu: Add '\n' back to log prints
Add back the automatic '\n' addition for logging functions. Since the
driver was developed like this it is simpler to add this back.

Change-Id: Iff097d667cf0fac7d64dc916a1d1b3b4f8c519ff
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1458140
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-12 07:01:01 -07:00
Terje Bergstrom
19fdb429c2 gpu: nvgpu: Wrappers for checking platform type
Add nvgpu_* wrappers for determining if we're running in simulation
or silicon, and if we're running in hypervisor.

The new wrappers require struct gk20a pointer, and gk20a_fence_wait()
did not have access to one. Add struct gk20a pointer as the first
parameter.

JIRA NVGPU-16

Change-Id: I73b2b8f091ca29fb1827054abd2adaf583710331
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331565
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-11 10:56:06 -07:00
Konsta Holtta
1a4647272f gpu: nvgpu: remove fence dependency tracking
In preparation for better abstraction in job synchronization, drop
support for the dependency fences tracked via submit pre-fences in
semaphore-based syncs. This has only worked for semaphores, not nvhost
syncpoints, and hasn't really been used. The dependency was printed in
the sync framework's sync pt value string.

Remove also the userspace-visible gk20a_sync_pt_info which is not used
and depends on this feature (providing a duration since the dependency
fence's timestamp).

Jira NVGPU-43

Change-Id: Ia2b26502a9dc8f5bef5470f94b1475001f621da1
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1456880
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-11 09:57:21 -07:00
Deepak Nibade
6de456f840 gpu: nvgpu: wait for engine idle in shutdown
In gk20a_pm_shutdown(), we do not check return value
of gk20a_pm_prepare_poweroff

In some cases it is possible that gk20a_pm_prepare_poweroff()
returns -EBUSY (this could happen if engines are busy)
so we don't clean up s/w state and directly
trigger GPU railgate

In case some interrupt is triggered simultaneously
we try to access a register while GPU is already railgated
This leads to a hard hang in nvgpu shutdown path

Make below changes in shutdown sequence to fix this:
- check return value of gk20a_wait_for_idle()
- disable activity on all engines with
  gk20a_fifo_disable_all_engine_activity()
- ensure engines are idle with gk20a_fifo_wait_engine_idle()
- check return value of gk20a_pm_prepare_poweroff()
- check return value of gk20a_pm_railgate()

Add a print when we bail out early in case
GPU is already railgated

Move to use new nvgpu_info/err() log messages
instead of dev_*() messages

Bug 200281010

Change-Id: I2856f9be6cd2de9b0d3ae12955cb1f0a2b6c29be
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1454658
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-11 09:57:16 -07:00
Deepak Nibade
a100422df5 gpu: nvgpu: re-add API to disable all engine activity
Patch e1e059454a
removed the API gk20a_fifo_disable_all_engine_activity()
which disables activity on all engines

Re-add it since it is now needed in the shutdown path
to ensure engines are idle

Bug 200281010

Change-Id: Idf5860f7f5009f3fb875ce94b7d66007c866ac49
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1457755
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-11 09:57:11 -07:00
Deepak Nibade
8f2f31354e gpu: nvgpu: add nvgpu_info() API for info messages
Add new API nvgpu_info() to print information/debug
messages

Change-Id: I40723bb10807186aab9de9ed60fb678f44288b94
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1460265
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-11 09:57:11 -07:00
Harry Lin
324032126f gpu: nvgpu: fix compile error in non-debugfs case
struct gk20a* g is undefined before used by trace_gk10a_pm_unrailgate()
if CONFIG_DEBUG_FS is not defined.

bug 200289063

Change-Id: Ifd613c8bae3ee05023b72347fbc64c8a9883dcbf
Signed-off-by: Harry Lin <harlin@nvidia.com>
Reviewed-on: http://git-master/r/1460205
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-04-11 08:45:02 -07:00
Terje Bergstrom
19b76d4fd7 gpu: nvgpu: common: linux: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: Ie3cf6f278dd4468832de3c3a6a6b601d55185461
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1459818
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-10 20:24:35 -07:00
Terje Bergstrom
a9c4c5d88d gpu: nvgpu: volt: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: Iea4a2f81d3aa2ff409fbb4bf9db441401f3a41e5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457352
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-10 19:04:20 -07:00
Terje Bergstrom
57d624f900 gpu: nvgpu: gp10b: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: I8dc0ddf3b6ea38af6300c27558b60786c163da6d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457344
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-10 19:04:20 -07:00
Terje Bergstrom
3ba374a5d9 gpu: nvgpu: gk20a: Use new error macro
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: Ia51f36d94c5ce57a5a0ab83b3c83a6bce09e2d5c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331694
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-04-10 19:04:19 -07:00
Terje Bergstrom
2be51206af gpu: nvgpu: pci: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: I747efef66aee6e58551e36737c06b3c1d0ec7858
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457357
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2017-04-10 12:24:28 -07:00
Terje Bergstrom
04d9de8478 gpu: nvgpu: tegra: linux: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: I248295107c5959a98ff00917e0474bcd03708156
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457356
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
2017-04-10 12:24:27 -07:00
Terje Bergstrom
5405070ecd gpu: nvgpu: vgpu: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer,
which is not portable across operating systems. The new nvgpu_err()
and nvgpu_warn() macros take struct gk20a pointer. Convert code
to use the more portable macros.

JIRA NVGPU-16

Change-Id: I071e8c50959bfa81730ca964d912bc69f9c7e6ad
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457355
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-04-10 12:24:27 -07:00