Commit Graph

3149 Commits

Author SHA1 Message Date
Nan Wang
b63a822a1b pva: deploy V3 KMD
Jira PVAAS-17785

Change-Id: I8ebc4c49aec209c5f82c6725605b62742402500a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3299880
Tested-by: Nan Wang <nanwa@nvidia.com>
Reviewed-by: Vishwas M <vishwasm@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nan Wang <nanwa@nvidia.com>
2025-07-24 10:19:15 +00:00
Nan Wang
b5d768302a pva: move V2 to pva_v2 folder
Prepare for deploying v3 driver

Jira PVAAS-17785

Change-Id: I0a28a90c87394bdc40c587dad11d5991c46b6cab
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3299879
Tested-by: Vishwas M <vishwasm@nvidia.com>
Tested-by: Nan Wang <nanwa@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nan Wang <nanwa@nvidia.com>
Reviewed-by: Mohnish Jain <mohnishj@nvidia.com>
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
2025-07-24 10:19:15 +00:00
Pritesh Raithatha
7399ae2100 platform: tegra: allow mc-utils load for non-tegra devices
Nvgpu driver has dependency on mc-utils driver so
allow the driver to get loaded for non-tegra devices.
Also update functions to fail for non-tegra devices
in case called by mistake.

Bug 5066721

Change-Id: I410c10d0155ac85001eb12b2f4bce694affb5186
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3295359
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2025-07-24 10:19:15 +00:00
Ankur Pawar
4299b8bfe0 camera: fusa: Fix concurrency issue
Fix concurrent access issue in destroy_buffer_table().
The function is freeing buffers while only holding the
write lock during hash deletion. Other threads could
still be accessing the buffers.

Create a temporary list within the lock and then unmap
the addresses safely.

Bug 5017044

Change-Id: Ib262570aaa19f65c4cb3959123a85c5f66e5db68
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306890
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Zuyi Hu <zuyih@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
2025-07-24 10:19:15 +00:00
amitabhd
909b489e87 host1x_emu: Fence polling modification
In simulation platform enabling hrtimer fence polling
is causing kernel to block/unresposive.

This issue is not observed in sillicon platforms.
As per this CL making following changes.

1. Added flag for kernel Thread polling.
2. Enabling HRTimer fence polling for silicon platform.
   only.

Bug 5094695

Change-Id: I011900e9299be71413c92952d447e53abfd34128
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297995
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Raghavendra Vishnu Kumar <rvk@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:15 +00:00
Khushi
08f05cb80d vse: Add vaildation checks for Algorithms
Bug 5058383

Change-Id: Ibeb1436938db0d87a5c4f99275aed6cec17dabe1
Signed-off-by: Khushi <khushi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284860
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
2025-07-24 10:19:15 +00:00
saranyad
d0e719df4a DCE_KMD: Fix TOP 25 CWE Rule
- This patch fixes the following violations

  OVERRUN - 1 (24138320)
  - Added checks to validate boundries

  Rule: OVERRUN
  Rule Description: Out-of-bounds access to a buffer

JIRA TDS-15862

Change-Id: I4df6c7124da19143eb0d9b8027df28fccdff0b75
Signed-off-by: saranyad <saranyad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305934
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagarjuna Kristam
4dce44a907 PCI: tegra: Add common DMA IRQ
IRQ is external interface for DMA driver. Use one IRQ handler callbacks
to register and call SoC specific handler them based on SoC type.
Add ICD documentation for common IRQ API's

JIRA NET-2663

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I51137489ebe071e2e4a3edc3c5e3fefb84c994fa
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305091
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagarjuna Kristam
330ecd452b pci: tegra264: Remove MSI info from ICD
MSI API are not supported via GuestOs decomposition. Disable documentation
for the same during ICD compilation.

JIRA NET-2663

Change-Id: Ie1a0ca75b91e848152d0748f8f49735bedd0be70
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305090
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:15 +00:00
Ketan Patil
d256920b00 video: tegra: nvmap: Handle pages mapped using remap_pfn_range in alloc from VA
OpenRM maps the buffer with remap_pfn_range and then it's user VA is
passed to libnvrm_mem to create a handle out of it. NvMap uses
get_user_pages to get user pages from the VA. It fails for the buffer
mapped with remap_pfn_range. Hence use follow_pfn/follow_pfnmap_start
functions to obtain pfn from the VA and then obtain page pointer from
it.

Bug 5007238

Change-Id: I45a6ede6b5f164e537f014d9db3475b4c6d89307
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298720
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Lakshmanan Selvi Muthusamy <lm@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
2025-07-24 10:19:15 +00:00
Mainak Sen
db0d9da92f drm/tegra: Fix Engine timestamp shift factor
In Orin and previous chipsets, engine timestamp counter
runs 32 times faster than CNTVCT register, so the actual
timestamp is obtained by right shifting with factor of 5.
In Thor onwards, this shift is not required is for VIC engine.

Jira HOSTX-5905

Change-Id: I69980fdfcf50b15db99b1fbad522aecd571a0f17
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306825
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Joshua Cha
a674701be0 nvsciipc: add suspend/resume callback
print suspend/resume status

JIRA NVIPC-3318

Change-Id: I43585ba82ccb75dda92f7276e5d5bab416087818
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297783
Reviewed-by: Jeungwoo Yoo <jeungwooy@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:15 +00:00
spatki
0b1641eee3 tsec: allow sending more than 1 cmd to same unit
This change removes the check in tsec comms part of dce
which blocks sending more than 1 command to tsec fw for the
same unit. This is to let the display driver force send
command to tsec fw when it is in the middle of a command
to inform it about certain events ex: hotplug. Tsec driver
should trust that display driver is doing checks when sending
the command to tsec fw.

Bug 5008088

Change-Id: Id765c558a8350c501466685d3894a2c8349550eb
Signed-off-by: spatki <spatki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3288182
Reviewed-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagaraj P N
f552a45569 cryptodev: update buf addr check for SHA requests
Input buffer VA needs to be checked only for
non-zero copy IVC queues.

Bug 4999798

Change-Id: Ic8bcc44abb65f8e2d614f6734870e81a8d5ec03c
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3306711
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
2025-07-24 10:19:15 +00:00
Yuyuan Chen
d27873d84e kernel: nvidia-oot: Fix Static issues S2/5
Jira CAMERASW-31832

Change-Id: I67167abc5939569ab644a22cdf3ce494ee43f391
Signed-off-by: Yuyuan Chen <yuyuanc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305725
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ryan Li <ryanli@nvidia.com>
2025-07-24 10:19:15 +00:00
omar
590c2cab5b drivers: pva: boot from file in sim
In simulation, on VDK or SCSIM, force boot from file

Bug 4872880

Change-Id: Ifc594986f4470cc82ff54a21613c5a249bdea4ae
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304778
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
omar
d3f9244dcb drivers: pva: enable boot from GSC
Bug 4872880

Change-Id: Ie3be16633e9ee1d53e582da74e157e786668172f
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3296454
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Mahesh Kumar
fb5f279667 platform:dce: Add a delay between ivc reset
Add a few microseconds delay between IVC channel reset retries.
This prevents kernel logs from flooding if dce bootstrapping takes
some time for any reason.

Based on logs below, DCE is taking around 10-30 microsecond for channel reset.
So, Keeping the delay of 10-20 microseconds.

20:26:46.637409: dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x5]
20:26:46.637421: message repeated 15 times: [ dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x5]]
---
20:26:46.637429: dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x1]
20:26:46.637458: message repeated 12 times: [ dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x1]]
----
20:26:46.637461: dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x2]
20:26:46.637471: message repeated 15 times: [ dce: dce_mailbox_set_full_interrupt:157  Intr bit set multiple times for MB : [0x2]]

Jira TDS-6381

Change-Id: I0f8d3c55058019df5a52edd232eae93b3bf84276
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304216
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagaraj P N
965bd044c6 vse/cryptodev: add memory map/unmap interface
- add support for zero copy SHA/GMAC operations
- add support to read zero copy nodes in DT
- support memory buf map/unmap ioctl interfaces
- unmap all memory buffers when FD corresponding
  to device node is closed.
- support only one open call at a time for zero
  copy nodes.

Bug 4999798

Change-Id: If110108a73b24ca9f523a8c67a47c02b922c3fd8
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292084
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
2025-07-24 10:19:15 +00:00
Ketan Patil
268a87ecfa video: tegra: nvmap: Add DT based API disabling support
There are debug/duplicate APIs like NvRmMemGetIVCId,
NvRmMemHandleFromIVCId, NvRmMemWrite etc. which don't have corresponding
requirements in DriveOS 7.0 Linux NSR. We have taken sign-off from the
stakeholders to confirm that they are not using these APIs in T264 Linux
Prod NSR variant. But some of them are using these APIs in dev-nsr and
did not agree to remove it from dev-nsr, L4T, HOS etc. Hence we need to
make sure that they do not accidentally start using these APIs. Hence
add following DT based disabling support.

- Add disable-debug-support property in tegra-carveouts DT node in T264
prod nsr dts.
- Parse this DT node in nvmap and if the above property is present then
BUG_ON in the ioctl functions corresponding to these APIs.

Bug 4980348

Change-Id: Icdd5aadf3197d0649b61d285f433fa65ea69e806
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298507
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2025-07-24 10:19:15 +00:00
Mainak Sen
b45d59c4a6 gpu: host1x: Enable VI syncpoint pool
Create VI specific syncpoint pool based on
PCT configured VI syncpoint range. VI module shall
allocate syncpoint only from this pool.

Jira HOSTX-5827

Change-Id: I2d6014de2033f0878492d0243010cc7ca507c383
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3290562
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:15 +00:00
Suneel Kumar Pemmineti
38d739c860 nvsciipc: Add UID member to Config structure
- Added UID member to nvsciipc_config_entry data
structure. this is needed for implementing
test_nvsciipc_cfgblob in linux.
- removed static from ioctl function to attach eBPF program
- add error-injection.h and ALLOW_ERROR_INJECTION macro to ioctl
  to use bpf_override_return()

JIRA NVIPC-2817

Change-Id: Ic27156e321368041f41fbabff9e6375140fe1d0e
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301786
Tested-by: Joshua Cha <joshuac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Simon Je <sje@nvidia.com>
2025-07-24 10:19:15 +00:00
Surbhi Singh
b1af9a0347 video: tegra: nvmap: Add checks for addition overflow
Add check for overflow when two unsigned integers are added and return
error in case of overflow condition.

CID 13772217
CID 13772356
CID 13772469
CID 13772634
CID 13772882
CID 13772995

JIRA: TMM-5724
Bug 4479044

Change-Id: Iaa04cc45bfe11a0cfb2e8124d9423e3a66e39f73
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3270465
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
saranyad
bb80a707cd KMD: Fix Misra-C:2012 Rule
- This patch fixes the following violations

  OVERRUN - 2 (CIDs 22827501, 22827481)
  - Added checks to validate boundries

  Rule: OVERRUN
  Rule Description: Out-of-bounds access to a buffer

JIRA TDS-15862

Change-Id: I94b19dc491583a63ec242c59cc288c5e32134cc0
Signed-off-by: saranyad <saranyad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3299743
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Adithya Sanjeev Byalpi <abyalpi@nvidia.com>
Reviewed-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
2025-07-24 10:19:15 +00:00
Mallikarjun Kasoju
14d6946415 watchdog: Fix overflow error
Fixed unsigned int overflow error.

Bug 5083375

Change-Id: If8ddb802938e9ef811462a99023830e3370a00ab
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3296593
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
amitabhd
090b44a9f1 host1x_emu: Enable event-service for Host1x-EMU
Add change to host1x-fence kernel module to support
its functionality over host1x-emu driver.

Jira HOSTX-5818

Change-Id: I09c7f2ee2059e0eeee11429b059c5152ffd855d5
Signed-off-by: amitabhd <amitabhd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3285249
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:15 +00:00
Yuyuan Chen
3b31f76f27 kernel: nvidia-oot: Fix Static issues S2/5
Jira CAMERASW-31832

Change-Id: I4060480865bf3895fae22127bb3e0c915af8af9f
Signed-off-by: Yuyuan Chen <yuyuanc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297678
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Tested-by: Patrick Young <payoung@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ryan Li <ryanli@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
2025-07-24 10:19:15 +00:00
Mallikarjun Kasoju
5ee83509d5 spi: Fix overflow error
Fixed overflow errors that could be
caused by arithmetic operations.

Bug 5083347

Change-Id: I96779bfa5f106e058056f16c1fe94100308a6d59
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297615
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:15 +00:00
Sanjith T D
a86effcc71 vblk: Fix mapping of SECURE_ERASE to ERASE
In 6.1+ kernel, blk_queue_max_secure_erase_sectors()
has to be used to tell block layer that vblk supports
SECURE_ERASE operation.

Bug 5011844
Bug 4311184

Change-Id: Id61edee27f4ae0db9a92a4e2d331bb3f209fdd85
Signed-off-by: Sanjith T D <std@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3300237
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sreenivas Velpula <svelpula@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
2025-07-24 10:19:15 +00:00
Hongming Dong
ede67c712a kernel: nvidia-oot: Fix Linux KMD coverity defects
Fix INT30-C, INT08-C, and EXP34-C coverity defects for
cam_fsync.c and cam_cdi_tsc.c.

Jira CAMERASW-30847

Change-Id: I525ed2e0986c3987d062a9baeaefad048715c6c1
Signed-off-by: Hongming Dong <hongmingd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3280943
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
2025-07-24 10:19:15 +00:00
Vishal Thoke
c5fe909fd6 nvdla: kmd: add stub debugfs nodes for DVFS/LPWR
[1] add debugfs nodes for ctrl (clk, power, rail).
    and for dvfs as well.
[2] these nodes are stubbed and will be implemented
    along with features.

Jira DLA-7681
Jira DLA-7797

Signed-off-by: Vishal Thoke <vthoke@nvidia.com>
Change-Id: I534382e78548cde838a28b2a888a8231b5b16ff1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3296913
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
2025-07-24 10:19:15 +00:00
Ketan Patil
afd5300c2b video: tegra: nvmap: Don't allow executable mapping
Don't allow executable mapping during mmap on the fd corresponding to
memory buffer to prevent security risks of code injection and execution
in kernel space.

JIRA TMM-5962

Change-Id: I3d756afdd1b51c8d651230f1a634ef0909d17cc7
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298639
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2025-07-24 10:19:15 +00:00
Suneel Kumar Pemmineti
63a1d3e6e0 nvsciipc: Add nvsciipc_ioctl_get_db_by_idx
- Added nvsciipc_ioctl_get_db_by_idx to retrieve
the endpoint DB entry using index

JIRA: NVIPC-2818
Change-Id: I5651cf29b11dad0ff505f5f497a896572b893e94
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297838
Reviewed-by: Simon Je <sje@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagarjuna Kristam
789e70d35e pci: tegra264: Add EP driver ICD documentation
JIRA NET-2663

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I5855c28c7834fe6ca8f0571321b04a4997dc6185
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293557
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:15 +00:00
Bob Zhang
9297cd7cfd kernel: nvidia-oot: Fix Linux KMD coverity defects
Fix INT32-C and INT08-C coverity defects for tegra-rtcpu-trace.c.

JIRA CAMERASW-31291

Change-Id: I2b80963663df440a38e39bdc3b15d240270f99a5
Signed-off-by: Bob Zhang <bozhang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297723
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
71c53e0ff0 drm/tegra: set CONFIG_TEGRA_DRM_NATIVE_DIS for emb-linux
Set export variable and build config flag, CONFIG_TEGRA_DRM_NATIVE_DIS,
based on emb-linux platform identifier flag NV_OOT_NVHOST_NATIVE_DIS.

Jira HOSTX-5885

Change-Id: I43d3c08a8494fb25524e4b4a91eb2eb68b3526f2
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297034
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:15 +00:00
ryanli
7c4412a765 kernel: nvidia-oot: Static Analysis for S01/08 P11
Fix CERT STR07-C coverity defects for cdi_mgr.c tegra_rtcpu.h

Jira CAMERASW-30850

Change-Id: I86c4cec8cdda2a1f16d5ca7ea7fbeed3a0318ad1
Signed-off-by: ryanli <ryanli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3282774
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
b577e6d0e9 gpu: host1x: form u64 address for shim address
Store u64 shim address from u32 array fetched from DT.

Jira HOSTX-5885

Change-Id: Icf332585c095f81fadfc05b35cc77b16e6ab3a88
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3298399
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Akihiro Mizusawa <amizusawa@nvidia.com>
2025-07-24 10:19:15 +00:00
omar
8c01fe4f87 drivers: pva: fix recovery
When pva recovery is initiated due to command or
task submit timeout or initiated by pva-fw, queues
are cleared and tasks returned with error among other
cleanup activities and pva reset and fw reboot.

There could be multiple concurrent attempts to recover
the PVA engine.  Additionally, task and command submit
may be at varying stages of execution.

- Skip recovery requests while recovery work is pending.
- Skip task removal in case of timeout or invalidated task
  during task submit.
- Skip task submit to CCQ if task was removed during abort.
- Guard against concurrency during recovery
- Re-attempt pva reboot on fail during boot except in recovery.
- Reset driver PM state if module busy fails and PM error is set.
- Set default FW trace mask to WARN+ERROR+BOOT
- Set default driver log mask to FW TRACING
- ccq polling routine exits with timeout if abort is active

Bug 4944591

Change-Id: Id3a7388700ccada135b568c978176bb9f2c5f8a0
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284303
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
2025-07-24 10:19:15 +00:00
omar
4cf0090819 drivers: pva: robustness under severe system load
In order to test hypothesis that severe system loads are causing
erroneous timeouts on command submit and task submit, polling
loop and event wait functions are changed to check for true timeout.

-- dump out FW traces on abort outside ISR.
-- add debug fs node to override driver timeout in mailbox wait event
   and ccq wait event.
-- add device info dump on abort.
-- dump queues

Bug 4944591

Change-Id: Iea78131016e0913d909f504272a6370bb37c35db
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3259651
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Vishnu Mandalapu
09bf300e40 drivers: tegra: virt: runtime frequency
- Add support to change VM profiler frequency in rumtime.

 Jira HYP-19279

Signed-off-by: Vishnu Reddy Mandalapu <vmandalapu@nvidia.com>
Change-Id: I2b260fff61addbd5e2bd53d9b16e441506bdf2d6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222316
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3252176
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Daniel Kudrow <dkudrow@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Alexey Lugovskoy <alugovskoy@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
aa7bcad3cf gpu: host1x: move actmon specific code under CONFIG_PM_DEVFREQ
Move actmon.c file under CONFIG_PM_DEVFREQ and
stub the functions when it is not enabled.

Jira HOSTX-5885

Change-Id: I8e6f86c617061587e4034a184f9a7d82a41a4a03
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297630
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Jon Hunter
2a4ac9e68f drm/tegra: Fix build for Linux v6.14
In Linux v6.14, the 'date' field was removed from the 'drm_driver'
structure. Add a test to conftest to detect this and update the Tegra
DRM driver accordingly.

Jira LINQPJ14-6

Change-Id: Ia3024321f12f8448d382deba996407f9d3232567
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297069
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Jon Hunter
cc09c0267d nvmap: Fix build for Linux v6.14
In Linux v6.14, the 'page_list' argument was dropped from the
__alloc_pages_bulk() function. Add a test to conftest to check for this
and update the NVMAP driver accordlingly to fix the build.

Jira LINQPJ14-6

Change-Id: Id3513890a9d948cb42abf7449d9fb3aa95edcf96
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297065
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Surbhi Singh
ab4ebfc4f7 video: tegra: nvmap: Make function static.
Fix for: Sparse defects

Sparse stated that:

-symbol 'nvmap_of_ids' was not declared. Should it be static?

Making nvmap_of_ids static as it is only used in nvmap_init.c

Bug 4513982

Change-Id: Id767ef7796e978c0cc4fee83068b795aeb85d753
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3296795
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: N V S Abhishek <nabhishek@nvidia.com>
2025-07-24 10:19:15 +00:00
Surbhi Singh
4ea9ca5d30 video: tegra: nvmap: Make function static.
Fix for: Sparse defects

Sparse stated that:

-symbol 'tegra_vpr1_dev' was not declared. Should it be static?
-symbol 'tegra_vpr_cma_dev' was not declared. Should it be static?
-symbol 'tegra_generic_cma_dev' was not declared. Should it be static?
-symbol 'tegra_vpr_dev' was not declared. Should it be static?
-symbol 'tegra_generic_dev' was not declared. Should it be static?

Making all the above functions static since it is being used in nvmap_init.c only.

Bug 4513982

Change-Id: I4887d994d9ae852a4faa7da735c18d25b393187a
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3295831
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
Santosh BS
df285efd88 drm/tegra: move debug support under CONFIG_DEBUG_FS
Move debug specific code portions in virt.c under CONFIG_DEBUG_FS
config.

Jira HOSTX-5885

Change-Id: Icd90deb7c556ce100c0ee61d69719bde902514d5
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3295412
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:15 +00:00
N V S Abhishek
a3e0e896a0 tegra: nvmap: Fix nvmap_query_heap for multi numa node platform
In current implementation, when NvRmMemQueryHeapParams is
called and multiple numa nodes are online:
1. For iovmm carveout, numa_id is set to garbage value,
   and we are calling compute_memory_stat with it.
2. For gpu carveout, we are returning values for
   numa_id 0.
3. For other carveouts, we are returning params for the
   first matching entry in nvmap_dev->heaps[i].

Correct this behavior as follows:
Regardless of carveout type, return params for numa_id 0
when NvRmMemQueryHeapParams is called and multiple numa
nodes are online.

In long-term, we need to disable NvRmMemQueryHeapParams
when multiple numa nodes are online. Clients should use
NvRmMemQueryHeapParamsNuma instead.

Jira TMM-5970

Change-Id: Id49289e51eda187b1d676e5192583f320835c2f4
Signed-off-by: N V S Abhishek <nabhishek@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3290730
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Ketan Patil
73f74915ee video: tegra: nvmap: Add checks for input flags
In order to serve MEMSERV70-REQ-670 requirement, which makes validation
checks mandatory for input flowing across execution boundary. Hence add
checks for input flags in nvmap and make sure the execution does not
proceed if flag other than read or write is provided in handle
duplication, creating sciipc id or during handle creation from sciipc id
even though the checks are present at libnvrm_mem layer.

JIRA TMM-5962

Change-Id: I1fc6ce6ec4435c50220d4e49a08de50320a8f574
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3295201
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
ebe01a47a3 drm/tegra: move tegra iommu domain support under CONFIG_TEGRA_IOMMU_SMMU
Tegra iommu domain is used in legacy chips (<= T210).
Move the related codes under CONFIG_TEGRA_IOMMU_SMMU accordingly.

Jira HOSTX-5833

Change-Id: I1e1e1dab33935b8881b905574ee006bbe8fc61d9
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293445
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:14 +00:00