Commit Graph

2908 Commits

Author SHA1 Message Date
Saravanan Ponnuswamy
67366636bb nvidia-oot: MISRA violation fixes
This patch fixes the following violations:

CERT STR31-C - 3 violations

Signed-off-by: Saravanan P <saravananp@nvidia.com>
Change-Id: Ic1fa2b18e855a5eb6e28d09fd6f436151ed2a880
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931426
(cherry picked from commit 4c29b05e2734b197b9ffcdd2a0d7e1e8cc788451)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2943561
Reviewed-by: Shu Zhong <shuz@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-18 10:50:42 -07:00
Ankur Pawar
630aa8bba7 media: add pca9570.c driver
Enable pca9570 for IO Expander.
This is used by IMX185.

Bug 4191790

Change-Id: Ia0051718803cc1c898969739a0cb975c7432b647
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2889570
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-18 10:44:06 -07:00
Mainak Sen
420b84b69d drm/tegra: Stop channel DMA during suspend
When channels are kept open over a suspend cycle, we need to
re-initialize CDMA after resume.

Bug 4133027

Change-Id: I9a2737b377a9ffb37e5f98703b7928bfceab58e3
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2963164
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:43:47 -07:00
Advaya Andhare
7d1a687636 nvvse: Allowing multiple access to dev node
- This CL partially reverts the changes done in CL - 2891721
- Current implementation checks if multiple process/threads/apps
  try to access same dev node when it is already open by another
  process/thread/app, and throws an error if condition is true causing
  new process/threads/apps to fail as in bug mentioned below
- This change allows multiple process/threads/apps to access the same
  dev node.

bug 4126726
jira ESSS-759

Change-Id: Ibe18449014e69148ae2feebd854b6c5d278f5bc4
Signed-off-by: Advaya Andhare <aandhare@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946094
(cherry picked from commit 615a1aba49e2662d767a23e47fed329627f6f91e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2956815
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:29:44 -07:00
Bharat Nihalani
0f7f6190a1 nv-virtio-poc: Include correct header
This driver was including <linux/tegra-ivc.h> that uses deprecated
CONFIG_TEGRA_HV_MANAGER. This caused all tegra_hv functions to be
stubbed.

With K5.15, a new header <soc/tegra/virt/hv-ivc.h> should be
used instead that makes use of CONFIG_TEGRA_VIRTUALIZATION which
is enabled as part of the kernel build flow. With this header
included, all tegra_hv functions are correctly linked.

Also, there is no need to include tegra_hv.h as this driver
does not use the functions declared in that header.

Bug 4206871

Change-Id: I6ef6e2cf5f2c88dab015c2f10913ede4fdfd5583
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954916
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:27:27 -07:00
Jian-Min Liu
7bcd11a009 Avoid function re-definition when FS_DEBUG is not set
add FS_DEBUG to the implementation function to avoid re-definition
build error caused by FS_DEBUG is not set with ack user build.

Bug 4230728

Change-Id: I0c1d4357ec86f030b386f65cd32bed87b2382557
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952839
Reviewed-by: Kevin Kuo (SW-GPU) <kevkuo@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:19:17 -07:00
Mahesh Patil
6883238a21 nvethernet: Fix coverity "unused value"
Bug 3952896

Change-Id: Ie30c3da4d0979f664cb3c951794e905b52e5c005
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952208
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2023-08-17 20:16:21 -07:00
Anubhav Rai
d6bcba5193 vi5: fix v4l2 VI driver channel open
unmap chan_id from DT with capture channel id.
Capture channel id is shared between isp capture
and v4l2. Find a free capture channel that does not
conflict with other clients

bug 3691031

Change-Id: If3cd887db6feb2a1817a7451249185de47d6e9ad
Signed-off-by: Anubhav Rai <arai@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2768753
(cherry picked from commit cf54cc587eba0854236c634b8ec0c1c2c98a3a5d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2866951
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:05:09 -07:00
Anubhav rai
b66b703f0e camera: vi: Fix VI clk scaling for gangmode
gangmode uses single VI channel to stream simultaneously
from 2 CSI bricks. The VI clk should be scaled accordingly
to accommodate this bandwidth

bug 3814565

Signed-off-by: Anubhav rai <arai@nvidia.com>
Change-Id: I6912f1aeb878e53e63e3a04c7132219f030973d1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2791338
(cherry picked from commit 7a95f84f1eb4f60a8e9740876db53b23c95f865e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2866932
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 20:05:03 -07:00
Anubhav Rai
33f74c0dd8 csi5: add lane polarity config
parse the lane polarity config from the DTB and
program the nvcsi brick config accordingly.

bug 3865161

Change-Id: I70f746a40033bafa7d9286790b9c01ae5986a9f8
Signed-off-by: Anubhav Rai <arai@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2855412
(cherry picked from commit bee21e4c839b8c55ac6314fd55f2e36edd547c97)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2953780
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-17 05:11:26 -07:00
Ketan Patil
1c2599bcba video: tegra: nvmap: Update carveout name
Compression carveout is not correct carveout name as it will be used
by gpu even for non-compression usecases. Hence rename it to gpu
carveout.

Bug 3956637

Change-Id: I802b91d58d9ca120e34655c21f56c0da8c8cf677
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2955536
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
2023-08-16 18:47:35 -07:00
Aniket Bahadarpurkar
3e51976226 tegra: cdi: Add delay while setting gpio
On p3898 platform, VCC_CAM can't handle high
inrush current when gpios are set in parallel.
Hence, a SW WAR is required to add a delay of 5ms
after a gpio is set.

Bug 4125801

Change-Id: Ib235cb00b5ef42c7255be5d212dd9e190630d7bc
Signed-off-by: Aniket Bahadarpurkar <aniketb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2943541
(cherry picked from commit 6e44996aae022c9e46fb431b75d60c8499bcd874)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2953356
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2023-08-16 18:39:52 -07:00
Sagar Tyagi
a65561e6b4 p3898: Bridge driver for MAX96751
Implemented the bridge driver
for MAX96751 HDMI serializer.
In initial version following
features were added.

1) Bring serializer into functional state
2) Drive the RCLKOUT
3) Power management operations

Bug 4069908

Change-Id: Ifbfe5fed3eba5b35303a5072d7eb5935884f1a0f
Signed-off-by: Sagar Tyagi <satyagi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2905398
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shu Zhong <shuz@nvidia.com>
2023-08-16 06:38:07 -07:00
Jian-Min Liu
898a587665 Revert "Add compiler flag to avoid function re-definition"
This reverts commit 2cf67077e2.

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: Ibe2eabd7c3b84c8f753a089231e90993f377b513
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954802
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-08-14 01:55:13 -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
1df2ef7d23 nvidia-oot: Fix compilation warning for ack build
Refine the compiler flags for ACK make command and fix compilation
warnings from the new command.

Bug 4187941
Bug 4223187

Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Change-Id: Iff7bf5839c585a6c3d3ef6daefb64eb113c739e2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954087
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-14 01:54:51 -07:00
Akhil R
37cf697fb1 crypto: tegra: Init keyslot for SHA as well
Inititalize keyslot for SHA algorithms as well since SHA-HMAC
uses the same keyslots.
Also reduce the log level of some prints. The scenario does not
have any functional impact that the user need to be notified.

Bug 4221414

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I73449144ce56aaf35fae52aa1c4c5b0bb8c01d9c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952640
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-13 00:37:29 -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
Sameer Pujar
1e35fdd8c5 ASoC: tegra: Align with upstream DT for compatible and clock name
It is nice to have downstream DTB working well with upstream kernel
drivers. This gives a flexibile option for users to choose between
out-of-tree and upstream audio drivers by selectively adding either
of these to deny list.

For clock PLLA_OUT0, upstream DT uses 'plla_out0' clock name where
as downstream uses 'pll_a_out0'. So aligning with upstream DT makes
probe to fail. Thus update the clock name in driver to match upstream
DT bindings.

The sound DT supports compatibles to either work with upstream or
downstream machine drivers. Earlier the source 'tegra_codecs.c' was
modified to make it potentially usable for upstream machine driver
as well and thus it has upstream compatible checks. This check is
now replaced with a flag which is known to be set only during
upstream machine driver probe.

Bug 4119612

Change-Id: Icd5d97343029e35a5702ff4dc527881fb9277346
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948525
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dara Ramesh <dramesh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-10 00:33:15 -07:00
Wayne Chang
5fe0f39e06 usb: typec: Add fusb301 driver support
The change adds fusb301 driver support on k5.15.

Bug 4119758

Signed-off-by: Wayne Chang <waynec@nvidia.com>
Change-Id: I9af363b46e71853c1681c68396dff7f5e9036d6a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2917816
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-10 00:26:01 -07:00
Johnny Liu
d412dc39e1 drm/tegra: Set actmon count weight for nvdec once
Method invocation for updating count weight for nvdec may conflict
with a job being submitted through host1x.

Change the implementation to set count weight values for both actmon and
the engine once in runtime resume cycle to prevent possible conflicts.

Bug 3962196

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I19d160abd90373721df78cdb107ca396a206a6e8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952692
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-08-09 10:50:55 -07:00
Johnny Liu
69d9f479a4 drm/tegra: Unify logic for suspend and resume
Two main changes for the suspend and resume:
1. Set clock to Fmin/Fmax in suspend/resume cycles
2. Reorder the code in suspend and resume functions and add recovering
   logic when error happens in between

Bug 4224081

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Iadb0b1f960ca8b9c80094d1769a2d90496263124
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948452
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-08-09 10:40:23 -07:00
Sahil Mukund Patki
61af983ca4 tsec: fix coverity defect
Issue:
Unchecked return value for clk_prepare_enable function.

Fix:
Add check for return value of clk_prepare_enable function and take
proper action in case of error.

CID 10162292

Bug 3952896

Change-Id: I2f3a75d028fbed2f855b72d2efc9a30844b8c336
Signed-off-by: Sahil Mukund Patki <spatki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2950809
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-08 20:56:29 -07:00
Johnny Liu
c983eec625 drivers: pva: skip vpu load reading when suspended
WHen PVA is already suspended, there is no need to resume the device
through nvhost_module_busy and send mailbox request to PVA for VPU load
reading. It avoids switching CV power domain on and off.

Bug 4168798

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ib9ec4d4ded2b96ee8f76267e190087612d1e0468
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946818
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-08 06:47:35 -07:00
Ketan Patil
edf9d114e1 video: tegra: nvmap: Don't perform repetitive ioremap
__ioremap function called during cache maint takes more time in case of
multiple processes compared to single process. This is impacting camera
tests when multiple cameras are used. For carveouts, nvmap performs page
by page ioremap and then cache maint on it. Optimize this with following
steps:
- During first cache_maint of the buffer, perform ioremap on entire
buffer and save the kernel V.A.
- Next time, when cache_maint is called on the same buffer, we will
reuse the saved kernel V.A.

Bug 3922175

Change-Id: Iecb372365409de1951bcc8e6f3d8e8e867bb2a80
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948759
Reviewed-by: Barton Xu (SW-TEGRA) <bartonx@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-07 05:01:37 -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
Johnny Liu
d171c817ec drm/tegra: Correct icc cleanup logic
Since devm_of_icc_get is used, no need to call icc_put when device probe
fails or device driver is removed.

Bug 4222919

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ide313c6f56e1bef83ffe3718cd434abbdaeec869
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947933
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-04 14:09:18 -07:00
Sushil Kumar Singh
8fc898d1ec nvethernet: assign macsec private data to NULL
Issue:
L4T platforms on boot comes up with MTU as 1500.
However on changing the MTU to jumbo, the final
MTU which gets set accounts the MACSEC ICV tag
len and reduces the MTU by 34 bytes even though
the platform does not support MACSEC.

Fix:
Assign macsec allocated private data to NULL and
use the NULL check in ndo mtu change ioctl call
to reject MTU reduction if macsec is not supported.

Bug 4137597

Change-Id: Ica3003b54762dd5d240c9b0c5c012049b4e503b2
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928569
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-04 13:57:42 -07:00
Akshata
410b23ffce dla: kmd: Update logic for single DLA boards
+ Added logic to enumerate single instance DLA as
DLA0 for Linux builds

Bug 4165116

Change-Id: If01bfa98a9bcef02270056d786e4574785a46850
Signed-off-by: Akshata <akshatab@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2945452
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-03 20:27:56 -07:00
omar
058bb1ad7f drivers: pva: add checks on block height
Block height has valid values > 0 and < 6. Add checks to validate
values to be legal.

Additionally, a value of 0xff indicates channel has no block linear
transfer descriptors.  0xff to be converted to 0.

Bug 4185281

Change-Id: I8a2ff03a4098a27eb0ad6a773abbb50a2cbc50a7
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2944683
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-02 14:13:53 -07:00
Mikko Perttunen
89cd5927c9 drm/tegra: Enable timestamping for virtual engines
Enable timestamping for virtual engines except for NVJPG, as it
doesn't support timestamping currently.

Bug 4174916

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I36d426f3d6d83c056a7cf10555460966fc820e6c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942199
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-02 14:05:28 -07:00
Jon Hunter
44443da0bb net: realtek: Fix build for Linux v6.1+
Upstream Linux kernel commit b48b89f9c189 ("net: drop the weight
argument from netif_napi_add") removes the weight argument from the
netif_napi_add() function and this is breaking the build of a few
drivers that use this function. Fix this by updating these drivers
to use the netif_napi_add_weight() function instead for Linux v6.1.

Finally, allow building the realtek wireless driver for kernels other
than v5.15 so that we can ensure it will build against other kernel
versions.

Bug 3750163

Change-Id: If179d044c00bfa83c9902973c642717263d9e3de
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942057
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-02 14:05:18 -07:00
Ketan Patil
6b88806712 video: tegra: nvmap: Do not recycle handle id immediately
xa_alloc can return the handle id which was freed recently. Instead,
once handle id is provided, next time start from next handle id. Once
max limit is reached then start from U32MAX / 2 again.

Bug 4171509

Change-Id: Ib5678136835e809632e4a2498b4dffe522e56c8d
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2942022
(cherry picked from commit 2927da12a16d69d2bc49d3a6e910abefefd77f5b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942016
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-02 14:05:09 -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
Sanjith T D
8975fb1f4b virt_storage: Update calling of ivc_reset()
Below race condition can happen during boot
1) Server calls sivc_reset()
2) Storage client driver has IVC event handler registered, so it gets the event
   and it calls ivc_notified()
3) Server gets ivc event, it calls ivc_notified()
   ( this makes server local state to established )
4) Storage cliend driver also goes to established state
5) After this, storage client driver continued with probe() and
   calls ivc_reset() which results in disconnecting the
   already established connection.

To fix this race condition, perform ivc_reset in storage client
driver right after tegra_hv_ivc_reserve() before registering
the IVC IRQ handler.

Bug 4125055

Change-Id: I36e6db3479f34fb649bdb8d890f24b1783d10cb9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2943766
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Sanjith T D <std@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
2023-07-31 06:26:24 -07:00
Sushil Kumar Singh
0f0dc2e6c1 nvethernet: Cancel set speed workqueue on SC7 entry
set speed work function is not cancelled on system suspend
fix this by cancelling the work queue function

Bug 4167378

Change-Id: I2c065011a830470f690441b2c841893479b361fb
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921347
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-07-28 13:16:35 -07:00
Revanth Kumar Uppala
4c0d72dba6 nvethernet: Fix coverity defect
Issue:
Assigning value 0 to ret, but that stored value is overwritten
before it can be used.

Fix:
Remove unused assignment to ret

CID: 10166550

Bug 3952896

Change-Id: Ieb877e618ca252c218b338682ca02d44096c7a47
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942165
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-27 18:42:20 -07:00
Sushil Kumar Singh
cec663aa8d r8168: Fix -20C 10mbps failure in Mods test
Issue:
Ethernet mplan stability tests at -20C for 10Mbps fails with rate 15%
Basically the GPHY 10M power saving includes the below parameters,
clock speed down, pll off and reference voltage off.
During debugging it was found that enable/disable pll circuit
frequently when in 10M low data traffic (such as idle mode) may have
a corner case and plays a part in this issue repro.

Fix:
So plloff saving function should be disable (do not have to open it) for nvidia -20C mplan test case.

Bug 3946623

Change-Id: I87ab9b487fe5924ee9ee16bbb14d7f8c19f3a4e7
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2939046
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
(cherry picked from commit 80f6470d40821bfbad8f8166d22442e949b47173)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942039
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-07-27 18:41:33 -07:00
Aniket Bahadarpurkar
3b116f7c1a tegra: rtcpu: use separate thread for reading ivc
Using global work queue and its associated worker
pool to read IVC messages from RTCPU may lead to
capture timeouts if the worker thread is not able
to get cpu due to other higher priority threads in
the system. Hence use a separate RT thread to read
IVC.

Notes for nvidia-oot: 

Use low fifo priority for worker threads to avoid
pre-empting the interrupt thread serving the HSP
driver.

Bug 200643334
Bug 3293029
Bug 3291799
Bug 4084364

Old-Change-Id: I5a3e749ec46fac1c7a2de74968169443f5cab939
Signed-off-by: Aniket Bahadarpurkar <aniketb@nvidia.com>
Signed-off-by: Pekka Pessi <ppessi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2689827
(cherry picked from commit 18d670accc7960b0afbc7b58b339a323e424e010)
Change-Id: I48e22606e53d934d3788d524fd1f496d0f92a04a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2939796
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Kalle Jokiniemi <kjokiniemi@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Tested-by: Viktor Horsmanheimo <viktorh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-25 15:26:25 -07:00
Prathamesh Shete
e15d8dc379 pinctrl: dont compile pinmux driver under nvidia-oot
This is being done as pinmux driver is being moved to kernel-oot.

Bug 3950014

Change-Id: Id32a3c0e839ac48dd4e64a58d1c794455463a1ab
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2844308
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-25 15:03:09 -07:00
Bhadram Varka
7cf98e614a nvethernet: return error from ether_get_tx_ts
ether_get_tx_ts, pdata->tx_ts_ref_cnt is an atomic variable
that is used as a mutex in this function and should not return 0
if the function fails to acquire the mutex.
The workqueue is scheduled when the return value of the
judgment function is <0. If one CPU core execution softirq
is running in ether_get_tx_ts function and another CPU core
softirq also calls ether_get_tx_ts function to get hardware
timestamp, then the acquisition of mutex fails and return 0.
After returning 0, the workqueue is not scheduled.
The timestamp cannot be obtained in time. So ether_get_tx_ts
should returns -1 on failure to acquire the mutex.

Bug 4150416

Change-Id: Icffd409b349d8bb8dbf5a483124b3bd3d7ef6cc8
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934350
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-24 17:41:11 -07:00
Rohit Khanna
2561ee0aa9 drivers: Fix mods arm ffa error for kernel 6.1
Updated from ffa_ops to msg_ops for ffa api

Change-Id: I59bec58f2546d2aee1474d6c63a40b8871cd1e52
Signed-off-by: Rohit Khanna <rokhanna@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934214
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Tested-by: Koen Zhao <koenz@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 20:07:39 -07:00
Abhilash G
2797b7499d scsi: ufs: Remove hardcoded programming to enable HS mode
Remove hardcoded programming to enable HS mode since we
need to support PWM mode for UFS for provisioning.

Bug 3866554

Change-Id: I8b3ef6ca61b51009129f6b42fa169eaa5101c347
Signed-off-by: Abhilash G <abhilashg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938538
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 12:11:05 -07:00
omar nemri
8e837b02d4 drivers: pva: add buffer serial id for fences
in order to support unique identification of semaphores
while tracing across VMs, a unique identifier is added
during buffer pin and is emitted in traces.

Bug 4149342

Change-Id: I88e53be197f5354834795aab197e8de39535ac5c
Signed-off-by: omar nemri <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938555
Reviewed-by: Nikita Chumakov <nchumakov@nvidia.com>
Reviewed-by: Oleg Sikorskiy <osikorskiy@nvidia.com>
Reviewed-by: Amruta Sai Anusha Bhamidipati <abhamidipati@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 12:09:54 -07:00
Nitin Kumbhar
8472163ba0 drivers: nv virtio poc console driver
Add a back-end char driver to implement a virtio console driver which
handles a part of virtio mmio protocol to send and receive data
from a peer VM. IVC queue and mempool are used for this communication.

Also, this driver adds blocking read, write and poll ops for an
user-space application.

JIRA TSSKERNEL-1
Bug 4050146

This change also cherry-picks the fix pushed in linux-nvidia repo:
https://git-master.nvidia.com/r/c/linux-nvidia/+/2918779

Change-Id: I97a88f1dd4eb9e3ac7e1e94439f3ebc8ac933239
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2898234
(cherry picked from commit 10436d9d5bfbbf11ffc63771189b57fdf94e50f6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936644
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2023-07-21 11:58:30 -07:00
Ankur Pawar
0d04975aed media: i2c: Fix camera driver Coverity defects
Fix the below Coverity defects for lt6911uxc driver

Unchecked return value
CID: 10174208

Dereference null return value
CID: 10174210

Unchecked return value
CID: 10175851

Bug 3952896

Change-Id: I43132879e31f8a27db8fd41c717d598fb2c33490
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2915435
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-21 01:24:49 -07:00
Jian-Min Liu
fc93f2390c Separate -Werror=frame-larger-than as clang can't recognize
Use '-Werror' and '-Wframe-larger-than' to replace
'-Werror=frame-larger-than' since clang compiler can't
ecognize the combination.

Build failure:

error: unknown warning option '-Werror=frame-larger-than=2560'; did you
mean '-Werror=frame-larger-than='? [-Werror,-Wunknown-warning-option]

Bug 4187941

Change-Id: I4d05a8dc96820517e1047b982a24ed97bb21327f
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938229
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-07-20 01:19:53 -07:00
Jon Hunter
9f2ed528c8 drm/tegra: Fix interconnect support for Linux v6.2+
Interconnect support for multimedia engines is disable for Linux v6.2
kernels. Rather than always disabling interconnect support for these
kernels, we just need to ensure the necessary upstream kernel patches
are in place for Linux v6.2 kernels. Therefore, enable interconnect
support for all kernels.

Bug 4097374

Change-Id: Ibceb866ba239454a131543cdff90e68007b28942
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2937758
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-20 01:16:09 -07:00
Santosh BS
32221411a4 gpu: host1x: add .signaled op for host1x_syncpt_fence_ops
Add a callback function host1x_syncpt_fence_signaled() to
.signaled op under host1x_syncpt_fence_ops.

.signaled is a optional operation. The change here is a performance
improvement and acts as temporary workaround for sync_file code not
calling enable_signaling.

Bug 4085239

Change-Id: Ief19c2d9af3f504bb1a067bfc9a31b9ef2ecd8fc
Signed-off-by: Santosh BS <santoshb@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2935867
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-20 01:10:50 -07:00
Manish Bhardwaj
d421a6465c storage: fix cert-c issue in tegra_hv driver
Using this patch we are fixing below cert error:-
1. check_return: Calling tegra_ivc_init without checking
   return value (as is done elsewhere 42 out of 52 times).

CID 10177835

Bug 3512545

Change-Id: I625914bbeee69718689d23da942feec9f05e9236
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2937650
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:49:56 -07:00