Commit Graph

2880 Commits

Author SHA1 Message Date
Amruta Bhamidipati
827c90d801 drivers: pva: Add polling for mailbox interrupts
Support polling on mailbox ISR and AISR status registers
when interrupts are disabled.

Change-Id: I58a65d47a9ff9269f641edf3d97dc8cebc41a521
Signed-off-by: Amruta Bhamidipati <abhamidipati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2929381
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999150
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Tested-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-20 01:25:20 -07:00
Amruta Bhamidipati
b2381d6aec drivers: pva: Add support for next chip
- PVA initialization and programming sequence update for next chip.
- Update to VMEM regions and addresses.

Signed-off-by: Amruta Bhamidipati <abhamidipati@nvidia.com>
Change-Id: I25b0fae260c516d5a7521aabc994a87525555577
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2925454
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sreehari Mohan <sreeharim@nvidia.com>
Reviewed-by: Krish Agarwal <krisha@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2999149
Tested-by: Omar Nemri <onemri@nvidia.com>
2023-10-20 01:25:15 -07:00
Niranjan Dighe
aaa19719df sound: safety-i2s: Add support for always-on rx/tx
Add support for keeping RX/TX always ON by using amixer commands
and to not disable clocks after playback/capture usecases finish.
This is to prevent A2B master from losing internal state.

Bug 3742979

Change-Id: I01dacaa3f54c98a7a14be101d8f0a315b006d7d8
Signed-off-by: Niranjan Dighe <ndighe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2966000
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Purvi Medawala <pmedawala@nvidia.com>
2023-10-17 18:44:37 -07:00
Shreshtha SAHU
36531e7e1d virt: tegra: tegra_hv: print total IVC and mempool memory usage
bug 4115385
bug 4136301

Change-Id: Idfdf1b3a45943b4da58bb7da9070825472ec3d53
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2997776
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Kasinadha Dendukuri <kdendukuri@nvidia.com>
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-17 10:01:50 -07:00
Laxman Dewangan
9a65689ba2 mttcan: tegra: Add new prod setting support
Add new prod setting support which is the
property based on device tree. The prod
setting of each register field are new property
in DT and prod configurations are configured
via these new properties.

Bug 4097475

Change-Id: I86adc7b72a28802d73fee8a085db2bccf0d6d1cc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996771
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-14 05:56:30 -07:00
Laxman Dewangan
1e8bd7b606 qspi: tegra: Add new prod setting support
Add new prod setting support which is the
property based on device tree. The prod
setting of each register field are new property
in DT and prod configurations are configured
via these new properties.

Bug 4097475

Change-Id: Iac61ddd20ceb5b1ea588519ab031275a926f5c41
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996302
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-14 05:54:31 -07:00
Laxman Dewangan
869fff1af3 include: Organise OOT prod headers
There is two implementation of the prod setting, legacy
where driver directly get the register offset/mask/value
and upstreamable where configuration come as property of the
respective field.

The legacy is supported till K5.15 and afterwards, the upstreamable
solution is supported.

Add the dummy header incase the core kernel have not implemented
the prods and organise the oot prod accordingly.

Bug 4097475

Change-Id: Idd0e8759342c1c4ffd88df046785595aa4fab52d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996588
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:48:15 -07:00
Jon Hunter
a4334a5009 scsi: ufs: Add missing headers
When compiling the Tegra UFS driver on certain kernels the various clk
and udelay functions are not found. Add the corresponding headers to fix
the build.

Bug 4221847

Change-Id: Ief2f20abf3704ab7c61c5c802e9eb2ec201179c7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996210
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:47:12 -07:00
Jon Hunter
e83aa807d4 scsi: ufs: Depend on CONFIG_SCSI_UFSHCD
If CONFIG_SCSI_UFSHCD is not enabled, then the Tegra UFS driver fails to
build because the various ufshcd_xxx functions are not exported by the
kernel. Update the Makefile to only build the Tegra UFS driver is
CONFIG_SCSI_UFSHCD enabled.

Bug 4221847

Change-Id: Ie0eb3773f245981a6afcc8bf5a684c193307179d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996209
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:47:07 -07:00
Jon Hunter
7f53d7ba3e nvidia-oot: Add options to disable drivers
In Linux v6.2, the Tegra IVC driver was updated to support iosys-map and
this breaks building some of the out-of-tree drivers for Linux v6.2+
kernels. In Linux v6.3, the GPIO OF APIs were removed and this breaks
building some of the out-of-tree drivers that use these legacy APIs. For
now the broken drivers are not built for these corresponding kernels.

Instead of checking the kernel version in the Makefile for the
corresponding broken driver, move the kernel version checking to the
top-level Makefile and add CONFIG definitions that can be used the
various Makefiles.

This is also needed for working with 3rd party Linux kernels that may
have upstream backports and need to set these CONFIG variables for their
Linux kernel.

Bug 4221847

Change-Id: I35ee59bccdcdb1be56e4680c453279b421692c6a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996215
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-13 15:46:10 -07:00
Jon Hunter
4e8ed5f7b7 firmware: tegra: Add support iosys-map support for IVC
Linux v6.2 update the Tegra IVC driver to use iosys-map and this broke
support for the IVC EXT driver. Update the IVC EXT driver to support
iosys-map if the kernel supports this version of the Tegra IVC driver.

Bug 4221847

Change-Id: I1f1ddb1cc4312cb2359373b53287c110831b473c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996208
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:45:59 -07:00
Ketan Patil
5c59fead46 video: tegra: nvmap: Fix data race
Consider the following execution scenario, it can lead to a data race

Thread 1                    Thread 2
-------------------------------------------------------
NvRmMemHandleAllocAttr
NvRmMemGetFd
NvRmMemHandleFromFd         close(fd), NvRmMemHandleFree

When thread 1 is executing NvRmMemHandleFromFd while thread 2 is closing
the fd and freeing the handle, then following sequence will lead to
accessing a freed dma-buf and may lead to dereference issue.

- TH1: Get handle from fd and increment handle's refcount.
- TH2: Close the fd and start execution of NvRmMemHandleFree.
- TH2: Decrement ref's dup count, it will become 0, hence ref would be
freed and dma-buf as well, but as handle's refcount is incremented in
step 1, handle won't be freed.
- TH1: Resume HandleFromFd part, call to nvmap_duplicate_handle. Ref is
already freed, so generate new ref and increment dma-buf's count but as
dma-buf is freed already, accessing dma-buf will lead to dereferene
issue. Hence, we need to add a null check here and return error value in
such scenario.

Also, add check for return value of nvmap_handle_get, at missing places.

Bug 4214453

Change-Id: Ib6ef66b4a7126bef2ed1dbb48643445a4ded1bab
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994962
(cherry picked from commit 7ba6a3abfe65f7cffeeb4004cf0868468121fc32)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994440
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 15:38:16 -07:00
Viswanath L
383e589822 nvadsp: Enable IOVA paths in driver
Enable driver paths that allocate IOVA memory for
ADSP OS and shared memory, where memory is required
at a fixed address.

Bug 4164138
Bug 3682950

Change-Id: I16563e14aefbcd55cc6455f88c1689664846c689
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988130
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 07:57:21 -07:00
Ankur Pawar
6038bd9e6c platform: tegra: rtcpu: use upstream icc API
Use devm_of_icc_get() in rtcpu base and debug driver.
CONFIG_TEGRA_T23X_GRHOST, CONFIG_TEGRA_ISOMGR,
CONFIG_TEGRA_BWMGR are not enabled in K5.15 so cleanup
tegra_camera_platform driver.

Don't read memory-bw from rtcpu dt, set it to max
during probe.

Bug 3997304
Bug 4311411

Change-Id: Ib76b3338749de5d33e13cd518375a6b55dd17f5b
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2899021
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-13 07:55:59 -07:00
Akhil R
3926014666 crypto: tegra: Fix coverity and CERT C defects
Fix the following coverity defects.

ID 10181328, CID 687742 - Uninitialized variable
ID 10181331 - Dead code
ID 10181330, CID 687711 - Uninitialize variable
ID 10181332 - Potential overflow
ID 10181329 - Wrong data type

Bug 3952896
Bug 3959323

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I62064ee9b0cef4ad78a1aa4980637fcd3df682d6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2995805
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:38:15 -07:00
Jon Hunter
59b14ea0b8 ASoC: tegra: Avoid kernel version checks
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

Note that the function snd_soc_dai_init_dma_data() has been present
in the Linux kernel since v3.13 and so use this for all kernel versions.
In Linux v6.3, the 'playback_dma_data' and 'capture_dma_data' members of
the snd_soc_dai_driver structure were replaced and so these could no
longer be set directly. However, the arguments to
snd_soc_dai_init_dma_data() have not changed and so can be used for
older kernels and well has the current.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: Ibac0c6bab78e93f03981dfe3d1b2025ea19d4c92
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993795
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:29:24 -07:00
Jon Hunter
5ec164e7c3 ASoC: tegra: Only compile drivers if ASoC is enabled
When compiling the out-of-tree audio drivers against a kernel that does
not have CONFIG_SND_SOC enabled, the build fails because the various
snd_soc_xxx functions are not exported by the kernel. Update the
out-of-tree Makefile to only build the Tegra ASoC drivers if
CONFIG_SND_SOC is enabled. Note that CONFIG_SOUND is enabled if
CONFIG_SND_SOC is enabled so it is not necessary to check for both.

Bug 4221847

Change-Id: I7a55e18324baa229d715fa0831df919502e2a3d3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993768
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:29:14 -07:00
Jon Hunter
86fece401a thermal: pex9749: Use conftest
Rather than using kernel version checks to determine which kernel APIs
to use, use the definitions generated by the conftest script which
determines which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I160c74224c582cc3b3a327544fc16b021226d54a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993808
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 20:29:09 -07:00
Jon Hunter
f6e070f87e spi: aurix: Use conftest
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: I159cd7d5feca050c8a8014d9c2a3b43e8974fdfd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993807
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:29:04 -07:00
vasukis
610533a15d tegra: hwpm: Add HWPM-NVDEC registration mechanism
- Add support to extend NVDEC IP for HWPM profiling.

DOS-SHR-7601

Change-Id: I93efd02b348829c33d9ba90cfc39b8b824f64347
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983398
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 20:13:26 -07:00
Jon Hunter
35ac3d9d5e block: virtual-storage: Drop version checks for flags
In Linux v5.17, the GENHD_FL_EXT_DEVT and GENHD_FL_NO_PART_SCAN were
removed and in Linux v5.19, the flags QUEUE_FLAG_SECERASE and
QUEUE_FLAG_DISCARD were removed. Rather than using kernel version
checks, simply check if the flag is defined. This is beneficial for
working with 3rd party Linux kernels that may have backported changes
from upstream.

Although the Tegra virtual-storage can be compiled for v5.19 kernels, it
still needs to be fixed properly for v5.19 kernels. Add some dev_WARN
prints to warn if these flags are not supported so that it will be clear
that this is not expected to work.

Bug 4119327
Bug 4311184

Change-Id: I7f7585b238ad45b26fb1d0df42b338c904ce87e7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2992552
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-12 17:27:02 -07:00
Mika Liljeberg
635466f751 firmware-api: capture ISP control MSG documentation
Update documentation for ISP capture channel control messages and
associated structures and definitions.

Jira CAMERASW-14051

Change-Id: I0f10470132b727520e278aaa3b2573f93d4053f1
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2982815
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988970
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994202
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:24 -07:00
Mika Liljeberg
1eb3b03e5f firmware-api: capture control MSG documentation
Update documentation for capture channel control messages and
associated structures and definitions.

Jira CAMERASW-14048

Change-Id: I525eca545eef64eb8fceac14480348b2dd173d1c
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2980882
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988969
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994201
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:19 -07:00
Mika Liljeberg
4e0255fbae include: soc: tegra: fix divergence to firmware-api
Fix minor differences to firmware-api that can cause conflicts
when propagating changes to kernel headers.

Jira CAMERASW-15815

Change-Id: I23239a246cdae69a8818a6ed0e2e8d23ee337f10
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988968
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994200
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:14 -07:00
pripatel
f7c66766b7 firmware-api:changed macro definition
Change is done to resolve
AUTOSAR C++14 M5-0-10 violations

Rule: AUTOSAR C++14 M5-0-10
Rule description : If the bitwise operators ~ and << are
applied to an operand with an underlying type of unsigned
char or unsigned short, the result shall be immediately cast
to the underlying type of the operand.

JIRA CAMERASW-12899

Change-Id: Ide1491e00094299d3785dbb1cd3366a043b3de0e
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2933961
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988965
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988977
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:09 -07:00
Mika Liljeberg
4e8871bdef include: soc: tegra: define tag for trace console
Define a new TLV tag for combined trace and console support.
Deprecate unused CAMRTC_TAG_NV_CAM_TRACE tag.

Bug 3898176

Change-Id: I0d6d586dd1a82d6f95a12b22b6e9bd96000efe7e
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2845583
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988964
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988976
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:17:04 -07:00
Mika Liljeberg
e69d77ec71 firmware-api: add commands for I2C over HSP
Add command specifications for RCE I2C HSP protocol.

Jira CAMERASW-1404

Change-Id: I17cbe234371140934b04e3a9683aa1cbc7d5ef91
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/tegra/camera/firmware-api/+/2701487
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988962
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988975
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
2023-10-12 17:16:59 -07:00
Mika Liljeberg
cac12c4fb7 tegra: rtcpu: signal trace console support
Use new TLV tag to signal that the trace processor supports
console prints. Populate TLV size field for additional range
checking on RCE side.

Bug 3898176

Change-Id: Ie3cd18198ab325eb34fac4803e93019318cf44df
Signed-off-by: Mika Liljeberg <mliljeberg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2845587
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2988237
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Viktor Horsmanheimo <viktorh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-12 17:16:54 -07:00
omar
16e44e82a9 drivers: pva: ignore blk height if pitch transfers
If all linked descripotrs on a channel only use pitch linear
transfers, then ignore block height value passed in to the
driver.

in all cases, value of block height should be a valid value

Bug 4185299

Change-Id: Iad795f9799de9422f787f3e6cd6414b2825aeb60
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980988
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vivek Bangera <vbangera@nvidia.com>
2023-10-12 17:15:02 -07:00
omar
70a8faf023 drivers: pva: optmimize block height processing
remove dependency on 0xFF flag in block height field as
a performance optimization.

fold processing of descriptors into channel processing loop
in order to be able to traverse the descriptor list.

second call to nvpva_task_dma_desc_mapping is to process
descriptors not attached to any channels.

Bug 4185299

Change-Id: Ic5d3c60bca7de13698b83365fe3b0cedbe42c60b
Signed-off-by: omar <onemri@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979303
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vivek Bangera <vbangera@nvidia.com>
2023-10-12 17:14:57 -07:00
Jon Hunter
e6fddfc5f6 scripts: conftest: Fix test for __alloc_disk_node
The test to see if the function __alloc_disk_node() has the 'lkclass'
argument is not working as expected and so builds for Linux v5.18 and
Linux v5.19 are failing. The problem is that the type 'NULL' is not
defined and so the test always fails. Fix this by using the
'lock_class_key' type and including the appropriate headers.

Bug 4221847

Change-Id: I6b3d6987d0d3250f00c27c586d6a971a3dceac59
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994321
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-11 15:25:38 -07:00
Chris Dragan
51d4ae99d9 misc: mods: update from Perforce to 4.22
Bug 4119327

Change-Id: I7704293f7fce103e9fba6b088da8081987da36c5
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993627
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2023-10-10 19:47:13 -07:00
Jon Hunter
dc189dfb94 block: virtual-storage: Remove kernel version checks
Rather than using kernel version checks to determine which kernel APIs
to use, add the necessary tests to the conftest script to determine
which kernel APIs are present in the kernel.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4221847

Change-Id: Iec2c793ce408dab1cf7e5118c019dfe656dfa87c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2992630
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-09 22:00:21 -07:00
Manish Bhardwaj
a0eaae1775 nvidia-oot: vsc: fix compilation error with k6.5
fix compilation error while building vsc driver
with k6.5

Bug 4221847
Bug 4311184

Change-Id: Ie015a25d8e6d50ecb2c908d9d505fa15d4daad1e
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990176
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-10-09 21:58:55 -07:00
Jon Hunter
4b3511a749 spi: tegra124-slave: Drop legacy GPIO support
Since Linux v6.3, legacy GPIO support has been dropped from the Linux
kernel and the gpiod_xxx functions have been supported for a long time
going back to Linux v3.x kernels. Therefore, drop support for the legacy
GPIO functions.

This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.

Bug 4119327

Change-Id: Ib84e70b27645032108b2c25ce5d4ea3977f6cae1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2993098
Reviewed-by: Vishwaroop A <va@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-09 15:30:33 -07:00
Jon Hunter
413055df75 drm/tegra: Fix build for Linux v6.5
In Linux v6.5, commit 62aeaeaa1b26 ("drm/aperture: Remove primary
argument") removed the 'primary' argument from the function
drm_aperture_remove_framebuffers(). Update the test in conftest script
for drm_aperture_remove_framebuffers() to test for this and use the
generated definition accordlingly in the Tegra DRM driver to fix the
build for Linux v6.5.

Bug 4221847

Change-Id: I7a7bb3a029b236e0ce42c1a404085757d95374d1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990528
2023-10-08 13:10:35 -07:00
Jon Hunter
f926a58dd1 ASoC: tegra: Fix build for Linux v6.5
In Linux v6.5, the arguments to the function snd_soc_of_get_dai_name()
were updated and this is causing the Tegra ASoC machine driver build to
fail. Add a new test to the conftest script to check the arguments for
snd_soc_of_get_dai_name() and use the definition generated by the
conftest script accordingly.

Bug 4221847

Change-Id: I32772da12ab59eb09e2f9d8bc66471d859201f8e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990531
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:04:11 -07:00
Jon Hunter
2fab40f274 video: tegra: nvmap: Fix build for Linux v6.5
In Linux v6.5, the 'vmas' parameter is removed from get_user_pages() by
commit 54d020692b34 ("mm/gup: remove unused vmas parameter from
get_user_pages()"). Update the conftest script test for
'get_user_pages' to test for this and use the generated definition in
the NVMAP driver accordingly.

Bug 4221847

Change-Id: I3b2b2b9937bba86a8924cf5852fe62d57cd5d3b6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990512
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:04:01 -07:00
Revanth Kumar Uppala
9db9eb336c nvethernet: fix compilation error with k6.4.5
Fix compilation error while building nvethernet driver with k6.4.5

Bug 4221847

Change-Id: I0f7158949da7371135e4b483aea5a0fc4dc33890
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990328
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:37 -07:00
Jon Hunter
2cc58560db ASoC: tegra: Fix build for Linux v6.4
In Linux v6.4, the 'params' member of the snd_soc_dai_link was replaced
with the 'c2c_params' member. Add a new test to the conftest script that
checks if the 'c2c_params' structure member is present and use the
definition created by conftest to select which structure member is used.

Bug 4221847

Change-Id: I7ebb4187fd1cd70097bf65409bda3b2a6830a303
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989731
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:26 -07:00
Jon Hunter
d021a4fbae drm/tegra: Fix build for Linux v6.4
In Linux v6.4, the various drm_scdc_get/set functions were updated to
take an argument of type 'struct drm_connector'. Add a new test to the
conftest script that checks if this argument is used and use the
definition created by conftest to select which version of the function
is used.

Bug 4221847

Change-Id: Id6b6396bbe875a0268f8fe2f68ae08f78a32c954
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989035
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:15 -07:00
Jim Lin
5c6720246f usb: typec: Setting same toggle time is not error
Invoking fusb301_set_toggle_time() with input parameter same as
current register value to set toggle time shouldn't be treated as
error.

This patch is to change message level from dev_err() to dev_info()
when above situation is met.

Bug 4218496

Signed-off-by: Jim Lin <jilin@nvidia.com>
Change-Id: Ieab7cfe8ae8496ca4a5f3b514d9e278479f200d0
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2946869
(cherry picked from commit 2a53cb0010a449ffd5ce6d6afe7f39dc5d020e65)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990991
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Haotien Hsu <haotienh@nvidia.com>
Reviewed-by: WK Tsai <wtsai@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-06 20:12:11 -07:00
Jon Hunter
68d1ae26d6 block: virtual-storage: Drop version check
The function blk_mq_alloc_request() has been exported in the Linux
kernel since v3.16 and the function blk_mq_free_request() has been
exported in the Linux kernel since v3.19. The function

Since Linux v5.0, blk_get_request() has always called
blk_mq_alloc_request() and blk_put_request() has always called
blk_mq_free_request(). Given that kernels newer than v5.0 are now
supported drop the version check around blk_mq_alloc_request() and
blk_mq_free_request() and always use these functions.

Bug 4119327

Change-Id: I018687b340acaa9617c81551efb436a0439b14f1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2991457
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:57:14 -07:00
Jon Hunter
ce678a37b1 drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the
class_create() function. Add a test to the conftest script that checks
if this argument for the class_create() function has been removed and
use the definition created by conftest to select which version of the
function is used.

Bug 4183168
Bug 4221847

Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:54:05 -07:00
Jon Hunter
86dafc35bb tty: serial: ch384: Fix build for Linux v6.4
In Linux v6.4, the macro DEFINE_SEMAPHORE was updated and this breaks
the build for the ch384 serial driver. Add a new test to the conftest
script that checks if the macro DEFINE_SEMAPHORE takes a number argument
and use the definition created by conftest to select which version of
the macro is used.

Bug 4183168
Bug 4221847

Change-Id: Ie1bcb95b07e792c70fa52e22465bdf565dc456af
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989732
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-05 17:53:54 -07:00
Jon Hunter
ed130f099a net: nvethernet: Fix build for Linux v6.4
In Linux v6.4, commit
3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS")
added a kernel config option for MAX_SKB_FRAGS and change the type of
the definition to integer. This causes the nvethernet driver build to
fail and the following errors are seen ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:5949:33: error:
  format ‘%ld’ expects argument of type ‘long int’, but argument 4
  has type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
    "invalid tx-frames, must be inrange %d to %ld",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 drivers/net/ethernet/nvidia/nvethernet/ethtool.c:950:28: error: format
  ‘%ld’ expects argument of type ‘long int’, but argument 4 has
  type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
    "invalid tx-frames, must be in the range of"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by changing the type in the respective prints to integer. Note
that his is also to make this change for kernel prior to Linux v6.4.

Bug 4183168
Bug 4221847

Change-Id: Ibd9160ad08e65e0b85cae1cf4903075c31a1cd77
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989002
Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-05 04:37:24 -07:00
Jon Hunter
1c89d6b9cd net: r8168: Fix build for Linux v6.5
The r8168 driver fails to build with Linux v6.5 because the
skb_gso_segment() is not found ...

 drivers/net/ethernet/realtek/r8168_n.c:29231:24: error: implicit
  declaration of function ‘skb_gso_segment’; did you mean
  ‘skb_gso_reset’? [-Werror=implicit-function-declaration]
      segs = skb_gso_segment(skb, features);
             ^~~~~~~~~~~~~~~

Commit d457a0e329b0 ("net: move gso declarations and functions to their
own files") moved the definition to a new file 'net/gso.h'. Fix this by
updating the conftest Makefile to check for the presence of this header
file and use the definition generated by conftest accordingly in the
r8168 driver.

Bug 4221847

Change-Id: I6ad83a06602ef0679a76ff1a6e5ddabbcb1bfe00
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990521
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-04 13:54:55 -07:00
Johnny Liu
e0b77a8761 gpu: host1x: add actmon information for OFA
OFA is one of the host1x clients. One unit actmon is used for OFA.

Bug 4310958

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I27bf72d642530740eb67954ef93177d56e63db87
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990250
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-04 07:45:02 -07:00
Johnny Liu
0840137ad6 drm/tegra: Enable actmon for OFA
OFA has unit actmon monitoring its active time. Enabling actmon for OFA
to export load information of OFA.

Bug 4310958

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I8df79f266da71c0cc248e603a07fec7508cbb8ce
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990240
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-04 07:44:57 -07:00
Shubhi Garg
0b989c71b1 drivers: fix CERT-C violations in max77851 driver
Cert-C fixes in max77851 mfd and pinctrl driver.

CID:685661
CID:685622
CID:685626
CID:685637

Bug 3959323

Change-Id: I0a5fbd9d90ecc4c43d0967fdd4a9da7286aab1f5
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2987950
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-04 07:40:33 -07:00