804966 Commits

Author SHA1 Message Date
Sultan Alsawaf
7b98484a22 simple_lmk: Run reclaim kthread on big CPU cluster
Simple LMK's reclaim thread needs to run as quickly as possible to
reduce memory allocation latency when memory pressure is high. Run it
on fast, big cluster CPUs.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I6fef904710722b89b19cf119bf92779c364b2c2e
2023-11-14 20:23:14 -03:00
Sultan Alsawaf
111fe1c861 mm: Always indicate OOM kill progress when Simple LMK is enabled
When Simple LMK is enabled, the page allocator slowpath always thinks that
no OOM kill progress is made because out_of_memory() returns false. As a
result, spurious page allocation failures are observed when memory is low
and Simple LMK is killing tasks, simply because the page allocator slowpath
doesn't think that any OOM killing is taking place.

Fix this by simply making out_of_memory() always return true when Simple
LMK is enabled.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: Ib91e593e67b8d155bb8c1a1de807b524f9348d61
2023-11-14 20:23:14 -03:00
Richard Raya
6db22e1b63 Revert "simple_lmk: Set the victims to the highest priority"
This reverts commit 05293dbde43c7f464f3ad8b97dbbc05073b01d9b.

Change-Id: I0a597332b72577c1416087e55407659057cd38b3
2023-11-14 20:23:14 -03:00
dianlujitao
9c63213ba6 msm: camera: Use boot clock for recording start time
* Our camera HAL uses boot time for buffer timestamp, rather than
   system monotonic time. This leads to issues as framework uses system
   monotonic time as reference start time for timestamp adjustment.
 * This patch is taken from stock kernel source.

Change-Id: Ia4fac1d48e2206a7befd0030585776371dd8c3a9
2023-11-14 20:23:14 -03:00
Danny Lin
1f9cc305a2 drm/msm/sde: Trigger panel reset after first kickoff on non-60 Hz
If we're using a refresh rate different from what the bootloader
initializes the display with, a panel reset is necessary for our custom
refresh rate to take effect.

After the first kickoff, request a panel reset from userspace using the
existing ESD recovery mechanism to update the refresh rate. Note that
this is only done if the target refresh rate is *not* 60 Hz because this
is redundant if we don't need a refresh rate update.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: Icb7170ad84a719fc89d94ac763e54d804410a894
2023-11-14 20:23:14 -03:00
Adithya R
49c14e3854 nt36xxx: Fix snprintf usage
Change-Id: I93121ce750d7a2977b75c6c4cb36589d40d8072c
2023-11-14 20:23:14 -03:00
Erfan Abdi
f726740689 nt36xxx: Implement double_tap node
[dereference23]
- Use lct_nvt_tp_gesture_callback

Change-Id: I051d8a1dcd5a50d60e172933139fe02f01a51675
2023-11-14 20:23:14 -03:00
dianlujitao
26bde9a20a touchscreen: Add an interface to expose TP features to userspace
* Needs to implement and register ops from TP driver
 * Access them via /sys/touchpanel/*
 * Export capacitive keys status

Change-Id: Iad0fdfc1c9a2b3daf8cf97b6a3a079bdfae05e10
2023-11-14 20:23:13 -03:00
Richard Raya
70bd2d2c36 defconfig: Enable KernelSU
Change-Id: I47a4118ffef336d90ae69cfef255be192d6c6478
2023-11-14 20:23:13 -03:00
Richard Raya
e7dda3604e drivers: Import KernelSU v0.7.1
https://github.com/tiann/KernelSU/tree/v0.7.1/kernel

Change-Id: I19ceb5735796faa3f3e51064d15a7ee6da344598
2023-11-14 20:23:13 -03:00
Richard Raya
1d8d15cb15 selinux: Prepare for KernelSU
Change-Id: If3a633c82ab6f527514c55da5f6189c44a96d207
2023-11-14 20:23:13 -03:00
Richard Raya
f6d601a80d kernel_headers: Add linux/ncsi.h
Change-Id: I30918cc5e7f5324090ec7e00193a914eed51653d
2023-11-14 20:23:13 -03:00
Richard Raya
0ec10e6fee kernel_headers: Add linux/f2fs.h
Change-Id: If4fb532fcd889a878174efbf5ef8ab0427f7d022
2023-11-14 20:23:13 -03:00
Bharat Pawar
0045b06418 kernel_headers: Change the subprocess argument to fix build
Change subprocess arguments in  kernel_headers.py
script so that it can include dirname to resolve the
compilation issues in the new build system.

Change-Id: I89bbe53aa8a8b50e2c98a795fa20a976f2792a3b
Signed-off-by: Bharat Pawar <c_bpawar@codeaurora.org>
Signed-off-by: Eruvaram Kumar Raja Reddy <erajared@codeaurora.org>
2023-11-14 20:23:13 -03:00
Bill Peckham
b552333131 kernel_headers: Use environment variable to find unifdef tool
Tools used within the sandbox are now copied into the
sandbox, see aosp/1531944. This caused the modified
headers_install.sh, which is no longer installed, to
point to a non-existent location.

This change adds a level of indirection. The
gen-headers_install.sh module no longer uses unifdef as
a tool, but still modifies the headers_install.sh
script, but not to point to a particular location, but
to find the unifdef tool via an environment variable,
LOC_UNIFDEF.

Next, we modify qti_generate_kernel_headers_arm and
qti_generate_kernel_headers_arm64 to need the unifdef
tool (which is copied into the sandbox for these tools).

We add a new --unifdef option to the kernel_headers.py
script so that it can find the tool in the sandbox. The
kernel_headers.py script sets the LOC_UNIFDEF
environment variable before invoking the altered
headers_install.sh script (also copied into the
sandbox).

Finally, we generate gen_headers_arm.bp and
gen_headers_arm64.bp with all of these changes.

Bug: 178500203
Change-Id: Ie3b8c36b7d60bd950c28bac566e04f43de78cf98
Signed-off-by: Mohammed Athar <athar@codeaurora.org>
Signed-off-by: Shadab Naseem <snaseem@codeaurora.org>
Signed-off-by: Eruvaram Kumar Raja Reddy <erajared@codeaurora.org>
2023-11-14 20:23:13 -03:00
Soumil Shah
955ccdc1fd kernel_headers: Explicitly run headers_install under 'sh'
To avoid build failures in the newer Android build systems,
run the headers_install script explicitly under 'sh'.

Change-Id: If30d2bda653c6be443345a2594e9993d9780db21
Signed-off-by: Soumil Shah <soumshah@codeaurora.org>
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
2023-11-14 20:23:13 -03:00
Omkar Chandorkar
fd07d150e1 Android.bp: Allow system to use generated kernel headers
Change-Id: Idd2619bb73befe1a61863b28942c7759d5cd53fa
2023-11-14 20:23:13 -03:00
Richard Raya
8ee1d0fb2c Revert "headers_lib: rename Android.bp"
This reverts commit 962e4231253bb33f0308b09d3ba06fcd76735d23.

Change-Id: If1a940cceca1c812df3504575a5064cb2c9a3c79
2023-11-14 20:23:13 -03:00
Linus Torvalds
928332d518 scripts: Stop complaining about deprecated OpenSSL functions
commit 6bfb56e93bcef41859c2d5ab234ffd80b691be35 upstream.

OpenSSL 3.0 deprecated the OpenSSL's ENGINE API.  That is as may be, but
the kernel build host tools still use it.  Disable the warning about
deprecated declarations until somebody who cares fixes it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ica9fdcbc6276bdb76b6e7a2f5cab7af608e97659
2023-11-14 20:23:13 -03:00
Masahiro Yamada
f7ce147e87 kconfig: Display recursive dependency resolution hint just once
commit e3b03bf29d6b99fab7001fb20c33fe54928c157a upstream.

Commit 1c199f2878f6 ("kbuild: document recursive dependency limitation
/ resolution") probably intended to show a hint along with "recursive
dependency detected!" error, but it missed to add {...} guard, and the
hint is displayed in every loop of the dep_stack traverse, annoyingly.

This error was detected by GCC's -Wmisleading-indentation when switching
to build-time generation of lexer/parser.

scripts/kconfig/symbol.c: In function ‘sym_check_print_recursive’:
scripts/kconfig/symbol.c:1150:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   if (stack->sym == last_sym)
   ^~
scripts/kconfig/symbol.c:1153:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
    fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
    ^~~~~~~

I could simply add {...} to surround the three fprintf(), but I rather
chose to move the hint after the loop to make the whole message readable.

Fixes: 1c199f2878f6 ("kbuild: document recursive dependency limitation / resolution"
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I02f72a4d3c20248f8dc8502888511edaea56af7f
2023-11-14 20:23:13 -03:00
Richard Raya
50571a8b67 Makefile: Pass int-conversion warnings
Change-Id: I9cdd686abaa286a7f38b009473ad65b5e099b6ec
2023-11-14 20:23:13 -03:00
Nathan Chancellor
b18a371da0 Makefile: Wrap zero trivial-auto-var-init enablement flag with cc-option
Starting with LLVM 16, this flag is deprecated, which means its presence
breaks the build:

  Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
  make[2]: *** [../Makefile:1289: prepare-compiler-check] Error 1
  clang-16: warning: the flag '-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang' has been deprecated and will be ignored [-Wunused-command-line-argument]
  clang-16: warning: the flag '-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang' has been deprecated and will be ignored [-Wunused-command-line-argument]

Wrap this option in cc-option so that it only gets added to the list of
flags when it is supported. This is resolved properly upstream already
with commit 607e57c6c62c ("hardening: Remove Clang's enable flag for
-ftrivial-auto-var-init=zero") but that cannot be easily backported due
to lack of cc-option support in Kconfig, hence this downstream only
change.

Change-Id: Ie1f7bcdec23f01bf19c68b4dae460923aaa150c9
Fixes: a7eda6eddca5 ("BACKPORT: security: allow using Clang's zero initialization for stack variables")
Link: aef03c9b3b
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2023-11-14 20:23:13 -03:00
Fangrui Song
5b2db14d1f arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S
commit ec9d78070de986ecf581ea204fd322af4d2477ec upstream.

Commit 39d114ddc682 ("arm64: add KASAN support") added .weak directives to
arch/arm64/lib/mem*.S instead of changing the existing SYM_FUNC_START_PI
macros. This can lead to the assembly snippet `.weak memcpy ... .globl
memcpy` which will produce a STB_WEAK memcpy with GNU as but STB_GLOBAL
memcpy with LLVM's integrated assembler before LLVM 12. LLVM 12 (since
https://reviews.llvm.org/D90108) will error on such an overridden symbol
binding.

Use the appropriate SYM_FUNC_START_WEAK_PI instead.

Fixes: 39d114ddc682 ("arm64: add KASAN support")
Reported-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Fangrui Song <maskray@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201029181951.1866093-1-maskray@google.com
Signed-off-by: Will Deacon <will@kernel.org>
[nd: backport to adjust for missing:
  commit 3ac0f4526dfb ("arm64: lib: Use modern annotations for assembly functions")
  commit 35e61c77ef38 ("arm64: asm: Add new-style position independent function annotations")]
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I63c34385861c5a84cdf332a912f5ee53dedac3bd
2023-11-14 20:23:13 -03:00
Richard Raya
822b8a173b FSociety
Change-Id: I54dea019d902e91dade536edd0d41cf31f1939cd
2023-11-14 20:23:13 -03:00
Richard Raya
edd5cdec0b github: Setup CI
Change-Id: Ie2cdbab4f8673f5fb1d2f0781eaec575e52c8e44
2023-11-14 20:23:13 -03:00
Richard Raya
02b2b8d3ce build.sh: Remove upload handling
Change-Id: I35913fbaa1fb05c08facb7ac405d596ea10c46af
2023-11-14 20:23:13 -03:00
Richard Raya
bc2686affc build.sh: Build dtb image
Change-Id: I7e748b671eac917a44bc7f1c1382f325dc30af8b
2023-11-14 20:23:13 -03:00
Richard Raya
89595d01a3 build.sh: Print relevant logs to log.txt
Change-Id: I194658d821a3607f2abf279c725472708c77def5
2023-11-14 20:23:13 -03:00
Richard Raya
e742ed38bb build.sh: Allow to regenerate full defconfig
Change-Id: I56ce173012c2fe84bfa6a1ef7132d500c448af4d
2023-11-14 20:23:13 -03:00
Richard Raya
b101fdf672 build.sh: Switch to Neutron Clang
Change-Id: Ic3d58a78a054d2ad6a24ba0246d6264defa01b2e
2023-11-14 20:23:13 -03:00
Richard Raya
2753b8a651 build.sh: s/HOME/(pwd)/g
Change-Id: I56a472fd2e65d123feba6527f41961a2555bdb14
2023-11-14 20:23:12 -03:00
Richard Raya
473cd75a50 msm-4.14: Import QuicksilveR's build script
https://github.com/ghostrider-reborn/android_kernel_xiaomi_surya/blob/staging/LA.UM.9.x/build.sh

Change-Id: I4d39d963aa97d1d285d61c5d53d72e7001039932
2023-11-14 20:23:12 -03:00
azrim
b973c9b88c
Revert "cpufreq: schedutil: Queue sugov irq work on policy online cpu"
This reverts commit b424f23ce72b92873c3e3167ecd2077714dc983c.
2022-08-25 15:52:01 +00:00
azrim
8609e007d7
Merge remote-tracking branch 'google/upstream-f2fs-stable-linux-4.14.y' into richelieu
* google/upstream-f2fs-stable-linux-4.14.y:
  f2fs: use onstack pages instead of pvec
  f2fs: intorduce f2fs_all_cluster_page_ready
  f2fs: clean up f2fs_abort_atomic_write()
  f2fs: handle decompress only post processing in softirq
  f2fs: do not allow to decompress files have FI_COMPRESS_RELEASED
  f2fs: do not set compression bit if kernel doesn't support
  f2fs: remove device type check for direct IO
  f2fs: fix null-ptr-deref in f2fs_get_dnode_of_data
  f2fs: revive F2FS_IOC_ABORT_VOLATILE_WRITE
  f2fs: fix fallocate to use file_modified to update permissions consistently
  vfs: introduce file_modified() helper
  f2fs: fix to do sanity check on segment type in build_sit_entries()
  f2fs: obsolete unused MAX_DISCARD_BLOCKS
  f2fs: fix to avoid use f2fs_bug_on() in f2fs_new_node_page()
  f2fs: fix to remove F2FS_COMPR_FL and tag F2FS_NOCOMP_FL at the same time
  f2fs: introduce sysfs atomic write statistics
  f2fs: don't bother wait_ms by foreground gc
  f2fs: invalidate meta pages only for post_read required inode
  f2fs: allow compression of files without blocks
  f2fs: fix to check inline_data during compressed inode conversion
  f2fs: fix to invalidate META_MAPPING before DIO write
  f2fs: adjust zone capacity when considering valid block count
  f2fs: enforce single zone capacity
  f2fs: remove redundant code for gc condition
  f2fs: introduce memory mode
  f2fs: initialize page_array_entry slab only if compression feature is on
  f2fs: optimize error handling in redirty_blocks
  f2fs: do not skip updating inode when retrying to flush node page
  Revert "f2fs: run GCs synchronously given user requests"
2022-08-25 14:57:49 +00:00
azrim
c402391914
Merge commit '03aa12a9fdba0ba94e6c18386d203471a5f23514' into richelieu
* commit '03aa12a9fdba0ba94e6c18386d203471a5f23514':
  exfat: fix overflow for large capacity partition
2022-08-25 14:56:54 +00:00
azrim
f5d1d8f9f6
Merge commit '709af6e1a6ec3689fb14399db326eb7fb3c6e8be' into richelieu
* commit '709af6e1a6ec3689fb14399db326eb7fb3c6e8be':
  asoc: codecs: Add nullptr check
  asoc: codecs: Add nullptr check
2022-08-25 14:56:07 +00:00
azrim
b5951684b1
Merge commit '48feda7ae9eb2b12828cc5fc4eb79c5281f752e3' into richelieu
* commit '48feda7ae9eb2b12828cc5fc4eb79c5281f752e3':
  fw-api: CL 18643854 - update fw common interface files
  fw-api: Add missing header for qca8074V2
  fw-api: CL 18584219 - update fw common interface files
  fw-api: CL 18582357 - update fw common interface files
  fw-api: CL 18549173 - update fw common interface files
  fw-api: CL 18544227 - update fw common interface files
  fw-api: CL 18528502 - update fw common interface files
  fw-api: CL 18520590 - update fw common interface files
  fw-api: CL 18520582 - update fw common interface files
  fw-api: CL 18514323 - update fw common interface files
  fw-api: CL 18495064 - update fw common interface files
  fw-api: CL 18480658 - update fw common interface files
  fw-api: CL 18479583 - update fw common interface files
  fw-api: CL 18472328 - update fw common interface files
  fw-api: CL 18469088 - update fw common interface files
  fw-api: CL 18457221 - update fw common interface files
  fw-api: CL 18457215 - update fw common interface files
2022-08-25 14:55:16 +00:00
azrim
0b573cd72d
Merge tag 'LA.UM.9.1.r1-12200-SMxxx0.QSSI13.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.14 into richelieu
"LA.UM.9.1.r1-12200-SMxxx0.QSSI13.0"

* tag 'LA.UM.9.1.r1-12200-SMxxx0.QSSI13.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.14:
  smcinvoke : file private data validation, which is sent by userspace
  input: touchscreen: focaltech: queue touch suspend work on workqueue
  input: touchscreen: focaltech: fix return value
  haven: irq_lend: add support for IRQ notifications
  haven: Add support for the MEM_ACCEPTED notification
  msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS
  msm: vidc: fix msm_comm_get_vidc_buffer fd race issue
  msm: ipa: clear the ipa pipeline before any ep config
2022-08-25 14:53:06 +00:00
azrim
10dbf6b623
configs: surya: Regenerate full defconfig 2022-08-25 14:50:59 +00:00
Venkata Manasa Kakarla
0ab6cc0f95
msm_serial_hs: Fix race between mod_timer and del_timer calls
Deletion of timer and synchronization of the handler will happen
during del_timer, but in the issue case the timer got deleted and
before handler_sync should happen the timer is getting modified or
accessed which further leads to kernel panic.

Fix this by modifying del_timer to del_timer_sync so that the timer
is protected until synchronization happen.

Change-Id: If5dec66b9bbcb5369898536ba1c727b487a13018
Signed-off-by: Venkata Manasa Kakarla <venkka@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:48:20 +00:00
Ashok Vuyyuru
79102280fa
msm: ipa3: Fix to avoid gsi/sys len stats mismatch
In suspend just before stopping the channel possible to receive
the IEOB interrupt and xfer pointer will not be processed in this
mode but gsi stats are updated.  In resume after starting the channel
will receive the IEOB interrupt and xfer pointer will be overwritten
because of this observing the gsi/sys len stats are not matching and
buffers won't be replinished properly leading to HW stall.
To avoid this process all data in polling context, gsi/sys len
stats are updated properly.

Bug: 158990845
Test: 1.build pass and can boot to home
      2.Mobile data,VoLTE,WFC,MMS,MHS

Change-Id: Id665448165b6aa51b251cddd72573c6df64ee541
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:48:20 +00:00
Kyle Lin
84f900dc93
clk: qcom: osm: avoid freq run over max_freq
Setting max freq which is not in the given cpu's freq table, the
target_freq is the same with max freq. When selecting the freq, it uses
CPUFREQ_RELATION_L, so the frequency round to the next. This is
reasonable for normal cases but the frequency should not run over the
max setting.

Bug: 158134249
Test: build and set max/min freq to check
Change-Id: I804454225c10b7a023b323c58e77b7bba1ec3576
Signed-off-by: Kyle Lin <kylelin@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:48:19 +00:00
Joel Fernandes (Google)
c3d11d9a9a
schedutil: Allow cpufreq requests to be made even when kthread kicked
Currently there is a chance of a schedutil cpufreq update request to be
dropped if there is a pending update request. This pending request can
be delayed if there is a scheduling delay of the irq_work and the wake
up of the schedutil governor kthread.

A very bad scenario is when a schedutil request was already just made,
such as to reduce the CPU frequency, then a newer request to increase
CPU frequency (even sched deadline urgent frequency increase requests)
can be dropped, even though the rate limits suggest that its Ok to
process a request. This is because of the way the work_in_progress flag
is used.

This patch improves the situation by allowing new requests to happen
even though the old one is still being processed. Note that in this
approach, if an irq_work was already issued, we just update next_freq
and don't bother to queue another request so there's no extra work being
done to make this happen.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:47:59 +00:00
Maria Yu
b424f23ce7
cpufreq: schedutil: Queue sugov irq work on policy online cpu
Got never update frequency if scheduled the irq
work on an offlined cpu and it will always pending.
Queue sugov irq work on any online cpu if current
cpu is offline.

Change-Id: I33fc691917b5866488b6aeb11ed902a2753130b2
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
[clingutla@codeaurora.org: Resolved minor merge conflicts]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:47:59 +00:00
Cristian Gafton
4dcd29606a
bump default tcp_wmem from 16KB to 20KB
to account for skb structure growth since the 3.4.x kernel series

(cherry picked from commit 4859c886f6ee760a0d99a68ee7711026090a1746)
Signed-off-by: Cristian Gafton <gafton@amazon.com>
(cherry picked from commit 64f08e9da01ff957cbebd44de8797373c589545f)
Reviewed-by: Cristian Gafton <gafton@amazon.com>
Reviewed-by: Guru Anbalagane <guruanb@amazon.com>

CR: https://cr.amazon.com/r/6834769/

Reviewed-by: Cristian Gafton <gafton@amazon.com>
Reviewed-by: Frederick Lefebvre <fredlef@amazon.com>
Reviewed-by: Eduardo Valentin <eduval@amazon.com>
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com>
CR: https://cr.amazon.com/r/8209723/
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:46:42 +00:00
Munehisa Kamata
ba135ce357
bump the default TTL to 255
Signed-off-by: Munehisa Kamata <kamatam@amazon.com>
Reviewed-by: Rashika Kheria <rashika@amazon.de>
Reviewed-by: Harris Palaiologos <palaiolo@amazon.de>
CR: https://cr.amazon.com/r/4775330/
(cherry picked from commit fe107a549001408933250a3224e2b620f4b0f3ec)
Signed-off-by: Munehisa Kamata <kamatam@amazon.com>
Reviewed-by: Cristian Gafton <gafton@amazon.com>
Reviewed-by: Guru Anbalagane <guruanb@amazon.com>

CR: https://cr.amazon.com/r/6834769/

Reviewed-by: Cristian Gafton <gafton@amazon.com>
Reviewed-by: Frederick Lefebvre <fredlef@amazon.com>
Reviewed-by: Eduardo Valentin <eduval@amazon.com>
Signed-off-by: Vallish Vaidyeshwara <vallish@amazon.com>
CR: https://cr.amazon.com/r/8209723/
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:46:42 +00:00
Yu Zhao
009ecbb667
UPSTREAM: include/linux/compaction.h: fix potential build error
Declaration of struct node is required regardless.  On UMA systems,
including compaction.h without preceding node.h shouldn't cause a build
error.

Link: http://lkml.kernel.org/r/20190208080437.253322-1-yuzhao@google.com
Signed-off-by: Yu Zhao <yuzhao@google.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Change-Id: I37fda3050a67d55829f3433034f98483b7c9ad0b
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:46:42 +00:00
Eric Biggers
11f8aec1a0
ANDROID: allow add_hwgenerator_randomness() from non-kthread
A recent LTS change causes add_hwgenerator_randomness() to crash when
called from a non-kthread task.  This shouldn't be a problem, since this
function should only be called by the HWRNG framework.  However, on this
branch it is part of the KMI since a vendor module is using it
inappropriately by calling it during early init.  (Note that
add_bootloader_randomness() would be a better fit for the use case.)

To prevent a crash in this case, restore support for
add_hwgenerator_randomness() being called from a non-kthread task.

This change isn't currently needed in 5.4 or newer kernels, as
add_hwgenerator_randomness() isn't part of the KMI there.

Bug: 238701371
Fixes: 8bc7018f08a9 ("random: do not use batches when !crng_ready()")
Change-Id: I0b86743deb30f54b8f838a36eea740b370a30a8b
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:46:41 +00:00
Charan Teja Kalla
f97cfad544
UPSTREAM: mm: madvise: return correct bytes advised with process_madvise
Patch series "mm: madvise: return correct bytes processed with
process_madvise", v2.  With the process_madvise(), always choose to return
non zero processed bytes over an error.  This can help the user to know on
which VMA, passed in the 'struct iovec' vector list, is failed to advise
thus can take the decission of retrying/skipping on that VMA.

This patch (of 2):

The process_madvise() system call returns error even after processing some
VMA's passed in the 'struct iovec' vector list which leaves the user
confused to know where to restart the advise next.  It is also against
this syscall man page[1] documentation where it mentions that "return
value may be less than the total number of requested bytes, if an error
occurred after some iovec elements were already processed.".

Consider a user passed 10 VMA's in the 'struct iovec' vector list of which
9 are processed but one.  Then it just returns the error caused on that
failed VMA despite the first 9 VMA's processed, leaving the user confused
about on which VMA it is failed.  Returning the number of bytes processed
here can help the user to know which VMA it is failed on and thus can
retry/skip the advise on that VMA.

[1]https://man7.org/linux/man-pages/man2/process_madvise.2.html.

Link: https://lkml.kernel.org/r/cover.1647008754.git.quic_charante@quicinc.com
Link: https://lkml.kernel.org/r/125b61a0edcee5c2db8658aed9d06a43a19ccafc.1647008754.git.quic_charante@quicinc.com
Fixes: ecb8ac8b1f14("mm/madvise: introduce process_madvise() syscall: an external memory hinting API")
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Change-Id: Id743a28f41e28f4867bb5265be6ae7ef58bbc394
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:46:34 +00:00
Sultan Alsawaf
0b26fa6f0d
cpuidle: lpm-levels: Make hrtimers expire in hard IRQ context
The CPU idle driver's hrtimers need to be able to wake CPUs up from their
C-states using a timer interrupt. This doesn't work if the hrtimers are
instead queued into soft IRQ and run from there, so make them expire in
hard IRQ.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Kazuki Hashimoto <kazukih@tuta.io>
Signed-off-by: azrim <mirzaspc@gmail.com>
2022-08-25 14:45:05 +00:00