Commit Graph

4 Commits

Author SHA1 Message Date
Nicolas Benech
4e41a0b199 gpu: nvgpu: Fix LibC MISRA 17.7 in os/posix
MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch contains fix for all 17.7 violations instandard C functions
in OS/Posix interface.

JIRA NVGPU-1036

Change-Id: I2da417edc992f16de24cdff536c0538f1fde8b61
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929901
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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-31 15:25:27 -07:00
Philip Elcan
b43ea7df61 gpu: nvgpu: unit: fault injection for dma alloc
Add the ability to force errors from the dma_alloc routines in the POSIX
build for the unit test framework.

JIRA NVGPU-1235

Change-Id: Ie368b8e5aa1385aa46e8190feb8a450cf96b94fe
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930800
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-26 17:29:23 -07:00
Philip Elcan
bd95a0c5ff gpu: nvgpu: fix malloc in POSIX dma module
This fixes a bug where the POSIX dma module was calling malloc for
dma allocation requests with the incorrect size.

Bug found as a result of JIRA NVGPU-1235

Change-Id: Ia2933dc90f12d84a7da91a50eb3eafd6eb0e129e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930799
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
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-26 17:29:19 -07:00
Alex Waterman
b44c7fdb11 gpu: nvgpu: Move common DMA code to common/mm
This migrates the common DMA code (os agnostic) to the
common directory. This new unit will be the common DMA
allocator that lets users allocate SYSMEM, VIDMEM, or
either. Other units will be responsible for actually
handling the mechanics of allocating VIDMEM or SYSMEM.

Also update the names of the DMA related files so that
tmake doesn't complain about duplicate C file names. To
do this call the common DMA file dma.c and prepend the
OS to the other DMA files. So now we have:

  common/mm/dma.c
  os/posix/posix-dma.c
  os/linux/linux-dma.c

JIRA NVGPU-990

Change-Id: I22d2d41803ad89be7d9c28f87864ce4fedf10836
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1799807
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-05 20:38:42 -07:00