809837 Commits

Author SHA1 Message Date
Pranav Vashi
7555dcc7b6 Merge pull request #14 from sticpaper/16.0
xiaomi nabu device touchpanel changes
2026-01-04 20:06:30 +05:30
Fuutao
aa11f01121 drivers: nt36523: register game_mode into common touchpanel
Change-Id: I12213afefda3f8695dc3b0a308de21648d9bc9bb
2026-01-04 21:39:03 +08:00
stic-server-open
7c8b9e64de drivers: tp_common: create game_mode into touchpanel node
Change-Id: I0b5d2ba62a9f85b2f946797e66529c67dd4be8d3
2026-01-04 21:15:18 +08:00
stic-server-open
4c6b3e53c2 firmware: Import xiaomi nabu-r-oss nt36523 original touch firmware
* Since the new touchpanel firmware version only compatible with stylus
  and enhances screen anti-mistouch suppression, it causes abnormal touch
  interruptions when playing some games. Therefore, has been added back
  to the original nabu-r-oss ( MIUI 12.5 ) touchpanel firmware.

Change-Id: Icb50f711651b0f09af0a83ccc0b95ab86f55eed9
2026-01-04 21:04:17 +08:00
stic-server-open
e43f9fe03b drivers: nt36523: Disable NVT_TOUCH_ESD_PROTECT Feature
* When using the new touchpanel firmware, applying certain screen
  protectors may cause screen touch issues due to frequent ESD checks.
  xiaomi has disable this feature into Xiaomi Pad 6 (pipa) nt36532

Change-Id: Ib5f24c6cfb5237bc0efa58a32088e6c872d63f37
2026-01-04 20:52:25 +08:00
Kanishk
d3ad462391 f2fs: Lower reclaim segment and threshold
• Xiaomi's default segment reclamation (4096), along with that of other OEMs, is designed for MIUI, HyperOS's, and other $hit stocks roms.
  heavy I/O patterns (background services, frequent writes).
  For AOSP: 1. Lower Overhead: Smaller Garbage Collection (GC) batches
               reduce CPU/storage load.
            2. Better Responsiveness: Avoid long GC pauses during light
               usage.
            3. Battery Savings: Less aggressive reclaiming reduces
               power spikes.

Change-Id: 710531a8b778ce9bc190b87ffe22fa3a52e51499
Signed-off-by: Kanishk <kanishkthederp@gmail.com>
Signed-off-by: TogoFire <togofire@mailfence.com>
2026-01-04 11:55:52 +05:30
Thomas Turner
0e736d1388 netfilter: conntrack: Make nf_ct_protos store const l4proto pointers
Needed for newer clang versions.

Change-Id: I7e9de21eb8de5e56404dec43f5e5de31148c9eb0
2026-01-04 11:55:52 +05:30
Will Deacon
38e99137cb UPSTREAM: netfilter: Avoid assigning 'const' pointer to non-const pointer
nf_remove_net_hook() uses WRITE_ONCE() to assign a 'const' pointer to a
'non-const' pointer. Cleanups to the implementation of WRITE_ONCE() mean
that this will give rise to a compiler warning, just like a plain old
assignment would do:

  | In file included from ./include/linux/export.h:43,
  |                  from ./include/linux/linkage.h:7,
  |                  from ./include/linux/kernel.h:8,
  |                  from net/netfilter/core.c:9:
  | net/netfilter/core.c: In function ‘nf_remove_net_hook’:
  | ./include/linux/compiler.h:216:30: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  |   *(volatile typeof(x) *)&(x) = (val);  \
  |                               ^
  | net/netfilter/core.c:379:3: note: in expansion of macro ‘WRITE_ONCE’
  |    WRITE_ONCE(orig_ops[i], &dummy_ops);
  |    ^~~~~~~~~~

Follow the pattern used elsewhere in this file and add a cast to 'void *'
to squash the warning.

Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ib55b2ace01d4a3fa4228778f0bc86e89d68e372a
Signed-off-by: Will Deacon <will@kernel.org>
2026-01-04 11:55:52 +05:30
Nathan Chancellor
6069d576ac UPSTREAM: kbuild: Disable -Wdefault-const-init-unsafe
A new on by default warning in clang [1] aims to flags instances where
const variables without static or thread local storage or const members
in aggregate types are not initialized because it can lead to an
indeterminate value. This is quite noisy for the kernel due to
instances originating from header files such as:

  drivers/gpu/drm/i915/gt/intel_ring.h:62:2: error: default initialization of an object of type 'typeof (ring->size)' (aka 'const unsigned int') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
     62 |         typecheck(typeof(ring->size), next);
        |         ^
  include/linux/typecheck.h:10:9: note: expanded from macro 'typecheck'
     10 | ({      type __dummy; \
        |              ^

  include/net/ip.h:478:14: error: default initialization of an object of type 'typeof (rt->dst.expires)' (aka 'const unsigned long') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
    478 |                 if (mtu && time_before(jiffies, rt->dst.expires))
        |                            ^
  include/linux/jiffies.h:138:26: note: expanded from macro 'time_before'
    138 | #define time_before(a,b)        time_after(b,a)
        |                                 ^
  include/linux/jiffies.h:128:3: note: expanded from macro 'time_after'
    128 |         (typecheck(unsigned long, a) && \
        |          ^
  include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck'
     11 |         typeof(x) __dummy2; \
        |                   ^

  include/linux/list.h:409:27: warning: default initialization of an object of type 'union (unnamed union at include/linux/list.h:409:27)' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe]
    409 |         struct list_head *next = smp_load_acquire(&head->next);
        |                                  ^
  include/asm-generic/barrier.h:176:29: note: expanded from macro 'smp_load_acquire'
    176 | #define smp_load_acquire(p) __smp_load_acquire(p)
        |                             ^
  arch/arm64/include/asm/barrier.h:164:59: note: expanded from macro '__smp_load_acquire'
    164 |         union { __unqual_scalar_typeof(*p) __val; char __c[1]; } __u;   \
        |                                                                  ^
  include/linux/list.h:409:27: note: member '__val' declared 'const' here

  crypto/scatterwalk.c:66:22: error: default initialization of an object of type 'struct scatter_walk' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
     66 |         struct scatter_walk walk;
        |                             ^
  include/crypto/algapi.h:112:15: note: member 'addr' declared 'const' here
    112 |                 void *const addr;
        |                             ^

  fs/hugetlbfs/inode.c:733:24: error: default initialization of an object of type 'struct vm_area_struct' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
    733 |         struct vm_area_struct pseudo_vma;
        |                               ^
  include/linux/mm_types.h:803:20: note: member 'vm_flags' declared 'const' here
    803 |                 const vm_flags_t vm_flags;
        |                                  ^

Silencing the instances from typecheck.h is difficult because '= {}' is
not available in older but supported compilers and '= {0}' would cause
warnings about a literal 0 being treated as NULL. While it might be
possible to come up with a local hack to silence the warning for
clang-21+, it may not be worth it since -Wuninitialized will still
trigger if an uninitialized const variable is actually used.

In all audited cases of the "field" variant of the warning, the members
are either not used in the particular call path, modified through other
means such as memset() / memcpy() because the containing object is not
const, or are within a union with other non-const members.

Since this warning does not appear to have a high signal to noise ratio,
just disable it.

Cc: stable@vger.kernel.org
Link: 576161cb60 [1]
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/CA+G9fYuNjKcxFKS_MKPRuga32XbndkLGcY-PVuoSwzv6VWbY=w@mail.gmail.com/
Reported-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2088
Change-Id: Ibca67d259577cfa2d39c6237dbcff6c8ff6a176e
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2026-01-04 11:55:52 +05:30
Will Deacon
9f2fb399ab UPSTREAM: READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
The implementations of {READ,WRITE}_ONCE() suffer from a significant
amount of indirection and complexity due to a historic GCC bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145

which was originally worked around by 230fa253df ("kernel: Provide
READ_ONCE and ASSIGN_ONCE").

Since GCC 4.8 is fairly vintage at this point and we emit a warning if
we detect it during the build, return {READ,WRITE}_ONCE() to their former
glory with an implementation that is easier to understand and, crucially,
more amenable to optimisation. A side effect of this simplification is
that WRITE_ONCE() no longer returns a value, but nobody seems to be
relying on that and the new behaviour is aligned with smp_store_release().

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Change-Id: I15d15e61577164e22aa215b9405d24491bd92b93
Signed-off-by: Will Deacon <will@kernel.org>
2026-01-04 11:55:52 +05:30
Neill Kapron
627db36ed3 UPSTREAM: ANDROID: bpf: do not fail to load if log is full
Upstream commit 973c7a0d8a38 ("bpf: fix precision backtracking
instruction iteration") slightly changes the logic in the verifier which
results in the verifier log growing. This results in the log being too
small when loading the filterPowerSupplyEvents BPF program in Android,
and therefore causing the program loading to fail. Because this
program is labeled 'critical', a load failure forces a boot loop.

This BPF program exists on the vendor partition, and therefore we must
maintain the GRF/ treble boundary and modify the kernel logic.

The kernel's bpf log logic is refactored in the 6.4 kernel and
acknowledges the shortcomings of the existing approach which causes the
program load to fail. Instead of backporting the significant changes,
this change simply ignores the fact that the log is full.

For more information see commit 121664093803 ("bpf: Switch BPF verifier
log to be a rotating log by default")

Bug: 432207940
Bug: 433641053
Test: verify pixel 6 boots on a 5.10 kernel including commit 973c7a0d8a38
Change-Id: I35c3d2074dd9b39e44bfdbaf66fa56ec917df0a6
Signed-off-by: Neill Kapron <nkapron@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2026-01-04 11:55:52 +05:30
Daniel Mentz
257fc94aa2 BACKPORT: ANDROID: Disable kthread delayed work fp check in CFI builds
With non-canonical CFI, LLVM generates jump table entries for external
symbols in modules and as a result, a function pointer passed from a
module to the core kernel will have a different address.

Disable the warning for now.

Bug: 145210207
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: I576a07206a465902773481e51a84529f0ac2e84b
2026-01-04 11:55:52 +05:30
Mayank Grover
81e236915d BACKPORT: ANDROID: modules: cfi cleanup for module load failure
Cleanup cfi shadow for failure in module loading,
to avoid causing warnings.

Bug: 172542186
Change-Id: I1de7ffa7d884c8e46891b8bbc8196ec0d2cef0d6
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
2026-01-04 11:55:52 +05:30
Harshit Jain
9f46eb21d2 dts: display: redo dimensions for 2nd panel
Same as: 913a8afad0

Signed-off-by: Harshit Jain <reach@harsh1998.dev>
2026-01-04 11:55:52 +05:30
Faris
c3afaf3fc1 kernelsu: pkg_observer: Add backward compatibility
Co-authored-by: TwinbornPlate75 <42514046+TwinbornPlate75@users.noreply.github.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
pershoot
b99173a043 kernelsu: replace renameat hook with fsnotify
* kernel: replace renameat hook with fsnotify

* kernel: fix compile

* kernel: fix compile below 6.0

---------

Co-authored-by: weishu <twsxtd@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Rifat Azad
be2b595fda kernelsu: implement v2_signature size/hash override from userspace through kernel module parameter
- /sys/module/kernelsu/parameters/expected_manager_*

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Pranav Vashi
115db6ff46 kernelsu: Allow compatible manager apks
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
sidex15
551f00bdc2 kernelsu: implement susfs v1.5.12
This is a modfied version of susfs v1.5.12 for n3x7g3n kernel

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
sidex15
1219b14df9 fs: implement susfs v1.5.12
- This is a heavily modified version of susfs v1.5.12
- It does not comply with the upstream offical susfs v1.5.12
- sus_mount functionality still remain in v1.5.5 as backporting it to the latest version will result a mount detection leak in some apps/detectors
- Increase susfs_open_redirect UID limit to <11000
- susfs magic mount support is still implemented and enabled
- sus_map is implemented and complied with the upstream v1.5.12 codebase

This commit requires a bunch of backports commits from v4.19 and v5.x to make sus_map working:

0a8cbf3725edbacc5f1ead33eeae7e4d78823b5a proc: less memory for /proc/*/map_files readdir
37ae2444584654f6785f2cc49181f05af788c9b2 mm: smaps: split PSS into components
49a5115e11350ee68f6a5fbd56b3e817bf9e5aac fs/task_mmu: add pkeys header
6f94042bed51121f8f28a5e572cda20c21fed2e1 mm/pkeys: Add an empty arch_pkeys_enabled()
bbd5aec12b32097a71dc6a0097194a18f3ee9a17 mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h
849ca8ce954d9dbb082dcf83c98af861e98e5635 mm: /proc/pid/smaps_rollup: convert to single value seq_file
6071a482c8e603be25895cc2cac5f0eab61c4051 mm: /proc/pid/smaps: factor out common stats printing
03fd2fbe9c40da8128cec5c69ef54755c0f38c6c mm: /proc/pid/smaps: factor out mem stats gathering
95f8be4c8a86a491a1c2ac9bfe470aef9e1baa8f mm: /proc/pid/*maps remove is_pid and related wrappers
27956d255e3b012372951dd6131e07c106d2daae procfs: add seq_put_hex_ll to speed up /proc/pid/maps
7f2847d02cdc4491b5ee6d4a0043854cbd6c7a1a proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps

For KernelSU side patches for this commit you need the sidex15's KernelSU-Next fork:
https://github.com/sidex15/KernelSU-Next/tree/n3x7g3n-kernel

Or if you want to patch on your own here's the commit patch of susfs in the KernelSU-Next:
13b1dfd6e2

Co-authored-by: simonpunk <simonpunk2016@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Alexey Dobriyan
22d95a657d proc: less memory for /proc/*/map_files readdir
dentry name can be evaluated later, right before calling into VFS.

Also, spend less time under ->mmap_sem.

Link: http://lkml.kernel.org/r/20171110163034.GA2534@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Luigi Semenzato
1a83991b7c mm: smaps: split PSS into components
Report separate components (anon, file, and shmem) for PSS in
smaps_rollup.

This helps understand and tune the memory manager behavior in consumer
devices, particularly mobile devices.  Many of them (e.g.  chromebooks and
Android-based devices) use zram for anon memory, and perform disk reads
for discarded file pages.  The difference in latency is large (e.g.
reading a single page from SSD is 30 times slower than decompressing a
zram page on one popular device), thus it is useful to know how much of
the PSS is anon vs.  file.

All the information is already present in /proc/pid/smaps, but much more
expensive to obtain because of the large size of that procfs entry.

This patch also removes a small code duplication in smaps_account, which
would have gotten worse otherwise.

Also updated Documentation/filesystems/proc.txt (the smaps section was a
bit stale, and I added a smaps_rollup section) and
Documentation/ABI/testing/procfs-smaps_rollup.

[semenzato@chromium.org: v5]
  Link: http://lkml.kernel.org/r/20190626234333.44608-1-semenzato@chromium.org
Link: http://lkml.kernel.org/r/20190626180429.174569-1-semenzato@chromium.org
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Acked-by: Yu Zhao <yuzhao@chromium.org>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Yu Zhao <yuzhao@chromium.org>
Cc: Brian Geffon <bgeffon@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
sidex15
3a4367259c fs/task_mmu: add pkeys header
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Michael Ellerman
ea0b8e1b57 mm/pkeys: Add an empty arch_pkeys_enabled()
Add an empty arch_pkeys_enabled() in linux/pkeys.h for the
CONFIG_ARCH_HAS_PKEYS=n case.

Split out of a patch by Ram Pai <linuxram@us.ibm.com>.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Michael Ellerman
b559e6c69f mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h
Consolidate the pkey handling by providing a common empty definition
of vma_pkey() in pkeys.h when CONFIG_ARCH_HAS_PKEYS=n.

This also removes another entanglement of pkeys.h and
asm/mmu_context.h.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Vlastimil Babka
1af9890e34 mm: /proc/pid/smaps_rollup: convert to single value seq_file
The /proc/pid/smaps_rollup file is currently implemented via the
m_start/m_next/m_stop seq_file iterators shared with the other maps files,
that iterate over vma's.  However, the rollup file doesn't print anything
for each vma, only accumulate the stats.

There are some issues with the current code as reported in [1] - the
accumulated stats can get skewed if seq_file start()/stop() op is called
multiple times, if show() is called multiple times, and after seeks to
non-zero position.

Patch [1] fixed those within existing design, but I believe it is
fundamentally wrong to expose the vma iterators to the seq_file mechanism
when smaps_rollup shows logically a single set of values for the whole
address space.

This patch thus refactors the code to provide a single "value" at offset
0, with vma iteration to gather the stats done internally.  This fixes the
situations where results are skewed, and simplifies the code, especially
in show_smap(), at the expense of somewhat less code reuse.

[1] https://marc.info/?l=linux-mm&m=151927723128134&w=2

[vbabka@suse.c: use seq_file infrastructure]
  Link: http://lkml.kernel.org/r/bf4525b0-fd5b-4c4c-2cb3-adee3dd95a48@suse.cz
Link: http://lkml.kernel.org/r/20180723111933.15443-5-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Daniel Colascione <dancol@google.com>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:52 +05:30
Vlastimil Babka
93b0969b71 mm: /proc/pid/smaps: factor out common stats printing
To prepare for handling /proc/pid/smaps_rollup differently from
/proc/pid/smaps factor out from show_smap() printing the parts of output
that are common for both variants, which is the bulk of the gathered
memory stats.

[vbabka@suse.cz: add const, per Alexey]
  Link: http://lkml.kernel.org/r/b45f319f-cd04-337b-37f8-77f99786aa8a@suse.cz
Link: http://lkml.kernel.org/r/20180723111933.15443-4-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Daniel Colascione <dancol@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Vlastimil Babka
7dbf2de9b8 mm: /proc/pid/smaps: factor out mem stats gathering
To prepare for handling /proc/pid/smaps_rollup differently from
/proc/pid/smaps factor out vma mem stats gathering from show_smap() - it
will be used by both.

Link: http://lkml.kernel.org/r/20180723111933.15443-3-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Daniel Colascione <dancol@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Vlastimil Babka
1b91b3aa80 mm: /proc/pid/*maps remove is_pid and related wrappers
Patch series "cleanups and refactor of /proc/pid/smaps*".

The recent regression in /proc/pid/smaps made me look more into the code.
Especially the issues with smaps_rollup reported in [1] as explained in
Patch 4, which fixes them by refactoring the code.  Patches 2 and 3 are
preparations for that.  Patch 1 is me realizing that there's a lot of
boilerplate left from times where we tried (unsuccessfuly) to mark thread
stacks in the output.

Originally I had also plans to rework the translation from
/proc/pid/*maps* file offsets to the internal structures.  Now the offset
means "vma number", which is not really stable (vma's can come and go
between read() calls) and there's an extra caching of last vma's address.
My idea was that offsets would be interpreted directly as addresses, which
would also allow meaningful seeks (see the ugly seek_to_smaps_entry() in
tools/testing/selftests/vm/mlock2.h).  However loff_t is (signed) long
long so that might be insufficient somewhere for the unsigned long
addresses.

So the result is fixed issues with skewed /proc/pid/smaps_rollup results,
simpler smaps code, and a lot of unused code removed.

[1] https://marc.info/?l=linux-mm&m=151927723128134&w=2

This patch (of 4):

Commit b76437579d ("procfs: mark thread stack correctly in
proc/<pid>/maps") introduced differences between /proc/PID/maps and
/proc/PID/task/TID/maps to mark thread stacks properly, and this was
also done for smaps and numa_maps.  However it didn't work properly and
was ultimately removed by commit b18cb64ead ("fs/proc: Stop trying to
report thread stacks").

Now the is_pid parameter for the related show_*() functions is unused
and we can remove it together with wrapper functions and ops structures
that differ for PID and TID cases only in this parameter.

Link: http://lkml.kernel.org/r/20180723111933.15443-2-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Daniel Colascione <dancol@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Andrei Vagin
0d91b5fa04 procfs: add seq_put_hex_ll to speed up /proc/pid/maps
seq_put_hex_ll() prints a number in hexadecimal notation and works
faster than seq_printf().

== test.py
  num = 0
  with open("/proc/1/maps") as f:
          while num < 10000 :
                  data = f.read()
                  f.seek(0, 0)
                 num = num + 1
==

== Before patch ==
  $  time python test.py

  real	0m1.561s
  user	0m0.257s
  sys	0m1.302s

== After patch ==
  $ time python test.py

  real	0m0.986s
  user	0m0.279s
  sys	0m0.707s

$ perf -g record python test.py:

== Before patch ==
-   67.42%     2.82%  python   [kernel.kallsyms] [k] show_map_vma.isra.22
   - 64.60% show_map_vma.isra.22
      - 44.98% seq_printf
         - seq_vprintf
            - vsnprintf
               + 14.85% number
               + 12.22% format_decode
                 5.56% memcpy_erms
      + 15.06% seq_path
      + 4.42% seq_pad
   + 2.45% __GI___libc_read

== After patch ==
-   47.35%     3.38%  python   [kernel.kallsyms] [k] show_map_vma.isra.23
   - 43.97% show_map_vma.isra.23
      + 20.84% seq_path
      - 15.73% show_vma_header_prefix
           10.55% seq_put_hex_ll
         + 2.65% seq_put_decimal_ull
           0.95% seq_putc
      + 6.96% seq_pad
   + 2.94% __GI___libc_read

[avagin@openvz.org: use unsigned int instead of int where it is suitable]
  Link: http://lkml.kernel.org/r/20180214025619.4005-1-avagin@openvz.org
[avagin@openvz.org: v2]
  Link: http://lkml.kernel.org/r/20180117082050.25406-1-avagin@openvz.org
Link: http://lkml.kernel.org/r/20180112185812.7710-1-avagin@openvz.org
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Andrei Vagin
73567266c9 proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps
seq_put_decimal_ull_w(m, str, val, width) prints a decimal number with a
specified minimal field width.

It is equivalent of seq_printf(m, "%s%*d", str, width, val), but it
works much faster.

== test_smaps.py
  num = 0
  with open("/proc/1/smaps") as f:
          for x in xrange(10000):
                  data = f.read()
                  f.seek(0, 0)
==

== Before patch ==
  $ time python test_smaps.py
  real    0m4.593s
  user    0m0.398s
  sys     0m4.158s

== After patch ==
  $ time python test_smaps.py
  real    0m3.828s
  user    0m0.413s
  sys     0m3.408s

$ perf -g record python test_smaps.py
== Before patch ==
-   79.01%     3.36%  python   [kernel.kallsyms]    [k] show_smap.isra.33
   - 75.65% show_smap.isra.33
      + 48.85% seq_printf
      + 15.75% __walk_page_range
      + 9.70% show_map_vma.isra.23
        0.61% seq_puts

== After patch ==
-   75.51%     4.62%  python   [kernel.kallsyms]    [k] show_smap.isra.33
   - 70.88% show_smap.isra.33
      + 24.82% seq_put_decimal_ull_w
      + 19.78% __walk_page_range
      + 12.74% seq_printf
      + 11.08% show_map_vma.isra.23
      + 1.68% seq_puts

[akpm@linux-foundation.org: fix drivers/of/unittest.c build]
Link: http://lkml.kernel.org/r/20180212074931.7227-1-avagin@openvz.org
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
6d59646090 fs: kernelsu: Add scope-minimized manual hooks 1.4
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
chiteroman
04a1e6280b BACKPORT: fs: path_umount for KernelSu
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
NeilBrown
6e4f18d8ab BACKPORT: cred: add get_cred_rcu()
Sometimes we want to opportunistically get a
ref to a cred in an rcu_read_lock protected section.
get_task_cred() does this, and NFS does as similar thing
with its own credential structures.
To prepare for NFS converting to use 'struct cred' more
uniformly, define get_cred_rcu(), and use it in
get_task_cred().

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
[neobuddy89: Backport for KernelSU-Next]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Selfmuser
9528c00d06 BACKPORT: seccomp: add filter_count field for KernelSU
KernelSU requires struct seccomp to have atomic_t filter_count ,
but this field is missing on NON-GKI kernels.

Adding the field fixes build errors such as:
error: no member named 'filter_count' in 'struct seccomp'

Reference: https://github.com/tiann/KernelSU/pull/2708
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
2ff945df4b drivers: Set proper version for KernelSU-Next
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
3d537b013e drivers: Import KernelSU Next v1.1.1
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
3d483ec816 drivers: Add KSU config path
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Harshit Jain
cd4c15da6b nt36523: update_firmware_request: use novatek_nt36523_fw01_pen 2026-01-04 11:55:51 +05:30
stic-server-open
c1d5f91042 drivers: input: Import nt36523 nvt_ts_work_func changes from pipa-t-oss
Change-Id: Ie6e4fb0c11129361dadaf42dac0b157d77bce219
2026-01-04 11:55:51 +05:30
Luka Panio
a1d7120f0d drivers: input: Remove nt36523 firmware_update unnecessary delays
* Change delay from 14000 to 100ms before loading fw, as
  usually ts driver is probed when it is already load fw.

[zhaoyuenan: migrate nt36523 touchscreen change]
Signed-off-by: Luka Panio <lukapanio@gmail.com>
Change-Id: Icf138949c0df3ed071e1e244dd2f65768e88f823
2026-01-04 11:55:51 +05:30
UtsavBalar1231
78f55afecd drivers: input: Improve nt36523 touchscreen stylus input accuracy
* this change need nabu nt36523 touchscreen firmware patch:
  (firmware: Update nt36523 touch firmware from nabu OS1.0.3.0.TKXCNXM)
  Otherwise you will experience severe drift with the mi pen 2.

Change-Id: Ie967a248d471851fed53d60dbc516ee1fdc4c606
2026-01-04 11:55:51 +05:30
stic-server-open
e6ddce9f79 firmware: Update nt36523 touch firmware from nabu OS1.0.3.0.TKXCNXM
* check novatek proc node file: (/proc/nvt_fw_version)
  fw_ver=25, ... (where fw_ver changes from 18 to 25.)

* nabu firmware feature code:
  00 0a 02 00 00 00 00 00 00 2a 02 00 cb 94 d0 20
  (The number of lines per bin firmware is 12287)

Signed-off-by: zhaoyuenan <amktiao030215@gmail.com>
Change-Id: Ib8877ae1ab5dd57b73605cf095eb797fce785def
2026-01-04 11:55:51 +05:30
Harshit Jain
db4a61eaa7 input: nt36523: add a workaround for forcing fw 2026-01-04 11:55:51 +05:30
Harshit Jain
a1d69c1ae7 arch: arm64: recalculate panel dimensions (just divided with 10 and rouded)
Plug in 2560x1600 screen size as 10.95 for diagonal at https://www.sven.de/dpi/

Display size: 9.29" × 5.8" = 53.89in² (23.59cm × 14.74cm = 347.67cm²) at 275.7 PPI, 0.0921mm dot pitch, 76008 PPI²

23.59cm  = 236mm (rouded to nearest ceil)
14.74cm  = 147mm

why: https://github.com/dev-harsh1998/android_kernel_xiaomi_nabu/blob/arrow-13.0/Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt#L311
the units should be in mm.

Signed-off-by: Harshit Jain <reach@harsh1998.dev>
2026-01-04 11:55:51 +05:30
Harshit Jain
2062f44938 Revert "[SQUASH]drivers: input: misc: revert keyboard commits"
This reverts commit 1a104aa3ea8bc2709799bedfd7cd5159241eb56d.
2026-01-04 11:55:51 +05:30
Pranav Vashi
56877980dd fixup! memlat: Optimize perf event reads when possible
* Required with new BPF changes.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
ecf190a4d0 arm64: configs: Reset init stack config changes
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Andrey Konovalov
acb5fd9ecd UPSTREAM: usb: raw-gadget: properly handle interrupted requests
Currently, if a USB request that was queued by Raw Gadget is interrupted
(via a signal), wait_for_completion_interruptible returns -ERESTARTSYS.
Raw Gadget then attempts to propagate this value to userspace as a return
value from its ioctls. However, when -ERESTARTSYS is returned by a syscall
handler, the kernel internally restarts the syscall.

This doesn't allow userspace applications to interrupt requests queued by
Raw Gadget (which is required when the emulated device is asked to switch
altsettings). It also violates the implied interface of Raw Gadget that a
single ioctl must only queue a single USB request.

Instead, make Raw Gadget do what GadgetFS does: check whether the request
was interrupted (dequeued with status == -ECONNRESET) and report -EINTR to
userspace.

Bug: 254441685
Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Cc: stable <stable@kernel.org>
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/0db45b1d7cc466e3d4d1ab353f61d63c977fbbc5.1698350424.git.andreyknvl@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit e8033bde451eddfb9b1bbd6e2d848c1b5c277222)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If8724001949230e99e44dfb8b65c545e573a2ca0
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:51 +05:30
Pranav Vashi
3977c73be3 arm64: configs: Enable camera usage with USB
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2026-01-04 11:55:50 +05:30