Skip to content

msm8917: fix cpuidle#12

Merged
barni2000 merged 2 commits intomsm89x7-mainline:msm89x7/6.13from
valpackett:push-qpnztyvuwqsk
Feb 5, 2025
Merged

msm8917: fix cpuidle#12
barni2000 merged 2 commits intomsm89x7-mainline:msm89x7/6.13from
valpackett:push-qpnztyvuwqsk

Conversation

@valpackett
Copy link

Would need a similar (but not identical — cluster power collapse would be fine since it's multi-cluster) commit for msm8937 but I don't have one to test so only including 8917 changes here.

Downstream ref: https://github.com/motoe5/android_kernel_motorola_msm8937/blob/b7208334649ddee80cf1cdc8cf233d481509199f/arch/arm/boot/dts/qcom/msm8917-pm.dtsi#L64-L86

alikates and others added 2 commits February 1, 2025 00:24
On some Qualcomm SoCs the OS Initiated PSCI mode seems to be already
enabled. Trying to change it makes PSCI report it as unsupported.

Add a new property to force using PSCI domains and OS initiated idle.

Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>

[alikates] TODO: maybe split this in two for upstreaming
Like on MSM8953, we need to use force-psci-domains on this SoCs.
Also, we cannot just do cluster power collapse like that (it freezes):
since MSM8917 is a single-cluster SoC, cluster PC is system PC.

Signed-off-by: Val Packett <val@packett.cool>
@barni2000
Copy link
Collaborator

Can this be sent to upstream?

@barni2000 barni2000 merged commit dbc64a5 into msm89x7-mainline:msm89x7/6.13 Feb 5, 2025
1 check passed
@barni2000
Copy link
Collaborator

Thank You!

@valpackett
Copy link
Author

Can this be sent to upstream?

Well, it depends on "Allow forcing PSCI domains", so let's ping @alikates about that one first :)

@valpackett valpackett deleted the push-qpnztyvuwqsk branch February 6, 2025 02:10
@alikates
Copy link

alikates commented Feb 6, 2025

Hi! Its fine by me, but I suspect the maintainers will require some changes. I don't have much time for it now but feel free to modify it if needed. (Co-authored-by or smth similar appreciated!)

@alikates
Copy link

alikates commented Feb 6, 2025

Btw, could it be I already split this patch somewhere? The last version I remember was different from this one, but maybe I'm mistaken...

@valpackett
Copy link
Author

OK, I'll take it then.

barni2000 pushed a commit that referenced this pull request Mar 10, 2025
[ Upstream commit c7b87ce ]

libtraceevent parses and returns an array of argument fields, sometimes
larger than RAW_SYSCALL_ARGS_NUM (6) because it includes "__syscall_nr",
idx will traverse to index 6 (7th element) whereas sc->fmt->arg holds 6
elements max, creating an out-of-bounds access. This runtime error is
found by UBsan. The error message:

  $ sudo UBSAN_OPTIONS=print_stacktrace=1 ./perf trace -a --max-events=1
  builtin-trace.c:1966:35: runtime error: index 6 out of bounds for type 'syscall_arg_fmt [6]'
    #0 0x5c04956be5fe in syscall__alloc_arg_fmts /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:1966
    #1 0x5c04956c0510 in trace__read_syscall_info /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:2110
    #2 0x5c04956c372b in trace__syscall_info /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:2436
    #3 0x5c04956d2f39 in trace__init_syscalls_bpf_prog_array_maps /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:3897
    #4 0x5c04956d6d25 in trace__run /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:4335
    #5 0x5c04956e112e in cmd_trace /home/howard/hw/linux-perf/tools/perf/builtin-trace.c:5502
    #6 0x5c04956eda7d in run_builtin /home/howard/hw/linux-perf/tools/perf/perf.c:351
    #7 0x5c04956ee0a8 in handle_internal_command /home/howard/hw/linux-perf/tools/perf/perf.c:404
    #8 0x5c04956ee37f in run_argv /home/howard/hw/linux-perf/tools/perf/perf.c:448
    #9 0x5c04956ee8e9 in main /home/howard/hw/linux-perf/tools/perf/perf.c:556
    #10 0x79eb3622a3b7 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #11 0x79eb3622a47a in __libc_start_main_impl ../csu/libc-start.c:360
    #12 0x5c04955422d4 in _start (/home/howard/hw/linux-perf/tools/perf/perf+0x4e02d4) (BuildId: 5b6cab2d59e96a4341741765ad6914a4d784dbc6)

     0.000 ( 0.014 ms): Chrome_ChildIO/117244 write(fd: 238, buf: !, count: 1)                                      = 1

Fixes: 5e58fcf ("perf trace: Allow allocating sc->arg_fmt even without the syscall tracepoint")
Signed-off-by: Howard Chu <howardchu95@gmail.com>
Link: https://lore.kernel.org/r/20250122025519.361873-1-howardchu95@gmail.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants