srajum
585c3ab1c1
gpu: nvgpu: fixing MISRA violations
...
- Rule 4.12
Dynamic memory allocation shall not be used.
- Rule 8.6
"gp10b_device_info_parse_data" is declared but never defined
- Rule 5.7
A tag name shall be a unique identifier
JIRA NVGPU-6536
Change-Id: I2f234d4aadd217f13b51e4dcadfa13d284a3750f
Signed-off-by: srajum <srajum@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2582076
(cherry picked from commit 7394eedcdfd606a4687adba1ce82e96b5d6e23f8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2677542
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: Ankur Kishore <ankkishore@nvidia.com >
GVS: Gerrit_Virtual_Submit
2022-03-08 05:31:42 -08:00
srajum
ee670a0afd
gpu: nvgpu: allowlist violations wrt RFD
...
- Rule 21.3
The memory allocation and deallocation functions of <stdlib.h>
shall not be used
- Rule 4.12
Dynamic memory allocation shall not be used.
- These are approved RFD's
https://jirasw.nvidia.com/browse/TID-1129
https://jirasw.nvidia.com/browse/TID-1131
JIRA NVGPU-5955
Change-Id: I1bff5d63b406d91f61a333da59cf43b9fb0a3a92
Signed-off-by: srajum <srajum@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2572086
(cherry picked from commit c8840abab61a50c7afb561eac884a40a1338397d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674342
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: Rajesh Devaraj <rdevaraj@nvidia.com >
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com >
GVS: Gerrit_Virtual_Submit
2022-02-27 18:12:20 -08:00
Richard Zhao
09cf3642ef
gpu: nvgpu: add more compile flags to posix iGPU
...
Added bellow CFLAGS:
-Werror -Wall -Wextra \
-Wmissing-braces -Wpointer-arith -Wundef \
-Wconversion -Wsign-conversion \
-Wformat-security \
-Wmissing-declarations -Wredundant-decls -Wimplicit-fallthrough
Also fixed all of compile errors for posix.
It's preparing for porting gpu server.
Jira GVSCI-11640
Signed-off-by: Richard Zhao <rizhao@nvidia.com >
Change-Id: I30b09a62a57396abd642922e22f2e550a96f42c2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2555059
Reviewed-by: Shashank Singh <shashsingh@nvidia.com >
Reviewed-by: Aparna Das <aparnad@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
GVS: Gerrit_Virtual_Submit
2022-01-13 12:36:31 -08:00
ajesh
1c1dca5d6f
gpu: nvgpu: avoid hard coded constants
...
Replace the hard coded numeric constants in posix unit.
Jira NVGPU-4954
Change-Id: I9f57e2d60b44c942924c47a7e38c237c732b13b0
Signed-off-by: ajesh <akv@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2289633
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com >
Reviewed-by: Sagar Kamble <skamble@nvidia.com >
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2020-12-15 14:13:28 -06:00
Philip Elcan
95c3e56961
gpu: nvgpu: unit: propagate fault injection to threads
...
Change approach to how the fault injection state is stored to facilitate
propagating fault injection state to child-threads. Rather than each
unit maintaining a thread-local object, there is a thread-local
container stored in the posix-fault-injection itself. This container is
initialized for each test module so that is independent of other other
test modules (for parallel test module execution). When child threads
are created with nvgpu_create_thread(), the fault injection container is
configured for the child.
JIRA NVGPU-3981
Change-Id: I9b580dc7f1621a7770eef8eba796f3918f2738bf
Signed-off-by: Philip Elcan <pelcan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2238474
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2020-12-15 14:10:29 -06:00
Philip Elcan
acc65f6e84
gpu: nvgpu: bug: move nvgpu_do_assert_print() into assert.c
...
There was a header file circular dependency that was preventing
including some files. For example, for utils.h to include safe_ops.h
would include bug.h which included log.h which included bitops.h which
included utils.h. To break this loop, the macro nvgpu_do_assert_print()
into a function in a new file assert.c. With this change, log.h is no
longer required in bug.h.
This change also required adding a few includes in C files that were
picking up definitions through the chain above.
JIRA NVGPU-3868
Change-Id: Icf95677bb36e4aa034cba25594cf71f2d028c289
Signed-off-by: Philip Elcan <pelcan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2168528
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-08-06 13:36:30 -07:00
ajesh
92f42b293b
gpu: nvgpu: fix MISRA violation in kmem unit
...
MISRA Rule 21.6 requires that the standard library input/output
functions shall not be used.
Remove the usage of snprintf function to fix the violation.
Cache name is not required in QNX build as it is not used in cache
allocation.
Jira NVGPU-3293
Change-Id: I2bd92a3ed2510a3ef8f2bdee8ad446b353baf613
Signed-off-by: ajesh <akv@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2144442
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com >
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shashank Singh <shashsingh@nvidia.com >
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-07-01 03:55:40 -07:00
ajesh
70d8a4555a
gpu: nvgpu: fix CERTC violations in kmem unit
...
INT30-C Requires that unsigned integer operations do not wrap.
INT31-C Requires that integer conversions do not result in lost or
misinterpreted data.
ERR33-C Requires to detect and handle standard library errors.
Fix the above CERT C violations in kmem unit.
Jira NVGPU-3603
Change-Id: I104551406e3cf6d2da22c5b6c6edc6694992ce62
Signed-off-by: ajesh <akv@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2139529
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com >
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-06-21 04:36:51 -07:00
ajesh
cfb17a1f9a
gpu: nvgpu: fix MISRA violations in kmem unit
...
MISRA rule 21.2 forbids the usage of identifier names which start with
an underscore. Fix the violations of MISRA rule 21.2 in kmem unit.
Jira NVGPU-3139
Change-Id: I20f80e8bcdc8f802bd9aea34bbf050cafdfbd72e
Signed-off-by: ajesh <akv@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2110524
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-05-03 13:08:00 -07:00
Dinesh
a6bb97da34
gpu: nvgpu: Unifying qnx kmem with posix
...
This patch will add changes for unifying the kmem functions in
posix with qnx kmem functions.
JIRA NVGPU-2148
Change-Id: I7ed08796d8baa9a0f5e194a664ac5710d5cb79b7
Signed-off-by: Dinesh <dt@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2077081
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-04-05 00:34:58 -07:00
Adeel Raza
800d96865d
gpu: nvgpu: posix: MISRA rule 15.6 fixes
...
MISRA rule 15.6 requires that all if/else/loop blocks should be enclosed
by brackets. This patch adds brackets to single line if/else/loop blocks
in the POSIX code.
JIRA NVGPU-775
Change-Id: Idafd5a5068c23b850ad1b0b083550a75b35588c1
Signed-off-by: Adeel Raza <araza@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/2011739
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com >
Reviewed-by: Scott Long <scottl@nvidia.com >
Reviewed-by: Alex Waterman <alexw@nvidia.com >
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com >
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com >
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2019-02-05 19:23:58 -08:00
Philip Elcan
a310dca7a7
gpu: nvgpu: add fault injection for kmem
...
This adds the ability to enable fault injection for the POSIX
implementation of the nvgpu kmem alloc routines.
JIRA NVGPU-1235
Change-Id: I22f2949cf63511cb021086ed49e603e8adc121ad
Signed-off-by: Philip Elcan <pelcan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/1919443
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2018-10-19 00:35:52 -07:00
Philip Elcan
9fda4bc276
gpu: nvgpu: fix malloc return check in POSIX kmem
...
This fixes a bug in nvgpu_kmem_cache_create() where the return of
malloc() was incorrectly checked.
Bug found as a result of JIRA NVGPU-1235
Change-Id: I1c80f2035df980fd1193cf60dfe6132c1f9b693d
Signed-off-by: Philip Elcan <pelcan@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/1919442
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com >
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com >
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2018-10-19 00:35:45 -07:00
Alex Waterman
b15624b39b
gpu: nvgpu: posix: move the posix dir to os
...
Since the posix code is supporting a particular OS this code
should belong under os/ not common/.
Change-Id: Idf5f75b8ab9d614c9dd43ea23dab8df3c346c0ef
Signed-off-by: Alex Waterman <alexw@nvidia.com >
Reviewed-on: https://git-master.nvidia.com/r/1800658
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com >
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com >
2018-08-17 13:54:25 -07:00