Commit Graph

1566 Commits

Author SHA1 Message Date
Peter Daifuku
aa14c1f803 gpu: nvgpu: update vsms_mapping ioctl
Update vsms_mapping ioctl to copy from the internal sm_to_cluster array to
new nvgpu_gpu_vsms_mapping_entry array before copying the latter back to user.

Bug 200260086
Bug 1882741

Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1266174
(cherry picked from commit e28882c05491cb8f9573ff71c2d7309e5714e385)

Change-Id: I0fccc6fb6e0d6b6f737b3a44818d2b47438cd3c8
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/1312774
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
tegra-l4t-r27.1
2017-03-01 15:20:41 -08:00
Rohit Vaswani
811880da40 gpu: nvgpu: Allow defining min_freq and stepping
Allow defining min_freq and stepping to use for generating freq
table via Kconfig.

Bug 1869602

Change-Id: Iaf0af19219a5ce48f424df336e5e5d27d0b7acb4
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Signed-off-by: Rohit Vaswani <rvaswani@nvidia.com>
Reviewed-on: http://git-master/r/1297666
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Wen Yi <wyi@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
2017-02-02 20:33:05 -08:00
Deepak Nibade
bfecee3b9c 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
(cherry picked from commit 72f27f7747)
Reviewed-on: http://git-master/r/1287346
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-01-19 11:49:30 -08:00
Vijayakumar
8ef013e36e gpu: nvgpu: handle vf curve change due to temp
JIRA DNVGPU-129

1)Add function hook for PMU VFE event handler which will do for VF
curve re-evaluation

2)Add function hook to send temperature limit of GPU sensor

3)Call VFE event handler from PMU's event handle function

Change-Id: I2e3577d3d895e97e6ad06e92f0f4827f9855d0b6
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1245393
(cherry picked from commit 1a5c6c32cdec73fb23735430f43577eda675e5af)
Reviewed-on: http://git-master/r/1268060
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-15 10:15:10 -08:00
Thomas Fleury
68eeda3ebd gpu: nvgpu: alarm/event interface cleanup
use CPU timestamp in nanoseconds
define last event/alarm number

Jira DNVGPU-186

Change-Id: I769c8a7a41ac1fb49234f0d5144a78fa657ec230
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1260799
(cherry picked from commit 379171b43cb20d7a31b3966cad3696525e8cf7d9)
Reviewed-on: http://git-master/r/1267159
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-15 10:15:02 -08:00
Thomas Fleury
f2f06852c3 gpu: nvgpu: alarm/event numbering
Remove hole in alarm/event numbering

Jira DNVGPU-186

Change-Id: I5c71c08d345a734c27ff75a04ab18ee4746e47fa
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1256413
(cherry picked from commit 7b068e588712980f1d33c14e692db24068b3ef56)
Reviewed-on: http://git-master/r/1267158
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-15 10:15:01 -08:00
Thomas Fleury
ec011cd1ee gpu: nvgpu: add device alarms
Add event definitions for:
- Clock alarm (target frequency not met)
- Thermal alarm (temperature above threshold)
- Power alarm (power above threshold)
- GPU shut down

Jira DNVGPU-186

Change-Id: I52edd44352ed0cba83033949272f41cc9e1c630f
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1249342
(cherry picked from commit 67a6681aade241ff24982771778f7e2193d1cd7f)
Reviewed-on: http://git-master/r/1267157
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-15 10:15:00 -08:00
Thomas Fleury
0250221955 gpu: nvgpu: support negative temperatures
Jira DNVGPU-166

Change-Id: Id0561d49c64096ad5cbcd23bd371b49b2e0db57c
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1245557
(cherry picked from commit 2e0269c76fdda5c8e1a30ca7ef73a08ebe644f88)
Reviewed-on: http://git-master/r/1267156
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-15 10:14:59 -08:00
Deepak Nibade
02b8cda953 gpu: nvgpu: store last_freq in gk20a struct
In gk20a_scale_target(), to check for duplicate
freq requests we compare current frequency with
devfreq->previous_freq

But for very first request after boot, we have
devfreq->previous_freq set to MIN freq

And in case we evaluate new frew as MIN freq
then we skip calling postscale() and scaling
of EMC clock
This results in keeping EMC at MAX value

To fix this, add new variable last_freq in
gk20a structure.
Use this variable to store frequency value
and to compare for duplicate requests

Bug 200255163
Bug 200257544

Change-Id: Icfc57234c63f68cce8ccf8221237105272dad853
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1263747
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-14 12:38:32 -08:00
David Nieto
866dafa484 gpu: nvgpu: read effective frequency from counter
JIRA DNVGPU-164

Adding export functions to gk20a and gk20a_clk structure

Change-Id: Ia448f17a6c456139544c1d36a3e17ceec0edd2f6
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1239465
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1268000
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2016-12-09 20:24:10 -08:00
Mahantesh Kumbar
5319bb4559 gpu: nvgpu: pmu version update
JIRA DNVGPU-71

Change-Id: I08668e17a258fe7c025c79ee2e00a0f4d7cb8a2d
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1243834
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1267999
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2016-12-09 20:24:10 -08:00
Thomas Fleury
e77256a187 gpu: nvgpu: renumber power and temperature ioctls
One ioctl number collided with NVGPU_GPU_IOCTL_GET_MEMORY_STATE.

Jira DNVGPU-166

Change-Id: Ib83fec2c0c4e3bc4ee3053005a8559bc15bdb33b
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1243115
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1267155
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2016-12-09 20:24:08 -08:00
Thomas Fleury
dfb061cbdb gpu: nvgpu: get voltage, current, power and temperature
Add ioctls to retrieve voltage, current, power and temperature.
Add flags in GPU characteristics to indicate if feature is supported.

Jira DNVGPU-166

Change-Id: Idd5a767326c9d43630e8289ca7d2c27bb96a9f14
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1241862
Tested-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1267153
2016-12-09 20:24:07 -08:00
David Nieto
71ecc8f660 nvgpu: gpu: arbiter for vf switch management
JIRA DNVGPU-143

(1) Added conversion routines in ctrl_gk20a.c to
do conversions between Hz and MHZ
(2) Use new api to prevent corruption of requests
is multiple threads on same session commit
simultaneously

Change-Id: I87875e593d2cc90647d5c4f60a4e293ed3ea6b83
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1239460
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1267152
Reviewed-by: Automatic_Commit_Validation_User
2016-12-09 20:24:06 -08:00
Thomas Fleury
8cfcf181f1 gpu: nvgpu: add clocks control capability
Add NVGPU_GPU_FLAGS_SUPPORT_CLOCK_CONTROLS bit to allow user library
to determine if GPU supports clock control ioctls.

Jira DNVGPU-125

Change-Id: Ia09808ed36aa85a7c520039bb336888e2b467076
Signed-off-by: David Martine Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1239379
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1267154
Reviewed-by: Automatic_Commit_Validation_User
2016-12-09 20:24:06 -08:00
Terje Bergstrom
a4731b3282 gpu: nvgpu: Use end of vidmem as bootstrap region
Instead of hard coding bootstrap region, it should always be set to
the last 256MB of vidmem.

Bug 200244445

Change-Id: I91779d1bf861f4f23a0b646f70b1febbbc4581b5
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1242409
Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-on: http://git-master/r/1267124
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-09 15:05:12 -08:00
Konsta Holtta
54810444d2 gpu: nvgpu: fix timeout retry usage in mm_gk20a.c
Loop conditions of timeout checking introduced in commit
2109478311 ("gpu: nvgpu: Use timeout retry
API in mm_gk20a.c") were flipped by accident, so each usage in a loop
actually did not wait enough but ran only one iteration. Fix the
conditions to loop as long as the timeout is NOT expired.

Also restore l2 flush timeout to 10 ms from 1, which was done in commit
030ef82bdd ("gpu: nvgpu: increase l2 flush
timeout") but overwritten by the above "use timeout" commit.

Bug 200260715

Change-Id: I0db16be79a1a27caa3d97fac9d4361582cc232e8
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1268482
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-09 13:44:53 -08:00
Terje Bergstrom
0859cf9539 gpu: nvgpu: Enable signed versus non-signed errors
Fix a few trivial signed versus unsigned problems, and enable
compilation flag to treat them as errors.

Change-Id: I68cc327885ef1efb12db7f347a2699a65415f889
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1265291
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-08 10:11:28 -08:00
Peter Daifuku
dd075c39bb gpu: nvgpu: fix pes_tpc_count
In calculation of pes_tpc_count, accumulate the number of PEs
with TPCs connected to them instead of using the architectural
maximum number.

Bug 200250616

Change-Id: I4b2edc420ac03e24f2c298587d4dd1d77c51f5d6
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1262642
(cherry picked from commit 65723cf5be8fe24bcaf56570883f0880a198efcb)
Reviewed-on: http://git-master/r/1263958
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
2016-12-08 01:40:13 -08:00
Richard Zhao
9bc735ac6a gpu: nvgpu: vgpu: fix va leak when call gk20a_vm_free_va
page size index needs to be set explicitly when call gk20a_vm_free_va.

Bug 200255799
JIRA VFND-3033

Change-Id: I376c63e724b8f59aee389c54ca1589683536f043
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1262586
(cherry picked from commit 82c05633f17fa094d8e08c8a0fa4bad2d3275268)
Reviewed-on: http://git-master/r/1263403
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
2016-12-08 01:40:12 -08:00
Thomas Fleury
b6411b0290 gpu: nvgpu: check untrusted num_entries for clock controls
Jira DNVGPU-125

Change-Id: I0e547b05d57c08f76327869c189498e82f4ffd1a
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1244916
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-07 15:01:18 -08:00
Thomas Fleury
60a9fcb467 gpu: nvgpu: fix clock controls compile
Add clock controls only for ARCH_T18x and later.

Jira DNVGPU-125

Change-Id: Iab7c831aec925253dd3d9336c653305cb96e052c
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1244932
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-07 15:01:17 -08:00
Thomas Fleury
a8f90069e9 gpu: nvgpu: update clock controls
Install one completion fd per SET request.
Notifications on dedicated event fd.
Changed frequencies unit to Hz from MHz.
Remove sequence numbers from dummy arbiter.
Added effective clock type (query frequency from counters).

Jira DNVGPU-125

Change-Id: Ica364eccdf85b188fd208f770e4eae0e9f0379e9
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1230224
(cherry picked from commit f9b06686c090c676e60e1e137fdc9bbfc76d4843)
Reviewed-on: http://git-master/r/1243109
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-07 15:01:16 -08:00
Thomas Fleury
94cea420c8 gpu: nvgpu: flags to query specific clk domains
Added NVGPU_GPU_CLK_FLAG_SPECIFIC_DOMAINS to indicate that a
request (get clock info/range) applies only to domains specified
in clock entries. If flag is not set, request returns all clock
domains.

Jira DNVGPU-125

Change-Id: I11bffbdf491ebffa7f47bd327037b0b8cfcbde31
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1227998
(cherry picked from commit 7613dd30e120a82d342da402b4e0b070512dddad)
Reviewed-on: http://git-master/r/1243108
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-07 15:01:15 -08:00
Thomas Fleury
05805ec65b gpu: nvgpu: ioctls for clock controls
Add ioctls for clock range and VF points query.
Add ioctls to set target mhz, and get actual mhz.

Jira DNVGPU-125

Change-Id: I7639789bb15eabd8c98adc468201dba3a6e19ade
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1223473
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
(cherry picked from commit 5e635ae34221c99a739321bcfc1418db56c1051d)
Reviewed-on: http://git-master/r/1243107
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-07 15:01:14 -08:00
Alex Waterman
2109478311 gpu: nvgpu: Use timeout retry API in mm_gk20a.c
Use the retry API that is part of the nvgpu timeout API to keep
track of retry attempts in the vrious flushing and invalidating
operations in the MM code.

Bug 1799159

Change-Id: I36e98d37183a13d7c3183262629f8569f64fe4d7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1255866
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-05 16:16:24 -08:00
Alex Waterman
4dc977e25f gpu: nvgpu: Use timeout API in PMU code
Instead of using custom code for timeout monitoring use the generic
timeout API for nvgpu.

Bug 1799159

Change-Id: If77e67b2d8678b824d6948620003d3892d5f41d2
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1255865
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-05 16:16:17 -08:00
Alex Waterman
d8fd0e6467 gpu: nvgpu: Add timeout API
Add a timeout API to nvgpu since this is a common operation done all
across the nvgpu driver.

Also add two new directories for this common code:

  drivers/gpu/nvgpu/common
  drivers/gpu/nvgpu/include/nvgpu

The common directory is for common C code. The include directory is for
common include files.

Bug 1799159

Change-Id: I8b710eecaa75c0707df83f859fb28484525185a6
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1255864
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-05 16:16:16 -08:00
Terje Bergstrom
37d4b649d4 gpu: nvgpu: Wait for full UDE completion
devinit signals completion even before the full UDE script has been
executed. Wait for both devinit complete & PMU halt to make sure
UDE is fully completed.

Bug 200244445

Change-Id: Iaec27d9fc312f282a778aabbbe8b75d85e7a0a87
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1242253
(cherry picked from commit a013029e48fcc83f670bfd0e82da035fa41d6030)
(cherry picked from commit e742842eb4fbcefdc5bb88b2f7b3055a1a60652b)
Reviewed-on: http://git-master/r/1263293
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
2016-12-05 13:49:21 -08:00
Krishna Reddy
89e707d2b4 gpu: nvgpu: fix hardcoded page size reference
Bug 1843356
Bug 1769772

Change-Id: I6c2a3a72f7082074bbf1165a74d5070195e1e653
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/1258352
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-05 13:49:17 -08:00
Laxman Dewangan
665b017c32 gpu: nvgpu: gk20a: Get rid of include of mach/clk.h
mach/clk.h just include the linux/clk/tegra.h and hence directly
include this header instead of via mach/clk.h.

bug 200259459

Change-Id: Ia84c325309c308e02bb5dc1a8b32ef669053f439
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1264322
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
2016-12-04 23:10:42 -08:00
Deepak Nibade
3d99c46dab gpu: nvgpu: enable gm20b clk APIs for CCF
GM20B platform specific clk API should now support
both Tegra Clock Framework and Common Clock
Framework

Hence enable those APIs for both TCF and CCF

Bug 200256389
Bug 200233943

Change-Id: If0f0568c7779e4ea16cf5e3b3e2380cf9c4cd697
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1262892
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Tested-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-12-02 05:39:04 -08:00
seshendra Gadagottu
030ef82bdd gpu: nvgpu: increase l2 flush timeout
Under heavy throttling case gpu runs 8 times slower.
This is making l2 flush to timeout, to avoid this increase
timeout to 10msec from 1msec.

Bug 1787261

Change-Id: Ia112ce968c136135ccb9df4a7364073103684403
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1216559
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-02 05:37:03 -08:00
Seema Khowala
a841a88bf0 gpu: nvgpu: fix enable engine activity
fifo_sched_disable_true_v() returns 1 and this
value is being right shifted by runlist_id.
This will work only if runlist_id is 0. For runlist_id
other than 0, 1 right shifted by runlist_id will return 0 and
engine will remain disabled. fifo_sched_disable_true_v()
should be left shifted by runlist_id to fix the bug.

Change-Id: If747035b9f6c80a21a67c63e27fb214223a55d4d
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/1257344
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-12-02 00:42:38 -08:00
Thomas Fleury
f4171ac358 gpu: nvgpu: enable FECS traces by default
Compile FECS ctxsw tracing code by default. GPU that support
this feature implement ops.fecs_trace.init() function

Bug 1739908

Change-Id: Ie347524e788614bc94fc119cd48f740e2998c2be
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1255941
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-12-02 00:42:25 -08:00
Deepak Nibade
53a9eceab7 gpu: nvgpu: fix deadlock between clean up and timeout worker
In case one job completes just around timeout boundary,
it is possible that we launch both clean up worker and
timeout worker for same job

Then in clean up worker we try to cancel timeout
worker, and in timeout worker we try to wait for clean
up to finish which leads to deadlock with below stacks

stack 1:
[<ffffffc0000bb484>] cancel_delayed_work_sync+0x10/0x18
[<ffffffc0004f820c>] gk20a_channel_cancel_job_clean_up+0x20/0x44
[<ffffffc0004fc794>] gk20a_channel_abort_clean_up+0x34/0x31c
[<ffffffc0004fcb30>] gk20a_channel_abort+0xb4/0xc0
[<ffffffc0004f3d18>] gk20a_fifo_recover_ch+0x9c/0xec
[<ffffffc0004f3f04>] gk20a_fifo_force_reset_ch+0xdc/0xf8
[<ffffffc0004fa8c4>] gk20a_channel_timeout_handler+0xf8/0x128

stack 2:
[<ffffffc0000bb484>] cancel_delayed_work_sync+0x10/0x18
[<ffffffc0004f82c4>] gk20a_channel_timeout_stop+0x40/0x60
[<ffffffc0004fc488>] gk20a_channel_clean_up_jobs+0x7c/0x238

To fix this, cancel the timeout worker in
gk20a_channel_update() itself instead of cancelling in
gk20a_channel_clean_up_jobs()

Bug 200246829

Change-Id: Idef9de3cae29668f4e25beb564422cf2e3736182
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1259963
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-11-30 09:19:31 -08:00
Thomas Fleury
bc5a258049 gpu: nvgpu: fix dGPU support rule for T18x
Fix typo for GK20A_PCI dependency on ARCH_TEGRA_18x_SOC.

Bug 200251486

Change-Id: I9210fb88b6b25fbddd14353a86c6f0eb4fd7d209
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: http://git-master/r/1258436
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Lawrence Ibarria <libarria@nvidia.com>
Reviewed-by: Hugo Lin <hugol@nvidia.com>
Tested-by: Hugo Lin <hugol@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-11-30 09:19:24 -08:00
seshendra Gadagottu
4a8802eab4 gpu: nvgpu: chip specific channel commit_inst
Add function pointer to add chip specific commit_inst.
Update this function pointer for gk20a and gm20b.

JIRA GV11B-21

Change-Id: Iae7231fae70c7b4f56647fe242776670675de3fd
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1258275
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-11-30 09:19:23 -08:00
Deepak Nibade
af5d2d208a gpu: nvgpu: API to access fb memory
Add IOCTL API NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY
to read/write fb/vidmem memory

Interface will accept dmabuf_fd of the buffer in vidmem,
offset into the buffer to access, temporary buffer
to copy data across API, size of read/write and
command indicating either read or write operation

API will first parse all the inputs, and then call
gk20a_vidbuf_access_memory() to complete fb access

gk20a_vidbuf_access_memory() will then just use
gk20a_mem_rd_n() or gk20a_mem_wr_n() depending
on the command issued

Bug 1804714
Jira DNVGPU-192

Change-Id: Iba3c42410abe12c2884d3b603fa33d27782e4c56
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1255556
(cherry picked from commit 2c49a8a79d93fc526adbf6f808484fa9a3fa2498)
Reviewed-on: http://git-master/r/1260471
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-11-30 02:18:17 -08:00
Konsta Holtta
5f6a2aa02b gpu: nvgpu: fix setup_rop_mapping for gm20b+
gm20b_init_gr does not inherit the ops set by gk20a_init_gr_ops, and the
gr.setup_rop_mapping HAL was not set there, so it was not set for chips
that inherit from gm20b_init_gr and do not override it explicitly.

Set the pointer in gm20b_init_gr, which other chips inherit, and delete
the surrounding if condition from the call, making sure that future
users always call it, because there is an implementation since the
earliest supported chip.

Bug 1833382

Change-Id: I7893c9aac7c5c49ce9a55031ea6baa9382a1b7ca
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1258960
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
2016-11-29 09:50:21 -08:00
Peter De Schrijver
0fbd9f9398 gpu: nvgpu: register clkdev for DVFS purposes
Change-Id: I354d4bbddb2aba2a1a668cc0401437f1e2403b79
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/1259495
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
2016-11-29 01:20:35 -08:00
Peter Daifuku
1b6fe7346f gpu: nvgpu: hardcode gk20a/gm20b fbpa values
gk20a/gm20b do not have an fbpa unit, although the
hw header files claim they do. Hardcode all fbpa
values to 0.

Bug 200249125

Change-Id: I4afb29795199552979247de7c76b6b55ea4f368f
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1256420
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-11-22 12:58:02 -08:00
seshendra Gadagottu
ef95e43d97 gpu: nvgpu: chip specific init_inst_block
Add function pointer to add chip specific init_inst_block.
Update this function pointer for gk20a and gm20b.

JIRA GV11B-21

Change-Id: I74ca6a8b4d5d1ed36f7b25b7f62361c2789b9540
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1254875
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-11-21 08:50:45 -08:00
seshendra Gadagottu
499aaafa97 gpu: nvgpu: free veid bundle init data
During gk20a_remove_gr_support, free veid bundle
init data.

JIRA GV11B-21

Change-Id: Ie1ea7387202c0bae55d5e5f0e1827b5b7b826e96
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1254869
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-11-21 08:50:33 -08:00
Sachit Kadle
5277ecd79c gpu: nvgpu: fix error handling bug
This change fixes error handling logic in
gk20a_alloc_channel_gpfifo(). In cases, where we don't
allocate a channel_sync at gpfifo allocation time,
we shouldn't attempt to destroy it while handling
an error.

Bug 200253447

Change-Id: I57a78c74bbce84fa17fb0360c59b8f413a9124a7
Signed-off-by: Sachit Kadle <skadle@nvidia.com>
Reviewed-on: http://git-master/r/1255858
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-11-21 04:00:13 -08:00
tk
c1064c27df gpu: nvgpu: FBPA broadcast support
Add FBPA broadcast support to hwpm regops

Bug 200249125

Change-Id: Iaf413a162a8985bcce94ff96ec6318e129609c4c
Signed-off-by: Tejaswi K <tk@nvidia.com>
Reviewed-on: http://git-master/r/1247408
(cherry picked from commit 4e0a805f5a8762d1a90f3b5dd76902a04941d9ef)
Reviewed-on: http://git-master/r/1252160
Tested-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-11-17 17:24:39 -08:00
Peter Daifuku
dd5b630e13 gpu: nvgpu: fix gpc addr determination
Fix pri_is_gpc_addr: determines whether a register offset
is a GPC address.

Needed for:

Bug 200249125

Change-Id: I8322efc95cb8d02fa42b916f6649d9fa3f93171c
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: http://git-master/r/1255061
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2016-11-17 17:24:39 -08:00
Terje Bergstrom
23c647f7a0 gpu: nvgpu: Expose boot freq as max freq for dGPU
On dGPU so far we boot only at maximum GPC2CLK frequency. Expose that
as maximum clock rate to user space.

Bug 200251486

Change-Id: Ie3463782a0e36028074325ce652c7ef554f6ea2c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1252907
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2016-11-17 13:19:52 -08:00
Terje Bergstrom
60a5bc79be gpu: nvgpu: Enable dGPU support only on T18x
We build all necessary components only on builds with T18x support.

Bug 200251486

Change-Id: I927ceecbbc8c9e83ee84656fb4a8643356f224ec
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1253632
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
2016-11-17 13:19:49 -08:00
seshendra Gadagottu
fab87a29bb gpu: nvgpu: use define macros for litter values
Instead of using enum type for litter values, use
define macros. This will fix:

1. Resolve ambiguity associated with enum type size.
2. Litter values can be extended easily in future chips.

JIRA GV11B-21

Change-Id: Idca5144ea3754820c67831a716bb0aaf2e375eb2
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1254854
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2016-11-17 12:07:49 -08:00