Commit Graph

4524 Commits

Author SHA1 Message Date
Rakibul Hassan
77a8c8c156 platform: tegra: rtcpu: ivc bus check null
Add a check before dereferencing pointer.

Bug 5597251

Change-Id: Ied1bc79ad631a44bbf9f00f497cfc6e85a62a579
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3480970
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Akihiro Mizusawa <amizusawa@nvidia.com>
2025-11-17 00:29:40 -08:00
Shaofu
e7201ee607 fix driver get Association fail with FT-SAE
WLAN_AKM_SUITE_FT_OVER_SAE(0x000FAC09) is not processed in
rtw_cfg80211_set_key_mgt, which makes rtw_ft_validate_akm_type not set
RTW_FT_PEER_EN to ft_flags, and thus MDIE is not built in
rtw_ft_build_assoc_req_ies

Fix:
- Add WLAN_AKM_SUITE_FT_OVER_SAE into rtw_cfg80211_set_key_mgt check condition
- Add 9 into rtw_ft_valid_akm check condition
- Update driver version number to 277-9-6

Bug 5580277

Change-Id: I7cc987a9141dc65577dc20e804e92def10e9412e
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485741
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
2025-11-10 12:57:08 -08:00
Narayana Reddy P
422ec5c90a Update the revision numbers to 277-9-5
Bug 5578305

Change-Id: I3047c5d8c786afec34bee1f02b7f21128afbc70c
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485453
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-11-07 10:58:01 -08:00
Shaofu
1b4312e37b Fixed redundant association requests when WPA3 SAE H2E authentication fails
Bug 5578305

Change-Id: I495c2311bc79b84df1a367fa9c7b89c90888ec45
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485390
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2025-11-07 10:57:56 -08:00
Shaofu
188f83f47a Fixed 802.11r OTD roaming failure
Bug 5578305

Change-Id: I8db3a30e3830423212c334a9f4c8b7efdde1d480
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485386
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
2025-11-07 10:57:51 -08:00
Shaofu
cd8063b7e1 Fixed issue where 6 GHz hidden APs could not be found on non-PSC channels
Bug 5578305

Change-Id: Ia0479d756cd64fd2a60ff563c22fdc5194954420
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485380
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2025-11-07 10:57:46 -08:00
Shaofu
fef3efa9d1 Ensure disconnect indication after roam command failure
Bug 5578305

Change-Id: I2f8caaa18b3220285182f30774d6246dd4557cca
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485374
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-11-07 10:57:41 -08:00
Shaofu
5f08e6dabd If ROAM CMD (wpa_cli roam), do scan if bssid not found even in busy traffic
Bug 5578305

Change-Id: I92c794dee4c3a6a01589c05570eb227f0e2730dd
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485372
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-11-07 10:57:36 -08:00
Shobek Attupurath
56fe2c567d rtl8852ce: Add Nvidia changes to driver v277-9
- Reduce log level
- Remove unwanted prints
- Add Nvidia sourcetree path

Bug 5504994

Change-Id: I243236f586b0ee62161d7a4dbca5660c29c3b8b3
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3473468
Tested-by: Narayana Reddy P <narayanr@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-11-06 21:17:19 -08:00
Narayana Reddy P
4efcfaf97c rtl8852ce: realtek driver update to 277-9
----------------------------------
rtl8852ce release notes for Nvidia
----------------------------------

v1.19.16_nv-277-9-0-g3c314be22.20251020_Certified_Module
- same as v1.19.16_nv-277-9-g3c314be22.20250903_Certified_Module_beta
- just remove "beta" string for formal release

==================================================================
v1.19.16_nv-277-9-1-gc6d0f2e20.20251015_Certified_Module_beta
* If ROAM CMD (wpa_cli roam), do scan if bssid not found even in busy traffic

Tested:
- simple connection test: PASS
- wpa_cli roam command is work and show prev_bssid in log: PASS

==================================================================
v1.19.16_nv-277-14-ga7d65c4a9.20251002_Certified_Module_beta
* fix the deauth reason 7 caused by roaming racing
* downgrade the fwstate debug level

==================================================================
v1.19.16_nv-277-12-g1a8402802.20250926_Certified_Module_beta
* add fwstate debug log

==================================================================
v1.19.16_nv-277-11-g3b6c1d36e.20250925_Certified_Module_beta
* default enable ACS and RSSI debug
* add reauth and reassoc timeout config via insmod or /proc/

==================================================================

Bug 5504994

Change-Id: I3ecd41fdb28de12bf6e37d9dfaca5c7f40e2fe1d
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3473467
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-11-06 21:17:13 -08:00
Revanth Kumar Uppala
d25418285d r8126: Fix system crash during shutdown
During system shutdown, a kernel crash could occur because the r8126
driver's tally counter update routine (`rtl8126_dump_tally_counter`)
was still accessing PCIe address space after the device was already
stopped or powered down.

To prevent this, introduce a new driver flag `R8126_FLAG_SHUTDOWN`
that is set in `rtl8126_shutdown()`. This flag is checked
now before accessing tally counters, ensuring no further
crash during shutdown.

Bug 5620576

Change-Id: I2bb74fc52e712198bfe15b109a2136dc8a2affcd
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3482325
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Tested-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
2025-11-04 10:11:55 -08:00
Manish Bhardwaj
e3f7b0f173 nvidia-oot: remove tegra_hv_ivc_convert_cookie API
tegra_hv_ivc_convert_cookie API is not being used
and is there lying as dead code.

Bug 5433066

Change-Id: I8036cb5e398bcc3fb720ff3afbea92e350d441a0
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3440189
(cherry picked from commit 8560fc5c340ae63e39169aca3beb02dbf229e9bc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3448411
(cherry picked from commit 2c8771c90e44da8d423fc1896ff277343c06647b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3480666
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-10-31 10:42:10 -07:00
robelin
7f93fd77a5 platform: tegra: bwmgr: Improve resource management to avoid leak
The previous implementation doesn't release the resource in a few
cases, which can lead to leakage. Improving error handling and resource
cleanup when the driver is removed.

Bug 5483386

Change-Id: I316879075808ea945ebac997728aa51ff8b69488
Signed-off-by: robelin <robelin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3474021
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
2025-10-29 22:38:10 -07:00
Revanth Kumar Uppala
9831027796 nvethernet: Support both DT flags to maintain backward compatibility
In the previous release for T264 platforms,the restart lane bringup
logic was controlled through the device tree flag
'nvidia,pcs-rx-eq-sw-ovrd'.
In incremental releases, the flag has been renamed
'nvidia,force-restart-lane-bringup'.

To maintain backward compatibility with older device trees,
the driver now checks for both flags.If either flag is present,
restart lane bringup is executed.

The legacy flag 'nvidia,pcs-rx-eq-sw-ovrd' is deprecated.

Bug 5017313

Change-Id: I24040f508ef776e29a0bb0c1f07d4a74fa4cc8cc
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3471233
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-24 16:27:28 -07:00
Ketan Patil
a530fa20f8 video: tegra: nvmap: Define nth_page
In Linux v6.18, commit 84efbefa26df ("mm: remove nth_page()") removes
the nth_page macro and this breaks the build for NVMAP. Define the
nth_page macro if it is not defined in the kernel to fix the build.

Bug 5566555
Bug 5215421

Change-Id: Iaa6bcd2204e4c1ab59516bb7353a71f3ec6e19c4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3449760
(cherry picked from commit c0db792d335d8525821d3aac16e64506e84bf4c2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3475136
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-23 07:12:06 -07:00
Johnny Liu
d7466525c8 platform: tegra: bwmgr: support error handling
When BWMGR is unavailable, BWMGR could be either unsupported and
disabled in BPMP firmware.

For unsupported state, MRQ_BWMGR_INT is not available to use.

For disabled state, MRQ_BWMGR_INT is available but sending any
MRQ_BWMGR_INT request will just get -BPMP_NODEV error code.

Add error handling logic to make min_freq and max_freq devfreq sysfs
nodes as read-only but still expose devfreq nodes, such as
available_frequencies, min_freq, and max_freq, to allow user space
apps to read information from.

Bug 5555075

Change-Id: Id7c2695765d3dfee148a0d1bc1f7b0552fe4b343
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3467128
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-20 12:11:55 -07:00
Johnny Liu
bf60517305 drivers: pva: enable profiling when it is active
Bug 5467846

Change-Id: Iad35078b05e0dbfa5ac638a718b1a900fd054d9e
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3465128
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nan Wang <nanwa@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
2025-10-15 11:27:03 -07:00
Asha Talambedu
eb29d03e62 nvadsp: Fix UBSAN array-index-out-of-bounds in msgq
Replace struct hack pattern with flexible array members in msgq_t
and msgq_message_t to resolve UBSAN warnings.

The message queue implementation was using the old "struct hack"
pattern with single-element arrays (int32_t queue[1] and
int32_t payload[1]) to create variable-length structures. While
functionally correct, this triggers UBSAN array-index-out-of-bounds
errors when accessing elements beyond index 0, even though the
memory is properly allocated.

UBSAN errors observed:
- msgq.c:64: index 2045 out of range for type 'int32_t [1]'
- msgq.c:69: index 153 out of range for type 'int32_t [1]'
- msgq.c:124: index 53 out of range for type 'int32_t [1]'
- msgq.c:148: index 53 out of range for type 'int32_t [1]'
- msgq.c:149: index 2045 out of range for type 'int32_t [1]'

Changes:
1. Convert queue[1] to queue[] in msgq_t structure
2. Convert payload[1] to payload[] in msgq_message_t structure
3. Update MSGQ_HEADER_SIZE and MSGQ_MESSAGE_HEADER_SIZE macros
   to use sizeof() directly, as flexible array members have zero
   size and cannot be used with sizeof()

The flexible array member (FAM) approach is:
- C99 standard compliant
- Linux kernel best practice for variable-length structures
- Binary compatible with the previous implementation
- Eliminates UBSAN false positives without functional changes

Bug 4831393

Change-Id: I243d4a1b1f091bf17cfc10337e75dbd1b878042f
Signed-off-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3464624
Reviewed-by: Mohan kumar <mkumard@nvidia.com>
Reviewed-by: Viswanath L <viswanathl@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-15 04:42:29 -07:00
Shubhi Garg
12c09aa934 net: can: mttcan: split 8Mbps for 40MHz and 50MHz
The MTTCAN controller uses different core clock frequencies depending on
the SoC variant: 40MHz for T264 and 50MHz for T194/T234. The 8Mbps data
bitrate needs to be an exact divisor of the clock frequency for proper
operation.

For 40MHz clock: 8Mbps = 8000000 bps (40MHz / 5)
For 50MHz clock: 8Mbps = 8333333 bps (50MHz / 6)

The previous single MTTCAN_SPEED_8MBPS definition (8333333) only worked
correctly for 50MHz clocks and would not divide evenly for 40MHz clocks.

Split MTTCAN_SPEED_8MBPS into two separate defines:
- MTTCAN_SPEED_8MBPS_40MHZ: 8000000 for exact 8Mbps on 40MHz clock
- MTTCAN_SPEED_8MBPS_50MHZ: 8333333 for closest 8Mbps on 50MHz clock

Both values use the same production settings (prod_c_can_8m) and will be
selected based on the chip's configured clock frequency. The 5Mbps rate
remains unchanged as it divides evenly for both clock frequencies.

Bug 5497458

Change-Id: I17190ae6821f89d33e76114f20b91dbd65ba25f2
Signed-off-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3469194
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Kevin Fu <chunhuaif@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-10-15 01:28:10 -07:00
Jon Hunter
0242b95056 PCI: tegra264: Fix RP off support
We cannot use enum definitions in '#if defined()' statements because the
'#if defined()' is a preprocessor macro that is evaluated prior to
compilation. Fix this by adding a test to conftest to detect if
CMD_PCIE_RP_CONTROLLER_OFF is defined.

Bug 5551652

Change-Id: I71826a58e428f1a335e8e0d895f25f3cea46a65e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3467641
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Prakhar Srivastava (SW-TEGRA) <prasrivastav@nvidia.com>
2025-10-13 17:57:26 -07:00
Ankur Pawar
9ee2b01686 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/+/3463848
Tested-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Jerry Chang <jerchang@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
rel-38_eng_2025-10-06
2025-10-07 09:27:06 -07:00
Jon Hunter
76bdc9f5b6 net: can: mttcan: Fix build for Linux v6.17
In Linux v6.17, the 'const' qualifier for the 'struct cyclecounter'
argument on of the cyclecounter 'read' function pointer was dropped.
Add a test to conftest to detect this and update the Tegra MTT CAN
driver accordingly to fix the build.

Bug 5420210

Change-Id: Idff1429bbf45fe160e16a6dbc51e8cb00909a876
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423831
(cherry picked from commit 10569f9bbea4fc8172a94b8d5c5190fc2687b199)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462468
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-02 10:14:18 -07:00
Jon Hunter
9976ac1020 net: can: mttcan: Drop support for legacy kernels
Drop support for Linux kernel prior to v5.15 because these are no longer
supported.

Bug 5420210

Change-Id: I659c71f11d4c8996a35c952e0c6b27d7b7dcf239
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423848
(cherry picked from commit f236f1fbd9d5d7b1886fc3abfa83719da1996772)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462467
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-02 10:14:07 -07:00
Jon Hunter
a5bb404485 virt: tegra: Fix build for Linux v6.17
Upstream commit fc2898ea793a ("workqueue: Remove unused
work_on_cpu_safe") removed the 'work_on_cpu_safe()' function for Linux
v6.17. Fix this by open coding the 'work_on_cpu_safe()' in the Tegra HV
CPU Yield driver.

Bug 5420210

Change-Id: I3110554839853be9a906063d479539543394acbd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423830
(cherry picked from commit 97075404a16dc4f9d66147ae4b15a04526978e0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462466
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:14:02 -07:00
Jon Hunter
74171df1a4 platform: tegra: uss-io-proxy: Migrate to GPIOD
Upstream commit a55893133830 ("gpiolib: Remove unused
devm_gpio_request()") removed the devm_gpio_request() function and this
breaks the Tegra USS IO Proxy driver. The devm_gpiod_get() function has
been supported in the Linux kernel since v4.3 and now that the legacy
GPIO functions are being removed, migrate the Tegra USS IO Proxy driver
over to using GPIO descriptors.

Bug 4387902
Bug 5420210

Change-Id: I0c62977dc4ec829e14f105babdd08bbd64113fa2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423827
(cherry picked from commit e4572a5ff434f778178b1dfb39b4c1cf7923db6d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462463
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:13:50 -07:00
Jon Hunter
d814c113bb drm/tegra: Fix build for Linux v6.17
The arguments to the function drm_helper_mode_fill_fb_struct() and
function pointer fb_create() have been updated in the Linux v6.17. Add
the necessary conftest tests to check for the new variants of these
functions and update the Tegra DRM driver accordingly.

Bug 5420210

Change-Id: Ie1470df199d154d3f94f5f7773dcc1ba138e23da
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3423828
(cherry picked from commit dde42d012e4187e798d5d7c3cfa974f49059d0a1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462462
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-02 10:13:45 -07:00
Jon Hunter
2800fd5f4b drivers: Fix gpio_chip '.set' callback for v6.17
In Linux v6.17, the gpio_chip structure's '.set' callback function was
updated to return an integer. Add a test to conftest to detect this and
update the necessary drivers accordingly.

Bug 5483854

Change-Id: Ie48a50775885a06c8aa23ddb72fdbc73361ab92b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3440815
(cherry picked from commit 5dc88266853f0c5fbc7dd925187f63c2b6560a4b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461855
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-02 10:13:34 -07:00
Jon Hunter
c2fd2c3c66 misc: bluedroid_pm: Ensure 'host_wake' is configured
Currently the wakeup source is configured if only the 'ext_wake' is
valid. However, the bluedroid_pm_timer and proc interface that are
configured when 'ext_wake' is valid, also assumes that 'host_wake' is
also valid. Therefore, update the code to only configure the
bluedroid_pm_timer and proc interface if both of these are valid.

Bug 4958861

Change-Id: I16ef55359c36acc9dc50464f43816ae2ef3c3123
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3397252
(cherry picked from commit b1e18d66aa0ab6d491b88caac5fa9abddb69d0e4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462461
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:13:17 -07:00
Jon Hunter
432f3748e0 misc: bluedroid_pm: Free proc on failure
If the call to wakeup_source_register() fails during probe, then the
'proc' interface is not freed. Ensure that this is freed as expected.

JIRA LINQPJ14-60

Change-Id: I188be2998429c1ada6ccdf765791367e61735359
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3397251
(cherry picked from commit a0f0bebe2a2a54b87f91b1812c22bbd14470a61c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461888
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:13:12 -07:00
Jon Hunter
7c70fbf0cf misc: bluedroid_pm: Verify wakeup registration
The structure returned from the function wakeup_source_register() is not
currently checked to see that a valid structure is returned. If
wakeup_source_register fails to register the wake-up source, then this
function will return a NULL pointer and this will lead to a crash when
defereferencing this pointer. Therefore, check that a valid structure is
returned from wakeup_source_register() and if not then return an error
from the probe function.

JIRA LINQPJ14-60
Bug 4958861

Change-Id: I03356700ab03d6c25080b3806ea8b7da3983a302
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3394894
(cherry picked from commit 14286052fb9dd496b243221fa1066f828451b294)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3405519
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:13:06 -07:00
Jon Hunter
8407ab4b3e misc: bluedroid_pm: Fix optional GPIOs
The function devm_gpiod_get_optional() will return an error code encoded
as a pointer type if the GPIO requested is not found. Therefore, we need
to use the IS_ERR() macro to determine if the GPIO is valid, otherwise
we could incorrectly attempt to dereference an invalid pointer. This bug
was introduced when migrating the bluedroid driver to use the gpiod
functions.

Bug 4387902
Bug 4958861

Change-Id: Ib9e7494c92226454d93506c2c0d4c80bd6a7493c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3397231
(cherry picked from commit b461fa1a87f9beb5faa1dc917956603430b12df7)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3405518
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-02 10:13:01 -07:00
Bruce Xu
74cc0f56f2 misc: bluedroid: remove duplicate timer declaration
There are 2 timer defined. One statically and one in the
bluedroid_pm_data struct. Both timers call the same function on expiration. In the case of the statically defined timer this is a problem because it assumes that the timer is part of the bluedroid_pm_data and so calling timer_container_of() or from_timer() results in an invalid pointer and hence kernel panic. Fix this by
removing the statically defined timer.

Bug 4958861

Change-Id: I08f9dc3a032f84ca3350fbec5fb97062da8d6795
Signed-off-by: Bruce Xu <brucex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3400991
(cherry picked from commit 61490c6a2a65e24068cd33a92d8730260ad83f95)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3405517
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-02 10:12:56 -07:00
Jon Hunter
50c387ecf9 nvmap: Remove dma_buf_ops flag cache_sgt_mapping
The dma_buf_ops flag 'cache_sgt_mapping' has been removed in Linux
v6.16. Although NVMAP has its own caching and so it should be possible
to simply drop this flag, some tests are failing. For now add a test to
conftest to detect if this flag is present and update the NVMAP driver
accordingly.

Bug 5215421

Change-Id: I382d5c62fd550254d387abd1a21e5a1c5cda3a6e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3384177
(cherry picked from commit 326b31912bf1da7de0a5340826ec1fdaf084c11e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461885
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-01 15:28:54 -07:00
Jon Hunter
e004561637 drm/tegra: Update to Linux v6.16-rc1
Update the Tegra DRM driver to Linux v6.16-rc1. In Linux v6.16-rc1, the
drm_dp_link_power_up/down functions were moved from the Tegra DRM driver
into the main DRM code. Conftest is used to detect this change and the
appropriate updates are made to the Tegra DRM driver.

JIRA LINQPJ14-60

Change-Id: Id5449b22e8eda5ee70eb6aed09ce627e63e7722e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375214
(cherry picked from commit f8adc0c950eb4905d397b6e1d8e524b856945f0e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461883
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-01 15:28:42 -07:00
Jon Hunter
da9c8f46c4 virt: hvc_sysfs: Fix build for Linux v6.16
In Linux v6.16, the 'bin_attribute' argument to the 'read' and 'write'
function pointers of the 'bin_attribute' structure was made const. Add a
test to conftest to detect this and update the Tegra HVC SYSFS driver
accordingly.

JIRA LINQPJ14-60

Change-Id: I74b88bc0d1ed55eca1565386b38d16ff65626132
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375213
(cherry picked from commit fef581cb0bac2d1468a710927771be9fa027f6e0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461880
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-01 15:28:30 -07:00
Jon Hunter
e48b52cbba net: marvell: oak: Fix build for Linux v6.16
In Linux v6.16, the 'index' member of the 'page' structure was renamed
to '__folio_index'. Add a test to conftest to detect this and update the
Marvell OAK ethernet driver accordingly to fix the build for Linux
v6.16.

JIRA LINQPJ14-60

Change-Id: I64a8e60990ea03eb212e79bfde474cd87efdf064
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375190
(cherry picked from commit 5b61fa9366558e7567dc6b432059e581f347ca1a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461879
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-01 15:28:17 -07:00
Jon Hunter
66ab02d7b9 misc: bluedroid_pm: Use wakeup_source_register/unregister
In Linux v6.16, commit 142ba31d8b4a ("PM: wakeup: Do not expose 4 device
wakeup source APIs") made the wakeup_source_add/destroy internal
functions. Instead of using wakeup_source_add/destroy, use
wakeup_source_register/unregister which internally call
wakeup_source_add/destroy and have been supported since Linux v2.6.x
kernels.

JIRA LINQPJ14-60

Change-Id: I6c471677876192e8985c8c336f95184564618c8a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3375073
(cherry picked from commit 8118ce4f4df7513d26ca3d0150cfa2104e969d35)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461877
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-10-01 15:28:05 -07:00
Jon Hunter
eaa2a1abe1 media: camera: cdi-mgr: Simplify i2c_board_info init
In Linux v6.16, the 'of_node' structure was removed from the
'i2c_board_info' structure and the 'cdi-mgr' driver fails to build.
Although it is possible to detect whether the 'i2c_board_info' structure
has the 'of_node' structure using conftest, the 'cdi-mgr' driver does
not even use this. Therefore, it is simpler to fix this by using memset
and strncpy to initialize the 'i2c_board_info' structure and this also
aligns the camera 'cdi-mgr' driver with the camera 'isc-mgr' driver that
initializes the 'i2c_board_info' structure in this way.

JIRA LINQPJ14-60

Change-Id: I1d9df0fb1ccea3d303f256f65d187a131b7352ad
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3374654
(cherry picked from commit 30cad15a2e832ad445003911a76627fb18f91b49)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461876
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-01 15:27:53 -07:00
Jon Hunter
594c03645c net: can: mttcan: Fix build for Linux v6.16
In Linux v6.16, the structure 'data_bittiming_params' was added to the
'can_priv' structure and all the related data bittiming parameters were
moved under this new structure. Add a test to conftest to determine if
this new structure is present and update the Tegra MTTCAN driver
accordingly.

JIRA LINQPJ14-60

Change-Id: Ibd8f6bd81a903b15a55d837023dada835a1e72ca
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3374645
(cherry picked from commit 86396ec47b78a7716a5faa8d492d74efc7f23dce)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461874
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-01 15:27:48 -07:00
Jon Hunter
96cae7f9de drivers: Fix from_timer() for Linux v6.16
In Linux v6.16, commit 41cb08555c41 ("treewide, timers: Rename
from_timer() to timer_container_of()") renamed 'from_timer()' to
'timer_container_of()'. Given that this is a macro we can simplfy see if
the macro 'timer_container_of' is defined and if so use this otherwise
fall back to 'from_timer()'. Update the necessary drivers to fix the
build for Linux v6.16.

JIRA LINQPJ14-60

Change-Id: I7f622b5d046a92da2ade755e6a697c1810f61275
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3383387
(cherry picked from commit 320ec84efd492c0c2711c69104fabc30b4f15ecb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461850
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-10-01 15:27:42 -07:00
Jon Hunter
a3097907b3 platform: tegra: bwmgr: Fix debug macro build
When NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined the build
fails and the following errors are seen ...

 drivers/platform/tegra/tegra-bpmp-bwmgr.c:101:12: error:
  ‘tegra_bpmp_bwmgr_devfreq_target’ defined but not used
  [-Werror=unused-function]
  101 | static int tegra_bpmp_bwmgr_devfreq_target(struct device *dev,
                                       unsigned long *freq, u32 flags)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/platform/tegra/tegra-bpmp-bwmgr.c:37:12: error:
  ‘tegra_bpmp_bwmgr_max_freq_notifier’ defined but not used
  [-Werror=unused-function]
   37 | static int tegra_bpmp_bwmgr_max_freq_notifier(struct
                  notifier_block *nb, unsigned long action, void *ptr)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by ensuring the above functions are not defined if
NV_TEGRA264_BWMGR_DEBUG_MACRO_PRESENT is not defined.

Bug 5483386
Bug 5196455

Change-Id: Ie2b069d163a32220c95ffaba217ddea3686ba92b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461865
Reviewed-by: Johnny Liu <johnliu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-01 12:56:56 -07:00
Johnny Liu
099e5e1cd7 platform: tegra: introduce bwmgr kernel driver
This driver exposes EMC frequency control interface to user space via
linux devfreq framework.

Users could change EMC frequency to the frequency value from the
available frequencies of EMC clock:

$ /sys/class/devfreq/bwmgr# cat available_frequencies
665600000 2750000000 3200000000 4266000000

and update the EMC floor frequency by writing into the min_freq QoS
sysfs node:

$ /sys/class/devfreq/bwmgr# echo 4266000000 > min_freq

and update the EMC max frequency by writing into the max_rate QoS
sysfs node to cap the EMC frequency:

$ /sys/class/devfreq/bwmgr# echo 4266000000 > max_freq

This driver does not directly manage the EMC clock rate. Instead it
just delivers the min/max frequency information to BPMP, and BPMP is
still the only entity that has the full control of EMC and other
related memory clocks.

Bug 5483386
Bug 5196455

Change-Id: I6124eeb7411a13bde5c51582064534063abca8d3
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453755
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rajkumar Kasirajan <rkasirajan@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-09-29 21:42:51 -07:00
Jaiyash Agrawal
b6fa67fca1 DCE-KMD: Add header support and use bytes written
Parse header info stored at beginning of buffer to retrieve log buffer
info and use bytes written to print the data depending on if encoding is
enabled or not.

JIRA TDS-17441

Change-Id: I99119be05ddda5c5354ba39497a0e471305863e1
Signed-off-by: Jaiyash Agrawal <jaiyasha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3436761
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3448848
2025-09-29 13:12:50 -07:00
Shobek Attupurath
1c3b3fa89b rtl8852ce: Add Nvidia changes to driver v126-16
- Reduce log level
- Remove unwanted prints
- Add Nvidia sourcetree path

Bug 5422314
Bug 5226667

Change-Id: Iad03a6f70c039c40c785ffeaf44f389b2a666318
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3450867
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Narayana Reddy P <narayanr@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
2025-09-29 04:28:09 -07:00
Narayana Reddy P
232b194aec rtl8852ce: realtek driver update to v126-16
----------------------------------
rtl8852ce release notes for Nvidia
----------------------------------

v1.19.16_nv-126-16-gbf1934e39.20250910_Certified_Module_beta
* fix scan issue in roaming test

==================================================================
v1.19.16_nv-126-15-ge5204803f.20250827_Certified_Module_beta
* Fix bug of 802.11d CC scan mechanism
[Description]
The 11d CC scan result may sometimes be overwritten by other scans.

==================================================================
v1.19.16_nv-126-14-g196875f8d.20250821_Certified_Module_beta
* fix 6G MBSSID disconnect problem
[Description]
Fix the issue where RSSI was not updated in non-transmitted BSSID, which could
cause disconnection due to incorrect RSSI values.

==================================================================

v1.19.16_nv-126-13-g7a2b96406.20250813_Certified_Module_beta
* fix 6G Enhanced open mode not work
[Description]
(1) Parse capabilities in MBSSID
    e.g. Vendor Specific OUI WMM IE
         Non-Inheritance IE
(2) Handle MBSSID sets
(3) Adjust MAX IE size from 768 to 1840 defined in WIFI Alliance

Bug 5422314
Bug 5226667

Change-Id: I63802c34fdc6e189566843d11992ff64b8e404fa
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3450784
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-09-29 04:28:03 -07:00
Ketan Patil
5ef68aa58f 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/+/3447073
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-09-22 16:27:22 -07:00
Ketan Patil
858d73775a 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/+/3447072
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Ajay Nandakumar Mannargudi <anandakumarm@nvidia.com>
2025-09-22 16:27:17 -07:00
Jon Hunter
6b6d1e009a camera-diagnostics: Fix missing release function
The camera-diagnostic driver is missing a release function for the IVC
channel device that it is creating. This causes the following WARNING to
be observed when probing the camera-diagnostic driver fails ...

 ------------[ cut here ]------------
 Device 'camera-diag' does not have a release() function, it is broken
 and must be fixed. See Documentation/core-api/kobject.rst.
 WARNING: CPU: 8 PID: 756 at drivers/base/core.c:2517 device_release+0x88/0xa8
 ...
 Call trace:
  device_release+0x88/0xa8
  kobject_put+0xac/0x150
  put_device+0x14/0x34
  __mod_of__camera_diag_of_match_device_table+0x602514/0x6033a0
   [camera_diagnostics]
  tegra_ivc_bus_boot_sync+0x204/0x28c [ivc_bus]
  really_probe+0x150/0x2c8
  __driver_probe_device+0x78/0x134
  driver_probe_device+0x3c/0x164
  __driver_attach+0x98/0x1c4
  bus_for_each_dev+0x7c/0xf4
  driver_attach+0x24/0x38
  bus_add_driver+0xec/0x218
  driver_register+0x5c/0x13c
  tegra_ivc_driver_register+0x10/0x1c [ivc_bus]
  init_module+0x18/0x1000
  [camera_diagnostics]
  do_one_initcall+0x58/0x318
  do_init_module+0x58/0x1ec
  load_module+0x1f04/0x2000
  init_module_from_file+0x88/0xd4
  __arm64_sys_finit_module+0x148/0x330
  invoke_syscall+0x48/0x134
  el0_svc_common.constprop.0+0x40/0xf0
  do_el0_svc+0x1c/0x30
  el0_svc+0x30/0xb8
  el0t_64_sync_handler+0x130/0x13c
  el0t_64_sync+0x194/0x198
 ---[ end trace 0000000000000000 ]---

Ideally we would use the 'tegra_ivc_channel_release()' function as the
release function but because the camera-diagnostic driver does not call
'tegra_ivc_channel_create()' to create the channel and does not actually
need to free any memory, simply define a new empty function that can be
called.

Bug 5489551

Change-Id: I6a7de9893af0167409af79599b61faf005047b0e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3443095
(cherry picked from commit f75c0f228ca4f1a4c17266cb97be2db63b25a592)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3453753
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-09-17 18:56:57 -07:00
Manikanta Maddireddy
8e2a32d25d PCI: tegra264: Add interconnect support
Add interconnect support to set PCIe bandwidth.

Bug 4775460
Bug 5407169

Change-Id: I7e0cbe6a391eb1d25795e39d9711f12ab1d8535e
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3420338
(cherry picked from commit 5b004c01f21a7f16613a29ee977471f970265577)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3444597
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-09-07 21:57:26 -07:00
Jerry Chang
c6da597514 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/+/3403484
(cherry picked from commit f7d53151d1ed7536f9c920a5f3b1ad54f9d8fe32)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3443797
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
2025-09-06 08:26:58 -07:00