Commit Graph

18 Commits

Author SHA1 Message Date
cyeddu
2e075e123d nvscic2c-pcie: Fix Top25 CWE CERT-C violations
Fix total 48 violations of below CERT-C rules:

CERT ARR30-C - 1
CERT EXP34-C - 1
CERT INT08-C - 20
CERT INT30-C - 20
CERT STR07-C - 4
CERT STR31-C - 1
FORWARD_NULL - 1

JIRA NVIPC-3120

Change-Id: I2b9b35e97fe6968ec4c656cdcdd01a764640033c
Signed-off-by: Anjanii <amohil@nvidia.com>
Signed-off-by: Janardhan Reddy <jreddya@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263785
Reviewed-by: Deepak Kumar Badgaiyan <dbadgaiyan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:17 +00:00
chandra
9dc7f5a20f nvscic2c-pcie: Fix MISRA rule 10.3 violations
Fix total 62 violations of rule 10.3

JIRA NVIPC-3121

Change-Id: I1eae97bdbd8e1b41363469a42c66c23e8899603f
Signed-off-by: cyeddu <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3250504
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
chandra
414c0b4cf7 nvscic2c-pcie: Fix MISRA rule 10.4 violations
Fix total 65 violations of rule 10.4

JIRA NVIPC-3121

Change-Id: I5a1bead886683cbe3ec4b0e68531ee6e2a149175
Signed-off-by: cyeddu <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246908
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:12 +00:00
chandra
20c4af34ac nvscic2c-pcie: Fix Top25 CWE CERT-C violations
Fix total 13 violations of rule CERT-C EXP34-C and EXP39-C

JIRA NVIPC-3120

Change-Id: Ie96f1a93964a019645ecf38a338efa5768ca24fc
Signed-off-by: chandra <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261129
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
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: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:11 +00:00
chandra
e946c2cbcc nvscic2c-pcie: Fix Top25 CWE CERT-C violations
Fix total 20 violations of rule CERT-C EXP34-C

JIRA NVIPC-3120

Change-Id: I1e8940269a2859a0483215cf44170dd669f637ea
Signed-off-by: chandra <cyeddu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3260920
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2025-07-24 10:19:11 +00:00
Janardhan Reddy
cfaad9cd6d nvscic2c-pcie: Add Buffer limts per endpoint
Address security ARR: DOS60-REQ-7169 in streaming mode.
Add per endpoint streaming mode buffer limits.

Bug 4883175
JIRA NVIPC-2453

Change-Id: I31edb2bacf4a8af560e7e6da7d378da874d105bd
Signed-off-by: Janardhan Reddy <jreddya@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3196300
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Deepak Badgaiyan
ee10f0e501 nvscic2c: common DMA integration
Integrate with common PCIe eDMA calls.
Common PCIe eDMA will support same calls between
T234 and T264.

Fix pci_epc_set_msi() failure. Initialize msi count.

Jira NVIPC-2448
Jira NVIPC-2708
Change-Id: I860fd2ee86950e558d2b6a362c05dba7988368e9
Signed-off-by: Deepak Badgaiyan <dbadgaiyan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197105
Reviewed-by: Sivagamy Govindasamy <sivagamyg@nvidia.com>
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:07 +00:00
Laxman Dewangan
6533bf9268 misc: nvscic2c-pcie: Fix missing headers for Linux v6.8
For Linux v6.8, commit ef175b29a242 ("of: Stop circularly including
of_device.h and of_platform.h") updated the OF headers included by these
header files. This breaks the build for various drivers and so fix this
by including the headers that are actually needed for each driver.

Bug 4448428

Change-Id: Ic40e43c99ff1a7f5c4b7a7c3ab525e6e046c452b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3062519
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-01-25 17:26:37 -08:00
Jon Hunter
d0e427c6e1 drivers: Use conftest for vm_flags
The conftest script has a test for checking if the vm_area struct has a
const vm_flags member. So enable this test and use the definition
generated in the appropriate drivers.

Bug 4374520

Change-Id: I0e7bd105fe8a821b0af23c0a5553b8d4468fa8c4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026924
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-06 16:36:32 -08:00
Laxman Dewangan
9ce6a359f7 nvscic2c-pcie: Use vm_flags_set() APIs for Linux 6.3 and later
The VM flag is set via the API vm_flags_set() provided from core kernel
from Linux 6.3 and above. Use this API to set the flag.

Bug 4374520

Change-Id: If09eea1d03de8ac05aac692879a52f0f74eca251
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3014990
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-13 06:44:41 -08:00
Jian-Min Liu
719d3fa024 nvidia-oot: use TEGRA_SYSTEM_TYPE_ACK as ack macro
Use config TEGRA_SYSTEM_TYPE_ACK to control kernel builds only
base on the system type which also aliged to Makefile use.

Bug 4223187

Change-Id: I276208d180d1b3459eccb80d8fdb818f4507d3df
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2966713
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-24 23:32:04 -07:00
Bruce Xu
db10888783 nvidia-oot: set/clear vm_flags via function
In new kernel, need to update vm_flags via kernel
provided function. Otherwise below error is met:
./include/linux/mm_types.h:476:20: note: non-static data member
'vm_flags' declared const here
                const vm_flags_t vm_flags;
                ~~~~~~~~~~~~~~~~~^~~~~~~~
1 error generated.

Bug 4196760

Change-Id: I03455af7ce3623d0d8a0f0cd56d569ef3c7af9ea
Signed-off-by: Bruce Xu <brucex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938942
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-11 05:19:43 -07:00
dbadgaiyan
e063d55fff nvscic2c-pcie: update async error reporting
NVSCIC2C_PCIE_EDMA_XFER_ERROR is returned when failure received from
PCIe EDMA in callback or when job scheduling failed.
Remove returning NVSCIC2C_PCIE_EDMA_XFER_ERROR in case of PCIe EDMA job
schedule failure as schedule failure should be due to validation failure.

UMD will return NVSCIC2C_PCIE_VALIDATION_ERROR for this case too.

Jira NVIPC-1333
Bug 4197626
Signed-off-by: dbadgaiyan <dbadgaiyan@nvidia.com>

Change-Id: I6e079360b4129aebcd75204267934f7b821a4b99
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2941054
(cherry picked from commit 6e58a46b78e37b5a6399bebc2f16c338b6444487)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947673
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arihant Jejani <ajejani@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Deepak Kumar Badgaiyan <dbadgaiyan@nvidia.com>
2023-08-05 13:09:23 -07:00
dbadgaiyan
3067ceeb00 nvscic2c-pcie: add support for error handling
Enable AER reporting for ednpoint.

Provide error handler for AER reception and
update error code to be read by user space process.
Change PCIe link to down.

Implement error reporting for runtime eDMA xfer errors.

Bug 4088959
Jira NVIPC-334

Change-Id: I74871e5226eab1b708c72aa71216cd160c6ebf68
Signed-off-by: dbadgaiyan <dbadgaiyan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2915753
(cherry picked from commit 7b24941fb486ada70229c42ae1deec12f75028c2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921480
Reviewed-by: Arihant Jejani <ajejani@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-19 12:29:40 -07:00
Arihant Jejani
0e6d4c804f nvscic2c: Implement Read-After-Write ordering WAR
- Ordering between message/data and host1x syncpoints is not enforced
   strictly.
 - Out of the possible WARs, implement dummy PCIe Read between
   data/message write and notifications towards peer / remote post-fences.
 - WAR: (IPC/messaging mode)For any UMD produced data towards peer,
   before notification is triggered, issue a dummy PCIe read  via CPU.
 - WAR: (streaming mode)DMA flush-ranges(data), wait for DMA interrupt,
   when success issue dummy PCIe reads via CPU on remote post-fences
   + issue CPU PCIe writes on each remote post-fence. To achieve this,
   CPU map every imported sync object.

NVIPC-974

Change-Id: Id6711d372c0a35e13e399ffbbcd8efcabf147c56
Signed-off-by: Arihant Jejani <ajejani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2912894
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Janardhan Reddy A <jreddya@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-31 18:41:36 -07:00
Akshay Tigga
75ac42b84c WAR: Add "VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver"
Android common kernel prevents the use of symbols exported from the
fs subsystem in other modules. As a WAR we need to explicity import
"VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver"
until the migration is complete to remove the use of such symbols.

Bug 3974840

Change-Id: Icb47eba34d069ec287e5ad5bd2e046b0f96f401c
Signed-off-by: Bruce Xu <brucex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2901632
(cherry picked from commit bfd7dc903f050f778f105af07e4ddfbde8497881)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2910053
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shardar Mohammed <smohammed@nvidia.com>
2023-05-29 03:55:46 -07:00
dbadgaiyan
f2088fd15d misc: nvscic2c-pcie: Update nvscic2c-pcie license
Modify nvscic2c-pcie files to use updated licenses
as per nvidia-oot.

Bug 3739487
Jira C2C-826

Change-Id: I819b459fdb0743d37bc08b4c9b92097d87e62884
Signed-off-by: dbadgaiyan <dbadgaiyan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2830686
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arihant Jejani <ajejani@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-22 20:29:46 -08:00
dbadgaiyan
4adc5c8fb4 drivers: misc: add nvscic2c-pcie in OOT
nvscic2c enables xfer between two SoC connected over PCIe.
nvscic2c already available with K5.10

Major changes in nvscic2c-pcie for K5.15:
 Integrate with upstream PCIe endpoint function changes.

 Allocate new IOVA domain to be used for
 empty IOVA allocation.
 This IOVA range would be used in iommu_map() to map
 physical backing with IOMMU domain attached in PCIe device.

 Migrate from nvhost to host1x and tegra-drm interfaces.

Bug 3739487
Jira C2C-826
Jira C2C-830

Change-Id: Ic4d8ac680921807fb17247855ca7037623681cb7
Signed-off-by: dbadgaiyan <dbadgaiyan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2810806
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Arihant Jejani <ajejani@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-15 20:52:33 -08:00