Commit Graph

131 Commits

Author SHA1 Message Date
Asha Talambedu
eb29d03e62 nvadsp: Fix UBSAN array-index-out-of-bounds in msgq
Replace struct hack pattern with flexible array members in msgq_t
and msgq_message_t to resolve UBSAN warnings.

The message queue implementation was using the old "struct hack"
pattern with single-element arrays (int32_t queue[1] and
int32_t payload[1]) to create variable-length structures. While
functionally correct, this triggers UBSAN array-index-out-of-bounds
errors when accessing elements beyond index 0, even though the
memory is properly allocated.

UBSAN errors observed:
- msgq.c:64: index 2045 out of range for type 'int32_t [1]'
- msgq.c:69: index 153 out of range for type 'int32_t [1]'
- msgq.c:124: index 53 out of range for type 'int32_t [1]'
- msgq.c:148: index 53 out of range for type 'int32_t [1]'
- msgq.c:149: index 2045 out of range for type 'int32_t [1]'

Changes:
1. Convert queue[1] to queue[] in msgq_t structure
2. Convert payload[1] to payload[] in msgq_message_t structure
3. Update MSGQ_HEADER_SIZE and MSGQ_MESSAGE_HEADER_SIZE macros
   to use sizeof() directly, as flexible array members have zero
   size and cannot be used with sizeof()

The flexible array member (FAM) approach is:
- C99 standard compliant
- Linux kernel best practice for variable-length structures
- Binary compatible with the previous implementation
- Eliminates UBSAN false positives without functional changes

Bug 4831393

Change-Id: I243d4a1b1f091bf17cfc10337e75dbd1b878042f
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3464624
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-15 04:42:29 -07:00
yizhou
737925e58e kmd: re-enable the panic_callback
- introduced a panic_flag in the tegra_rtcpu_trace.
- set panic_flag to 1 when kmd receives panic hsp
  message from RCE.
- the trace buffer readout thread calls rtcpu_trace_snapshot
  to dump out the snapshot section when panic_flag is set to 1.

Bug 5293085

Change-Id: Ief5d9431bfc944fc588f38a69f7758f829cf2e6e
Signed-off-by: yizhou <yizhou@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3368252
Reviewed-by: Evgeny Kornev <ekornev@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Chinniah Poosapadi <cpoosapadi@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-by: Kalle Jokiniemi <kjokiniemi@nvidia.com>
2025-07-24 10:20:35 +00:00
yizhou
4736728ec1 camera: dump out RCE snapshot on CAMRTC_HSP_PANIC
- implemented a panic callback function which dumps out
  the snapshot section of the RCE trace buffer.
- registered the panic callback function with hsp handle
  during handle init time.
- when receiving the CAMRTC_HSP_PANIC from RCE, trigger
  the panic callback function to dump out the RCE snapshot.

Jira CAMERASW-32243

Change-Id: I523a0b51637a6cf1091d578195c75090b52ffcd7
Signed-off-by: yizhou <yizhou@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3341536
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:19 +00:00
Nagarjuna Kristam
0f2a737b8a linux: pcie-dma: Update calibration info for DMA init API
Add calibration details of register used by DMA driver.

Bug 4635515

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I4621184cbff919b73b990cd62543404367d8df8d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3341775
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:18 +00:00
Mainak Sen
31b5b5d17a gpu: nvhost-host1x: Move nvhost_get_* APIs to header file
deprecate definition of below APIs from host1x-nvhost.ko -

nvhost_get_default_device
nvhost_get_host1x_device
nvhost_get_host1x

Bug 5176225

Change-Id: I72c3aae62fbc8c297a3871a9337562fe3998621b
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3342019
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Nagarjuna Kristam
3a9f9b5d12 linux: dma-test-common: Fix DMA re-init sequence
DMA channel is re-init based on incorrect previous and current
channel change check, fix the same. Add DMA cookie pointer info
logs for easy debugging.

Bug 4742850

Change-Id: Iec5dd32ffb3699c5d57961949597c2c80ef250ad
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330635
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:17 +00:00
Nagarjuna Kristam
8759302687 linux: dma-test-common: Add SWITS Stop and Abort tests
Exisintg Abort and STOP tests hardcodes usage of all channels.
In SWITS scope, prepare tests to use single channel DMA.

JIRA NET-2991

Change-Id: I62464714bfd359ad141bcb8df8316e703e95d591
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3323878
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Johnny Liu
601567ef37 devfreq: nvhost_podgov: implementation cleanup
Previous implementation lacks of documentation and it's hard to
understand the effect of changing specific tunable parameter.

Revise the implementation so that the scaling behavior is somehow
aligned with the tegra_wmark governor supported by the actmon. The
only different is that nvhost_podgov governor is polling-based DFS
algorithm and it maintaines the moving average load in the governor
instead of hardware itself.

Bug 4892068

Change-Id: I033cb1359a484d4c9433fa4f2e7a99c42cb636b3
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3315446
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
2025-07-24 10:19:16 +00:00
Jon Hunter
23e3912ef7 PCI: tegra264: Fix build issues using conftest
The Tegra264 PCIe drivers don't build for kernels that don't have:

1. The structure mrq_pcie_request_req defined
2. The function pci_epc_deinit_notify() present

This is currently being handling by building a dummy driver for kernels
that don't have these. To simplify this, use conftest to detect if the
above are present and modify the Tegra264 PCIe driver accordingly if
they are not present. By using conftest we can remove the Makefile
variable 'NV_OOT_PCIE_T264_SOC_SKIP_BUILD' and ccflag
'DNV_CONFIG_PCIE_TEGRA_DMA_DISABLE'.

Finally, the PCIe drivers are always built as modules so simplify the
Makefile and remove the usage of 'CONFIG_TEGRA_OOT_MODULE'.

Bug 4911768

Change-Id: Id282497b8607a732b5e6c90e1e7c1436589a0b5f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3245592
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Mainak Sen
bfe763841a gpu: host1x: Deprecate falcon implementation from host1x driver
This commit deprecates the falcon hardware interface implementation from the host1x-nvhost driver.

falcon_exit() function will be deprecated once usage of
nvhost_module_deinit API is removed from PVA/DLA/Camera elements.

Jira HOSTX-5933

Bug 4918838

Change-Id: I268836c8c8fc2f1ab060412bb4446c7080f846c4
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311319
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Sanif Veeras <sveeras@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagarjuna Kristam
b13657daac pci: tegra-pcie-dma: Remove Remote, read and sync from ICD
There are no use cases for Remote DMA or Read channel support or
SYNC mode support. Remove these fields from ICD.

JIRA NET-2663

Change-Id: I18a4cb54da5e3c1535231f746afa9b1886776667
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3310943
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +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
Nagarjuna Kristam
8237e3463b pci: private-soc: dma: Update ICD documentation
- Add Direction and Usage info.
- Add links for API's and data fields.
- Correct info for API's and data structure comments.

JIRA NET-2663

Change-Id: I541157713070372a0487ae7879a165436be4fe26
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292839
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@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
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
Mikko Perttunen
5362309e7f gpu: host1x: Add option for disabling context stealing
Add kernel module parameter to allow disabling context stealing in
cases where reliability and consistency is preferred.

Change-Id: Iffa3f098814bcdd3ae760a05cb013c3c0c804ad5
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3284406
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
2025-07-24 10:19:14 +00:00
anupamg
2f69bee627 DCE-KMD: Update shared files licenses
- Updates licenses for DCE-KMD files that are shared with HVRTOS.
    - Update from GPL-2.0 to MIT as we use these files in both
      open source and closed source context.

JIRA TDS-16741

Change-Id: Icf7aeb737f2f3b294bb9ff9c36d5ed7220c13dea
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293404
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
2e59ef0253 gpu: host1x: move disply related code under CONFIG_DRM_TEGRA_HAVE_DISPLAY
As display support is not needed for recent chips,
 move the related codes under CONFIG_DRM_TEGRA_HAVE_DISPLAY configs accordingly.

Jira HOSTX-5833

Change-Id: Ie1cfd730a69fcb7d9e26600487a11f720fc509ba
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292240
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Santosh BS
8bfe83d4ee gpu: host1x: syncpoint base support for chips <= t186
As syncpoint base feature is not supported from T194 onwards,
moving the related driver code under CONFIG_HOST1X_HAVE_SYNCPT_BASE
accordingly.

Jira HOSTX-5833

Change-Id: I388dea16527acd0153331710312efc477aa2bbde
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3292180
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:14 +00:00
Jon Hunter
71ac531606 gpu: host1x-nvhost: Prepare for removing nvhost_t194.h
Move the function prototypes declared in nvhost_t194.h into nvhost.h so
that we can update the necessary drivers and remove nvhost_t194.h
completely.

Bug 4472097

Change-Id: I1466561cf2ec98b0552bff84c1e45a52a74a3598
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283337
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:13 +00:00
Jon Hunter
e709a790c4 gpu: host1x: Move host1x-next.h
Move the host1x-next.h file into the 'include/linux' directory so that
we don't need to have a specific include path that we need to provide to
the various out-of-tree drivers that use this.

Bug 4991705
Bug 5043885

Change-Id: I6ebfa291aa1c038e8bf9bbaa59362403e29ceb5a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3282045
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:13 +00:00
Srishti Goel
8fbbb20a8d Revert "linux: Add PCIe DMA sanity header"
This reverts commit 658adea9cdeb40b955b1e720f0c18467f02c3574.

Reason for revert: Moving to tests-oot

Bug 4865361

Change-Id: I0d52195aca8cff8559f017d088a64d0c8ae0b25d
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246560
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Johnny Liu
f9d2fc0ff0 platform/tegra: Remove legacy code regarding bwmgr
CONFIG_TEGRA_BWMGR is a downstream solution in the kernel before
K5.15, and the implementation now is completed moved to BPMP side.

Since it is not supported anymore, remove the legacy code for
maintainability.

Bug 4955427

Change-Id: I688c44288bfb8522ddfebd8abe294b0410ca8dc1
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3248363
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-07-24 10:19:10 +00:00
Srishti Goel
556ee3c643 linux: Add PCIe DMA sanity header
Add common DMA sanity helper header that can be used by both EP client
and EP function sanity DMA test drivers.

Bug 4865361

Change-Id: Ia448065a694e3784b5bd158ebb8a9b049c1fa62c
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225560
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Laxman Dewangan
b4c6c5f2a4 tegra-pcie-dma: Disable CONFIG_PCIE_TEGRA_DMA for non-supported kernel
Disable CONFIG_PCIE_TEGRA_DMA for few kernel like jammy-src, stable and
rhivos-1 where PCIE_TEGRA_DMA is not supported.

Bug 4911768

Change-Id: I4c3a379a2bc9facff2744ae83300f3e12587ec17
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3237170
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:09 +00:00
Manikanta Maddireddy
3b4ea40773 PCI: Define CONFIG_PCIE_TEGRA_DMA option
Enable CONFIG_PCIE_TEGRA_DMA to support Tegra PCIe generic DMA driver.

Bug 4712065

Change-Id: I061268d023234fe395ab01cd8a2cf523252dfd52
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3237169
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:09 +00:00
Ketan Patil
deaa196fd0 platform: tegra: mc-utils: Cleanup unnecessary functions
No client need the dram_clk_to_mc_clk, tegra_dram_types functions from
mc-utils. Hence remove these functions.
get_dram_num_channels is needed by resman team, hence update it to
return number of channels for t264.

Bug 4090660

Change-Id: I3e7571be73cfd94b3e2feebb6320a57b46b5fd48
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3047611
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
86efe596c5 platform: tegra: Copy mc-utils driver
mc-utils driver support is needed on T264, and it should be present in
nvidia-t264 repo, so as to avoid leaking any information. Also, we need
to make sure once T264 is public the existing mc-utils driver can be
updated easily for T264 support.
Hence first copy the existing mc-utils driver from nvidia-oot into
nvidia-t264, then make changes for T264 and finally when T264 is public,
just cherry-pick the addional changes in nvidia-oot and clean up driver
from nvidia-t264. This change is doing the first step i.e. copying
existing mc-utils driver code from nvidia-oot into nvidia-t264.

Bug 4090660

Change-Id: I95eff8d3f7fef267a5c0f0e2137c4343a615d4aa
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2911970
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Laxman Dewangan
217b544137 mc-utils: Prepare tree for collapsing T264 OOT drivers
Remove some of the files which were added as optional for
non-existing of T264 patches. As T264 OOT drivers are
collapsing into the core tree, remove such optional files.

Change-Id: I83116585369f4893d14b527356752fbf2a9a80c8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
f384316969 video: tegra: nvmap: Refactor nvmap_dev unit
- Add nvmap_dev.h file which include declaration for functions and data
structs which are exposed by nvmap_dev unit to other units.
- Also, add nvmap_dev_int.h file which include declaration for
functions which are internal to nvmap_dev unit that can be called by
files within nvmap_dev unit.
- Move definition of nvmap_handle_get_from_id, nvmap_install_fd,
find_range_of_handles to nvmap_handle.c as they belong to nvmap_handle
unit.
- Cleanup nvmap_priv.h by moving all relevant items for nvmap_dev unit
to nvmap_dev unit.
- Remove nvmap_mm.c file as nvmap_zap_handle is the only function
present; move it to nvmap_cache.c where it's being called.
- Remove function declarations whose definition are not present.

JIRA TMM-5694
JIRA TMM-5730

Change-Id: Ifd45235076da2ef0c628f3179d828c0ccadf6df2
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3223994
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Ketan Patil
98b0460f42 video: tegra: nvmap: Add header files for nvmap_alloc unit
As part of the nvmap_refactoring, add nvmap_alloc.h file which include
declaration for functions which are exposed by nvmap_alloc unit to other
units. Also, add nvmap_alloc_int.h file which include declaration for
functions which are internal to nvmap_alloc unit that can be called by
files within nvmap_alloc unit.

JIRA TMM-5621

Change-Id: Ie30e5e8a4f87591eb9c49a0a349f837a22726fa5
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3198546
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:06 +00:00
N V S Abhishek
fcd1fdd03e nvmap: Update license info for Nvmap
Update license info for NvMap with SPDX-FileCopyrightText and latest
year.

Change-Id: I9f000d842a37e607d647d01e0439d2537192cec1
Signed-off-by: N V S Abhishek <nabhishek@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3117889
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:06 +00:00
Omar Nemri
edf6adc357 gpu: host1x-nvhost: export nvhost_get_host1x_device API
Export the API, that can be used by other modules, for retrieving
the host1x platform_device data for the right host1x instance.

Bug 4793553
Jira HOSTX-5414

Signed-off-by: Santosh BS <santoshb@nvidia.com>
Change-Id: Iadfb9f1f28468a4ff470ea505512a27f9092e2f2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196481
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:06 +00:00
Ketan Patil
644d35281a Revert "video: tegra: nvmap: Add flag to skip cache cleaning at alloc"
This reverts commit fcb299a9cd.

Reason for revert: The zeroed memory may not reflect in case of non-coherent devices

Bug 4628529

Change-Id: I6bb0c10ebf273a912e71b8252a5ddfd33c70e1fe
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197357
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
2024-08-22 05:11:30 -07:00
Ketan Patil
fcb299a9cd video: tegra: nvmap: Add flag to skip cache cleaning at alloc
For bigger buffer allocation (e.g. 4GB, 5GB etc) from IOMMU heap, 70% of
the total time is consumed in cache cleaning. CUDA team confirmed that,
it is not always necessary to clean the CPU cache during allocation
flow. Hence provide an option to users of libnvrm_mem to skip cache
cleaning whenever required.

Bug 4628529

Change-Id: I9f4cdc930fcc673b69344f0167c8bc1378ec8d61
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192376
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-20 17:44:16 -07:00
Robert Kelly
98be04181c rtcpu: set op point via sysfs
Create and register set and get operating point sysfs functions.

The operating point notification will contain the requested
operating point.

The nvcap resource manager will extract the operating point
from the notfication and send it to rce via the hsp command
interface.

In turn, rce will apply the operating point by adjusting the
functional clock frequencies for the following camera ip:

- rce hardware
- vi hardware
- isp hardware
- nvcsi

Jira CAMERASW-26378

Signed-off-by: Robert Kelly <rkelly@nvidia.com>
Change-Id: Ia814b2716d3738efb3cbc37307a267140b555f42
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3179593
(cherry picked from commit d259727a57ecf4b9463030b3418715891b3b1209)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3189078
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-17 10:38:56 -07:00
Krishna Yarlagadda
2ca08ce7f4 conftest: update test for prod settings
Change prod settings test from header to apis. Check if legacy prod
settings defined. Remove references to new prod settings.

Bug 4765671

Change-Id: I77e55cf473f75216ded5d7eae3de2bd9a7ae91d4
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186208
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-08-13 10:46:42 -07:00
Nagarjuna Kristam
19f9a6939a linux: pcie: Add MSI vector macros
Define MSI read, write and CRC vector macros.

Bug 4779415

Change-Id: Icc6ac9c6b765ca9bfe01e7026381f9ec2052e0d0
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3186457
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2024-08-05 12:27:25 -07:00
Ketan Patil
9c92d38302 video: tegra: nvmap: Cleanup gpu carveout support
Cleanup gpu carveout support as we are moving to hugetlbfs.

Bug 4510173

Change-Id: I68b88e81d2c4da7e35e241f2f29633ec39a4bcbe
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3174619
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-08-03 04:57:23 -07:00
Jon Hunter
fc171fe539 drivers: Fix bus->match for Linux v6.11
In Linux v6.11, the 'bus_type' structure match() callback was updated to
make its 'drv' argument constant. Add a conftest test to detect this and
update the relevant drivers according to fix building them for Linux
v6.11.

Bug 4749580

Change-Id: I895d97241a7357074bb34b8e7a5bdfa2e31d5ca5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3183068
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-31 08:06:48 -07:00
Manikanta Maddireddy
49bb1dec11 PCI: EPF: dma-test: Add outbound ATU test function
PCIe endpoint controller supports 8 outbound channels to map Root port
address and access it as memory mapped IO. Add test function to verify
this feature.

Bug 4705051

Change-Id: I126e94619c581ed15f1d6db54845de209742af0e
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3163953
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
2024-07-01 14:38:00 -07:00
Manikanta Maddireddy
fb5a616f92 PCI: EPF: dma-test: Fix unaligned offset during dma reinit
Clear the unaligned offset when reinitializing the DMA with new settings
to avoid CRC check fail.

Bug 4712065

Change-Id: I9faee6b5c74be32a421a594c8bb842d2b2cb97c2
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3163952
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
2024-07-01 14:37:56 -07:00
Manikanta Maddireddy
120be4313a PCI: edma_test: Enhance edma stop test
Enable all channels in async mode and stop channel 2 to verify edma stop
feature. This stops the dma engine when channels 0, 1 and 2 are in middle
of processing descriptors and stops channel 3 before submitting the
descriptors.

Bug 4620420

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: Iadff763e299437ef8b7b575c0177968681adb15a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3133675
(cherry picked from commit 88187c18bf6fe4d64cb9d2964664479492afce5c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3133507
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2024-05-15 14:20:06 -07:00
Manikanta Maddireddy
b0c580762b PCI: Add T264 PCIe DMA support in PCIe EPF and client driver
Replace the exisiting T234 DMA APIs with common APIs and also add chip
specific changes like BAR.

Bug 4549851

Change-Id: I021e1e93a4fa4ff1d4429bd9db852e0e707ba879
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3116906
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-05-04 16:43:14 -07:00
Manikanta Maddireddy
82e2f7b2d5 PCI: Add common PCIe DMA header file to support T234 and T264
To use DMA in PCIe EP function driver and client driver support common
PCIe DMA header file. This header supports T234 and T264 SoCs.

Bug 4549851

Change-Id: I08d60d5c8bbd89de37b6749571eaf1b81442df28
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3123176
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
2024-05-04 16:43:09 -07:00
Ashish Mhetre
ac5bcc86bd video: tegra: nvmap: Clean-up tegra_vpr_dev
tegra_vpr_dev is defined at multiple places as extern variable.
Keep it only in nvmap_exports.h as extern and define it in nvmap_init.c.

Bug 4390638

Change-Id: I48f2b44c0f935366ce6319460da7b417918fea2d
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3119454
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-04-25 09:20:46 -07:00
Viswanath L
e2a1904d46 nvadsp: Add multi-instance support
ADSP host driver is enhanced to be multi-instance
capable and reentrant:
 - Trailing unique identifier string in compatible DT property, like
    "adsp", "adsp1" or "aon", is used to identify the driver instances
 - Each probed driver instance is inserted into a global list, from
    which the handle can be fetched using 'nvadsp_get_handle' API
    (passing the above unique identifier as argument)
 - Above unique identifier is also used as name for the DBFS
    directory (containing files like adsp_console, adsp_logger, etc.)
 - 'nvadsp_get_handle' is the only exported API; all other APIs are
    accessible via function pointers within 'struct nvadsp_handle'
 - APIs above maintain one-is-to-one correspondence with all
    legacy APIs, with the addition of a new argument
    'struct nvadsp_handle *' at the beginning
 - Legacy APIs continue to be supported, but they are hardwired to
    work only if the kernel probes just one driver instance
 - All driver files are cleaned up to not use any global state
    variables (necessary for reentrancy)

Bug 3682950

Change-Id: Id5db49e861b2f81716ae8352b36b406654da2bbd
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3092701
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
2024-04-11 18:05:18 -07:00
Yash Bhatt
1eb5fc3ad7 video: tegra: nvmap: Remove VPR resize code
Remove VPR resize code from nvmap as VPR resize support is deprecated
from K5.10+.

Bug 4479027

Change-Id: I93daecaa86ebffb2aee09836cd3faa5211e574a0
Signed-off-by: Yash Bhatt <ybhatt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3112223
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2024-04-10 21:37:34 -07:00
Hiteshkumar Patel
f4720eda1d nvpps: Add support for AGX Orin.
Enable nvpps driver so it can be tested.

- Removed passing of ethernet interface name in DT.
- Require to pass Tegra ethernet controller DT phandle, where PTP server
  will run.

Bug 4489344
Bug 3826818

Change-Id: I943ddf4071a55fb409d589473fde0075ac9f7150
Signed-off-by: Hiteshkumar Patel <hiteshkumarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3076494
(cherry pick from commit 90c8229157)
Signed-off-by: Hiteshkumar Patel <hiteshkumarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3097855
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-04-02 08:01:58 -07:00
Jon Hunter
16df0a48d5 pva: Remove unused legacy nvhost functions
The functions nvhost_debug_dump_device() and
nvhost_module_remove_client() are a no-op and were initially
added to ensure that the PVA driver worked with both the legacy nvhost
driver and upstream host1x driver. Now the legacy nvhost driver is
deprecated remove these functions.

Bug 4475969

Change-Id: I1c1444b7b6578117f42200259174e2f60a464db3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3092468
Reviewed-by: Pekka Jylha Ollila <pjylhaollila@nvidia.com>
Tested-by: Pekka Jylha Ollila <pjylhaollila@nvidia.com>
2024-03-18 04:43:55 -07:00