Commit Graph

9520 Commits

Author SHA1 Message Date
Jinesh Parakh
b8b90f85ee gpu: nvgpu: Fix CERT-C Violations
Fix the following CERT-C Violations:
gsp_runlist.c : CERT EXP34-C
channel_sync_syncpt.c : CERT ERR33-C
grmgr_ga100.c : CERT ERR33-C
grmgr_ga10b.c : CERT ERR33-C
debug.c : CERT ERR33-C
debug_fecs_trace.c : CERT EXP34-C
ioctl.c : CERT ERR33-C

CID 495110
CID 141061
CID 222881
CID 222890
CID 450994
CID 366644
CID 466529

Bug 3512546

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I318a27a6fcb8ea8f6d5d6c1f65d940c48d6f8dfc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2723008
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-06-03 12:05:26 -07:00
Divya
dcec7f184e gpu: nvgpu: disable elpg earlier in recovery path
When MMU fault happens, if the id_type = 1, that means
fault happened in TSG. So in that path we set the error
notifier and let userspace know about faulty channel.
During this, we check if debugger is attached or not by
reading gr_gpc0_tpc0_sm0_dbgr_control0_r() register.
During this time ELPG is enabled and this read causes
IDLE SNAP error for ELPG.

To resolve this, move CG/PG disable function call
early in fifo recover code path. This ensures that
ELPG is disabled early before any read happens for any
GR register.

Bug 3660592

Change-Id: Ie5d01b7ccf00167b58f260e9142aa5deb2a08be4
Signed-off-by: Divya <dsinghatwari@nvidia.com>
(cherry picked from commit f09e429f2d142c20529bedc05acf193805e1bb25)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2720655
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-06-01 06:41:57 -07:00
Jinesh Parakh
cb78bca971 gpu: nvgpu: Fix Out-of-bounds access defect
Fix following Coverity Defect:
priv_ring_ga10b_fusa.c : Out-of-bounds access

CID 10062315

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I76e4122132ad13cc53d24816c59586695d6f80a4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708565
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-31 11:07:30 -07:00
Rajesh Devaraj
019bee2174 gpu: nvgpu: add additional registers to allowlist
To add GL/VK support for shader debugging via the SM trap handler
functionality, a write operation to the following PRI registers need to
be allowed in all chips (ga10b, gv11b, gm20b, gp10b):

- NV_PGRAPH_PRI_GPCS_MMU_DEBUG_CTRL
- NV_PGRAPH_PRI_GPCS_TPCS_SM_SCH_MACRO_SCHED
- NV_PGRAPH_PRI_GPCS_TPCS_SMS_DBGR_CONTROL0
- NV_PGRAPH_PRI_GPCS_TPCS_SMS_HWW_WARP_ESR_REPORT_MASK
- NV_PGRAPH_PRI_GPCS_TPCS_SMS_HWW_GLOBAL_ESR_REPORT_MASK

In this patch, we are adding the above registers into allowlist, if they
were absent. Note that these registers included only in non-safety using
CONFIG_NVGPU_SET_FALCON_ACCESS_MAP flag.

Bug 3642131

Change-Id: I5f62731944b6b3e059afa80a491c3cf5c3656f60
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2715799
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Christopher Lentini <clentini@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Christopher Lentini <clentini@nvidia.com>
2022-05-31 05:55:17 -07:00
Jinesh Parakh
658f83ca48 gpu: nvgpu: Fix Explicit null dereference
Fix the following Coverity Defect:
pwrpolicy.c : Explicit null dereference

CID 10059138

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: Ie572e0608d0b07d5023e7cca878d16087cfc284f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2717978
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ramesh Mylavarapu <rmylavarapu@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-30 12:49:04 -07:00
prsethi
697215afd3 gpu: nvpgu: configure static ZBC table
Patch defines a ZBC static table and configure it at sw layer. Later
existing API read this sw configuration and program it to hw.

This is applicable only for ga10b safety build and for other chips/
configuration it will be supported in the legacy way.

Bug 3585766

Change-Id: I00d79162c0b096616e3f555da965e82e47c014d1
Signed-off-by: prsethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2713821
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-29 10:56:58 -07:00
atanand
5c3d78dfb0 gpu: nvgpu: add IP audited FBPROUTER/GPCROUTER base and extents and NV_PLTCG_LTCS base
Added IP audited FBPRouter and GPCRouter Pri Register Ranges
and LTC Broadcast base addr

IP audit bug number: 3616021
Bug: 3442801

Change-Id: I52adc3bbb6b573377a9012db4b50bef51ef31e8a
Signed-off-by: atanand <atanand@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2714144
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-28 09:00:03 -07:00
atanand
2ebc0bdf98 gpu: nvgpu: add broadcast to unicast expansion
Add broadcast to unicast expansion for NV_PLTCG_LTCS_MISC_LTC_PM and
PMM*_[GPC|FBP]SROUTER broadcast registers for non-resident regops.

Bug: 3442801

Change-Id: I88dcf00f4f6e910f0342d3968970070e0248a786
Signed-off-by: atanand <atanand@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2704951
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-28 08:59:44 -07:00
Krishna Reddy
961925be02 Revert "gpu: nvgpu: correct usage for gk20a_busy_noresume"
This reverts commit c1ea9e3955.

Reason for revert: ap_vulkan, ap_opengles, ap_mods tests failures
Bug 3661058
Bug 3661080 
Bug 3659004 

Change-Id: I929b5675a4fb0ddc8cbf3eeefc982b4ba04ddc59
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2718996
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
2022-05-27 14:49:26 -07:00
Antony Clince Alex
a80c445a5d gpu: nvgpu: ga10b: update runlist.write_state
Update HAL function runlist.write_state to skip in-active
runlists in fifo.runlists. It is possible for one or more
engines to be floorswept in which case their associated
runlist will be in-active, example, if host supports
3 runlists(0, 1, 2) each serving 3 engines(0, 1, 2), and
engine-1 is floorswept, then runlist-1 becomes in-active and
the entry fifo->runlists[1] will be set to NULL.

Bug  3650588

Change-Id: Iaf9d75e310903c47b842e84dcfa2209d9fe7da96
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
(cherry picked from commit e29a2019cf8f4796737c670f98164f7783448d49)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2717075
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-27 14:46:18 -07:00
Laxman Dewangan
152b4a0379 gpu: nvgpu: Add OOT kernel build support
Add OOT kernel support same as kstable for building nvgpu
as module.

Bug 3642168

Change-Id: I7353275a6c5e487773b716e23610b22e2dc5780d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710918
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-27 14:41:14 -07:00
Jinesh Parakh
7d50efb6bc gpu: nvgpu: Uninitialized pointer read
Fix the following Coverity Defect:
vm_remap.c : Uninitialized pointer read

CID 10127932

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I2de290882aec6a859c5280998e11fb75f3395302
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708539
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-27 14:40:45 -07:00
Jinesh Parakh
bb73cf9597 gpu: nvgpu: Fixed out-of-bounds Coverity Defects
Fix following Coverity Defects:
clk_mon_tu104.c : Out-of-bounds read and Out-of-bounds access

CID 10061400
CID 10061401

Bug 3460991

Changed the datatype of domain_mask from u32 to unsigned long
to solve the out-of-bounds defect.

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I1c43bd90053264ee4104ca8c3a33d9ea07f04045
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708765
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-25 11:44:59 -07:00
Debarshi Dutta
c1ea9e3955 gpu: nvgpu: correct usage for gk20a_busy_noresume
Background: In case of a deferred suspend implemented by gk20a_idle,
the device waits for a delay before suspending and invoking
power gating callbacks. This helps minimize resume latency for any
resume calls(gk20a_busy) that occur before the delay.

Now, some APIs spread across the driver requires that if the device
is powered on, then they can proceed with register writes, but if its
powered off, then it must return. Examples of such APIs include
l2_flush, fb_flush and even nvs_thread. We have relied on
some hacks to ensure the device is kept powered on to prevent any such
delayed suspension to proceed. However, this still raced for some calls
like ioctl l2_flush, so gk20a_busy() was added (Refer to commit Id
dd341e7ecbaf65843cb8059f9d57a8be58952f63)

Upstream linux kernel has introduced the API pm_runtime_get_if_active
specifically to handle the corner case for locking the state during the
event of a deferred suspend.

According to the Linux kernel docs, invoking the API with
ign_usage_count parameter set to true, prevents an incoming suspend
if it has not already suspended.

With this, there is no longer a need to check whether
nvgpu_is_powered_off(). Changed the behavior of gk20a_busy_noresume()
to return bool. It returns true, iff it managed to prevent
an imminent suspend, else returns false. For cases where
PM runtime is disabled, the code follows the existing implementation.

Added missing gk20a_busy_noresume() calls to tlb_invalidate.

Also, moved gk20a_pm_deinit to after nvgpu_quiesce() in
the module removal path. This is done to prevent regs access
after registers are locked out at the end of nvgpu_quiesce. This
can happen as some free function calls post quiesce  might still
have l2_flush, fb_flush deep inside their stack, hence invoke
gk20a_pm_deinit to disable pm_runtime immediately after quiesce.

Kept the legacy implementation same for VGPU and
older kernels

Jira NVGPU-8487

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I972f9afe577b670c44fc09e3177a5ce8a44ca338
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2715654
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-25 04:59:46 -07:00
Sagar Kamble
a0b0acad05 gpu: nvgpu: pass pmu rpc struct as char pointer
nvgpu_pmu_rpc_execute takes pmu rpc header address and dereferences
it at address past header based on rpc struct that the header is
part of.

This usage of pointer is not right and confuses CERT checker.
Instead, pass the rpc struct address as char pointer and use
as header or rpc struct as per need.

CID 17141
CID 154223
CID 17557
CID 154226
CID 153904
CID 153926
CID 153929
CID 153925
CID 153925
CID 225346
CID 225355
CID 225356
CID 225360
CID 225361
CID 225365
CID 225367
CID 296735
CID 330244
CID 17557
Bug 3512546

Change-Id: I93b154d4321e75c0d2b41f43d7c2b701682962a3
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710224
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-24 04:43:35 -07:00
Tejal Kudav
69bb38f606 gpu: nvgpu: Make missing DT prop print conditional
Below print is misleading and seems like an error.
 [INFO]  Missing support-gpu-tools property, ret =-22

'support-gpu-tools' property was added to allow disabling debugger
features on prod boards. The debugger/profiler support will be
enabled by default, even if the property is missing.

Make the INFO print conditional, more informational and less
dramatic.

Bug 3539518

Change-Id: I5fc50df30be23e1fd1ecc06282a0d50f3ca7ac64
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2668464
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-24 04:41:42 -07:00
mkumbar
5339bd3466 gpu: nvgpu: Add extra delay for ACR commands in non-silicon platforms
Increase delay for non-silicon platforms between ACR commands and before
polling to skip incorrect reading of IRQSTAT register and generate false
PMU external interrupt.

Bug 3596273

Change-Id: I0163cddbaa1919ac949467f65c74e06f85817aec
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2699396
Reviewed-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Tested-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-20 10:36:04 -07:00
Richard Zhao
10f6b98f70 gpu:nvgpu: move gops_clk to non fusa
gops_clk is needed by CONFIG_NVGPU_NON_FUSA but not specific to
CONFIG_NVGPU_CLK_ARB or CONFIG_NVGPU_DGPU.

Jira GVSCI-9976

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I6d8c6625badd6ef2f3a38b9ecc70e23da2fbc26b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2714079
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-20 00:11:02 -07:00
Dinesh T
6e4c3275bf gpu: nvgpu: Set max_ways_evict_cache to maximum
This is setting evict_max_ways for L2 cache to the maximum
supported value for safety.

In normal build L2 cache MAX_EVICT_LAST is configure via
KMD and RegOps. RegOps is enabled only on standard build
with CONFIG_DEBUGGER flag. This method we cant use it for
safety build. Safety we can make use of the patch buffer
to patch the register while creating the context.

JIRA NVGPU-8227

Change-Id: Iec5d73197239b9cad31c6b593ca2b87c224aad5e
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708702
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-18 22:57:54 -07:00
Richard Zhao
802aadf263 nvgpu: move nvgpu_falcon_copy_from/to_emem out of CONFIG_NVGPU_DGPU
nvgpu_falcon_copy_from/to_emem are also used by iGPU in
engine_emem_queue.

Jira GVSCI-9976

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: Ia36a38521807714eb5ad52b6e81c9f31ecc8fda6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708509
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-18 00:59:10 -07:00
Richard Zhao
7a39d8e9ce gpu: nvgpu: hal: remove .fb.mem_unlock for ga10b
.fb.mem_unlock is specific to dGPU.

Jira GVSCI-9976

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: Id1a52becaa5c2b0a00899c3bc92aa18058a1f97d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708394
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-18 00:59:05 -07:00
Richard Zhao
db4a1713cb gpu: nvgpu: gr: move .load_sw_bundle64() out of CONFIG_NVGPU_DGPU
.load_sw_bundle64 is also used by ga10b.

Jira GVSCI-9976

Change-Id: Ife46dd5bf40a9e143cf119a64dd0d2adcb1ae81c
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708393
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-18 00:58:54 -07:00
Richard Zhao
d603838110 gpu: nvgpu: pmu: move lsfm_sw_gv100.h out of CONFIG_NVGPU_DGPU
ga10b needs to call nvgpu_gv100_lsfm_sw_init() too, so the header cannot
be protected by CONFIG_NVGPU_DGPU.

Jira GVSCI-9976

Change-Id: I3f6016c3d5f924492629134e528a24cc20544365
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2708392
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-18 00:58:48 -07:00
Sagar Kamble
b7d436fd0e gpu: nvgpu: consider null character for strncat
While forming string available length to strncat should consider null
character in last byte otherwise strncat can index the array out of
bounds.

CID 481139
CID 455841
Bug 3512546

Change-Id: I011be1deea40e276e681965deefb60fe8ab79479
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710380
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-17 08:44:27 -07:00
Sagar Kamble
da884615d3 gpu: nvgpu: fix pmu_board_obj init in construct_pwr_policy
Fix below CERT violation:
In construct_pwr_policy: Do not dereference null pointers.

This was introduced in the below commit:

    commit 700bd83b41 ("gpu: nvgpu: Rename/clean boardobj unit")

CID 203372
Bug 3512546

Change-Id: I30a2ce13f9df343a1dc74fdd7427ccf65b228a3e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710234
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-17 08:44:18 -07:00
Sagar Kamble
e96740c59a gpu: nvgpu: change ecc error counters increment to wrapping type
Usage of nvgpu_safe_add_u32 to increment nvgpu maintained corrected
ecc error counters can lead to BUG due to overflow as corrected ecc
errors can keep coming in and system will continue to operate.

In some configurations, uncorrected error counters can also
overflow and lead to BUG.

Increment these counters and their delta calculations to use
nvgpu_wrapping_add_u32.

JIRA NVGPU-7054

Change-Id: I85ddddfa46062744cccbe0756ad942787e72f01b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2601152
(cherry picked from commit f016e59189d2bd66e23f17ccb638f6d384b82fbd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623638
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-17 08:41:07 -07:00
Sagar Kamble
d3b417ce2c gpu: nvgpu: address priv_ring unit code inspection gaps
1. Hardcoded constants are defined using #define are converted to
   const.
2. set_ppriv_timeout_settings HAL is not applicable from gm20b.
   Hence remove it completely.

JIRA NVGPU-6903

Change-Id: Ic096c5dc87aa45db0aa05482947cd032ae72bdd4
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2552581
(cherry picked from commit c5fb38a54208330f24754fed33d7242903dbac59)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2623635
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-17 08:40:46 -07:00
Debarshi Dutta
48cd58d332 gpu: nvgpu: add timeout error handling
Report a timeout error when fb_mmu_ctrl_r() register doesn't
correctly reflect the tlb invalidate status.

Jira NVGPU-7192

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2603267
(cherry picked from commit b16ed38d087667bc2bddaddde820648d6a931064)
Change-Id: I2360c8741b396b26079438a917770e0bb051c661
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2700042
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-13 01:00:40 -07:00
Debarshi Dutta
76cc8870e1 nvgpu: gpu: update default nvs domain implementation
In current form, the default domain acts like any schedulable
domain. TSGs are bound to it and it can be enumerated via the
public interfaces.

The new expectation for the default domain is meant to change
from the current form to a pseudo domain that cannot act like
an ordinary domain in other ways, i.e. it must not be reachable
by in particular the domain management API, it can't be removed,
does not show up in lists, and TSGs cannot be explicitly bound to
this domain. It won't participate in round-robin domain scheduling.
It is not really a domain, and acts like one only when activated in
the manual mode.

Following changes are made overall to support the above change in
definition.

1) Domain creation and attaching the domain to the scheduler are now
split into two separate functions. The new default domain (having ID
= UINT64_MAX) is created separately from a static function without
linking it with other domains in the scheduler.

2) struct nvgpu_nvs_scheduler explicitely stores the default domain
to support direct lookups.

3) TSGs are initially not bound to default domain/rl_domain.

Jira NVGPU-8165

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: I916d11f4eea5124d8d64176dc77f3806c6139695
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2697477
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-12 00:24:58 -07:00
Debarshi Dutta
26525cb1cf gpu: nvgpu: runlist changes for default domain implementation
In order to support the concept of the default domain, a new
rl domain is created that shadows all the other domains i.e.
all channels of all TSGs are replicated here. This is scheduled
by default during GPU boot.

1) The shadow rl_domain is constructed during poweron sequence via
nvgpu_runlist_alloc_shadow_rl_domain(). struct nvgpu_runlist
is appended to store this separately as 'shadow_rl_domain'.
This is scheduled in background as long as no other user created
rl domains exist.

2) 'shadow_rl_domain' is scheduled out once user created rl domain
exist. At this point, any updates in the user created rl domains
are synchronized with the 'shadow_rl_domain'. i.e. 'shadow_rl_domain'
is also reconstructed to contain active channels and tsgs from the rl
domain.

3) 'shadow_rl_domain' is scheduled back in when the last user created
rl domain is removed.

4) In future for manual mode, driver shall support explicitely
   switching to 'shadow_rl_domain'. Also, we will move to an
   implementation where 'shadow_rl_domain' is switched out only when
   other domains are actively scheduled.  These changes will be
   implemented later.

Jira NVGPU-8165

Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Change-Id: Ia6a07d6bfe90e7f6c9e04a867f58c01b9243c3b0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2704702
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-12 00:24:46 -07:00
Sagar Kamble
c7d495ffd6 gpu: nvgpu: fix misra rule 3.1 violation
With http path for ECC hw ref manual specified with two forward slashes
within comment block rule 3.1 is violated.

We can specify the http path with single forward slash. Fix it.

Change-Id: I310869995e1d064b4216a3ed99ea57f78cf78d8d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2614150
Reviewed-by: V M S Seeta Rama Raju Mudundi <srajum@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
(cherry picked from commit 0e1cb893d2637badece8d39f93f4025e92d8bd8e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2706558
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-11 04:18:17 -07:00
Sagar Kamble
d82400d2b8 gpu: nvgpu: fix MISRA Rule 5.1 violation
BVEC changes for nvgpu_rc_pbdma_fault and nvgpu_rc_mmu_fault
started reporting below MISRA issue.

kernel/nvgpu/drivers/gpu/nvgpu/common/fifo/tsg.c:321:
  1. misra_c_2012_rule_5_1_violation: Declaration with identifier
     "nvgpu_tsg_unbind_channel_check_hw_state", which is ambiguous.
kernel/nvgpu/drivers/gpu/nvgpu/common/fifo/tsg.c:349:
  2. other_declaration: The first 31 characters of identifiers
     "nvgpu_tsg_unbind_channel_check_ctx_reload" and
     "nvgpu_tsg_unbind_channel_check_hw_state" are identical.

Do below renames to fix the issue. Doing both for consistency.

s/nvgpu_tsg_unbind_channel_check_hw_state/nvgpu_tsg_unbind_channel_hw_state_check
s/nvgpu_tsg_unbind_channel_check_ctx_reload/nvgpu_tsg_unbind_channel_ctx_reload_check

JIRA NVGPU-6772

Change-Id: Ib92cabe11c486621351bf15ddb86e20d16d514c4
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2584152
(cherry picked from commit a619f259c6a4ffccb05550767212989af60c2a90)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2706551
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-11 04:18:12 -07:00
mkumbar
162d7ec32d gpu: nvgpu: falcon debug unit update
- Don't print error if debug display buffer is empty.

Bug 3623500
Bug 3418561

Change-Id: I066999fb0f7d41d491c3b01df2b976fcfa833ebf
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2704967
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-11 04:16:18 -07:00
Shashank Singh
ba22f6263b gpu: nvgpu: move gv11b code under config flag
Move gv11b specific code under CONFIG_NVGPU_GV11B_SUPPORT so that gv11b
support can be removed for qnx later as it is no longer POR for qnx on
dev-main.

Jira NVGPU-8189

Change-Id: Idc17cfa22199f2b69a1bab0849cd2bd2e0fb6288
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2693828
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-11 04:13:23 -07:00
Sagar Kamble
45c6aed68d gpu: nvgpu: fix CERT violations in nvgpu_dbg_gpu_access_gpu_va
Update nvgpu_dbg_gpu_access_gpu_va to:
1. Ensure that integer conversions do not result in lost or
   misinterpreted data.
2. Do not dereference null pointers.

CID 436748
CID 473585
CID 254272
CID 490303
Bug 3512546

Change-Id: I551484b671aa48175a8cea119885eac478c2731c
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707019
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-07 23:24:44 -07:00
Sagar Kamble
9d6269ce7f gpu: nvgpu: assert gr dev is non-NULL
nvgpu_device_get can return NULL if supplied invalid ID or instance
ID. We expect GR device struct to be non-NULL there hence just
assert that it is indeed non-NULL in gr_reset_engine and
ga10b_grmgr_init_gr_manager.

CID 224133
CID 250232
Bug 3512546

Change-Id: Id09a1c436a8e49b921111b940d3d013bd66bff7a
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707018
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-07 23:24:39 -07:00
Sagar Kamble
c1202d7283 gpu: nvgpu: assert that priv is non-NULL in gk20a_alloc_comptags
priv data is available when gk20a_alloc_comptags is called hence add
assert for it.

CID 274852
Bug 3512546

Change-Id: I9d907153c359900071f0f89b84d2ee15141dd874
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707492
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-07 15:18:56 -07:00
Sagar Kamble
75c9a2eb94 gpu: nvgpu: fix nvgpu_dma_alloc_flags_sys cleanup
aligned_size was decremented from g->dma_memory_used in case
of failure post dma alloc. However, aligned_size is not
initialized at that point. Use size instead.

CID 446040
Bug 3512546

Change-Id: Id1e117703a3c24dcb9c0b6f3b808c7e30bf90f0b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707486
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-07 15:18:45 -07:00
Sagar Kamble
c32c4025a4 gpu: nvgpu: fix the ce app ctx cleanup
tsg and ch members in ce_ctx may remain uninitialized when the cleanup
function nvgpu_ce_delete_gpu_context_locked is called. Guard the
references to those.

CID 438091
Bug 3512546

Change-Id: I0ce96f9bad1e4f7fd331171b3f134c48c893839f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707470
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-07 15:18:39 -07:00
mkumbar
2506dd2b86 gpu: nvgpu: set ACR FW load flag as per platform
-Add ACR FW load flag which will be set based on
 platform and load the requested FW accordingly.

Bug 3572869

Change-Id: I6643f183fed104fef059dd691036a2c509073a50
Signed-off-by: mkumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2689022
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Andy Chiang <achiang@nvidia.com>
2022-05-07 15:13:03 -07:00
Richard Zhao
1ce899ce46 gpu: nvgpu: fix compile error of new compile flags
Preparing to push hvrtos gpu server changes which requires bellow CFLAGS:
        -Werror -Wall -Wextra \
        -Wmissing-braces -Wpointer-arith -Wundef \
        -Wconversion -Wsign-conversion \
        -Wformat-security \
        -Wmissing-declarations -Wredundant-decls -Wimplicit-fallthrough

Jira GVSCI-11640

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I25167f17f231ed741f19af87ca0aa72991563a0f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2653746
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-07 15:11:49 -07:00
Johnny Liu
69ec2dcff7 gpu: nvgpu: ga10b+: emc scaling using ICC
For EMC frequency scaling, prior to ga10b, nvgpu driver
was using BWMGR. On ga10b+, BWMGR support is deprecated
and moved to Linux ICC framework.

Jira NVGPU-7312
Bug 3514055
Bug 200766984

Change-Id: Ib1f87afe021414dfc563e007823f93098937fe59
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2706374
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-06 05:21:55 -07:00
Rajesh Devaraj
fac998940c gpu: nvgpu: enable polling support for error reporting in AV+L
As per Safety_Services, a client must perform polling to ensure that the
previously reported errors are cleared at FSI, in case of back-to-back
error reporting. However, to minimize the polling overhead, NvGPU driver
performs polling only when the error to be reported is corrected error
to ensure that it is not overwriting the previously reported
uncorrected/corrected error. In case of uncorrected errors, it will be
reported without doing polling. This situation leads to a failure in
error reporting, when uncorrected errors are reported back-to-back. This
is acceptable for safety builds where SW quiesce will be triggered
immediately after the reporting of first uncorrected error. In case of
other build configurations, MCU/SEH takes the decision on encountering
uncorrected errors. To handle such build configurations, polling is
enabled for all types of errors, in all build configurations.

This patch also removes an unused macro "ERR_TYPE_MASK".

Bug 3622420

Change-Id: I750b0406faec9b229d8d0c74e986807234362cb9
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2707105
Reviewed-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-06 05:21:43 -07:00
Martin Radev
657daaee9e gpu: nvgpu: Mark fds with O_CLOEXEC
There shouldn't be an usecase that an fd, installed by nvgpu,
must be shared on exec with the new process. This doesn't only
lead to excessive number of fds in the exec process, but also
can lead to potential security issues.

This patch marks the fds with O_CLOEXEC, so that they get
closed on exec.

Bug 3583628

Change-Id: I3499b1429ac512b2c172e9e628d0a7a1417d72e3
Signed-off-by: Martin Radev <mradev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2704350
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-03 20:33:58 -07:00
Richard Zhao
c30afdce02 gpu: nvgpu: add periodic timer API
move fecs_trace polling from kthread to timer API.

Jira GVSCI-10883

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: I224754b7205f1d0eefdc19a73a98f42e4d3e9d0e
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2700601
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Aparna Das <aparnad@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-02 23:16:44 -07:00
Antony Clince Alex
61ae0b7642 gpu: nvgpu: fix emulate mode enable
The emulate mode support is determined after chip detect and is flagged
by using NVGPU_SUPPORT_EMULATE_MODE flag. The present logic prevents
user from configuring the emulate mode sysfs knobs if this flag is not
set, however the emulate mode usecase requires the user to configure the
syfs knob prior to power-on, hence defer emulate mode check to a later
stage after chip detect.

Bug 3621460

Change-Id: If522527542fa8d7e95ccbcff43b74adbb9e976e6
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2703953
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mayur Poojary <mpoojary@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: David Li <davli@nvidia.com>
2022-04-29 06:17:59 -07:00
Jinesh Parakh
e3ed309d35 gpu: nvgpu: Fix Unintentional integer overflow bug
Fix following Coverity defect:
cde.c : Unintentional integer overflow

The Coverity issue suggests that (u64) (nvgpu_ltc_get_ltc_count(g) * nvgpu_ltc_get_slices_per_ltc(g) * nvgpu_ltc_get_cacheline_size(g)) can cause overflow because typecasting is done after multiplication.
This patch solves that issue by typecasting it before multiplication.

CID 10112360

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I314ca7a9adc95fcb09f15eb603b56ad03ce34b99
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2697027
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-04-29 06:11:31 -07:00
Jinesh Parakh
131933d528 gpu: nvgpu: Fix Division by zero defect
Fix following Coverity Defect:
profile.c : Division or modulo by zero

CID 10061399

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I03979af4ab105f659cf0fe3eac8d21946dfca950
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2695362
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-04-29 06:10:48 -07:00
Jinesh Parakh
5b38f48227 gpu: nvgpu: Fix Bad bit shift Coverity issues
Fixed following Coverity Defects:
sec2_tu104.c : Bad bit shift operation
grmgr_ga10b.c : Bad bit shift operation
clk_gm20b.c : Bad bit shift operation
gsp_ga10b.c : Bad bit shift operation

CID 9869505
CID 9869506
CID 10062538
CID 10112176
CID 10127981

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I9cbb2403ccd41d6cbe99f73f27f915969094fa5b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2689262
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-04-29 06:08:50 -07:00
Jinesh Parakh
622fe70dab gpu: nvgpu: Fix Bad bit shift Coverity issues
Fixed following Coverity Defects:
ioctl_as.c : Bad bit shift operation
mc_tu104.c : Bad bit shift operation
vm.c : Bad bit shift operation
vm_remap.c : Bad bit shift operation

A new linux header file for ilog2 is created.
The files which used the old ilog2 function
have been changed to use the new nvgpu_ilog2
function.

CID 9847922
CID 9869507
CID 9859508
CID 10112314
CID 10127813
CID 10127899
CID 10128004

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: Ia201eea7cc426c3d6581e1e5ae3b882dbab3b490
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2700994
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-04-28 04:08:45 -07:00