Commit Graph

2438 Commits

Author SHA1 Message Date
Jon Hunter
addce432b9 misc: mods: Add missing conftest.h
The MODS dmabuf driver is missing the conftest.h header and so the
conftest changes are not being applied as expected.

Bug 4991705

Change-Id: Ia6e17a717619cdf74bb0eeb441467c81342514e2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3505943
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-12-10 07:53:59 -08:00
Jon Hunter
255dac6de5 crypto: tegra: Update crypto_engine_ctx handling
In Linux v6.6, the crypto_engine_ctx structure was removed and the
crypto_engine_ops was moved from this structure to the crypto_alg
structure. The Tegra Security Engine driver was updated accordingly to
populate the crypto_engine_ops in the appropriate structure depending
on whether the crypto_engine_ctx structure is present or not.

Currently conftest is using the presence of the crypto_engine_ctx
structure to decide where to populate the crypto_engine_ops. While
this works, it is possible that a kernel older than v6.6 also includes
a backport of commit e5e7eb023f24 ("crypto: engine - Move
crypto_engine_ops from request into crypto_alg") that moves the ops
to the crypto_alg structure. Although backporting this commit alone
should not cause any problems, it is better to detect if this commit
is present rather than relying on the presence of crypto_engine_ctx
structure.

To detect the presence of commit e5e7eb023f24 we can simply detect if
one of the functions added and exported by this commit is present.
For example, the function crypto_engine_register_aead() was added and
exported by this commit. Therefore, update conftest to detect if
commit e5e7eb023f24 is present and then update the Tegra Security
Engine accordingly.

Bug 5564561

Change-Id: I3f7688e6e954a158094a9a2fdf73354f765ed680
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499816
(cherry picked from commit c1631d32f8d80cd31f54e7297c542f308a281d25)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3494992
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Hiteshkumar Patel <hiteshkumarg@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-09 09:39:12 -08:00
Jon Hunter
2ec6cdcc9b drivers: Update timer APIs for Linux v6.15
In Linux v6.15, the timer APIs hrtimer_init() and del_timer() have been
removed. The hrtimer_setup() was added in Linux v6.13 to replace
hrtimer_init() and hrtimer_init() have finally been removed. The
functions del_timer()/del_timer_sync() were renamed to
timer_delete()/timer_delete_sync() in Linux v6.15. Use conftest to
detect these changes and update the drivers as necessary.

JIRA LINQPJ14-47

Change-Id: Id3994900384aad4b91155507cda91e04898ab12c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336168
(cherry picked from commit ce90abdb8137610988f291cd02ed8cf97bca673f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499760
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:41:48 -08:00
Jon Hunter
48373c24ad video: tegra: nvmap: Fix build for Linux v6.15
In Linux v6.15, the function ioremap_prot() was updated to pass a
variable of type pgprot_t instead of an unsigned long. Add a conftest
test to check for this and update the NVMAP driver accordlingly to fix
the build for Linux v6.15.

JIRA LINQPJ14-47

Change-Id: Icff9f63bf5c914997b69076435dd9e2432f343a3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3332454
(cherry picked from commit b464d75b06c7976ae73e5d7a8660b49e29e1df77)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499759
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-12-04 09:41:43 -08:00
Jon Hunter
8e9d8552c3 net: nvethernet: Fix build for Linux v6.15
In Linux v6,15, a 'speed' argument was added to the phy_loopback()
function. Add a conftest test to detect this change and update the
nvethernet driver accordingly. Note that if 'speed' is set to 0 when
calling phy_loopback(), then phy_loopback() behaves the same way as it
did before this argument was added. So by default set speed to 0 for the
nvethernet driver.

JIRA LINQPJ14-47

Change-Id: I55f775e672bfa1a00c9ccbd825c82be1868b0b52
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330685
(cherry picked from commit 5ba2674826bc9e39b320fd79afd7d52709a39eca)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499758
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:41:37 -08:00
Jon Hunter
13ad68519d ufs: Fix Tegra UFS for Linux v6.15
In Linux v6.15, the pwr_change_notify() function was updated making the
3rd argument of type const. Add a conftest to detect this and update the
Tegra UFS driver accordingly.

JIRA LINQPJ14-47

Change-Id: I83f22bf0961200d9078fb35d408dac9149d786d2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330680
(cherry picked from commit d9c16e70c4bf468a5ddab8a434693a8e7b442625)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499757
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-12-04 09:41:31 -08:00
Jon Hunter
3d26747166 blk: vblk: Fix build for Linux v6.15
In Linux v6.15, the 'request_queue' parameter was removed from the
function blk_rq_map_sg(). Add a conftest to check for this and update
the Tegra HV VBLK driver accordingly.

JIRA LINQPJ14-47

Change-Id: I140200fe7acbaebb383abd7939153178f0ca484a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330664
(cherry picked from commit a20fde1ade16dbfbac3f48327c360ca0a7c36545)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3475292
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-12-04 09:41:25 -08:00
Jon Hunter
3fba8947fb drm/tegra: Fix build for Linux v6.14
In Linux v6.14, the 'date' field was removed from the 'drm_driver'
structure. Add a test to conftest to detect this and update the Tegra
DRM driver accordingly.

Jira LINQPJ14-6

Change-Id: Ia3024321f12f8448d382deba996407f9d3232567
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297069
(cherry picked from commit 12d50906f3800c37a35be59b49157797ed529159)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499756
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:41:20 -08:00
Jon Hunter
34b4ec7938 nvmap: Fix build for Linux v6.14
In Linux v6.14, the 'page_list' argument was dropped from the
__alloc_pages_bulk() function. Add a test to conftest to check for this
and update the NVMAP driver accordlingly to fix the build.

Jira LINQPJ14-6

Change-Id: Id3513890a9d948cb42abf7449d9fb3aa95edcf96
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3297065
(cherry picked from commit a7d79ff243f922e112bc85a0830455e3e422a04c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499755
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:41:14 -08:00
Jon Hunter
774a1ec13d ufs: Fix Tegra UFS for Linux v6.13
In Linux v6.13, the quirk definition 'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS'
was removed and replaced with a function pointer than can be used to set
the DMA mask as needed for a given device. Update the Tegra UFS driver
to fix support for Linux v6.13. Note that prior to Linux v6.13, the flag
'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS' would set the DMA mask to 32-bits
and so this change is equivalent to the configuration of prior kernels.

Bug 4991705

Change-Id: I859331e9eea918d2438d68b871642fee5e4148e0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283447
(cherry picked from commit 65cd166a825e33cb77c0f7ca8ae146a3e296fda6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499754
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:41:07 -08:00
Jon Hunter
d9b938131d nvmap: Fix build for Linux v6.13
In Linux v6.13, commit b129125e1f96 ("arm64: asm-offsets: remove
DMA_{TO,FROM}_DEVICE") removes the definitions DMA_TO/FROM_DEVICE from
the assembly header file 'asm-offsets.h' which is used by the functions
__dma_map_area() and __dma_unmap_area() in nvmap_cache_maint.S.

From reviewing the NVMAP code, the function __dma_unmap_area() is never
used and so we can simply remove this. Split the __dma_map_area() into
two functions __dma_map_area_to_device() and
__dma_map_area_from_device() to avoid having to pass the direction.

Bug 4991895

Change-Id: I4a0f658401beff5c5e5457de72050b21acf820fa
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261710
(cherry picked from commit de3a6ce1cbff438cba468c5cf817e3fe297d47a0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499753
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-12-04 09:41:02 -08:00
Jon Hunter
5c780b2c63 drivers: Fix MODULE_IMPORT_NS for Linux v6.13
In Linux v6.13, commit cdd30ebb1b9f ("module: Convert symbol namespace
to string literal") updated the MODULE_IMPORT_NS macro to take a string
literal as an argument in Linux v6.13. Use conftest to detect if
MODULE_IMPORT_NS takes a string literal as an argument and update the
various drivers accordingly.

Bug 4991705

Change-Id: I8f34860648965dc2334e2916d5404522510778ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263798
(cherry picked from commit 2e3d9e2ad27ffc6743ad1f0bca06b9a802182a7a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499752
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:40:56 -08:00
Jon Hunter
5e815ff501 spi: Fix build for Linux v6.13
Commit 0809a9ccac4a ("spi: remove {devm_}spi_alloc_master/slave()")
removed devm_spi_alloc_master() and this breaks building the Tegra124
and Tegra210 SPI drivers for Linux v6.13. Commit b8d3b056a78d ("spi:
introduce new helpers with using modern naming") previously added new
helpers in Linux v6.2 which should be instead. Add a test for conftest
to detect if the kernel supports the function devm_spi_alloc_host()
and if so use this function.

Bug 4991705

Change-Id: I1d639297ef7adfdcde50927360607639b45a4a60
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261698
(cherry picked from commit c2219d8e43ca7e6509179206796b34c09ba1dbd1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499751
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:40:51 -08:00
Jon Hunter
aee51acfea drm/tegra: Fix aperture support for Linux v6.13
In Linux v6.13, commit 689274a56c0c ("drm: Remove DRM aperture helpers")
removed the DRM aperture helper functions and drivers should simply use
the existing video helpers. Update the Tegra DRM driver to use
aperture_remove_all_conflicting_devices() if available to align with
upstream.

Bug 4991705

Change-Id: Ie4b78a4ea519ffcaaf972417ec2cbe7c436eb808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261694
(cherry picked from commit 671f7a39d26449bcbf8fe242bdff7534b9aece63)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3475287
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:40:44 -08:00
Jon Hunter
0a8d8b47c7 drivers: gpu: Fix IOMMU support for Linux v6.13
In Linux v6.13, commit f6440fcc9c7b ("iommu: Remove
iommu_domain_alloc()") removed iommu_domain_alloc() and was replaced by
iommu_paging_domain_alloc(). Use conftest to detect if the function
iommu_paging_domain_alloc() is supported by the kernel and update the
Tegra DRM and Host1x drivers accordingly.

Bug 4991705

Change-Id: I86221d96232396fdb6bdccf40c412e029881c513
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261695
(cherry picked from commit e374ac996dceee884296c9f1e53fdd0f281b3e0c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499750
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-12-04 09:40:37 -08:00
Jon Hunter
0980dbb86e drm/tegra: Fix genpd support for Linux v6.13
In Linux v6.13, commit d6caca30a548 ("OPP: Drop redundant
*_opp_attach|detach_genpd()") removed devm_pm_opp_attach_genpd(). This
has been replaced by devm_pm_domain_attach_list(). Use conftest to
detect the presence of devm_pm_domain_attach_list() and update the Tegra
DRM driver accordingly.

Bug 4991705

Change-Id: I5a3bd258d3fce5b09fd4ba84adad166e4cf47cfb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261693
(cherry picked from commit 4c08d4e516a89751afc8410553ccebff983e29d0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499749
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:40:31 -08:00
Jon Hunter
c07615fe6a thermal: tegra-oc-event: Fix build for Linux v6.13
When compiling the tegra-oc-event driver with Linux v6.13 the build
fails with the following error:

 drivers/thermal/tegra234-oc-event.c:127:48: error: missing braces around
  initialiser [-Werror=missing-braces]
  127 | static const struct attribute_group oc1_data = {
      |                                                ^

The 'NULL' initialiser is not needed in the above structure because it
is not any array. Fix the build for Linux v6.13 by removing the NULL
initialisers from the appropriate structure declarations.

Bug 4991705

Change-Id: I2ddb99a316aa0124e9a4c1850ba1ea87d16abcbc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261689
(cherry picked from commit c3d634abe95c557551311acfbad602cd8824b4dc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263393
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Yi-Wei Wang <yiweiw@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-12-04 09:40:25 -08:00
Jon Hunter
814fdf0d88 cpuidle: Fix build for Linux v6.13
Commit ef4c675dc296 ("genirq: Unexport nr_irqs") unexported 'nr_irqs' in
Linux v6.13 and this breaks the build for the cpuidle-debugfs driver.
For Linux v6.13 the number of IRQs can be queried by using the function
irq_get_nr_irqs() instead. Fix the build by using conftest to detect if
the function irq_get_nr_irqs() and use this function if it is present.

Bug 4991705

Change-Id: I98d477896fcf9e8d2e1afa21e2f7ba4d071ab442
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261690
(cherry picked from commit 3fd3699807afd1503c72e1d2a1610ef0e4862197)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499748
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-12-04 09:40:19 -08:00
Jerry Chang
ac523e2cad media: i2c: imx477: remove 4-lane config
Raspberry PI HQ IMX477 only has 2-lanes for camera
cable and connector design, 4-lanes will never work

Bug 5331483

Change-Id: I419bb6a4ba2778e1a4b73d1749ec1da263bd3101
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3490068
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2025-12-04 05:54:31 -08:00
yunzhao
9dc6ab65c2 vi5:fix channel status inconsistency
set chan->is_streaming status to vi5_channel_stop_streaming to prevent
an error when restarting streaming next time after a failure.

Bug 5318702

Change-Id: I129811f932e8fb99c60d82f4cb1846adb87e1b34
Signed-off-by: yunzhao <yunzhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3500460
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Jackie Chen <jackchen@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
2025-12-01 23:24:00 -08:00
Shubhi Garg
e4ded64e88 oot: fix mutex unlocking in vrs rtc
Kernel throws a dump trace upon setting wakealarm time on VRS RTC.
We are unlocking mutex twice in a single API call. Delete one instance
which is not required.

[  590.301592] Call trace:
[  590.304035]  __mutex_unlock_slowpath.isra.0+0x1d4/0x2d0
[  590.309274]  mutex_unlock+0x60/0x80
[  590.312766]  0xffff80007ce0e6ec
[  590.315909]  __rtc_set_alarm+0x100/0x200
[  590.319751]  rtc_timer_enqueue+0x168/0x2e8
[  590.331275]  dev_attr_store+0x20/0x601e8
[  590.335117]  sysfs_kf_write+0x4c/0x88
[  590.338609]  kernfs_fop_write_iter+0x144/0x1d8
[  590.343149]  vfs_write+0x254/0x398
[  590.353626]  invoke_syscall+0x50/0x14040
[  590.357468]  el0_svc_common.constprop.0+0x48/0x100
[  590.362357]  do_el0_svc+0x24/0x40
[  590.365501]  el0_svc+0x34/0xc8
[  590.372835]  el0t_64_sync+0x194/0x19830/0x140
[  590.376679] ---[ end trace 0000000000000000 ]---

Bug 4715238

Change-Id: I7e070772c81474eb22859f2a00934211e6dad834
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3258911
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3502098
2025-12-01 05:38:59 -08:00
Wayne Wang(SW-TEGRA)
2f7421c40b nvethernet: add mutex lock for osi mdio
There is chance to hit race condition when doing mdio read/write from
different application.

This would lead to PHY not work properly intermittently.

Bug 5211090

Change-Id: I62afbc1d206fd4cf02a0b58036e8d38ca84968ac
Signed-off-by: Wayne Wang(SW-TEGRA) <waywang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/3453343
(cherry picked from commit 1442bbd24a8fe0423fc67b5b004b2a07d604c109)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3477850
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
2025-11-25 20:09:00 -08:00
Ankur Pawar
1d659b240c Camera: fix kernel warning after VI timeout
VI return timeout status when no frames are
received from camera sensor. During the error
recovery, the v4l2 buffers are set to
VB2_BUF_STATE_ERROR, this causes kernel warning.
As per the v4l2 framework correct buffer state
for timeout is VB2_BUF_STATE_QUEUED.

Bug 5512645

Change-Id: Iafc720b1ba74f04490d7d14e2e9014bd599b3cba
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462547
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-07 05:53:55 -07:00
Jon Hunter
d6685995db video: tegra: nvmap: Fix build for Linux v5.17+
Building NVMAP is failing for Linux v5.17, v5.18 and v5.19 and the
following error is observed ...

 drivers/video/tegra/nvmap/nvmap_alloc.c: In function
  ‘handle_page_alloc’:
 drivers/video/tegra/nvmap/nvmap_alloc.c:521:14:
  error: implicit declaration of function ‘mmget_not_zero’; did you mean
  ‘min_not_zero’? [-Werror=implicit-function-declaration]
    521 |         if (!mmget_not_zero(mm))
        |              ^~~~~~~~~~~~~~
        |              min_not_zero

The function 'mmget_not_zero' is present in these kernels and for all
kernels is defined in the header file 'include/linux/sched/mm.h'. Ensure
that this header is included by the NVMAP driver to fix the build.

Bug 5222690

Change-Id: I98dcac3bb19d37bc0f5e9bd85d49a8cfe0923061
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3454945
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
2025-09-22 02:53:55 -07:00
Ketan Patil
1c59063ce7 video: tegra: nvmap: Avoid double updation of RSS counter
The RSS counter is updated during buffer allocation as well as mmap,
which is leading to double updation. Fix this by decrementing the RSS
counter during page fault while increment it back during unmap flow.

Bug 5222690

Change-Id: I77972185f20d9d710571cc07ae1c5188060bfa1f
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3442670
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-09-16 15:54:39 -07:00
Ketan Patil
8e1a6b2dd1 video: tegra: nvmap: Remove use of add_mm_counter
add_mm_counter is not an exported function, so instead use
atomic_long_add_return/percpu_counter_add to directly modify RSS stat
counters.

Bug 5222690

Change-Id: I51a68d932aeb04f96e51a4a3c286ee5c8efc789a
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3446982
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-09-16 15:54:33 -07:00
Jon Hunter
69f69d9b7f i2c: tegra-slave: Fix build for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update the Tegra I2C Slave
driver accordingly to fix the build for Linux v6.11+ kernels.

Bug 4749580
Bug 5440303

Change-Id: Ic1d7d9b320e324b4847011af625e7e8e3f88d28a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3440226
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-08-27 06:08:57 -07:00
Ketan Patil
2ca91098aa video: tegra: nvmap: Account NvMap memory for OOM Decisions
Account NvMap allocated memory into both RSS and CG tracking to make
efficient OOM kill decisions during memory pressure.

NvMap allocates memory via kernel APIs like alloc_pages, the kernel
memory is not accounted on behalf of process who requests the
allocation. Hence in case OOM, the OOM killer never kills the process
who has allocated memory via NvMap even though this process might be
holding most of the memory.

Solve this issue using following approach:
- Use __GFP_ACCOUNT and __GFP_NORETRY flag
-  __GFP_NORETRY will not let the current allocation flow to go into OOM
path, so that it will never trigger OOM.
- __GFP_ACCOUNT causes the allocation to be accounted to kmemcg. So any
allocation done by NvMap will be definitely accounted to kmemcg and
cgroups can be used to define memory limits.
- Add RSS counting for the process which allocates by NvMap, so that OOM
score for that process will get updated and OOM killer can pick this
process based upon the OOM score.
- Every process that has a reference to NvMap Handle would have the
memory size accounted into its RSS. On releasing the reference to
handle, the RSS would be reduced.

Bug 5222690

Change-Id: I3fa9b76ec9fc8d7f805111cb96e11e2ab1db42ce
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3427871
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-08-22 04:09:39 -07:00
Chenjian
a196aadaf7 mfd: clear interrupt status in probe
VRS RTC may assert interrupt if battery mounted. Clear the status
registers before interrupt enabled to prevent bad logic.

Bug 3910065
Bug 3742306

Change-Id: I02dc6ce9352b1f1932cc539e6988375da4098014
Signed-off-by: Chenjian <jackchen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2833620
(cherry picked from commit a50dd0a752641a30d84a5edfed426a12f2641acc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2839704
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3418233
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Shubhi Garg <shgarg@nvidia.com>
Tested-by: Kevin Fu <chunhuaif@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-08-13 22:53:57 -07:00
Akhil R
858da4d574 i2c: tegra-slave: Add I2C Tegra slave driver
Add back the removed i2c-tegra-slave-byte driver and add support
for it in kernel v6.1

Though not enabled in device tree by default, I2C slave driver is
used by customers and developers for various debug and application
use cases.

Bug 4288065
Bug 4061232
Bug 5440303

Change-Id: Idd012303f51456492a8392e51aee1edc8dcb487c
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3048842
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
(cherry picked from commit 75ea3b11d0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3351662
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-08-08 04:54:36 -07:00
Shubham Chandra
b36ca8daa3 media: camera: modify error log to info log
v4l2-compliance has a negative test for image size,
resulting in an error log. Modify this error log to
info to avoid reporting kernel error/warning failure.

Bug 5143480

Change-Id: I5ec459f97c5b09e130293b59c19c1eb3ea9a53ee
Signed-off-by: Shubham Chandra <shubhamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3396425
(cherry picked from commit bac969836ec107b17489a782103517684691fddc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3395179
(cherry picked from commit 97058881b98459a100562cc41a148d7e3240059b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3415602
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nithin Varghese <nvarghese@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2025-07-24 22:38:54 -07:00
Jerry Chang
8d112b32e5 vi5: fix vi5_channel_error_recover memory leak
release chan->request_iova and also chan->emb_buf memory

Bug 5371485

Change-Id: I6e2642733a222a85b2f7d6814716835afc921948
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3397753
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-09 03:09:15 -07:00
snchen
6dcfde2bf7 vi5: reset capture_reqs_enqueued for stream on/off
Fix capture failed while repeatedly stop/starting streaming
by the VIDIOC_STREAMOFF/VIDIOC_STREAMON

bug 5262740

Change-Id: I1ab61497a1e8e2bfc83e62befc708d9be0662b82
Signed-off-by: snchen <snchen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3356037
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-06-15 23:08:57 -07:00
Dara Ramesh
b4b7c24bfe adsp: cleanup legacy code
The legacy ADSP applications, such as file access and lpthread,
as well as the actmon driver, are no longer supported on T26x/T23x.

Bug 5174542

Change-Id: I3e70f11e0c09a7178f069c2423ad068dc765eea8
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3359415
(cherry picked from commit 7522cb86599a2e9b1696dc3c6f878a421c7b84e9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3382804
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-06-10 05:25:02 -07:00
Robert Lin
0652332c19 nvethernet: defer WOL enablement.
This change defers WOL enablement to the moment
before suspending so the network retains connected
after enabling WOL.

ethtool -s eth0 wol g

Bug 4450559

Change-Id: Ib5e59052fb72a9c4f88667ab6182633af545b99d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3271298
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2025-05-28 17:54:30 -07:00
Ashish Mhetre
e2b9c86688 platform: tegra: Check if MC channel is enabled
In MC-HWPM driver, check if MC channel is enabled before accessing its
registers.

Bug 5279654

Change-Id: I41e3d277a75d0a1045e47f148e2b9eb63f29b279
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369527
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2025-05-26 00:53:54 -07:00
Jon Hunter
2f83033498 media: camera: Use conftest for CSI2 config
In Linux v5.18, commits 20c238dfb26c ("media: v4l2-mediabus: Drop legacy
V4L2_MBUS_CSI2_*_LANE flags"), 5a6ac3f4b46f ("media: v4l2-mediabus: Drop
legacy V4L2_MBUS_CSI2_CHANNEL_* flags") and b9f7caa7753a ("media:
v4l2-mediabus: Drop V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag") removed
various CSI2 flags. It turns out that out of these flags we only need to
actually set the number of lanes and the other flags are redundant. The
configuration was moved by commit 94d964e58ad6 ("media: v4l2-fwnode:
Move bus config structure to v4l2_mediabus.h") to the structure
v4l2_mbus_config_mipi_csi2 which itself is under the structure
v4l2_fwnode_endpoint. Use conftest to detect if the structure
v4l2_mbus_config_mipi_csi2 is present and avoid using kernel version
checks.

Bug 4425688

Change-Id: Icd597492e48831326c203a6556176ac3767472a3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3354475
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com>
2025-05-02 08:54:03 -07:00
Laxman Dewangan
3713d89fdb prod: Add support for legacy and next-gen prod via config
Instead of using the Linux kernel version, use the
configs coming from core kernel to find out whether
legacy or next-gen prod configuration method is used.

This will help on porting changes on any kernel and
configuring via core kernel configs.

Bug 3389584

Change-Id: I19c242c573dd63c7dbecbf87d4ba807857dcf4fb
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3013911
(cherry picked from commit 1dd2ef3473)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3087161
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-16 12:09:22 -07:00
Jon Hunter
3d806c0cd2 gpu/drm: tegra: Fix support for Linux v6.12
In Linux v6.12, commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
fop_flags") moves the setting of the FMODE_UNSIGNED_OFFSET into the
various drivers and renames this flag. This change is causing various
tests to fail because opening the DRM device is failing.

Use the presence of the new FOP_UNSIGNED_OFFSET flag in the kernel to
determine if we need to set this flag in the Tegra DRM driver.

Bug 4876974

Change-Id: Ie72a9340187b1c206f0cda6d7e3dab44d603a41c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3269063
(cherry picked from commit a680b4881fb8e6ace46f409c33307f3bc10366a4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3338872
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Ilies Chergui <ichergui@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ilies Chergui <ichergui@nvidia.com>
2025-04-11 14:08:53 -07:00
Ken Chang
785d9aa288 tegra-cec: poll WR_LOCK for TX data sync
After programming the TX Register, it takes 3-4 clock cycles for TX
data synchronization to the CEC core domain. The TX_EMPTY interrupt
should not be cleared until this data synchronization is complete.

Enable CEC HW feature to automatically clears the TX_EMPTY interrupt
after TX data synchronization is complete. It takes time for HW to
clear the interrupt and TX_EMPTY can still appear high, hence SW
needs to poll WR_LOCK until it goes to 0. This will avoid SW to
attempt the next TX block during the same TX_EMPTY interrupt.

Also read RX_REGISTER based on the buffer occupancy which is
indicated by the CEC_RX_BUFFER_STAT_0 register.

Bug 4954851

Change-Id: I3ec3792c9ae3b8a00c800c921cf4e4d09369e6b9
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322519
(cherry picked from commit 94cf6106402dc833dbaa4305c3e1a8f85fd80d0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3336992
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Prafull Suryawanshi <prafulls@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-11 06:40:40 -07:00
Jerry Chang
7bca2b2466 tegra: rtcpu: revise copyright
incorrect use of NVIDIA Properitary License in Linux driver code

Bug 5197152

Change-Id: Id23b8cbd4fd6315664c77d7f42014206d1ef8d5c
Signed-off-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330623
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-04-01 12:23:51 -07:00
Thierry Reding
eca775e222 gpu: host1x: Set up device DMA parameters
In order to store device DMA parameters, the DMA framework depends on
the device's dma_parms field to point at a valid memory location. Add
backing storage for this in struct host1x_memory_context and point to
it.

Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916133320.368620-1-thierry.reding@gmail.com
(cherry picked from commit b4ad4ef374d66cc8df3188bb1ddb65bce5fc9e50)

Bug 4876974

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I0a7f9c9f49a5e4580193d5814ff4a6a15f8014c8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268196
(cherry picked from commit 027ee6a9a0b3848fbaae21c788064f59072c0978)
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3326864
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-26 09:24:38 -07:00
Paritosh Dixit
8e353eecd4 bluetooth: realtek: Add option to disable driver
The RealTek drivers do not build against all Linux distributions because
some Linux distributions have back-ported upstream changes and so the
KERNEL_VERSION checks in the driver do not work for these distributions.

Add compilation flags for these drivers so that we can skip the building
of these drivers for certain Linux distributions.

Bug 5180190

Change-Id: I48101b5b9e199c6887a2cbde916d7df5ae1c53a7
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3325283
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-03-26 09:24:34 -07:00
Paritosh Dixit
f2f943a0d3 block: virt-storage: Add option to disable drivers
The tegra-virt-storage driver is currently not used for the L4T in the
rel-36 codeline. Add an option to disable building the driver. It
provides flexibility to disable the driver in case there are build
issues with 3rd-party distro kernels.

Bug 5180190

Change-Id: If58d8e782c564aa7b5229dc96093050c19882011
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3323464
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-03-26 09:24:30 -07:00
Laxman Dewangan
1e837fca66 camera: Use conftest to find if media_entity_remote_pad() present
Use conftest to determine if media_entity_remote_pad()
function is present or not

This function is removed by commit b2e44430b634 ("media:
mc-entity: Rename media_entity_remote_pad to media_pad_remote_pad_first")
in Linux 6.0

Bug 4387902

Change-Id: I816016731ac44a3c093438310f8e60bd166f2fd7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037917
(cherry picked from commit b40e45535e)
Signed-off-by: Paritosh Dixit <paritoshd@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3322771
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-03-26 09:24:26 -07:00
Akhil R
4b72ba2c83 crypto: tegra: Do not use IV for AES ECB
It may happen that the variable req->iv may have stale values or
zero sized buffer by default and may end up getting used during
encryption/decryption. This in turn may corrupt the results or break
the operation. Ensure not use IV for algorithms like AES ECB where IV
is not expected.

Bug 4883011

Change-Id: I309ad26f99fe54005ff71b270b3b115dc62ac168
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3319062
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-19 12:24:33 -07:00
Akhil R
15d7ca57b1 crypto: tegra: Reserve keyslots to allocate dynamically
The HW supports only storing 15 keys at a time. This limits the number
of tfms that can work without failutes. Reserve keyslots to solve this
and use the reserved ones during the encryption/decryption operation.
This allow users to have the capability of hardware protected keys
and faster operations if there are limited number of tfms while not
halting the operation if there are more tfms.

Bug 4883011

Change-Id: I220f1e8205dde1f078be6ed4cb09b699b6d5dfa2
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263283
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-03-19 12:24:29 -07:00
Akhil R
2f3c077115 crypto: tegra: Use separate buffer setkey
Use a separate buffer for setkey operation. setkey() is called
asynchronous to crypto engine APIs. This causes concurrency issues in
the tegra engine oprations.

Bug 4883011

Change-Id: I1ec7d0a041ee8a0a0bf350d2f3e9915091993034
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263282
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-03-19 12:24:25 -07:00
Brad Griffis
efeb1061bb Revert "crypto: tegra: Use separate buffer for each host1x command"
This reverts commit f6c3d49e92.

Reason for revert: Optimize implementation and align with upstream.

Bug 4883011

Change-Id: I32fe35daa30ddb5a272dbeee0c3316134e9ca55b
Signed-off-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321697
Tested-by: Akhil R <akhilrajeev@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Akhil R <akhilrajeev@nvidia.com>
2025-03-19 12:24:21 -07:00
Jon Hunter
a2b53ade55 virt: hvc_sysfs: Fix build for Linux v6.13
In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify
attribute callback of bin_attribute::mmap()") changed the type of the
'struct bin_attribute' argument of the bin_attribute:mmap function
pointer to const. Use conftest to detect if this argument is const or
not in the kernel the driver is being compiled against to fix the build.

Bug 4991705

Change-Id: I791d6c9dde50f1444d0339ebd8a18434045f9026
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261699
(cherry picked from commit fae042552e211199a160e5d6a82a67edd7b7e03c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3321698
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-03-19 10:23:57 -07:00