Commit Graph

2890 Commits

Author SHA1 Message Date
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
Jon Hunter
6f92155013 drivers: Enable -Werror for all drivers
Treat all warnings as errors when compiling the out-of-tree drivers.

Bug 4190165

Change-Id: Idba0f6385445b010cd272d5c44c517dfdf1f45ec
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934460
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:23 -07:00
Jon Hunter
308514c910 net: nvethernet: Fix unused variable warning
If DEBUGFS is not enabled, then the following warning is observed ...

 drivers/net/ethernet/nvidia/nvethernet/sysfs.c:3321:6:
  error: unused variable [-Werror=unused-variable]
  3321 |  int ret = 0;
       |      ^~~

Fix this by ensuring that 'ret' is only defined if the DEBUGFS is
enabled.

Bug 4190165

Change-Id: I0182874592f20abe8d53b7bfdcfd099518b23f9c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938450
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:18 -07:00
Jon Hunter
926a606226 platform: tegra: rtcpu: Fix frame-size warning
Building the Tegra RTCPU driver generates the following warning ...

 drivers/platform/tegra/rtcpu/tegra-rtcpu-trace.c:
  In function ‘rtcpu_trace_exceptions’:
 drivers/platform/tegra/rtcpu/tegra-rtcpu-trace.c:331:1:
  error: the frame size of 1424 bytes is larger than 1024 bytes
  [-Werror=frame-larger-than=]
  331 | }
      | ^

Allow the frame size to be 2048 bytes to resolve the warning while a
proper fix is implemented.

Bug 4190165

Change-Id: Id684711f036fce759d7a328ad7d63f754a9b46e0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938377
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:13 -07:00
Jon Hunter
bc6f405401 spi: tegra124-slave: Fix support for Linux v6.3
Linux v6.3 updated the GPIO APIs to use GPIO descriptors instead of
indices. This broke the Tegra SPI slave driver and when compiling the
driver for Linux v6.3 various warnings are observed. Update the Tegra
SPI slave driver as necessary to fix support for Linux v6.3.

Bug 4014315
Bug 4190165

Change-Id: Idfa29f729351d2971a649ddbcf1c3e9bf658d160
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938376
Reviewed-by: Vishwaroop A <va@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:08 -07:00
Jon Hunter
9655b8c6b0 net: nvethernet: Fix CONFIG_TEGRA_NVPPS not defined warning
Compiling the nvethernet driver without the ccflag CONFIG_TEGRA_NVPPS
defined generates the following warning ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:2936:5:
 warning: "CONFIG_TEGRA_NVPPS" is not defined, evaluates to 0 [-Wundef]
  2936 | #if CONFIG_TEGRA_NVPPS
       |     ^~~~~~~~~~~~~~~~~~

Fix this by using '#ifdef' to determine if CONFIG_TEGRA_NVPPS is
defined instead of '#if'.

Bug 4190030

Change-Id: Id1523de6f9ef9f4c72669584efb77ffd9ddf20f3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938375
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:03 -07:00
Jon Hunter
b970ad45ec platform: tegra: dce: Remove unneeded warning flags
The Tegra DCE driver compiles fine without the GCC flags to disable
specific warnings and so remove these to catch any new warnings that get
introduced that might be missed with these flags in place.

Bug 4190165

Change-Id: I4f2d445588baecec89ca9ba979e5d8febe39cf3c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938374
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:46:58 -07:00
Jon Hunter
06f4bc788a crypto: Remove -Wno-implicit-fallthrough flag
The crypto drivers compile fine without the ccflag
-Wno-implicit-fallthrough so remove this flag to catch any new warnings
that might be introduced.

Bug 4190030

Change-Id: Ibddbd9d76ea1faa4fa4d5b3a1ed12e1eaf36b40d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936714
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:46:53 -07:00
Jeremy Alves
10ac600b18 Lan743x - fix SC7 resume
Incorporate fixes from bug 4071996 and 3457173
To fix issue with userland phy driver interface
during sc7 resume

Bug 4172302

Change-Id: I827be437172ed1992baa724149fb39dd1e1f92ac
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2932422
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Praveen Ishwar Bajantri <pbajantri@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:45:52 -07:00
Ankit Patel
a922b344f8 nvidia: serial: CH384 driver support added
CH384 is a PCI-Express bus converter chip, which converts PCIE bus to Quad
serial ports and printer port, including four asynchronous serial ports
compatible with 16C550 or 16C750

This VCP driver supports pci to uart chips ch382/ch384, Crystal frequency
support 22.1184M

Bug 3857918

Change-Id: Iae13dbbb0959178d69a93277823d8305973d66be
Signed-off-by: Ankit patel <anpatel@nvidia.com>
(cherry picked from commit c0239f39c89fcd11dc9a3228892e920c680ddf49)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921009
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 02:06:45 -07:00
Johnny Liu
10474851f5 gpu: host1x: Correct allocated size for contexts
Oirginal implementation over allocates the memory size for the
contexts list. The size of memory for the contexts list is based
on the number of iommu groups specified in the device tree.

Bug 4183400

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I0ccfd7c67b995b0b335d05e1fb93c236c335b75d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2931800
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-18 12:12:38 -07:00
Sheetal Tigadoli
1a3543c91c drivers:nvpps:print warn msg in GETEVENT ioctl call
print ptp not running warning msg from NVPPS_GETEVENT
ioctl call
Existing print msg was coming even before boot completes
and hence was printing always.
Relocate these warn msgs to print once when NVPPS_GETEVENT
ioctl is called

Jira ESDP-20108

Change-Id: I41ea5133e3f7d3525e3529fd09058225661d66bb
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2915293
(cherry picked from commit 1ad9baad22516e8bc83116c8fc9d22b59c000d6a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2936977
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-17 14:48:34 -07:00
Jon Hunter
789890bd3e net: nvethernet: Fix compilation warning
Building the nvethernet driver generates the following warning ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:6730:1: warning:
 the frame size of 3664 bytes is larger than 2048 bytes
 [-Wframe-larger-than=]

For now allow the frame size to be 4096 bytes to resolve the warning
while a proper fix is implemented.

Bug 4190030

Change-Id: I5460ec04c80458174c2c51dd0058b7cc191fe808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934698
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-17 14:37:54 -07:00
Jon Hunter
88af3f4d9f crypto: nvvse: Fix compilation warning
Building the nvvse-cryptodev driver generates the following warning ...

 drivers/crypto/tegra-nvvse-cryptodev.c:2118:1: error: the frame size of
  2224 bytes is larger than 2048 bytes [-Werror=fra
me-larger-than=]
 2118 | }
      | ^

For now allow the frame size to be 2560 bytes to resolve the warning
while a proper fix is implemented.

Bug 4190030

Change-Id: Id361aebc9f3d83181afc820d8d9cf2ef90e33d55
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934696
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-17 14:37:49 -07:00
Akshata
e1ea98691b dla: kmd: Update resource utilization logic
+ Return 0% resource utilization when DLA
is turned off

Bug 4170503

Change-Id: Iaeb6131dc482a750cae1d54b6931e3dd8c9192d0
Signed-off-by: Akshata Bhat <akshatab@nvidia.com>
(cherry picked from commit 4da14f6b3b80f49ca00c92322ad71d75c8bfd4cd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2929821
Tested-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-16 04:35:47 -07:00
Jeremy Alves
0df8edb69b Lan743/6.1 vanilla driver of Lan7431 from upstream
Adding 6.1.9 unmodified Lan7431 driver to nvidia-oot

This is the unmodified driver from
  K6.1.9
without our NVIDIA specific changes

Bug 3978997

Signed-off-by: Jeremy Alves <jalves@nvidia.com>
Change-Id: Iaf453a1b9dc82355f8c7936823c5c90633fe24d9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934591
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-15 08:15:52 -07:00
Jon Hunter
fa591a862a net: wireless: realtek: Fix warnings
Building the realtek wireless driver generates various warnings due to
incorrect indentation or missing curly braces. For example, the
following warnings are seen ...

 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c: In function
 ‘rtw_drv_scan_by_self’:
 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c:3167:17:
 warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
 3167 |                 else
      |                 ^~~~
 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c:3170:25:
 note: ...this statement, but the latter is misleadingly indented as if
 it were guarded by the ‘else’
 3170 |                         goto exit;
      |                         ^~~~

 drivers/net/wireless/realtek/rtl8822ce/core/efuse/rtw_efuse.c:917:17:
 warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  917 |                 if (i % 16 == 0)
      |                 ^~

Fix the indentation and add the necessary curly braces to resolve these
warnings.

Bug 4190030

Change-Id: Ic13f1470043190ffd8401581cb97c908070c2940
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934697
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-14 20:21:42 -07:00
Jian-Min Liu
2cf67077e2 Add compiler flag to avoid function re-definition
Add CONFIG_TEGRA_VIRTUALIZATION with ack-5.15 build to avoid
re-definition symbols when building tegra_hv.ko

Bug 4187941

Change-Id: I64eb10264b527d59919fbe781198d227d0a21dda
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2933664
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
2023-07-14 20:20:16 -07:00
Jon Hunter
69b4420809 platform: tegra: Remove actmon driver for Tegra194
The tegra-cactmon driver is only used for Tegra194 and given that the
out-of-tree drivers are only supported for Tegra234 and newer devices we
can remove this driver.

Bug 4174107

Change-Id: I152e8119b5c179f2d75771c1af2eb5d5f865ccbc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2927995
Reviewed-by: Laxman Dewangan <ldewangan@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-07-14 20:19:11 -07:00