Commit Graph

527 Commits

Author SHA1 Message Date
Jon Hunter
a3097907b3 platform: tegra: bwmgr: Fix debug macro build
When NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined the build
fails and the following errors are seen ...

 drivers/platform/tegra/tegra-bpmp-bwmgr.c:101:12: error:
  ‘tegra_bpmp_bwmgr_devfreq_target’ defined but not used
  [-Werror=unused-function]
  101 | static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev,
                                       unsigned long *freq, u32 flags)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/platform/tegra/tegra-bpmp-bwmgr.c:37:12: error:
  ‘tegra_bpmp_bwmgr_max_freq_notifier’ defined but not used
  [-Werror=unused-function]
   37 | static int tegra_bpmp_bwmgr_max_freq_notifier(struct
                  notifier_block *nb, unsigned long action, void *ptr)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by ensuring the above functions are not defined if
NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined.

Bug 5483386
Bug 5196455

Change-Id: Ie2b069d163a32220c95ffaba217ddea3686ba92b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461865
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-01 12:56:56 -07:00
Johnny Liu
099e5e1cd7 platform: tegra: introduce bwmgr kernel driver
This driver exposes EMC frequency control interface to user space via
linux devfreq framework.

Users could change EMC frequency to the frequency value from the
available frequencies of EMC clock:

$ /sys/class/devfreq/bwmgr# cat available_frequencies
665600000 2750000000 3200000000 4266000000

and update the EMC floor frequency by writing into the min_freq QoS
sysfs node:

$ /sys/class/devfreq/bwmgr# echo 4266000000 > min_freq

and update the EMC max frequency by writing into the max_rate QoS
sysfs node to cap the EMC frequency:

$ /sys/class/devfreq/bwmgr# echo 4266000000 > max_freq

This driver does not directly manage the EMC clock rate. Instead it
just delivers the min/max frequency information to BPMP, and BPMP is
still the only entity that has the full control of EMC and other
related memory clocks.

Bug 5483386
Bug 5196455

Change-Id: I6124eeb7411a13bde5c51582064534063abca8d3
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453755
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-09-29 21:42:51 -07:00
Jaiyash Agrawal
b6fa67fca1 DCE-KMD: Add header support and use bytes written
Parse header info stored at beginning of buffer to retrieve log buffer
info and use bytes written to print the data depending on if encoding is
enabled or not.

JIRA TDS-17441

Change-Id: I99119be05ddda5c5354ba39497a0e471305863e1
Signed-off-by: Jaiyash Agrawal <jaiyasha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3436761
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3448848
2025-09-29 13:12:50 -07:00
Jon Hunter
6b6d1e009a camera-diagnostics: Fix missing release function
The camera-diagnostic driver is missing a release function for the IVC
channel device that it is creating. This causes the following WARNING to
be observed when probing the camera-diagnostic driver fails ...

 ------------[ cut here ]------------
 Device 'camera-diag' does not have a release() function, it is broken
 and must be fixed. See Documentation/core-api/kobject.rst.
 WARNING: CPU: 8 PID: 756 at drivers/base/core.c:2517 device_release+0x88/0xa8
 ...
 Call trace:
  device_release+0x88/0xa8
  kobject_put+0xac/0x150
  put_device+0x14/0x34
  __mod_of__camera_diag_of_match_device_table+0x602514/0x6033a0
   [camera_diagnostics]
  tegra_ivc_bus_boot_sync+0x204/0x28c [ivc_bus]
  really_probe+0x150/0x2c8
  __driver_probe_device+0x78/0x134
  driver_probe_device+0x3c/0x164
  __driver_attach+0x98/0x1c4
  bus_for_each_dev+0x7c/0xf4
  driver_attach+0x24/0x38
  bus_add_driver+0xec/0x218
  driver_register+0x5c/0x13c
  tegra_ivc_driver_register+0x10/0x1c [ivc_bus]
  init_module+0x18/0x1000
  [camera_diagnostics]
  do_one_initcall+0x58/0x318
  do_init_module+0x58/0x1ec
  load_module+0x1f04/0x2000
  init_module_from_file+0x88/0xd4
  __arm64_sys_finit_module+0x148/0x330
  invoke_syscall+0x48/0x134
  el0_svc_common.constprop.0+0x40/0xf0
  do_el0_svc+0x1c/0x30
  el0_svc+0x30/0xb8
  el0t_64_sync_handler+0x130/0x13c
  el0t_64_sync+0x194/0x198
 ---[ end trace 0000000000000000 ]---

Ideally we would use the 'tegra_ivc_channel_release()' function as the
release function but because the camera-diagnostic driver does not call
'tegra_ivc_channel_create()' to create the channel and does not actually
need to free any memory, simply define a new empty function that can be
called.

Bug 5489551

Change-Id: I6a7de9893af0167409af79599b61faf005047b0e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3443095
(cherry picked from commit f75c0f228ca4f1a4c17266cb97be2db63b25a592)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453753
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-09-17 18:56:57 -07:00
vinodg
f0c437e616 DCE: KMD: Use seq write to copy in binary format
Encoded data in the buffer is copied to the user
buffer in binary format

Jira TDS-17299

Change-Id: I329c9cd2fc1b91fe8700c4ef3c8d444fee6d4151
Signed-off-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3409070
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
(cherry picked from commit f865e4b21dbf5a50d47ef244929b625ff0d9aa78)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3433716
2025-08-20 14:28:04 -07:00
charliej
31cf676050 DCE KMD: Add timeout into synchronous IPC calls
This is for avoiding kernel hang when DCE FW fails to respond.
Failures of IPC call will return -ERESTARTSYS or -ETIMEOUT, which
will be handled by caller functions:
1. tegra_dce_client_ipc_send_recv (EXPORT_SYMBOL)
   This is module export symbol and caller have the responsibility
   of checking return value.
2. DCE FSM event handler
   Error return will change back to previous state.

DCE_IPC_TIMEOUT_MS_MAX is set to 10000[ms]
SHA computation time on SC7 entry request can go up 2sec.
Host tolerance time must be larger than this.

Jira TDS-16567
https://nvbugspro.nvidia.com/bug/5335034

Change-Id: I5d77a9497f14f305d07b98e39a58fbcecafedf92
Signed-off-by: charliej <charliej@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3358620
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
(cherry picked from commit 6c2ab3c78ce7cba0e88455b263d51d1a88c03927)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3402917
2025-07-24 10:20:36 +00:00
jaiyasha
c89da8defd DCE-KMD: Add support for logging infra
- Allocate DMA mapped buffer from DCE-KMD and pass it to DCE FW through
  admin-cmd calls.
- Add debugfs node to retrieve buffer data and print through seq file.
- Add support to clear log buffer

JIRA TDS-15963

Change-Id: Ied4ffe1df14c8db61cfe15e6442f55e8306530b8
Signed-off-by: jaiyasha <jaiyasha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3117241
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Tested-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
2025-07-24 10:20:35 +00:00
Ashish Mhetre
b79129381b platform: tegra: Check if MC channel is enabled
In MC-HWPM driver, check if MC channel is enabled before accessing its
registers.

Bug 5279654

Change-Id: I41e3d277a75d0a1045e47f148e2b9eb63f29b279
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369527
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
(cherry picked from commit e2b9c86688)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3370768
2025-07-24 10:20:35 +00:00
Dara Ramesh
97f7875469 adsp: cleanup legacy code
The legacy ADSP applications, such as file access and lpthread,
as well as the actmon driver, are no longer supported on T26x/T23x.

Bug 5174542

Change-Id: I3e70f11e0c09a7178f069c2423ad068dc765eea8
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3359415
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:20:35 +00: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
b1789adbac kmd: disable the panic_callback
Disable the panic_callback function as a workaround
for bug 5293085.

when panic_callback() is called from an atomic context,
it tries to do something that could sleep (e.g. calling
mutex_lock when the mutex is contended).

Bug 5293085

Change-Id: I822bd72fdbedcaa9201086dae991da36f34df8fa
Signed-off-by: yizhou <yizhou@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3368091
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Tested-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Chinniah Poosapadi <cpoosapadi@nvidia.com>
2025-07-24 10:20:35 +00:00
Mark Stephen Krueger
872a72234a kmd: trigger RCE snapshot on timeout
Jira CAMERASW-32243

Change-Id: I529a0d39990f6a20ff9780089383deebe22e2741
Signed-off-by: Mark Krueger <mkrueger@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3355776
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Ying Zhou <yizhou@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@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
Jon Hunter
ef0bf7c94c mc-utils: Remove get_dram_num_channels_t26X
The function get_dram_num_channels_t26X() is identical to the function
get_dram_num_channels_t23x() and so get rid of the
get_dram_num_channels_t26X() function and just use
get_dram_num_channels_t23x().

Bug 5054840

Change-Id: I5647bf9a946dc06e692b1a2fc44f750bc68ec65d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3362555
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2025-07-24 10:19:19 +00:00
Mohit Ingale
00c660901e rtcpu: camera-diagnostics: fix dependency module
tegra-isp5 module is identified by name nvhost_isp5, it should always be
loaded first to ensure all initializion is done for isp device.

Bug 5225858

Change-Id: I35c7715034ac1301c7592a59827d9fd1e1fbdcdd
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3358137
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
2025-07-24 10:19:19 +00:00
Mohit Ingale
5a615789cd platform: tegra: rtcpu: Rename camera diag control sysfs node
Renamed the "control" sysfs node to "diag_control" in the camera-diagnostics
driver to avoid naming conflicts with other control nodes in the system.

This renames the associated show/store functions and updates all references
to maintain the same functionality through the new more specific node name.
The camera diagnostic control interface is now accessible through
/sys/devices/platform/.../camera-diag/diag_control instead of .../control.

Bug 5225858


Change-Id: I5ce96d6d981354f7af9edc7495cf9eef6ba1fdb6
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3345338
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
2025-07-24 10:19:19 +00:00
Mohit Ingale
a8bff2c6e5 camera:kmd replace WARN/WARN_ON usage
Replace use of WARN or WARN_ON kernel with dev_warn to improve logging
behavior. This change ensures that error conditions are reported with
clear informative messages rather than kernel stack traces that can
flood logs.

Additional information:
- The files `drivers/platform/tegra/rtcpu/debug.c` and
  `drivers/platform/tegra/rtcpu/hsp-combo.c` present in the original
  codebase were deleted as part of unrelated refactoring in the
  target repository; hence, changes related to these files in the
  patch were not applied.
- Additional changes are done to replace WARN_ON at other places.

Bug 4719119

Change-Id: Id12f1b4de77f8b007b557de140257a3bd7478b52
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3308911
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3352892
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:19 +00:00
Mohit Ingale
15b054f417 rtcpu: Add power management support to camera-diagnostics driver
Added suspend and resume functionality to the camera-diagnostics driver
to properly handle ISP SDL diagnostics during system power transitions.
This ensures that diagnostics are stopped before system suspend and
restarted after resume if they were running before.

Jira CAMERASW-33531

Change-Id: Ic52fe91e0cfcc2a3138cacd8433e3b5a644378e4
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3344684
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Robert Kelly <rkelly@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
2025-07-24 10:19:19 +00:00
Jon Hunter
53584a0920 platform: tegra: rtcpu: Fix mixed declarations and code
The RTCPU driver fails to build with the compiler option
'-Werror=declaration-after-statement' and the following errors are
observed ...

 drivers/platform/tegra/rtcpu/camera-diagnostics.c:900:17: error: ISO
  C90 forbids mixed declarations and code
  [-Werror=declaration-after-statement]
  900 |                 unsigned long end_time = 0U;
      |                 ^~~~~~~~

 drivers/platform/tegra/rtcpu/camera-diagnostics.c:904:17: error: ISO
  C90 forbids mixed declarations and code
  [-Werror=declaration-after-statement]
  904 |  bool all_tests_pass = (status.executed > 0 &&
                                status.passed == status.executed);
      |  ^~~~

Fix this by declaring the necssary variables at the beginning of the
functions.

Jira CAMERASW-32042
Jira CAMERASW-32960

Change-Id: I6bc652b19f77f0a9bbbe3263cdff371acbc957d7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3334920
Reviewed-by: Zhiyuan Wang <zhiwang@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:18 +00:00
Jaiyash Agrawal
3223288ee0 DCE-KMD: Add T256 support for KMD driver
This patch Adds support to build DCE-KMD for T256 chip.
Since T264 and T256 use same HSP IP and offsets are same
reuse the T264 HAL functions with T256.

JIRA TDS-16705
Bug 5214628

Change-Id: I07deec4a70bc4edbe5d8dfe24b92c68e3c85e5ce
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3319943
Tested-by: Jaiyash Agrawal <jaiyasha@nvidia.com>
Reviewed-by: Jaiyash Agrawal <jaiyasha@nvidia.com>
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:18 +00:00
Mohit Ingale
63597e114a rtcpu: camera-diagnostics: Use device_iommu_mapped() to check IOMMU status
Replace the explicit IOMMU domain check using iommu_get_domain_for_dev()
with the more direct device_iommu_mapped() function. This ensures, iommu
domain is mapped and ready.

Bug 5225858

Change-Id: If54b77ed2468b2967a28abf98c5ff3e8517a7405
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3343722
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
2025-07-24 10:19:18 +00:00
kevixie
04fdeac230 nvidia-oot: CameraSW: KMD SWUD update
+ Use CameraDoxygenWorkflowV1_02182025 to generate
  SWUD doxygen headers for functions in FusaCap KMD
  and RTCPU
+ Use Cursor Agent to generate SWUD doxygen headers
  for FusaCap capture-vi.c

Jira CAMERASW-32271

Change-Id: Ida6b94d6ffea3df593fa793cc4b9a150c87187ba
Signed-off-by: kevixie <kevixie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313956
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Jon Hunter
a59a10dfeb drivers: Update timer APIs for Linux v6.15
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:18 +00:00
Zhiyuan Wang
c9f69ea5d8 linux: kmd: static analysis TOP25 04/02 Part 9
fix CERT INT08-C under the following path:
- drivers/platform/tegra/rtcpu/camera-diagnostics.c

Jira CAMERASW-32960

Change-Id: I592cab86961df8e3a23d95acadced0717f424616
Signed-off-by: Zhiyuan Wang <zhiwang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3334867
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vishal Agrawal (SW) <visagrawal@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Patrick Young <payoung@nvidia.com>
2025-07-24 10:19:17 +00:00
Mohit Ingale
02a104cbb2 rtcpu: Add Doxygen documentation to RTCPU subsystem
Add detailed Doxygen documentation across all files in the RTCPU subsystem.
This documentation effort follows SWUD Doxygen guidelines and provides
complete API documentation for the entire RTCPU codebase.

Use Cursor Agent to generate SWUD doxygen headers

Jira CAMERASW-31120

Change-Id: I3095ff2e321402e72f0f8f5762bad798ea0ecf19
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3332472
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:17 +00:00
Mohit Ingale
bce3cb0a57 platform: tegra: rtcpu: Add runtime control for camera diagnostics
Add a new sysfs interface that allows toggling camera diagnostics on and
off at runtime without deallocating memory resources. This enhances the
camera-diagnostics driver functionality by:

- Adding a new 'control' sysfs attribute for starting/stopping diagnostics
- Implementing intelligent state checking to avoid unnecessary operations
- Providing better user feedback about the current diagnostic state
- Preserving allocated memory between stop/start cycles

The implementation checks if diagnostics are already running or already
stopped before attempting state changes, preventing redundant operations
and providing informative messages to users.

This allows us to run isp-falcon-memtest, which conflicts with
camera-diagnostics driver.

Jira CAMERASW-32042

Change-Id: I67d0e7e15a25cf000554d1c222b2890be1adce4a
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330307
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:17 +00:00
Mohit Ingale
0f10f5e639 platform: tegra: rtcpu: Implement camera diagnostics driver
This commit expands the camera-diagnostics driver to add
support for ISP PFSD tests. The implementation:

- Adds diagnostics IVC communication between kernel and RCE firmware
- Implements ISP SDL test vector loading, verification, and execution
- Provides proper memory allocation and IOMMU mapping across devices
- Supports multiple ISP instances with chip-specific configurations
  (T234/ISP6 and T264/ISP7)
- Creates sysfs interface for diagnostic status reporting
- Adds proper error handling and resources cleanup
- Implements CRC validation for test vectors

The driver enables hardware safety diagnostics for camera subsystems
to ensure reliability and functional safety of the camera pipeline.

New header files:
- camrtc-diag-messages.h: Defines messages for IVC communication
- camrtc-diag.h: Contains common diagnostic data structures

Jira CAMERASW-32042

Change-Id: I9a892b40891cffc3d460723d9fdc92854c6cda85
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313001
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
2025-07-24 10:19:17 +00:00
Mahesh Kumar
a23d954e3e platform: dce: Add bootsrap2 command
Add support to the bootstrap command over the admin channel,
which will be called when a client registers. This command will
perform steps that must be performed only after the client is ready.

TODO: This bootstrap-2 command will be replaced by the existing
bootstrap command which we call during DCE-FW bootstrapping once
we split admin bootstrapping and RM bootstrapping in the DCE-KMD.

Jira TDS-17135

Change-Id: I55330b9ce73e1acf20e2a80d392d7984c91ed65f
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3274949
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:17 +00:00
Petri Niemela
58478b0ab6 rtcpu: Halt RTCPU using HSP_BYE before reset
Calling tegra_camrtc_reboot() can cause a memory fabric timeout error by
asserting reset when the RTCPU is in the middle of a memory transaction.
As a solution (similar to tegra_camrtc_halt), before asserting the
hardware reset, signaling the RTCPU to suspend its operations using
CAMRTC_HSP_BYE and waiting for RTCPU to enter WFI.

Bug 5051748

Change-Id: Iba8e4e837ee0983ffe9629e7627e0056ce1c2341
Signed-off-by: Petri Niemela <pniemela@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3317142
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
2025-07-24 10:19:16 +00:00
Zhiyuan Wang
578e8f6700 linux: kmd: static analysis TOP25 03/05 Part 9
Under the following path:
- drivers/platform/tegra/rtcpu/ivc-bus.c

Jira CAMERASW-32533

Change-Id: Iba0a529218a9aaf82f70bc4ff05b4658bbfe6fc3
Signed-off-by: Zhiyuan Wang <zhiwang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3318779
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Ajith Kumar <ajithk@nvidia.com>
2025-07-24 10:19:16 +00:00
Aki Niemi
83df8b7e03 camera/rtcpu: Fix concurrency on reboot
Make sure that if a reboot is in progress, we don't attempt
to reboot the RTCPU again.

Bug 4623451

Change-Id: I8d153edb7ded48100f772e2fdd8afc7621b346bf
Signed-off-by: Aki Niemi <aniemi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3205581
(cherry picked from commit 4ac65dc2c205c840b3e70e067831de57d43952e3)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3281752
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:16 +00:00
jaiyasha
b2a59883b3 DCE-KMD: Add logging structs in shared header
This change adds set and get log structs in shared admin cmd header file
Logging design document:
https://confluence.nvidia.com/display/TCS/DCE+Logging+support+design

JIRA TDS-15963

Change-Id: I8d6f1830a7bf7ebde1562cd31601b2ee4eadce0c
Signed-off-by: jaiyasha <jaiyasha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305936
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:16 +00:00
Zhiyuan Wang
c4fb69048c linux: kmd: static analysis TOP25 03/05 Part 9
Under the following path:
- drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c
- drivers/media/platform/tegra/camera/vi/mc_common.c
- drivers/platform/tegra/rtcpu/capture-ivc.c
- drivers/platform/tegra/rtcpu/ivc-bus.c
- drivers/platform/tegra/rtcpu/reset-group.c

Jira CAMERASW-32533

Change-Id: I4b3d36c77ab09cd930c80fe07846fd9e0e9c28df
Signed-off-by: Zhiyuan Wang <zhiwang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3314106
Reviewed-by: Frank Chen <frankc@nvidia.com>
Tested-by: Patrick Young <payoung@nvidia.com>
Reviewed-by: Ajith Kumar <ajithk@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
2025-07-24 10:19:16 +00:00
Viswanath L
f985bb9f00 nvadsp: Fix priv data in show_os_version()
Fetch correct private data in show_os_version(). This function
is mapped to callback seq_file->seq_operations->show, which will
be called in seq_read() flow.

Bug 5122582

Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Change-Id: Ic8e4df342063139b91fa33297e59916ffb8b5a20
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311120
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@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
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
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
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
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
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
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
Bob Zhang
d1c50209ba kernel: nvidia-oot: Fix Linux KMD coverity defects
Fix INT30-C and INT08-C coverity defects for
tegra-rtcpu-trace.c.

Fix MISSING_LOCK coverity defects for cdi_mgr.c.

Fix NULL_RETURNS coverity defects for cam_fsync.c.

JIRA CAMERASW-30844

Change-Id: If000ed4459479ba0bc9f06477b25efa65e896fc7
Signed-off-by: Bob Zhang <bozhang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283172
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Patrick Young <payoung@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
2025-07-24 10:19:14 +00:00
mhulagabal
580ec7794c dce: Update copyright in the errors header file
- Added MIT and GPL licensing details

- Bug 5065840

- JIRA TDS-15862

Change-Id: I438ea8c9d52c3cfaae76fe616e09bb18692c3bd4
Signed-off-by: mhulagabal <mhulagabal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3288450
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bernd Weber <bweber@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-07-24 10:19:14 +00:00
yongtaos
2b06fe0a29 kernel: nvidia-oot: Fix Top-25 coverity defects
Fix INT08-C, INT30-C and STR07-C coverity defects for rtcpu-debug.c.

Jira CAMERASW-30854

Change-Id: I0b516587b72bf631974f5f6ee99a55821744bf85
Signed-off-by: yongtaos <yongtaos@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3278378
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Zhiyuan Wang <zhiwang@nvidia.com>
2025-07-24 10:19:13 +00:00
anupamg
6c7b0070f8 DCE-KMD: Refactor dce client ipc registration.
- dce-client-ipc.c is a common file used by HVRTOS as well to
  register as a DCE client.

- We need to refactor existing register function due to certain
  HVRTOS restrictions at init time.
    1) Register function will be called at init time from HVRTOS.
    2) HVRTOS doesn't allow any mutex acquire calls or wait calls
       during INIT phase.

JIRA TDS-16581

Change-Id: I1b3a9587c1e237c2cca8214a3acce9ff34d98cc0
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3280251
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
2025-07-24 10:19:13 +00:00
kevixie
5ce08ee3ce nvidia-oot: cameraSW: add data validation to dt reads
+ Add the following data validation checks based on
  gaps identified when inspecting code for
  SHR-9320:
  + FSYNC: Add check to ensure existence of generators
    property before parse
  + FSYNC: Add check to ensure generators in default
    group adhere to LCM rule
  + CDI: Add check to ensure reg_len / dat_len do
    not exceed 2 bytes
  + CDI: Ensure err is set before jumping to err_probe
  + CDI: Jump to err_probe if IOExpander i2c-bus read
    fails
  + CDI-TCA: Return error if reg_len or dat_len
    out of expected range
  + FuSaCap: Ensure isp/vi-max-channels validated
  + VI: Add check for vi-mapping index found (this was
    already caught in existing code, but error message
    was non-specific)
  + camera_common: Add check for err that was set but
    never read
  + RTCPU: Add debug prints for properties not found

Jira CAMERASW-30537
Change-Id: I9953029f594c0153d6c335913944fb8906adedd9
Signed-off-by: kevixie <kevixie@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3280557
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:13 +00:00
anupamg
2bed40f6fe DCE-KMD: Refactor dce-os-worker.c/.h
- dce-os-worker.c/.h module exposes functionality which allows
  DCE KMD clients to wait/signal events.

- The current abstraction of this module has following drawbacks
  which this change attempts to address:
    * Name: dce-os-worker is a misnomer
        - Rename to dce-wait-cond.c/.h and make it a dce-kmd core file.
        - Rename functions accordingly.
    * dce-os-worker module initializes data structures from tegra_dce
      which makes it ineligible for re-use.
        - dce-client-ipc can re-use this module as it uses exact
          same functionality.
        - But this module is tied with DCE-KMD core such that it has
          functions that operate on fixed known inputs.
            - dce_os_work_cond_sw_resource_init/deinit()
                Inits/Deinits most but not all condition var resources
                from tegra_dce. Eg. dce-client-ipc resources
                are not initialized.
                    - Move this function to new core file:dce-waiters.c
            - All other functions require msg_id as input and can only
              operate on DCE_WAIT* resources making it ineligible
              to be used by other clients like dce-client-ipc.
                    - Refactor these fucntions to operate on
                      individual wait conditions so that all DCE-KMD
                      core modules can reuse them.

- Additionally, this change will also remove unused functions
  and macros from dce-os-cond.c/.h

- dce-client-ipc will also switch to use dce-wait-cond interface
  for client ipc waits.

- Make dce-os-cond.h a common file and move OS specific impl
  to dce-os-cond-internal.h

JIRA TDS-16581

Change-Id: Ie8c6ec724e48cde66917fab4aa43e7da464ef8fb
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3258562
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:13 +00:00
anupamg
3e2343fa57 DCE_KMD: dce-client-ipc.c: Separate out exports
- dce-client-ipc.c has linux specific export symbols that
  are required to be exported to linux kernel module client.

- We'll be using dce-client-ipc.c as a core DCE-KMD file and
  also be compiling it for HVRTOS.

- This change will add DCE_EXPORT_SYMBOL() as wrapper
  to EXPORT_SYMBOL. This will be OS agnostic macro.
    - For HVRTOS it will be empty.

JIRA TDS-16126

Change-Id: I45fbf3b8b61321c64f88a0c64a07dbe4935296b7
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3258496
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:13 +00:00
anupamg
d0bafbec62 DCE-KMD: dce-ipc.c: Remove simple wrappers
- This is a follow-up CL to address a comment in
  I55594d8e34c3b572129119d1f7240cde76cf37bd

- This change will remove below simple static wrappers
  from dce-ipc.c and directly call the corresponding OS functions.
    - _dce_ipc_get_next_write_buff()
    - _dce_ipc_get_next_read_buff()

JIRA TDS-16126

Change-Id: Ie8c08ace75f3c6e14e803c6aeccdf43a0c27f3fa
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3257965
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
2025-07-24 10:19:13 +00:00
anupamg
0137495706 DCE-KMD: Make dce-client-ipc.c core file
- This change will remove linux nuances from dce-client-ipc.c
  file and make it a core DCE-KMD file agnostic to OS.

- To do that, dce-client-ipc module will repalce linux specific
  nuances for work queue related functionality with
  dce-os-work module.

- Further to support existing dce_client_ipc asyn callback function
  we need to make worker queue more generic by allowing clients
  to pass any data of their choice as data param to the
  callback function.

- Also take this opportunity to make following functions static:
    - dce_resume_work_fn()
    - dce_bootstrap_work_fn()

JIRA TDS-16581

Change-Id: I741b8675dd67ef932ee462e16cad016cbe8b7e2c
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3257808
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:13 +00:00