Commit Graph
1459366 Commits
Author SHA1 Message Date
Aaron Kling 9e066aa60a HACK: Revert "UPSTREAM: drm/nouveau: select FW caching"
This reverts commit cf4c97db94.

Commit knowingly breaks building the nouveau module. As the issue only
affects full gsp devices, revert to keep builds going.
https://patchwork.freedesktop.org/patch/635827/#comment_1165994

Change-Id: I67d544b433f4a2dc047ed07088eda73466594cc6
2026-08-22 16:55:13 -05:00
Venkat Reddy Talla 71e3e94861 regulator: max77812: add max77812 regulator driver
Adding regulator driver for MAX77812 device which is
used in t210b01 based platforms for powering cpu,gpu
and dram io

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 16:55:13 -05:00
Aaron Kling 249af64b93 power: supply: bq24190_charger: Support usb role switching
Change-Id: Ia1e650f15ae55bb0972612b378d093a20d8a8a98
2026-08-22 16:55:13 -05:00
Aaron Kling 87a623ba79 power: supply: bq24190_charger: Export current regulator
Change-Id: I3958896da66740d503aec5ed93e14a7d743a43ac
2026-08-22 16:55:13 -05:00
Aaron Kling b4b5ddc195 memory: tegra210-emc: Support Device Tree EMC Tables
These are generated by the Tegra210 Android bootloader. This is similar
to the Tegra124 handling, so the support is based on that and modified
to match Tegra210 by referencing the downstream Nvidia 4.9 kernel.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 16:55:13 -05:00
Aaron Kling 1168324549 arm64: tegra: Add EMC timings to P2180
These entries are imported from the downstream Nvidia Linux4Tegra
kernel. They are expected to be updated with the trained values by the
bootloader. This is done by the Nvidia Android bootloader, which is
different from the handling by the Nvidia Linux bootloader which places
these values in a reserved memory location. P2180 is supported by both
bootloaders, so lets support initializing emc on both.

It should be noted that the bootloader will not create these nodes in
the kernel dtb if they do not exist. It will only set in place existing
properties.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 16:55:13 -05:00
Aaron Kling 17dc25fde0 WIP: drm/tegra: Add devfreq support to media engines
TODO: Better limit frequency count

Change-Id: If86527dc4985d9afd9d510430d1f3c137ca7f220
2026-08-22 16:55:12 -05:00
Aaron Kling 6665fa0e0e drm/tegra: Support Tegra186+ in NVJPG
Change-Id: I7bf2c200d4ad9690c4f21a004ecc6dea8065f93e
2026-08-22 16:55:12 -05:00
Aaron Kling e2b7c0d630 drm/tegra: Add NVENC driver
Add support for booting and using NVENC on Tegra210+ to the Host1x
and TegraDRM drivers. This driver only supports the new TegraDRM uAPI.

Change-Id: I07e1386604d7638ba43381c3f289688d7c5cb12b
2026-08-22 16:55:12 -05:00
Aaron Kling f107dd13fc arm64: tegra: Add tegra210 p2523
Change-Id: I0922c192477436ecb3f509c1cc1ce8b0f3e6f391
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 16:55:12 -05:00
Aaron Kling 5f4c18cff4 arm64: tegra: Add support for NVIDIA Shield TV 2015
Add initial device-tree support for NVIDIA Shield TV (a.k.a. Foster)
based upon Tegra210 SoC with 3 GiB of LPDDR4 RAM. It is based on P2571.

Change-Id: Ideeeb15f835ebf7f7617d3989908d245aff4b316
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling 706902a2c8 arm64: tegra: Enable sd card on P2571
Change-Id: I2320654ef9fc15dad901b516bd22379329e5ab88
2026-08-22 11:35:35 -05:00
Aaron Kling 5c071bf1e5 arm64: tegra: Enable HDA controller on P2571
The HDA controller can be used for audio playback over HDMI.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling cd3c3cf242 arm64: tegra: Enable HDMI on P2571
Add regulators and enable the host1x nodes necessary to attain video
output via hdmi.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling 647f86bba1 arm64: tegra: Enable DFLL clock on P2530
Using pwm regulator

Change-Id: Id41340bcfc4e12df74b579ec34e61ebba857d81c
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling 437e4a400b arm64: tegra: Enable XUSB controller on P2571
Enable the XUSB controller on P2571. One of the USB 3.0 lanes goes to an
internal ethernet interface, while two other USB 3.0 lanes support the
the USB-A receptacles on the I/O board.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling 7c3cd07474 arm64: tegra: Enable PWM fan on P2571
This is based on 6f78a94, which enabled added the fan and thermal zones
for the Jetson Nano Devkit. The fan and thermal characteristics of the
two devices are similar, so using the same configuration.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling bb93b387d4 arm64: tegra: Add power supplies to emmc on P2530
Change-Id: I3ddf282a9a4cf7b407897f8e7af073c1852704b7
2026-08-22 11:35:35 -05:00
Aaron Kling 81d1dce523 arm64: tegra: Add Wifi node for P2530
The p2530 som has a BCM4354 module with wifi on sdio.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling f486fc5941 arm64: tegra: Wire up Bluetooth for P2530
The p2530 som contains a BCM4354 module with bluetooth on uart.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling 3ab48113d2 arm64: tegra: Enable gpu on P2530
This adds the gpu regulator and enables the gpu node.

Change-Id: I8a0f580fa600d8f37fb3fa497cf657abf2905d5f
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:35 -05:00
Aaron Kling ba6ce716c5 arm64: tegra: Add PMIC support on P2530
Based on the p2180 pmic config, modified to match p2530

Change-Id: Ic7baa787b8e9633da72622a4562258860c05fca6
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling a7e6c6791e arm64: tegra: Enable CPU idle support for P2530
Enable CPU idle support for the P2530 module

Change-Id: Ia73f192b3450fe9c143fbaaea03d6a50527927a7
2026-08-22 11:35:34 -05:00
Aaron Kling 2a5e63e580 arm64: tegra: Add P2530 SC7 timings
Same as 106f7a0 and 47b4e12. Without these, the pmc driver locks up
during boot.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 0ac45d0c32 dt-bindings: tegra: Document SHIELD TV 2015
The SHIELD TV 2015 is a consumer media Android device that is based on
P2571

Change-Id: Ib981728d277f7daca812223ec3534d98555d43a1
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 7d1c80a51c arm64: tegra: Enable bluetooth on P3310
The p3310 som contains a BCM4354 module with bluetooth on uart.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling b00eb938cb arm64: tegra: Enable wifi on P3310
The p3310 som has a BCM4354 module with wifi on sdio.

Change-Id: Ie4b42165fb81a129a7afe58c1c632261d13eca53
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling eb678f0a0d arm64: tegra: Fix ldo5 voltage on P3310
This appears to be a typo. The voltage input to the wireless module is
expected to be 1.8V-3.3V, per the downstream device tree.

Fixes: 02df3f03a8 ("arm64: tegra: Add initial power tree for P3310")
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 04b2767faa arm64: tegra: Add CPU OPP tables for Tegra194
Add OPP table and interconnects property to scale DDR frequency with
CPU frequency for better performance. Each operating point entry of
the OPP table has CPU freq to per MC channel bandwidth mapping.
One table is added for each cluster even though the table data is
same because the bandwidth request is per cluster. This is done
because the OPP framework creates a single icc path and hence single
bandwidth request if the table is marked as 'opp-shared' and shared
among all clusters. For us, the OPP table data is same but the MC
Client ID argument to interconnects property is different for each
cluster. So, having per cluster tables makes different icc paths for
each cluster and helps to make per cluster BW requests.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling df06f3327d arm64: tegra: Add CPU OPP tables for Tegra186
Add OPP table and interconnects property to scale DDR frequency with
CPU frequency for better performance. Each operating point entry of
the OPP table has CPU freq to per MC channel bandwidth mapping. One
table is added for each cluster because the different cpu types have
different scaling curves.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 68b9da0d69 memory: tegra194: Support icc scaling
Add Interconnect framework support to dynamically set the DRAM
bandwidth from different clients. The MC driver is added as an ICC
provider and the EMC driver is already a provider.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling e1700d2895 memory: tegra186: Support icc scaling
Add Interconnect framework support to dynamically set the DRAM
bandwidth from different clients. The MC driver is added as an ICC
provider and the EMC driver is already a provider.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 979ef9969f memory: tegra186-emc: Support non-bpmp icc scaling
This adds support for dynamic frequency scaling of external memory on
devices with bpmp firmware that does not support bwmgr.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:34 -05:00
Aaron Kling 0b691900f2 memory: tegra186-emc: Register rates with opp
This will be used in the upcoming non-bpmp icc support, which will use
the common tegra emc rate support which uses the opp framework.

Change-Id: If4a3efaae0ad06de029ffd34c2b11faea5044d58
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling fd1455c178 dt-bindings: memory: tegra194-mc: Add dummy client IDs for Tegra194
Add ICC IDs for dummy software clients representing CCPLEX clusters.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling 4633bb55f6 dt-bindings: memory: tegra186-mc: Add dummy client IDs for Tegra186
Add ICC IDs for dummy software clients representing CCPLEX clusters.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling 8fb5c8bd3e arm64: tegra: Fix P2371 pcie lane assignments
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling f4efe632f0 arm64: tegra: Enable interconnect for MC and EMC on Tegra210
These are being referenced by actmon, but are not currently enabled.

Fixes: 654427e0b9 ("arm64: tegra: Add OPP tables on Tegra210")
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling 99603f7dff memory: tegra210: Support interconnect framework
This makes mc and emc interconnect providers and allows for dynamic
memory clock scaling.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Mikko Perttunen 7297c37213 memory: tegra: Deduplicate rate request management code
As is, the EMC drivers for each 32-bit platform contain almost
identical duplicated code for aggregating rate requests. Move this
code out to a shared tegra-emc-common file to reduce duplication,
and add kerneldoc comments.

Based on code from the tegra20-emc driver.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Link: https://patch.msgid.link/20260501-memory-refactor-v3-1-69fb1ae1a7ca@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-08-22 11:35:33 -05:00
Aaron Kling 167dcb6d3d arm64: tegra: Enable mmu on Tegra194 display controllers
These use a separate mmu instance compared to everything else currently
enabled for the soc.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling 10be68dc0b Revert "arm64: tegra: Disable ISO SMMU for Tegra194"
This reverts commit ebea268ea5.

Mmu is now being enabled for the display controllers.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
2026-08-22 11:35:33 -05:00
Aaron Kling 8364f53f1e drm/tegra: Enable cmu for Tegra186 and Tegra194
Without the cmu, nvdisplay will display colors that are notably darker
than intended. The vendor bootloader and the downstream display driver
enable the cmu and sets a sRGB table. Loading that table here results in
the intended colors.

Co-developed-by: Kurt Kiefer <kekiefer@gmail.com>
Signed-off-by: Kurt Kiefer <kekiefer@gmail.com>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Tested-by: Jasper Korten <jja2000@gmail.com>
2026-08-22 11:35:33 -05:00
Hung-Chun Tseng 19466c7172 ANDROID: binder: fix kernel-doc for struct binder_priority
The member list of struct binder_priority is missing the colon kernel-doc
needs to associate a line with a member, so neither @sched_policy nor @prio
is picked up as a description.

This has been wrong since the block was introduced together with the struct
in "ANDROID: binder: add support for RT prio inheritance."  That commit was
merged on experimental/android-4.19-staging and the block has been carried
forward across branches since, so there is no commit in android-mainline
history to point a Fixes: tag at. The same commit spelled @sched_policy:
correctly in the binder_node block just above, which suggests the missing
colons here were a typo rather than a convention.

struct binder_priority is ANDROID-only and does not exist upstream, so there
is nothing to send to mainline for this.

scripts/kernel-doc -none drivers/android/binder_internal.h reports two
warnings for binder_priority before this change and none after it. The
remaining warnings in this file are also present in mainline and are left
alone here.

No functional change.

Change-Id: Id475f34170682b465e270a0ffa359f8bbd1b641f
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
2026-08-20 09:58:09 -07:00
Hung-Chun Tseng ff645d863b ANDROID: dma-heap: document the return values of the exported helpers
dma_heap_find(), dma_heap_buffer_alloc() and dma_heap_bufferfd_alloc() all
have a documented parameter list but no Return: section, so kernel-doc has
nothing to say about what a caller gets back.

Documentation/doc-guide/kernel-doc.rst asks for a Return: section on
functions that return a value, and scripts/kernel-doc -none -Wall
include/linux/dma-heap.h reports three "No description found for return
value" warnings before this change and none after it. The default warning
level is unaffected: the file is clean there both before and after.

The wording follows what the implementations in drivers/dma-buf/dma-heap.c
actually do:

  dma_heap_find()          returns the heap, or NULL when the name is not
                           registered
  dma_heap_buffer_alloc()  returns a dma_buf, or an ERR_PTR() on failure
  dma_heap_bufferfd_alloc() returns an fd, or a negative errno on failure

All three helpers are ANDROID-only and do not exist upstream, so there is
nothing to send to mainline for this.

No functional change.

Change-Id: I9b8aa342cdda421af018171ec96f1257d8dbd5bc
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
2026-08-19 08:06:58 +08:00
Mayank Rungta db2acc01b7 ANDROID: mm: Make dump_tasks() safe in NMI context
dump_tasks() can be called from NMI context to dump memory status of all
tasks. However, calling from NMI context has safety issues:
1. find_lock_task_mm() acquires task_lock(t) using spin_lock(), which
   is not NMI-safe and can deadlock if alloc_lock is held when NMI fires.
2. mem_cgroup_scan_tasks() traverses memcg structures and takes locks
   that are not NMI-safe.

Fix these by:
- Using spin_trylock(&t->alloc_lock) in find_lock_task_mm() when in_nmi().
- Returning early if a memcg oom dump is requested in NMI context.

Fixes: 4df28ddcd9 ("ANDROID: mm: export dump_tasks symbol.")
Bug: 538262381
Change-Id: I8b79213015fde74b81427d44f122296c5e0edaf9
Signed-off-by: Mayank Rungta <mrungta@google.com>
2026-08-14 09:44:08 -07:00
Zyta Szpak 9b89b2c771 ANDROID: kconfig: Enable option needed for MTK desktop
MTK_TIMER is selected by ARCH_MEDIATEK. The commit enables
it in order to not alter the core when we enable
CONFIG_ARCH_MEDIATEK in vendor fragment.
It is also not directly settable due to visibility
condition "if COMPILE_TEST" not met thus selecting
it as a hidden config.

The GKI_HIDDEN_MTK_CONFIGS is enabled if ARM64 since
it is only applicable to Mediatek devices.

Bug: 432487220
Bug: 532940853
Bug: 545953895

Change-Id: Iac562e539063a59f3988e87a151251eb7554f964
Signed-off-by: Zyta Szpak <zyta@google.com>
(cherry picked from commit a79d348482)
(cherry picked from commit bcb75c47c8566960be30d9c3cf14f8b5bbf4d49a)
2026-08-13 03:48:39 -07:00
Henry Dong b4d3ec1582 ANDROID: mm: support __GFP_NORETRY in __alloc_contig_verify_gfp_mask
Currently, __alloc_contig_verify_gfp_mask() rejects __GFP_NORETRY because
it is not in the allowed action_mask. This causes cma_alloc() calls that
pass __GFP_NORETRY to fail immediately during mask verification in
alloc_contig_range().

Support __GFP_NORETRY by adding it to the allowed action_mask and
cc_action_mask. Furthermore, adjust the construction of gfp_cc_mask
so that if the caller explicitly requested __GFP_NORETRY, we respect
it and do not force __GFP_RETRY_MAYFAIL, avoiding conflicting retry
directives for the underlying migration/compaction.

This allows cma_alloc() with __GFP_NORETRY to fail quickly when the
range cannot be allocated, rather than retrying heavily or failing
immediately due to invalid GFP flags.

Bug: 519847597
Test: Local build and flash verification
Change-Id: I1bee0b838ac957d08a24358d100d20b8ef7babeb
Signed-off-by: Minchan Kim <minchan@google.com>
Signed-off-by: Henry Dong <donghenry@google.com>
2026-08-11 21:33:30 -07:00
Todd Kjos 4fa3c1db38 ANDROID: netfilter: xt_quota2: fix UAF in q2_get_counter error path
In q2_get_counter(), a new counter entry is added to counter_list
and counter_list_lock is released before proc_create_data() is
invoked. During this window, another thread can locate the counter
in counter_list and increment its reference count via
atomic_inc(&e->ref).

If proc_create_data() subsequently fails, the error handling path
previously called list_del() and kfree() unconditionally, ignoring
the refcount. If another thread acquired a reference in the interim,
this resulted in a Use-After-Free (UAF) condition.

Fix this by using atomic_dec_and_test(&e->ref) under
counter_list_lock when proc_create_data() fails. Only remove from
counter_list and free the memory if the refcount reaches zero. If
another thread holds a reference, set procfs_entry to NULL and
leave the counter intact for the surviving thread.

Fixes: 2e134f75ce91 ("ANDROID: netfilter: xt_quota2: add quota2 from xtables-addons")
Bug: 499166786

Change-Id: I1270d6d94ec0bd6a83858ad053434dae0393b7e3
Signed-off-by: Todd Kjos <tkjos@google.com>
2026-08-11 13:34:02 -07:00
T.J. Mercier b209fee2f5 ANDROID: Enable CONFIG_CGROUP_FAVOR_DYNMODS
favordynmods prioritizes cgroup writes over reads. Before commit
0568f89d4f ("cgroup: replace global percpu_rwsem with per threadgroup
resem when writing to cgroup.procs") first introduced in the 6.18
kernel, this effectively meant replacing the percpu_rwsem fast path with
a global lock (percpu_rwsem slowpath) for readers to allow speeding up
writers. This forced all fork()s and exit()s globally down the slow
path. After commit 0568f89d4f that is no longer the case, and the
write side of the lock is much more narrow at per-threadgroup scope
instead of global, drastically reducing contention.

So we want to use favordynmods only on kernels that have commit
0568f89d4f. A runtime check for the presence of commit 0568f89d4f is
possible, but awkward and potentially slow depending on how it's done. A
better alternative is to simply enable CONFIG_CGROUP_FAVOR_DYNMODS on
kernels where we know commit 0568f89d4f is present.

Bug: 543503146
Change-Id: I511223793adeab7263635895a467a15258086a23
Signed-off-by: T.J. Mercier <tjmercier@google.com>
2026-08-07 14:09:57 -07:00