Commit Graph

27 Commits

Author SHA1 Message Date
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
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
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
Jon Hunter
36e3d424b8 Revert "nvsciipc: Include change for nvsciipc_ioctl.h"
This reverts commit ee72e995da1ee31177a06053b4c89f3ba6a1060a.

Reason for revert: This breaks building the OOT modules standalone without the GPU sources which are not public. Futhermore, this header
appears to be internal and so should not be included in sources that
are distributed publicly.

Jira: NVIPC-2817

Change-Id: I9a98056b004b7b6454473957f488020718eabfd4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263605
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:11 +00:00
Suneel Kumar Pemmineti
936e6687ef nvsciipc: Include change for nvsciipc_ioctl.h
- KMD to refer nvsciipc_ioctl.h from
$TEGRA_TOP/gpu/drv/drivers/nvsci/nvsciipc/inc-linux

Jira: NVIPC-2817
Change-Id: Ic8d86c1320759bf9260d5bb9b4ee82441b0bbb71
Signed-off-by: Suneel Kumar Pemmineti <spemmineti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3252263
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:11 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
5a54d4161a drivers: Fix build for Linux v6.12
In Linux v6.12 the definition 'no_llseek' was finally removed. Since
Linux v6.0 it had been redefined as NULL. Add a test to conftest to
determine if 'no_llseek' is present and if not then it is no longer
necessary to populate this and we can leave as NULL.

Bug 4876974

Change-Id: I051fdb285b32260b5913dad89cabe0be04253f67
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3222106
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
7adb4caf5b misc: nvsciipc: Fix build for Linux v6.12
In Linux v6.12, commit 88a2f6468d01 ("struct fd: representation change")
removed the 'struct file' pointer from 'struct fd'. This breaks building
the NVSCIIPC driver that tries to directly access the 'file' pointer
from the 'fd' structure. Fix this by using the helper macros 'fd_empty'
and 'fd_file' as necessary to fix the build.

Bug 4593750

Change-Id: I0f84736b408f533a732476175a8745091bc8542f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217429
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00
Brad Griffis
aaee95a8eb nvidia-oot: Update OOT driver path
The installation path for the OOT drivers has been updated from 'extra'
to 'updates'.

Bug 4410785

Change-Id: I54c8ce97cb1b159095b9dc3450ef0af711eb7f9b
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3069039
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-02-24 05:24:07 -08:00
Joshua Cha
21a661c58f nvsciipc: fix mixed license
Bug 4405013

Change-Id: I4c37c89b7dcc4c25e0b4e568b8d68d1a73c424f7
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028570
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-12-07 08:13:27 -08:00
Joshua Cha
236a2f09ee nvidia-oot: add IPA type info of IVC channel
Bug 4293372

Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Change-Id: I5c0cf142afdac9a6a1108a38513af6861272a8e9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995973
(cherry picked from commit ebedbb2492ea13211b53a48655e9312ba6b255dd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3004066
Reviewed-by: Kurt Yi <kyi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-02 18:13:33 -07:00
Jon Hunter
ce678a37b1 drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.

Bug 4183168
Bug 4221847

Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:54:05 -07:00
Shardar Mohammed
4be2dd36bb nvidia-oot: remove module * from class_create()
Remove the module pointer from the class_create() based
on following change in core kernel

======
driver core: class: remove module * from class_create()

The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something.  So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====

Bug 4276500

Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-08 18:09:50 -07:00
Jian-Min Liu
dc318641f5 nvsciipc: Fix issue associated with no permission to set db
CONFIG_ANDROID kconfig option has been removed from ack-6.1 version,
hence we add ACK_BUILD config to identify android build.

Bug 4223187

Change-Id: I77e6a40fc57a54d2115938e1906faf15ee879d60
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2953312
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-24 23:32:11 -07:00
Jian-Min Liu
f36fdd5baf Revert "Ensure virtualization macro are defined with ACK"
This reverts commit 9a53ca82d0.

The CONFIG_TEGRA_VIRTUALIZATION defined in the top-level Makefile
can be effective in the ACK build after refined make cmd.

Bug 4187941
Bug 4223187

Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Change-Id: Ide57f77b6d82770d9a1eeeb91c25e0b34d5911f0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954801
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-08-14 01:55:07 -07:00
Jian-Min Liu
9a53ca82d0 Ensure virtualization macro are defined with ACK
The "subdir-ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION" defined in the
top-level Makefile seems to be ineffective in the ACK build, so it is
redefined in each local Makefile.

Bug 4187941

Change-Id: I47c515a20704736ea44881b65c59639bf8242760
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942314
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-01 12:38:09 -07:00
Jon Hunter
deffbf24ab virt: tegra: Ensure functions stubs are defined
When building the out-of-tree drivers with virtualization support
disabled, symbols for some of the virtualization functions are not found
...

 nvgpu: Unknown symbol tegra_hv_mempool_unreserve (err -2)
 nvgpu: Unknown symbol is_tegra_hypervisor_mode (err -2)
 nvgpu: Unknown symbol tegra_hv_mempool_reserve (err -2)
 nvhost_pva: Unknown symbol is_tegra_hypervisor_mode (err -2)
 mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)
 mc_utils: Unknown symbol is_tegra_hypervisor_mode (err -2)

Update the hv-ivc.h header to ensure that these function stubs are
defined when virtualization support is disabled and only build the
hv-ivc driver if virtualization is enabled.

Finally, move populating the ccflags to the top-level Makefile and use
the subdir-ccflags directive to ensure the ccflags are passed to all
sub-directories.

Bug 4159372
Bug 4170085

Change-Id: I35edb91007524c3143dff7564f9ad545bd34e969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921199
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-07-05 14:34:15 -07:00
Laxman Dewangan
0ea187142e Makefile: Add missing license files
Add lincese and copyright information on Makefile
where it is missing.

Bug 4078035

Change-Id: I4d44143c186a30aabacb706b7db6549131c6e4d6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924242
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-22 23:39:23 -07:00
Joshua Cha
69315af003 nvsciipc: remove CONFIG_TEGRA_OOT_MODULE config
For kernel/nvidia-oot code, it doesn't need CONFIG_TEGRA_OOT_MODULE.
Add nvsciipc related header files for x86 build.

Bug 4096403

Change-Id: Ib4c3109bee01e12a62774dbf2a37a48778472fe6
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913022
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-03 19:18:14 -07:00
Joshua Cha
45992044df misc: nvsciipc: add error log to OOT driver
Add log for DB update.
Add log for endpoint entry lookup failure and DB access failure.

Bug 4052130
Bug 4074668
Bug 4074515

Change-Id: I8c8fb29fd7a4c4abd14b0c5d6d65f9a36d7a3d85
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890654
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Priyanshu Sharma <priyanshus@nvidia.com>
Tested-by: Priyanshu Sharma <priyanshus@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit b3dde6d13dd2ae774ab6227a88b6539f39dbb010)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890779
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-24 10:15:45 -07:00
Laxman Dewangan
5469e6aaf3 nvsciipc: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: I422a02eb30ba96dc63b96ee901023d8f90ff201b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891211
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-21 11:40:34 -07:00
Laxman Dewangan
2f11adce1f nvsciipc: Get rid of explicit handling of CONFIG_TEGRA_OOT_MODULE
The nvsciipc driver inside nvidia-oot is always build
as module and hence it is not required to handle the
non-defined case of CONFIG_TEGRA_OOT_MODULE.

Bug 4074863

Change-Id: If1e911a3702625eee635446446eeb98f27e74ebe
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890059
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-21 11:40:11 -07:00
Joshua Cha
d22a9b34c6 misc: nvsciipc: fix auth token validation API
In NvSciIpcEndpointValidateAuthTokenLinuxCurrent(),
It returns incorrect VUID due to partial string match in corner case.
If string length of device node name is different from the size return of
snprintf(), it skips comparing strings.
Enable debug cmd to test NvSciIpcEndpointValidateAuthTokenLinuxCurrent() and
NvSciIpcEndpointMapVuid() since they're kernel APIs.

remove one time update limit of SET DB cmd.

Added missing updates in nvidia-oot.

Bug 3928121

Change-Id: I13cc1927e817a124722156cffa0b391c95c7d28e
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2850945
Reviewed-by: Simon Je <sje@nvidia.com>
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-06 10:53:39 -08:00
Joshua Cha
7f189297bd nvsciipc: use CONFIG_TEGRA_VIRTUALIZATION
Use CONFIG_TEGRA_VIRTUALIZATION to remove dependency on
ivc-cdev.ko and tegra_hv.ko in native Linux.

Bug 3861841

Change-Id: I671a0eec76713715d7fc79cb730aeaa7ab460043
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2830878
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Kurt Yi <kyi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 06:30:46 -08:00
Joshua Cha
fdbb8a0e96 nvsciipc: add nvsciipc to kernel-oot
nvsciipc driver shall be added to oot driver list
so as to use hv-ivc.h header file.

Bug 3861841

Change-Id: I1884fba6ec497ec23680217c70e44f7a251ebfaa
Signed-off-by: Joshua Cha <joshuac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2815697
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Kurt Yi <kyi@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-30 00:00:04 -08:00
Laxman Dewangan
995c108438 nvsciipc: Add support to build as module with OOT kernel
Add support to build the nvsciipc driver as module with
OOT kernel.

The source file and makefile for building the nvsccipc driver
as module is copied from kernel/nvidia in build time.

Bug 3583631

Change-Id: I70f16496948c69bc8cd4c96155f00d1ed03390e7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2713487
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-20 00:09:04 -07:00