Commit Graph

125 Commits

Author SHA1 Message Date
Chris Dragan
20730c6ceb misc: mods: fix compilation with kernel 5.17
Bug 3604749

Change-Id: I159a9d809d813184943295d7ac58eed0f35df497
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2729857
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
4974a781b6 misc: mods: fix compilation with kernel 5.18
Integrates CL 31407382.

Bug 3680536

Change-Id: I5a50dc1c5af1dfcc52aa112269f6802e447206d4
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2729243
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
d8714b7da4 misc: mods: add support for kstable
Bug 3660609

Change-Id: Iaa6e4e048afc1a1e26d5dccc361a18322a23b47e
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2726143
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Prateek Patel
86c8a8033d core: include: Fix cert_c defect
Signed index may evaluate to an address that could be at negative
offset of an array. Use unsigned indexing.

CID 479265
CID 452753

Bug 3512545

Change-Id: Iaae22838305aeeafb3ebaecc497fe1556749c5c2
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2701054
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
c7fe179f62 misc: mods: fix bugs and style issues
* Fixed __user and __iomem pointer types.
* Added __poll_t for poll() return type if possible.
* Fixed error return from poll().
* Fixed init/shutdown in mods_dma.
* Declared internal unit functions as static.
* Assign NULL to init pointers instead of 0.

Bug 3528414

Change-Id: If39a14a429e2cda5d58edb6ffd60fd13693371e6
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2688314
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Bodla Rakesh Babu
6fdf0401f7 misc: mods: Fix compilation flag
Fix compilation flag for tz mods, it is based on trusty
interface, guard it with CONFIG_TRUSTY.

Change-Id: I71ce90188c8c2a3d82371bb786b7e13971a06812
Signed-off-by: Bodla Rakesh Babu <rbodla@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2682655
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
koenz
5638242e6b misc: mods: Check return value of snprintf
CID 432482
CID 347889

Bug 3512545

Change-Id: I8b3b9b0c3986a36fd695768e0ff15f97ef5a566e
Signed-off-by: Koen Zhao <koenz@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2677372
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
andersm
fd352dc972 misc: mods: fix issues captured by Coverity
CID 477507
CID 490219
CID 490880

Bug 3512545

Change-Id: I30c7f671df776dd5967427450c8a07891094ff2c
Signed-off-by: Anders Ma <andersm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2676489
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
4e5838f829 misc: mods: fix issues from Coverity
CID 368887
CID 382069
CID 490237

Bug 3512545

Change-Id: I955bb2cf14a64127cb5243d46ea964cb94ff4f2d
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2673080
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
5335da0508 misc: mods: fix userspace pointer type
Bug 3528414

Change-Id: I7376f3b51a0f1b9ee93be340634da4cf2f5fcbcc
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2668746
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
fc5605722c misc: mods: fix uninitialized variable
CID 10127994
Bug 3461002

Change-Id: Ic1ae0abbb69fb686f59dfb176d9eecfa7758eb63
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2660727
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
13ac7c137c misc: mods: update MODS kernel driver
Bug 3461002

Change-Id: I9f577323cd8034a4464953031398c39a409ad69c
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2658852
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Anshul Goel
aa915e1412 MODS Online IST SMC support
Summary: This change adds support in mods kernel
driver to send messages to ATF using SMC interface in
order to fetch the Online IST test results.

JIRA TM-206

Change-Id: Iafa397287d7af63d77c51308345a9dc93d3a922f
Signed-off-by: Anshul Goel <ansgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2630148
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
andersm
c9052a874f misc: mods: dmaengine terminate API update
- dmaengine_terminate_all API is deprecated and
- use dmaengine_terminate_sync instead

Bug 3403616

Change-Id: I87d3edfae1ea8f02ad3c78c1d862ce8bea8dab67
Signed-off-by: Anders Ma <andersm@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2614263
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Lael Jones
2ce330f11a misc: mods: Replace CONFIG_ARCH_TEGRA
The perforce version of the MODS kernel driver
does not pull in any of the Tegra specific driver
functions. This prevents the perforce driver
from being compiled on any Tegra system or non
Tegra system with CONFIG_ARCH_TEGRA=y.

To allow the perforce driver to be compiled
replace CONFIG_ARCH_TEGRA with MODS_HAS_TEGRA
which is set based on CONFIG_ARCH_TEGRA in git
but left unset in perforce.

Bug 3397113

Signed-off-by: Lael Jones <lajones@nvidia.com>
Change-Id: Ie113d632c4dcc372058b9a1e3a549a70b8f7c03f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2607859
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Ellis
1658071414 misc: mods: Add ioctl to pass messages to tz app
Summary: This change adds support in mods kernel
driver to send messages to Trusty in order to
run tests trust zone side

Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Change-Id: I5cd0a1dcc4d1ac5543df5fb3ebec4427c1145e10
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2567469
Tested-by: Rohith Talluri <sitalluri@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Stephen Wolfe <swolfe@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
dongqiang
df0985a449 Update for Bpmp MRQ Call
Update Bpmp MRQ Call Api to use bpmp dtb node in mods dtb devices
Used by MODS PCIE Test for bpmp uphy api
JIRA: TM-586

Change-Id: I67b34979151fa57fd1707b2393237828f2c23cef
Signed-off-by: Carl Dong <carld@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2577098
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Danny Li <dali@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
dongqiang
62a67b00a8 Fix Smmu IOVA contiguous checking error
To allocate larger buffer, MODS code is allocating noncontiguous pages
and then calls dma buffer api to do smmu mapping to get a continuous
iova address. This change will fix the error when the scatterlist's
dma  address is 0xffffffffffffffff, skip checking the sg since it's
already merged to the head node.

JIRA: TM-129

Signed-off-by: Carl Dong <carld@nvidia.com>
Change-Id: I45aa3b0afcf5c86179fb293cd48326b14c2f3efc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2552672
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
16bb9a5ba0 misc: mods: update from Perforce
Change-Id: If7d0606ab444ba4dabc8ef317120d1d4393ef871
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2536359
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
koenz
7af9118d0a mods-kernel-driver: BPMP Uphy driver support
JIRA: TM-127

- Adding ioctl commands for setting PCIE state and initialize PCIE EP PLL;
- Sync some code from perforce;

DVS: http://ausdvs.nvidia.com/Build_Results?virtualId=1000859480

Signed-off-by: Koen Zhao <koenz@nvidia.com>
Change-Id: I4f9024f5037060a7c78f337148b202a078cbc4ba
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2461698
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
koenz
d711403132 misc: mods: synchronize with Perforce
Change-Id: Icfce1a3aa22d84cbd4825ab4fbce86970e2261f4
Signed-off-by: Koen Zhao <koenz@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2474042
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
32e7a1caab misc: mods: fix ioctl for writing into sysfs files
f_op->write doesn't always have to exist, it can be NULL.
Instead, use kernel function which handles this correctly.

Change-Id: I955bc1c2e97d3bfee3e5c7e48fefcbda4af1214c
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2457926
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Anand Nahar <anahar@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
a51241efac misc: mods: update MODS kernel driver to 4.1
Change-Id: I56377b85ff0909dba419c8e3f6df16c9302d6dc5
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2456573
Reviewed-by: svcguardwords <svcguardwords@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
125e88df0a misc: mods: update MODS kernel driver to 3.99
Change-Id: I7ca22718af4e4f897ec0d410949fa1c14022eec1
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2422786
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Petlozu Pravareshwar
7d821e9865 misc: mods: Fix compilation issue with K5.9
Use 'pci_channel_state_t' instead of 'enum pci_channel_state'.
This is to fix compilation issue with K5.9.

Bug 200622929

Change-Id: I5587d9913d0a053de9066fed4ab183f1e5f3ac93
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2417901
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shabbirali Palasaniya <spalasaniya@nvidia.com>
Reviewed-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
root
12952ac5dc Fix synchronization issue in mods kernel driver
Summary: The get_reset_handle function does not
release the spin_lock when it finds the handle in
the list of reset handles and returns. Modify the
function to ensure releasing of the lock in all
cases.

Change-Id: I2ead6d64199cccc7afb7876ca14ce91a110f7e6c
Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2365950
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
dongqiang
9e88fe9bb3 Update dma attrs for kernel 5.9 build
Bug 200622929

Change-Id: Ib4642122ebc09f5d2330d523ebab18c57cbdd892
Signed-off-by: Dong Qiang <carld@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2343983
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Richard Wiley <rwiley@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Bitan Biswas
22f3563ea5 nvidia: drivers: fix linux-5.7-rc5 build
Fix build linux-5.7-rc5 errors including following:
	- change timespec to timespec64. replace getnstimeofday
	  with ktime_get_ts64
	- replace usage of macro FIELD_SIZEOF with sizeof_field in ethtool.c
	  nvethernet and eqos files.
	- support 2 arguments for of_get_phy_mode call

bug 200617764

Change-Id: I46067d7d36d08ee9556b2722e9ccec707b8853d4
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2347244
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
ellisr
ad434b8d0e misc: mods: Update reset framework in mods driver
Summary: Previously mods stored handles for both
clocks and resets in the same list. This meant
reset signals that didn't have a corresponding
clock signal could not be toggled. This change
adds a separate list of structures to handle
resets and decouple it from the clock handling.

Change-Id: I2a83dd5cb7b7fe412acf7ae1815b18b747ad2cac
Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2225415
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
34b61af05b misc: mods: update MODS driver from Perforce
Change-Id: I46f5d639a06dbd26b89103cfa82aecc047fd2ccc
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2317597
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
fa93fef9fb update mods.h with public header guidelines
In git, we have moved this header to uapi directory, so that it can be
installed with the headers_install target. It now has to follow
guidelines of well-formed headers usable in userspace programs.

* Update SPDX license header.
* Don't use kernel CONFIG options.

Bug 2657961

Change-Id: Iee2bbfc6c931b5e8c5ee71cef9dfdfbb7f50d114
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2310801
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Dong Qiang
949b226f0e Smmu Support for MODS kernel module
Bug 200582229

This change will add smmu mapping/unmapping support for MODS
allocated memory buffer by using kernel smmu api dma_map_sg_attrs()
and dma_unmap_sg_attrs()
1. new IOCTL MODS_ESC_IOMMU_DMA_MAP_MEMORY and
MODS_ESC_IOMMU_DMA_UNMAP_MEMORY is added to do smmu mapping/unmapping
and get smmu mapped address for MODS allocated buffers;
2. a platform device and driver is added to match mods smmu sid in dtb,
the device is used to do smmu mapping/unampping; and mods smmu devices
are added in dtb to match with the driver with smmu config

Signed-off-by: Dong Qiang <carld@nvidia.com>
Change-Id: I47d4d1c43f14fc6b51f0c00cee127e1d51377f64
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2180897
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00
Chris Dragan
6a9401f3a1 misc: mods: move mods.h to uapi
Bug 2657961

Change-Id: I65f4a8ff48c534144afc5aca7ce556dcc82d9342
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2307271
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
14ecbcb3d5 misc: mods: update MODS driver from Perforce
Change-Id: I5a024a62688fa6ec1f445628bbc618ae92db737d
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2303203
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
a85680cbc5 misc: mods: fix compilation with k5.4
Clean up configuration in mods_config.h and make mods_config.h identical
to the official copy in Perforce.

Bug 200587200

Change-Id: I035119eb44025f45d8272729ebc5a918dd8da6fe
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2302436
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
b5b2def304 misc: mods: improve logging and fix SRIOV
* Add new cl_* macros for printing client-specific messages.
  This adds client index to messages in code which is called from
  user space.  This makes it easier to diagnose errors when multiple
  clients (processes) open the driver.
* Use kernel print levels appropriate to messages being printed.
* Print process pid when opening the driver.
* Print information about access token being set or released.
* Print information about PCI devices being enabled or disabled.
  PCI device enablement is tied to the driver getting ownership
  of the device.  It also prevents multiple MODS instances from
  owning the same PCI device.
* Print info about device DMA mask, print device DMA mask when DMA
  mapping fails.
* Print more info about SRIOV actions.
* Disable SRIOV when the driver is being closed by the process
  which enables SRIOV.  Leaving SRIOV enabled when disabling PCI
  device is an error and leads to stale functions, unusable on
  subsequent MODS runs.
* Clean up log messages in a few places.

Change-Id: I51953e984a55c0990e90f89d8260f215c8c58498
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2279439
Tested-by: Ellis Roberts <ellisr@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
root
022cae03a3 misc-mods Fix irq registering for tegra mods
Summary: Support to hook mods interrupts
for tegra mods devices was broken due to
gpu-mods changes that went uncaught in sanity.
This change modifies the kernel to allow the tegra
code paths to work again. This change also adds
support to map irq numbers to gpio input pins
to expand functionality in the irq framework.

Change-Id: Iee65f9bcaf09453c1740cd5cf7f64b76c87e00c3
Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2259509
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
root
49a69b4202 misc: mods: update MODS kernel driver to 3.96
Summary: Mods has released the latest kernel
driver in perforce. We need to make sure the
driver in git is at parity with the perforce
version

Change-Id: Ic3f1ab372574af7b61aa9736b33fb38a8c720ada
Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2261293
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
ellisr
726aeb070b mods-linux: Add debugfs for ras error programming
Summary: Add debug fs to allow user to program
the error control registers in RAS so mods can
selectively disable errors if so desired. A
current example of this usecase is disabling
ras from throttling, which is thrown during
the mods Soctherm OC throttling test

Bug 200533168

Change-Id: Id9007e9e13ae9563ad2aae107b130bcd951f0bc4
Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2224479
GVS: Gerrit_Virtual_Submit
Reviewed-by: Kiran Kasamsetty <kkasamsetty@nvidia.com>
Reviewed-by: Rohan Sreeram <rsreeram@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
9896b7bddc misc: mods: update MODS kernel driver to 3.94
Change-Id: Ib80e8ab4685e4edf48df6dcd3aa36e2efe7fdbcb
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2188947
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
003f79282f misc: mods: update MODS kernel driver to 3.93
Change-Id: I6bc81407edbd448867c0b6d979d2eb3920c0e95c
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2156158
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Nicolin Chen
9ca6957981 misc: mods: Fix segment_size overflow bug
The sg->length may happen to be a large size, and this
will overflow the local segment_size when accumulating
sg->length to it at line "segment_size += sg->length".

Since segment_size of MODS_DMABUF_GET_PHYSICAL_ADDRESS
structure is defined in u64 type, this patch fixes the
bug by changing the local varible to u64 as well.

Bug 2521255

Change-Id: Id1fb6d149f55f4fd9238a399393ed2efae77c84a
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2105445
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Ashish Mhetre
6f325d969e drivers: mods: Add a dummy device driver
Add a dummy device driver for retrieving physical address through dma_buf.
Set dma_mask bit to 39 during probe of this driver to add large mapping
support upto 512GB.

Bug 2482094

Change-Id: I4e6204bb2b5196b7362d547ee393abf6e291a043
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2002758
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
0395435413 misc: mods: update MODS driver to 3.91
Change-Id: I7bfcb63a7034c53e4b9773210442fa90d0855f39
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1998610
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Ashish Mhetre
01afe170c6 drivers: mods: Assign dma_ops to the device
dummy_device created in mods test does not have dma_ops set to it.
So explicitly set the dma_ops of device to swiotlb_dma_ops.

Bug 200460613

Change-Id: Ie9902f1c0b07948ea04355aa754b023f10f7581d
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975103
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
63bb979778 misc: mods: fix handling regions >4GB
The API for retrieving PAs needs to correctly handle offsets which
exceed 4GB.

Bug 1860962

Change-Id: I877c370d97c35fde565c70cd86a95093be083ebb
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1958611
Reviewed-by: Sami Kiminki <skiminki@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
bf8bcb968d misc: mods: update MODS driver from Perforce
Change-Id: Ic63f4f9c86c4575926ac33d8872199a59e9224ce
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1944110
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
5a7a662974 misc: mods: update MODS driver from Perforce
Bug 2418720

Change-Id: If2c51596a576ea11fd514c9bd6090b871d25c524
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1927063
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Phani Shankar Palani Ramamurthy
e707e546f1 Create display debugfs only if tegradc is enabled
Create display debugfs nodes in mods kernel
driver only if tegradc is supported

Bug 2331746

Change-Id: I906011c10d1fe9fafa83537290fce3916fc7f433
Signed-off-by: Phani Shankar <ppalaniramam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1848526
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00
Chris Dragan
7145a3f32b misc: mods: disable SWIOTLB detection
Removed #define MODS_HAS_DMA_OPS 1
and #define MODS_HAS_NONCOH_DMA_OPS 1

Bug 200435359

Change-Id: I17b901422fa2fa991c81bee77ab166071ebddb3f
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1810719
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-03 13:27:52 +00:00