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>
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
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
When we set time from max77851 pmic RTC, it hangs because
it calls read_time function which locks via mutex twice. System
goes in deadlock state. Reading time is not required during time set
as it is not performing anything thus removing it.
Following logs are seen during hang:
[ 242.930292] INFO: task systemd-timedat:1127 blocked for more than 120 seconds.
[ 242.937695] Tainted: G E 5.10.104-tegra #1
[ 242.943743] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.951643] task:systemd-timedat state:D stack: 0 pid: 1127 ppid: 1 flags:0x00000808
[ 242.960074] Call trace:
[ 242.962618] __switch_to+0xd0/0x120
[ 242.966193] __schedule+0x404/0xab0
[ 242.969709] schedule+0x78/0x110
[ 242.972963] schedule_preempt_disabled+0x2c/0x50
[ 242.977621] __mutex_lock.isra.0+0x1b4/0x5b0
[ 242.981925] __mutex_lock_slowpath+0x48/0x90
[ 242.986226] mutex_lock+0x74/0x80
[ 242.989610] max77851_rtc_read_time+0x48/0xf0
[ 242.994004] max77851_rtc_set_time+0xd4/0x1a0
[ 242.998398] rtc_set_time+0xac/0x220
[ 243.002003] rtc_dev_ioctl+0x478/0x950
[ 243.005805] __arm64_sys_ioctl+0xac/0xf0
[ 243.009773] el0_svc_common.constprop.0+0x80/0x1d0
[ 243.014605] do_el0_svc+0x38/0xb0
[ 243.017950] el0_svc+0x1c/0x30
[ 243.021029] el0_sync_handler+0xa8/0xb0
[ 243.024898] el0_sync+0x16c/0x180
Bug 200749982
Change-Id: I6f7d88871184bf64a03fa789746a189e0c0aa826
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2726550
(cherry picked from commit 129e9c03af0db8857d65e65ea72ce19ae2656b27)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2728925
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947784
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The MODULE_IMPORT_NS macro adds a namespace tag to the module
information. The DMA_BUF namespace is required for Linux v5.16+ kernels
for drivers that use DMA BUF, there is no reason not to populate this
for earlier kernels. Furthermore, some 3rd party kernels prior to v5.16
may require this too and so drop the version check around the DMA BUF
namespace.
Bug 4119327
Change-Id: If8a5e90340f7a0582247cb91611d275ec1f4990e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979260
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Determining whether the header file iosys-map.h is present in the kernel
is currently determine by kernel version. However, for Linux v5.15,
iosys-map.h has been backported in order to support simple-framebuffer
for early display. Therefore, we cannot rely on the kernel version to
indicate whether iosys-map is present. This is also true for 3rd party
Linux kernels that backport changes as well. Fix this by adding a
compile time flag, that will be set accordingly by the conftest script
if this header is present.
Bug 4119327
Bug 4228080
Change-Id: Ibd814285b2a07932ede2fbe9e6dc8fd03039d0c3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971954
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Remove the module pointer from the class_create() based
on following change in core kernel
======
driver core: class: remove module * from class_create()
The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====
Bug 4276500
Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>