Commit Graph

2941 Commits

Author SHA1 Message Date
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
Shubhi Garg
26a63fbba2 pinctrl: max77851: add max77851 pinctrl driver
Add duplicate copy of needed linux header files
from core kernel k6.1 into nvidia-oot as max77851
pinctrl drivers compilation fails.

Bug 200749982

Change-Id: I660e2025e86494e87e5972d16f356efd70720511
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595353
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947786
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:52 -07:00
Shubhi Garg
b60b757d9c rtc: fix year calculation in max77851 pmic rtc
Add +100 to year only if PMIC does not have separate alarm
enable registers. Since MAX77851 has separate alarm enable register
, MAX77851 RTC supports year calculation from 0..199 so we do not need
to add 100 on reading RTC YEAR register. Currently, default, driver is
adding +100 which is wrong. This change fixes rtc year calculation.

Bug 200749982

Change-Id: Ibaf1d2fb81e59cc21c22d509cf9ffc7b6005916c
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2727859
(cherry picked from commit b43364942c67fdf7958a42bfad5fe02725da00e3)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2728926
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947785
Reviewed-by: svcacv <svcacv@nvidia.com>
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:25:47 -07:00
Shubhi Garg
5b1a5fc4b6 rtc: fix max77851 pmic rtc hang in set time
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>
2023-09-14 13:25:42 -07:00
Shubhi Garg
da71dfa5a5 rtc: max77851: add max77851 rtc driver
Add max77851 rtc driver into nvidia-oot repo

Fix jammy-src kernel-only build max77851 rtc
in embedded recovery defconfig
 - guard regmap function calls with CONFIG_REGMAP_IRQ
 - guard i2c call with CONFIG_I2C

Bug 200749982

Change-Id: I9bfcbfa7bab42f393c7baa1f3dba78d599ca510a
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595387
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947783
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:37 -07:00
Shubhi Garg
83b0f18aa3 gpio: add max77851 PMIC GPIO driver
Adding MAX77851 GPIO driver provided by Maxim.
 - fix k6.3 (kstable and gh100) kernel-only build
 - fix k6.1 and jammy-src kernel-only build with
   CONFIG_REGMAP_IRQ and CONFIG_I2C conditional
   including -werror failures.

Bug 200749982

Change-Id: Ib46a075a2ca7c43301788dc0f54216f02c925c16
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595331
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947782
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:32 -07:00
David Yu
7354304367 regulator: max77851: fix LDO3 range
LDO3 voltage range was limited so that 3.3V couldn't be set.

Bug 3668223
Bug 3534753

Change-Id: I0e29effd9cbf81db41241312800971435f71e101
Signed-off-by: David Yu <davyu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2731026
(cherry picked from commit e320ac551bf5f713674ed40ff9f63edd2985b09c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2767188
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2947781
Reviewed-by: svcacv <svcacv@nvidia.com>
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:25:27 -07:00
Shubhi Garg
0acac0ee77 regulator: max77851: add max77851 regulator driver
Bug 200749982

Change-Id: I8bbc914b7aa93058e4ec116fb3eb5b6d3eb74606
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2595372
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946283
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:22 -07:00
Akhil R
3006e5b42f mfd: max77851: Enter SLEEP on suspend based on DT
Add option to disable entry to SLEEP when system is suspended.
There are systems where SW_SLP is not necessary on system suspend
as it could be managed differently. Provide an option not to enter
SLEEP state during suspend for such systems.

Bug 3643699

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Change-Id: I1600d0d053a15e18c7419a377962b76845bb92b5
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2712396
(cherry picked from commit a83d4b50fdef4af7a9360224cad0357672bbd380)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2717492
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938654
Reviewed-by: svcacv <svcacv@nvidia.com>
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:25:17 -07:00
Shubhi Garg
1ab8a495fc mfd: add max77851 pmic MFD driver
Adding MAX77851 MFD driver provided by Maxim.
 - fix android warning/error for uninitialized variable return

Bug 200749982

Change-Id: I6ef82a6c06fe7bbd4df2c71991ec6c5c15e28474
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-5.10/+/2591158
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938653
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-14 13:25:12 -07:00
Jon Hunter
cdc64f43fa drivers: Drop version check for DMA BUF namespace
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>
2023-09-13 22:21:25 -07:00
Ankur Pawar
f4b8e44a5e media: i2c: camera cert-c and coverity fixes
Cert-C fixes in camera ar1335, imx219 and imx477 driver.

Cert-C
CID:566165
CID:566166
CID:566168
CID:566169
CID:566170
CID:566171
CID:683423
CID:566021

Coverity
CID:10179834

Bug 3959323

Change-Id: Id68deab8051206b6eae3da917d83c32365186fc5
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2939548
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-13 22:21:06 -07:00
Jon Hunter
1212fd6023 scripts: Add copyright/license for conftest
The conftest script and Makefile are distributed as part of the
'open-gpu-kernel-modules' project [0]. These files don't have a explicit
copyright and license appended to the file, but per the COPYING file for
the files are licensed as MIT. Add the copyright and MIT license header
to the conftest files.

[0] https://github.com/NVIDIA/open-gpu-kernel-modules

Bug 4119327

Change-Id: I3f5dd44a4a8475a943660589432ebdf67ac3b255
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978871
Reviewed-by: svc-sw-mobile-l4t <svc-sw-mobile-l4t@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-12 22:14:21 -07:00
Anubhav Rai
ed8e05adbf vi5: capture descritor seq in gang mode
capture descriptor sequence in gang mode
should be followed for each vi channel
individually.

bug 4266018

Change-Id: Ic438cc5a46c501b3c7e97bd6f62f8552350f6527
Signed-off-by: Anubhav Rai <arai@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2972827
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-12 22:12:09 -07:00
Jon Hunter
214beca091 drivers: Add compilation flag for iosys-map.h
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>
2023-09-12 22:12:04 -07:00
Jon Hunter
b3b4cf6f51 debug: display-dts: Remove driver
The driver added to display the DT node name during boot is not being
used and so let's remove this driver. This is needed in the future for
debug it should be added under the test kernel modules.

Bug 3860578

Change-Id: Ief34ff4e33ab3094629c61e7051da6c1cb960fbe
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913270
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-12 22:11:54 -07:00
Timo Alho
320dee5c7d clk: tegra: fix error return case for recalc_rate
tegra-bpmp clocks driver makes implicit conversion of signed error
code to unsigned value in recalc_rate operation. The behavior for
recalc_rate, according to it's specification, should be that "If the
driver cannot figure out a rate for this clock, it must return 0."

Bug 3640397
Bug 4090576

Signed-off-by: Timo Alho <talho@nvidia.com>
Change-Id: I96cfbe466351fde035e0de6aeae1b9e6d929cec4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-stable/+/2975580
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977080
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-11 14:07:05 -07:00
Chris Dragan
97835cded8 misc: mods: update copyright header
Bug 4165184

Change-Id: Id5d570cc4e5c3364d696271b1333e47e02e17b9e
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976924
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-11 14:06:17 -07:00
Shardar Mohammed
4be2dd36bb nvidia-oot: remove module * from class_create()
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>
2023-09-08 18:09:50 -07:00
Chris Dragan
a7810cdbac misc: mods: update from Perforce to 4.21
Bug 4165184

Change-Id: I6b548008b21024d8e322c5a1ca1f98fbc5b389a2
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2975467
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-07 18:56:15 -07:00
Mahesh Kumar
4ded4286d6 platform: dce: prevent dce driver unloading
DCE-KMD driver does not support reloading of the driver today.
Support will be added in the future.

As a WAR this patch prevents unloading of the driver.

Bug 4239420

Change-Id: I29f60fbaaf99f5f4e22f75b6674bd1a543b83c1a
Signed-off-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2968906
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Vinod Atyam <vatyam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Vinod Atyam <vatyam@nvidia.com>
2023-09-06 17:05:13 -07:00
Johnny Liu
837b275df5 drm/tegra: Resume device frequency with Fmax
Avoid using suspend_freq to set the Fmax for the device, since it will
re-enable the actmon watermark interrupts again if the suspend_freq is
not zero in the devfreq_suspend_device call.

Since we want to make sure device is running at Fmax but avoid using
suspend_freq, we can forcelly override the resume_freq with the
scaling_max_freq to reach the same effect.

Bug 4271562

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ia19a7ef9de14643abf1b174b6180e40a847de132
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974074
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-06 12:05:33 -07:00
Ketan Patil
ebf51c43ae video: tegra: nvmap: Add more checks to avoid races
Add more checks in nvmap code so as to avoid any possible races.
- Update is_nvmap_id_ro and is_nvmap_dmabuf_fd_ro functions so that they
return error value during error conditions and also update their callers
to handle those error values.
- Move all trace statements from end of the function to before handle
refcount or dup count is decremented, this make sure we are not
dereferencing any freed handle/reference/dambuf.
- Increment ref's dup count wherever we feel data race is possible, and
decrement it accordingly towards end of function.

Bug 4253911

Change-Id: I50fc7cc98ebbf3c50025bc2f9ca32882138fb272
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2972602
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-06 11:58:16 -07:00
Revanth Kumar Uppala
7a01b01e88 nvethernet: Resolve "Wframe-larger-than" warning
-Use dynamic structure pointer to eliminate
"Wframe-larger-than" warning.

-Modify "-Wframe-larger-than" flag from 4096 bytes to 2048 bytes

Bug 4213870

Change-Id: I9dc3df951290415ce587b1fe2440ee52dd985b62
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954775
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-06 05:20:02 -07:00
Jon Hunter
2360391866 scripts: Add conftest.sh support
The script conftest.sh can be used at build time to determine which
kernel headers or versions of kernel functions/macros are present in the
kernel that drivers are being compiled against. This is useful for cases
where changes are backported from upstream Linux kernels that may change
kernel functions and so we can no longer rely on the kernel version to
indicate which version of the kernel function to use.

The conftest.h header file is a top-level header file that includes all
the header files that are generated by the conftest.sh script. This
header file can be included by drivers so that they can use the various
definitions that are generated by conftest.sh. This file is located
along with the conftest.sh script because this is copied to the output
directory where all the generated header files are placed.

Bug 4119327
Bug 4228080

Change-Id: I781884e359e9688640661548620e01a178debac9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974065
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-09-05 23:08:03 -07:00
Sheetal Tigadoli
514af0686d drivers:nvpps: skip PTP_TSC sync config if disable in DT
skip PTP_TSC sync config if disable in DT.

Bug 4044583
Bug 3896607

Change-Id: I5eccb2d2cf14aefbca792c935aeec407716db5ba
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2877072
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-05 10:43:37 -07:00
Sheetal Tigadoli
0f58bdf322 Documentation: bindings: define DT prop to disable PTP TSC sync logic
define DT prop to disable PTP TSC sync logic

Bug 4044583
Bug 3896607

Change-Id: I51778db4bd4203589c48bf5b3bdb0d49547fec55
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2877071
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-05 10:43:31 -07:00
Sheetal Tigadoli
182768fd7b drivers:nvpps: Add nvpps k5.10 updates to k5.15
Add nvpps k5.10 updates to k5.15

Bug 3896607

Change-Id: Id9614ca9329804ae81d3d60e2f8647191208d2b6
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2877070
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-05 10:43:26 -07:00
Sheetal Tigadoli
61586ca1df Documentation:binding:nvpps: Add nvpps documentation
Add nvpps documentation for dt binding

Bug 3896607

Change-Id: I238424db9152539f24f0544de8be320701215bfd
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2877069
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-05 10:43:20 -07:00
Johnny Liu
8b99f1f5b8 drm/tegra: Set static Fmax for suspend frequency
The suspend_freq is a fixed value for devfreq core, while the
resume_freq will be changed dynamically based on the last previous
updated frequency value of the device.

When device is put into suspend mode, devfreq core will update the
resume frequency with the suspend frequency. Therefore, when the device
is resumed back again, it will run at suspend_freq.

Forcelly set the suspend_freq as Fmax so that device will run at Fmax
when it is resumed back.

Bug 4269900

Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ic6511613ae5d02831a66dd1c2a93f21c142bf3a7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2973229
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-05 03:46:11 -07:00