Commit Graph

2820 Commits

Author SHA1 Message Date
Jon Hunter
07dbfa8de1 gpu: host1x: Make host1x_actmon_unregister() return void
The function host1x_actmon_unregister() never fails and so never returns
an error. Make this function return void to simplify the code.

Bug 4303860

Change-Id: I9e1cd403bd6db8e2d4ac6831ed26e1436638456f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2986789
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-28 22:00:51 -07:00
Uwe Kleine-König
ee866593b7 UPSTREAM: gpu: host1x: Make host1x_client_unregister() return void
This function returned zero unconditionally. Make it return no value and
simplify all callers accordingly.

Bug 4303860

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Change-Id: I07bf696e8af7c3472355b52549fb43ff3987c108
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2986788
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 22:00:46 -07:00
Manish Bhardwaj
4df331c666 Revert "nvidia: Optimize the request slots for queueing"
This reverts commit 4c20b236c8523e2af0fcd2f7396577ccf0328eec.
Reason for revert: <Seeing hung issue>

Bug 4260060

Change-Id: Ie9347885dd861ae9afc230c803246f86a0f34615
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984818
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:46:55 -07:00
Jon Hunter
b272a83282 video: tegra: nvmap: Use conftest
Instead of relying on kernel version to determine if the
register_shrinker() function has the 'fmt' argument, use the conftest.sh
script to test if this argument is present at compile time. 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: I0cbde2dfc2affc41e93eee1f3a195dbc0f8f5667
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984429
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:38 -07:00
Jon Hunter
ae64ed46c8 gpu: host1x: Add conftest support
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. 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: I56281fa5d95862338bd8a43d6e22225c27590462
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984422
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:27 -07:00
Jon Hunter
5a26b0ef9d drm/tegra: Add conftest support
Instead of relying on kernel version to determine if certain functions
or structure are present in the kernel, use the conftest.sh script to
test which functions, structures, etc are present at compile time. 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: If315b18af74c830e9ba3993208de3a3326c4187d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2984415
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-28 21:45:17 -07:00
Jon Hunter
040c0ad65f drivers: nv-p2p: Drop get_user_pages_locked
The nv-p2p driver does not compile against pre-v5.15 kernels and the
following error is seen ...

 drivers/nv-p2p/nvidia-p2p.c:153:24: error: passing argument 1 of
 'mmap_read_lock' from incompatible pointer type
 [-Werror=incompatible-pointer-types]
  153 |         mmap_read_lock(&current->mm);
      |                        ^~~~~~~~~~~~
      |                        |
      |                        struct mm_struct **

The version of the function get_user_pages_unlocked() used in the nv-p2p
driver has been support since v4.6 and so drop usage of
get_user_pages_locked() completely.

Bug 4142533

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I957197825ddee6b705626b345aaff4647de08533
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983961
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-28 21:44:29 -07:00
Lovie Wang
2c1450fb2f misc: mods: Remove CONFIG_OF_RESOLVE & CONFIG_OF_DYNAMIC
-OOT drivers are built unconditionally
-MODS selects these two flags in Kconfig while Kconfig is
 not used in OOT drivers. So these two flags can't be selcted
 by default, need to remove the check.

 Bug 4300801

Change-Id: I2e19ecdfd34c499b3000823025d0ad34752ae9aa
Signed-off-by: Lovie Wang <loview@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2981830
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-28 21:38:20 -07:00
Jon Hunter
990ccbf02c block: virtual-storage: Remove unneeded header
The header file 'linux/genhd.h' is not needed for compiling the virtual
storage drivers and so remove this unneeded header file.

Bug 4119327

Change-Id: Ib6dd7bc072b291a5617880fc65c7cd8dbc0b35ab
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985997
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-27 08:24:49 -07:00
Vishwaroop A
a47fbd17b7 drivers: spi: enable autosupsend delay
Add runtime auto suspend support and provide
a dt option to set this delay for each bus.

Perf drop is seen due to clock switching during
write operation. QSPI flash device write page size
is 256 KB so clock switching was being done for every
256KB due to pm_runtime_put(&pdev->dev) call.

pm_runtime_put() function is called, the Linux kernel
will begin to power down the device. This may involve
disabling clocks, powering down voltage regulators, and
releasing other resources etc.

pm_runtime_set_autosuspend_delay function sets the
autosuspend delay for a device. The autosuspend delay
is the amount of time that the device will remain active
after it has been idle before it is automatically suspended.
The pm_runtime_set_autosuspend_delay() function can be used to
reduce power consumption by automatically suspending devices
when they are not in use.

Bug 4229700

Change-Id: Ib49b02c78ad25957c80d22f5cc316afa55aa24dd
Signed-off-by: Vishwaroop A <va@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985140
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-27 08:21:40 -07:00
Gautham Srinivasan
6fec90c658 drivers: bmi088: Fix build for post-Linux v6.2
BMI088 driver was failing to build for Kernel version
> 6.2 and the following error is seen:

drivers/bmi088/bmi088_core.c:1043:42: error: 'struct iio_dev'
has no member named 'mlock'
  mutex_lock(&st->snsrs[hw].bmi_iio->mlock);

mlock field is moved from indio_dev to iio_dev_opaque
structure from v6.2 onwards.  Instead of using kernel
version, use conftest.sh script which checks for the
'mlock' field in iio_dev_opaque structure or not.

Bug 4190630

Change-Id: Icc540edd916718d30460b314600c20e70144b1d6
Signed-off-by: Gautham Srinivasan <gauthams@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983266
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-27 02:27:51 -07:00
Johnny Liu
6323c46280 gpu: host1x-fence: Share host1x compatible string
Same compatible string can be shared between host1x_next and
host1x_fence kernel modules so that those two modules will get
automatically loaded.

Bug 4291144

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Icf8b3fce960318c129194330c694e47826c440ee
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983673
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:22:03 -07:00
Viswanath L
e45c6bc8a9 nvadsp: Move DRAM map to custom property
Move DRAM map DT entries from 'reg' to a new custom
property "nvidia,dram_map". This is to restrict the
use of 'reg' only for actual registers, which will
be tightly controlled by 'ranges' property.

Bug 4164138
Bug 3682950

Change-Id: Ia535d136b15a0ba6d7758ed3a2d70ace2c8cf763
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-26 12:10:39 -07:00
Viswanath L
fa4a7643c5 nvadsp: Remove ABRIDGE and UNIT_FPGA_RST from DT
Remove redundant DT 'reg' entries ABRIDGE and UNIT_FPGA_RST
and associated code. 0x0 in the reg entry will not be possible
when 'ranges' property explicitly defines the address ranges.

Bug 4164138
Bug 3682950

Change-Id: I4cb11f8d143b1958c586471674e87d1ab243564f
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983548
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-26 12:10:28 -07:00
Viswanath L
ffdc1ff5c6 nvadsp: Use platform_get_irq to get IRQ num
Use platform_get_irq() instead of platform_get_resource()
to read IRQ num from DT, as platform_get_resource() is not
recommended to read IRQ early in the boot.

Bug 4164138
Bug 3682950

Change-Id: I117e608e6ae798aa2932a3a41f7942a741d3ff9c
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983098
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:10:18 -07:00
Viswanath L
21a60d1ca1 nvadsp: Load apps only if msgq is initialized
Load static apps only if shared memory is provisioned
and ADSP firmware has initialized message queue.

Bug 4164138
Bug 3682950

Change-Id: I86a9292d8d5f2949595c9a701f0565a9644f3d9a
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2930212
(cherry picked from commit 396b05637869ab2f49e8f3b3358fb9298ba96ae5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971982
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:10:13 -07:00
Viswanath L
6815f07e8f nvadsp: Restrict ICC API to T23x
Restrict call to icc_get API to T23x family of chips.

Bug 4164138
Bug 3682950

Change-Id: Ie4140b38661dcfd050305c7cdbbbc8c14031bbe7
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2930170
(cherry picked from commit 92e6565e02b32159469ff7562f75fd36c28f7f9d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971981
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:10:07 -07:00
Viswanath L
e2b06959b7 nvadsp: Generic changes for chip extensions
Below changes are made to support future
extensibility for new chips:

 - Chip data field 'adsp_prid' is added to specify DSP ID
 - Chip data field 'adsp_elf' is added to specify ELF file name
 - DT property "nvidia,cluster_mem" is added to specify cluster
    internal memories; ELF segments will be loaded into these
    using intermediate shadow buffers so that unaligned access
    is avoided
 - "nvidia,adsp_mem" entries are made optional (0x0 in the size
    field will indicate bypass)
 - Chip extension functions 'set_boot_vec' and 'set_boot_freqs'
    are added to support chip specific settings

Bug 4164138
Bug 3682950

Change-Id: I538ae0df57fa199a6eef75441167a9a5ba6924e8
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2894321
(cherry picked from commit fa7fc9d08af5fab9d0b2c5eb1b9b9a78446ade0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971980
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:10:02 -07:00
Viswanath L
d5138e1c58 nvadsp: Fix build issues and enable
Fix build issues for nvadsp in OOT kernel and enable the build.

 - Below files copied from kernel/nvidia/include/linux/
    - tegra_nvadsp.h (72af3e78a6aff0fa250e9fd36b8414264d0e4c9a)
    - tegra-firmwares.h (700223e52f49f300664dd91335fa11111af733aa)
    - tegra-hsp.h (988be8f05033e1d728e046e918b506d829106082)
 - Below file copied from kernel/nvidia/include/uapi/misc/
    - adsp_console_ioctl.h (72af3e78a6aff0fa250e9fd36b8414264d0e4c9a)
 - Functions that needs additional AGIC APIs not supported in upstream
    are pushed under macro CONFIG_AGIC_EXT_APIS
 - T210 chip_data and references removed

Bug 4164138
Bug 3682950

Change-Id: I5dfb570e578ca3631896de7350cea66698612568
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971924
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:09:57 -07:00
Viswanath L
119c4f87e2 nvadsp: Update license and remove kernel ver check
- Update license of all files in nvadsp that will be used
 - Remove kernel version checks in the code

Bug 4164138
Bug 3682950

Change-Id: Ie1f9ba95c1d46c3dd9bc5614e502b1b444484df6
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980528
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-26 12:09:52 -07:00
Laxman Dewangan
ac4912cb26 device-tree: generic: Add support to scan DT of internal SoCs
Add the support to build the DT of internal SoCs without
adding direct name from the Makefile but passed from the
make command. This will help to make the DT of all internal
SoCs.

Bug 4197981

Change-Id: I03c55cef5903a814a20d6f86d8ecfffe552daf29
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982406
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-23 14:37:09 -07:00
Jon Hunter
ed3fdebc33 thermal: max77851: Fix build for pre-Linux v6.1 kernels
The max77851 driver is failing to build for Linux kernels v5.16 to v6.0
and the following error is seen ...

 drivers/thermal/max77851_thermal.c:173:30: error: implicit declaration
 of function 'devm_thermal_of_zone_register'; did you mean
 'devm_thermal_zone_of_sensor_register'?
 [-Werror=implicit-function-declaration]
   thermal->tz_device = devm_thermal_of_zone_register(&pdev->dev, 0,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The function devm_thermal_of_zone_register() was introduced in Linux
kernel v6.1 and not v5.16.

Instead of relying on kernel version to determine if this function is
present using the conftest.sh script which checks the kernel that is
being compiled to see if this function is present or not. This is also
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 either.

Bug 200749982

Change-Id: I8d5e70d2d39497d7f513c82cd3a45312b2bc016a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980925
2023-09-23 14:34:00 -07:00
Manish Bhardwaj
f6227e9c57 crypto: check buffer size before allocing DMA memory
Passing zero size to dma_alloc API is causing below crash.
Added check on requested size before sending request to
dma layer.
[ 4178.581558]  sg_alloc_append_table_from_pages+0x28c/0x480
[ 4178.581790]  sg_alloc_table_from_pages_segment+0x40/0xb0
[ 4178.582009]  __iommu_dma_alloc_noncontiguous.isra.0+0x244/0x3a0
[ 4178.582258]  iommu_dma_alloc+0x280/0x3b0
[ 4178.582424]  dma_alloc_attrs+0xf8/0x110
[ 4178.582588]  tegra_hv_vse_get_db+0x76c/0x70e0 [tegra_hv_vse_safety]
[ 4178.582850]  hash_sendmsg+0xa8/0x290
[ 4178.583001]  sock_sendmsg+0x68/0x90
[ 4178.583146]  __sys_sendto+0xf0/0x170
[ 4178.583298]  __arm64_sys_sendto+0x38/0x60
[ 4178.583466]  invoke_syscall+0x5c/0x150
[ 4178.583628]  el0_svc_common.constprop.0+0x100/0x120
[ 4178.583829]  do_el0_svc+0x3c/0xb0
[ 4178.583966]  el0_svc+0x20/0x70
[ 4178.584098]  el0t_64_sync_handler+0xc0/0xd0
[ 4178.584270]  el0t_64_sync+0x1a4/0x1a8

Bug 4259208

Change-Id: I134bc84e7b5cbda7db4ed7dbcad4e1c6955429d8
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983402
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-22 20:08:52 -07:00
Manish Bhardwaj
1b6b4f8746 crypto: Fix compilation warning
Bug 4213877

Change-Id: Ic7fd0496473c5e3225e6235a18176faa8fe3e1be
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982158
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 21:32:13 -07:00
Manish Bhardwaj
90953fc012 Revert "crypto: nvvse: Fix compilation warning"
Bug 4213877

This reverts commit 88af3f4d9f.
Reason for revert: <Proper fix is being merged>

Change-Id: I3442f9a06cd752a5bc9f9c328a8d311a195f1574
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982104
Reviewed-by: Ashutosh Patel <ashutoshp@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 21:32:08 -07:00
Sumit Gupta
8a3c5d434b drivers: nv-p2p: fix compilation error in Nvidia Tegra P2P driver
Fix compilation error on making Nvidia Tegra P2P Driver as OOT.
Error coming because the get_user_pages_locked() API is removed now.
 https://lore.kernel.org/all/20220204020010.68930-6-jhubbard@nvidia.com/T/#mebb2b2dd622f702e76120aeca7896a4fd184d5c1

 kernel-oot/kernel-nvidia-oot/nvidia-oot/drivers/nv-p2p/nvidia-p2p.c
 :169:43: error: implicit declaration of function
 _get_user_pages_locked_; did you mean _get_user_pages_unlocked_?
 [-Werror=implicit-function-declaration]
  169 | user_pages = safe_cast_s64_to_s32(get_user_pages_locked
        (vaddr & PAGE_MASK, nr_pages,
      |                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                   get_user_pages_unlocked
 cc1: all warnings being treated as errors

Bug 4142533

Change-Id: Ic368ec288560f8f3c0acea29cfc935059ce2857e
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978104
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 21:24:10 -07:00
Sumit Gupta
c10e9dee5c drivers: nv-p2p: Move Nvidia Tegra P2P Driver to OOT
Make Nvidia Tegra P2P driver for RDMA as an OOT module.
The driver was earlier merged in Kernel-5.10 in the below cl.
 https://git-master.nvidia.com/r/c/linux-nvgpu/+/1821407

Bug 4142533

Change-Id: I6b24b44832d45fa5abedcd04c94d5d1e2576a6a3
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978103
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-21 21:24:05 -07:00
Jon Hunter
8409b7c652 net: can: mttcan: Make LED support depend on CAN_LEDS
CONFIG_CAN_LEDS has been marked as BROKEN since Linux v4.19 and was
finally removed in Linux v5.19. Only compile support for LEDS if enabled
in the kernel. Long-term we need to move the MTTCAN driver to use
LEDS_TRIGGER_NETDEV.

This is a better solution for working with 3rd party Linux kernels that
may backport upstream changes to the kernel and hence are not compatible
with these existing version checks.

Bug 4228080
Bug 4283911

Change-Id: I70e800c4a3699af59742d30111bc3a3cbf80bcb5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982135
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 13:11:36 -07:00
Jon Hunter
069925e74b video: tegra: nvmap: Make ioremap_prot depend on GENERIC_IOREMAP
The function ioremap_prot() has been exported by the Linux kernel since
v5.9. However, it is only available if GENERIC_IOREMAP is enabled. Since
Linux v6.0, when the ARM64 __ioremap() function was removed, was
GENERIC_IOREMAP enabled for ARM64 by default. Rather than depend on
kernel version for selecting if ioremap_prot is used, use ioremap_prot
if GENERIC_IOREMAP is enabled.

This is a better solution for working with 3rd party Linux kernels that
may backport upstream changes to the kernel and hence are not compatible
with these existing version checks.

Bug 4119327

Change-Id: I2f5f9a691c66c5fbd83d4aa51062c749d39dd447
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982126
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 13:11:31 -07:00
Jon Hunter
e3f94bde03 block: virt-storage: Fix build for pre-v5.15 kernels
Building the Tegra virtual storage driver for v5.14 kernels fails with
the following error ...

 drivers/block/tegra_virt_storage/tegra_hv_vblk.c:1236:48: error:
 passing argument 1 of '__alloc_disk_node' makes integer from pointer
 without a cast [-Werror=int-conversion]
  vblkdev->gd = __alloc_disk_node(vblkdev->queue, NUMA_NO_NODE);
                                  ~~~~~~~^~~~~~~
                                         |
                                         struct request_queue *

Fix this by correcting the arguments passed to __alloc_disk_node() for
pre-v5.15 kernels.

Bug 3820317

Change-Id: I2f208acb3ef0a009d877ab46fb110a87968862fe
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978392
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-09-20 18:57:55 -07:00
Manish Bhardwaj
3d4d545d18 nvidia-oot: ufs: add support for ufs driver for thor
Bug 4199271

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: If8f0270e7d1141e218d031ff8faca1274ec42c96
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974347
Reviewed-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-20 18:55:44 -07:00
Jon Hunter
89a8096aff video: tegra: nvmap: Simplify assembly macros
For the assembly code in the NVMAP cache maintenance source file it is
only necessary to use the SYM_FUNC_START/END macros. For NVMAP we don't
need to use the SYM_FUNC_START/END_PI variants (which add the __pi
prefix for position independent code) because they are only needed for
assembly code called early in boot prior to virtualisation being
enabled. Therefore, simplify the code to simply use the
SYM_FUNC_START/END macros and remove the kernel version check.

Bug 4119327

Change-Id: I53ed9e0d5300085afa45075ce19b65ff68605314
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980961
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2023-09-20 10:14:27 -07:00
Johnny Liu
9fa11c36c1 vi5: follow RPM framework for suspend and resume
When poweron and poweroff the device, runtime reusme and suspend
callbacks should be called respectively so that the device can prepare
and teardown the runtime environment properly. For example, requesting
proper ICC memory bandwidth requests in resume and suspend cycles.

Bug 4199055

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I67a77c58b3c05f67caf1fe83bcc0edd1da376768
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979911
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-20 10:08:34 -07:00
Johnny Liu
8748d6e9fd video: tegra: support icc for vi5
Support memory bandwidth management for VI5 through ICC framework.
Since EMC DVFS is not recommended for VI5, the driver should ask for
maximum possible memory bandwidth to fix the EMC/MC at Fmax and satisfy
latency requirement of VI5 and prevent buffer overflow in the MC side
with camera recording usecases.

Bug 4199055

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I3c78e2ee80cb70decd30878bb1620acce94278e3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977695
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-20 10:08:24 -07:00
Johnny Liu
08c0339264 video: tegra: support icc for nvdla
Support memory bandwidth management for NVDLA through ICC framework. The
bandwidth calculation formula is based on the current rate of NVDLA and
the width of AXI data bus between nvdla and DBB.

Bug 4102415

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: I75690269027b07f819cabaaf1a964c61b9033323
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971732
Reviewed-by: Yilin Zhang <yilinz@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-20 10:02:43 -07:00
Jon Hunter
8f976ab022 net: can: mttcan: Drop unnecessary version checks
GPIO descriptor support has been supported in the Linux kernel since
v3.16. Therefore, simplify the MTTCAN driver by removing the legacy GPIO
support and only use GPIO descriptors.

Bug 4119327
Bug 4228080

Change-Id: Ib1c50d17c514dee6a5c69145a8f5d3e07b5b3855
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2981396
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 21:11:29 -07:00
Shobek Attupurath
4ae0f1a759 rtl8822ce: Remove unwanted prints
Issue: Realtek driver has unwanted kernel prints being dumped in
       kernel logs

Fix: Remove unwanted kernel prints and move necesary prints to
     debug

Bug 4273483

Change-Id: I0a7b0d15e9456f6bcf296cd24fe758950cc64888
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977367
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2023-09-19 21:09:43 -07:00
Jon Hunter
00e11cac47 nvpps: Always use of_get_named_gpio
The function of_get_named_gpio() was first added for Linux v3.1 and is
still supported for in the latest mainline kernel. Therefore, always use
of_get_named_gpio() and avoid the unnecessary kernel version check.

Bug 4119327

Change-Id: I95e2458fdf00404bf91aa3e31e33dd2911377f48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979476
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 15:31:25 -07:00
Manish Bhardwaj
f8f33d49cc bpmp: stop mounting bpmp debugfs on vdk
Bug 4199271

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I7c960fcf3d7a125280ff33064ba7cd6bd1d0fb6d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974344
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 15:26:36 -07:00
vasukis
842bf32431 tegra: hwpm: Add HWPM registration in Virt_engine
- HWPM driver to profile OFA, VIC and NVENC IPs. Hence
add the IP-HWPM registration mechanism.
- Power management is not implemented as IPs are expected
to stay powered on as long as Guest-OS-0 stays powered on.
- Register operations for Read, Write to be handled by exposing
IP Perfmuxes within the hypervisor.

Bug 4170733
DOS-SHR-7601

Change-Id: I2936e9cc5539b7a5c93993694fbd1d866e2f6877
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2948008
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 08:22:15 -07:00
Johnny Liu
e3ce443fc9 devfreq: Migrate to K519 devfreq for tegra_wmark
Since K519, devfreq takes the priority of devfreq_dev_profile to save
the frequency table information and the number of frequency steps.

Therefore, change the implementation of tegra_wmark devfreq governor to
use devfreq to access the frequency table information and the nubmer of
frequency steps instead of devfreq_dev_profile.

Bug 4288411

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ib0affdcc8913642167cd82d45d014c46b51a8c38
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980425
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 03:30:17 -07:00
Jon Hunter
4612a9c24d staging: gte_test: Add missing header
With Linux v6.4 the gte_test driver fails to build and the following
error is observed ...

 drivers/staging/platform/tegra/gte_test/tegra194_gte_test.c:67:14:
 error: implicit declaration of function ‘of_find_compatible_node’
 [-Werror=implicit-function-declaration]
   np = of_find_compatible_node(NULL, NULL, "nvidia,tegra194-gte-aon");
        ^~~~~~~~~~~~~~~~~~~~~~~

The function of_find_compatible_node() is not found because the of.h
header is not explicitly included. Fix the build for Linux v6.4 by
including of.h.

Bug 4183168

Change-Id: I5dc6bb9aeb4e20a0bdab7e36c8ef0e5e466ad7ff
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979248
Reviewed-by: Dipen Patel <dipenp@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 20:46:53 -07:00
Kartik Rajput
5256b57dcd drm/tegra: fb: Use dedicated IO helpers
Upstream commit "43049f17b526"

[drm/i915: Implement dedicated fbdev I/O helpers]

Removed dedicated DRM helper APIs and introduced helper to define
dedicated IO helpers.

Use FB_IO_HELPERS to define fbdev helper APIs.

Bug 4276500

Change-Id: Iece6d2999bdcbafbdf8191d47441e2c8018063b7
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978955
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 20:45:29 -07:00
Kartik Rajput
e0558096ef oot: drivers: Replace gpio_cansleep() with gpiod_cansleep()
Upstream commit "7d0b80647f73"

[gpiolib: remove unused gpio_cansleep()]

Removed gpio_cansleep() API as there are no upstream users.

Replace the usage of gpio_cansleep() with gpiod_cansleep(). This is also
backwards compatible with older Kernels.

Bug 4276500

Change-Id: I37230d4371298d724e2311c803409108e93a4fed
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978834
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-14 20:45:05 -07:00
Kartik Rajput
d57bc53365 gpu: host1x-nvhost: Fix compilation issues with Kernel-6.5
Upstream commit "7e3f926bf453"

[rcu/kvfree: Eliminate k[v]free_rcu() single argument macro]

Removes the single-argument kvfree_rcu() and kfree_rcu() macros. Code
that would have previously used these single-argument kvfree_rcu() and
kfree_rcu() macros should instead use kvfree_rcu_mightsleep() or
kfree_rcu_mightsleep().

Use kfree_rcu_mightsleep() instead of kfree_rcu() if using Kernel-6.5 or
newer.

Bug 4276500

Change-Id: I5f948dd0d658cf4875a2e0010818f7dde856e55c
Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978720
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 20:44:03 -07:00
Jon Hunter
c563f4b4e4 drm/tegra: Drop devm_gpiod_get_from_of_node
The function devm_fwnode_gpiod_get() has been supported since Linux v5.5
and so it is not necessary to support devm_gpiod_get_from_of_node for
pre-v6.3 kernels. Drop devm_gpiod_get_from_of_node() support to simplify
the Tegra DRM driver.

Bug 4119327

Change-Id: I5d1fb433d99f350e127e439f351412f8ec3ebc8f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979270
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:32:14 -07:00
Jon Hunter
79e8e9cf3a media: Allow drivers to be built without V4L2
When building the NVIDIA out-of-tree drivers against 3rd party Linux
kernels where V4L2 support is not be enabled by default, the camera
drivers fail to build. Although this is expected, it is preferred that
the driver can still be built but then fail when loaded. Update the
camera drivers to guard around the V4L2 functions so that the drivers
can still be built but will return an error where needed.

Bug 4119327

Change-Id: I3a1115e5f0451153831c396244c01d7525cb51a1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979254
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-14 13:32:09 -07:00
Shubhi Garg
84302c4c14 watchdog: max77851: add max77851 watchdog driver
Bug 200749982

Change-Id: I29d5fec53b576cabce2c5dab975cc81ccf4a4e57
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595388
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2960844
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:26:07 -07:00
Shubhi Garg
fb139fef5c thermal: max77851: add max77851 thermal driver
Add max77851 thermal driver into nvidia-oot repo

Fix k6.1 build errors

k5.15 uses same APIs available in k5.10

Bug 200749982

Change-Id: I5a6eddc2835ae7aeeba36f66b545ef2105b5f616
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595378
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2960843
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:26:01 -07:00
Shubhi Garg
322305708c power: add max77851 pmic power driver
Add max77851 pmic power driver provided by MAXIM.

Bug 200749982

Change-Id: I44cbf11526eb83aa5722f780db4e9a7b6352151c
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2693149
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2960842
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:56 -07:00