From: Greg Kroah-Hartman Date: Tue, 8 Oct 2024 11:13:30 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.6.55~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0ab6453ec88cb9d580042b8bdd3bd778135f08d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: clk-imx6ul-fix-failed-to-get-parent-error.patch perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch --- diff --git a/queue-5.15/clk-imx6ul-fix-failed-to-get-parent-error.patch b/queue-5.15/clk-imx6ul-fix-failed-to-get-parent-error.patch new file mode 100644 index 00000000000..f6be7ee0001 --- /dev/null +++ b/queue-5.15/clk-imx6ul-fix-failed-to-get-parent-error.patch @@ -0,0 +1,50 @@ +From f420f47e56c67587d9bc8f94267327b6fb214c1d Mon Sep 17 00:00:00 2001 +From: Oleksij Rempel +Date: Fri, 10 Mar 2023 17:45:23 +0100 +Subject: clk: imx6ul: fix "failed to get parent" error + +From: Oleksij Rempel + +commit f420f47e56c67587d9bc8f94267327b6fb214c1d upstream. + +On some configuration we may get following error: +[ 0.000000] imx:clk-gpr-mux: failed to get parent (-EINVAL) + +This happens if selector is configured to not supported value. To avoid +this warnings add dummy parents for not supported values. + +Fixes: 4e197ee880c2 ("clk: imx6ul: add ethernet refclock mux support") +Signed-off-by: Oleksij Rempel +Link: https://lore.kernel.org/r/20230310164523.534571-1-o.rempel@pengutronix.de +Tested-by: Stefan Wahren +Reported-by: Stefan Wahren +Reviewed-by: Peng Fan +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/imx/clk-imx6ul.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/clk/imx/clk-imx6ul.c ++++ b/drivers/clk/imx/clk-imx6ul.c +@@ -95,14 +95,16 @@ static const struct clk_div_table video_ + { } + }; + +-static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", }; ++static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", "dummy", "dummy"}; + static const u32 enet1_ref_sels_table[] = { IMX6UL_GPR1_ENET1_TX_CLK_DIR, +- IMX6UL_GPR1_ENET1_CLK_SEL }; ++ IMX6UL_GPR1_ENET1_CLK_SEL, 0, ++ IMX6UL_GPR1_ENET1_TX_CLK_DIR | IMX6UL_GPR1_ENET1_CLK_SEL }; + static const u32 enet1_ref_sels_table_mask = IMX6UL_GPR1_ENET1_TX_CLK_DIR | + IMX6UL_GPR1_ENET1_CLK_SEL; +-static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", }; ++static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", "dummy", "dummy"}; + static const u32 enet2_ref_sels_table[] = { IMX6UL_GPR1_ENET2_TX_CLK_DIR, +- IMX6UL_GPR1_ENET2_CLK_SEL }; ++ IMX6UL_GPR1_ENET2_CLK_SEL, 0, ++ IMX6UL_GPR1_ENET2_TX_CLK_DIR | IMX6UL_GPR1_ENET2_CLK_SEL }; + static const u32 enet2_ref_sels_table_mask = IMX6UL_GPR1_ENET2_TX_CLK_DIR | + IMX6UL_GPR1_ENET2_CLK_SEL; + diff --git a/queue-5.15/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch b/queue-5.15/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch new file mode 100644 index 00000000000..034d65b6488 --- /dev/null +++ b/queue-5.15/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch @@ -0,0 +1,88 @@ +From 9af2efee41b27a0f386fb5aa95d8d0b4b5d9fede Mon Sep 17 00:00:00 2001 +From: Namhyung Kim +Date: Mon, 26 Aug 2024 15:10:42 -0700 +Subject: perf report: Fix segfault when 'sym' sort key is not used + +From: Namhyung Kim + +commit 9af2efee41b27a0f386fb5aa95d8d0b4b5d9fede upstream. + +The fields in the hist_entry are filled on-demand which means they only +have meaningful values when relevant sort keys are used. + +So if neither of 'dso' nor 'sym' sort keys are used, the map/symbols in +the hist entry can be garbage. So it shouldn't access it +unconditionally. + +I got a segfault, when I wanted to see cgroup profiles. + + $ sudo perf record -a --all-cgroups --synth=cgroup true + + $ sudo perf report -s cgroup + + Program received signal SIGSEGV, Segmentation fault. + 0x00005555557a8d90 in map__dso (map=0x0) at util/map.h:48 + 48 return RC_CHK_ACCESS(map)->dso; + (gdb) bt + #0 0x00005555557a8d90 in map__dso (map=0x0) at util/map.h:48 + #1 0x00005555557aa39b in map__load (map=0x0) at util/map.c:344 + #2 0x00005555557aa592 in map__find_symbol (map=0x0, addr=140736115941088) at util/map.c:385 + #3 0x00005555557ef000 in hists__findnew_entry (hists=0x555556039d60, entry=0x7fffffffa4c0, al=0x7fffffffa8c0, sample_self=true) + at util/hist.c:644 + #4 0x00005555557ef61c in __hists__add_entry (hists=0x555556039d60, al=0x7fffffffa8c0, sym_parent=0x0, bi=0x0, mi=0x0, ki=0x0, + block_info=0x0, sample=0x7fffffffaa90, sample_self=true, ops=0x0) at util/hist.c:761 + #5 0x00005555557ef71f in hists__add_entry (hists=0x555556039d60, al=0x7fffffffa8c0, sym_parent=0x0, bi=0x0, mi=0x0, ki=0x0, + sample=0x7fffffffaa90, sample_self=true) at util/hist.c:779 + #6 0x00005555557f00fb in iter_add_single_normal_entry (iter=0x7fffffffa900, al=0x7fffffffa8c0) at util/hist.c:1015 + #7 0x00005555557f09a7 in hist_entry_iter__add (iter=0x7fffffffa900, al=0x7fffffffa8c0, max_stack_depth=127, arg=0x7fffffffbce0) + at util/hist.c:1260 + #8 0x00005555555ba7ce in process_sample_event (tool=0x7fffffffbce0, event=0x7ffff7c14128, sample=0x7fffffffaa90, evsel=0x555556039ad0, + machine=0x5555560388e8) at builtin-report.c:334 + #9 0x00005555557b30c8 in evlist__deliver_sample (evlist=0x555556039010, tool=0x7fffffffbce0, event=0x7ffff7c14128, + sample=0x7fffffffaa90, evsel=0x555556039ad0, machine=0x5555560388e8) at util/session.c:1232 + #10 0x00005555557b32bc in machines__deliver_event (machines=0x5555560388e8, evlist=0x555556039010, event=0x7ffff7c14128, + sample=0x7fffffffaa90, tool=0x7fffffffbce0, file_offset=110888, file_path=0x555556038ff0 "perf.data") at util/session.c:1271 + #11 0x00005555557b3848 in perf_session__deliver_event (session=0x5555560386d0, event=0x7ffff7c14128, tool=0x7fffffffbce0, + file_offset=110888, file_path=0x555556038ff0 "perf.data") at util/session.c:1354 + #12 0x00005555557affaf in ordered_events__deliver_event (oe=0x555556038e60, event=0x555556135aa0) at util/session.c:132 + #13 0x00005555557bb605 in do_flush (oe=0x555556038e60, show_progress=false) at util/ordered-events.c:245 + #14 0x00005555557bb95c in __ordered_events__flush (oe=0x555556038e60, how=OE_FLUSH__ROUND, timestamp=0) at util/ordered-events.c:324 + #15 0x00005555557bba46 in ordered_events__flush (oe=0x555556038e60, how=OE_FLUSH__ROUND) at util/ordered-events.c:342 + #16 0x00005555557b1b3b in perf_event__process_finished_round (tool=0x7fffffffbce0, event=0x7ffff7c15bb8, oe=0x555556038e60) + at util/session.c:780 + #17 0x00005555557b3b27 in perf_session__process_user_event (session=0x5555560386d0, event=0x7ffff7c15bb8, file_offset=117688, + file_path=0x555556038ff0 "perf.data") at util/session.c:1406 + +As you can see the entry->ms.map was NULL even if he->ms.map has a +value. This is because 'sym' sort key is not given, so it cannot assume +whether he->ms.sym and entry->ms.sym is the same. I only checked the +'sym' sort key here as it implies 'dso' behavior (so maps are the same). + +Fixes: ac01c8c4246546fd ("perf hist: Update hist symbol when updating maps") +Signed-off-by: Namhyung Kim +Cc: Adrian Hunter +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Matt Fleming +Cc: Peter Zijlstra +Cc: Stephane Eranian +Link: https://lore.kernel.org/r/20240826221045.1202305-2-namhyung@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/hist.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/perf/util/hist.c ++++ b/tools/perf/util/hist.c +@@ -628,7 +628,7 @@ static struct hist_entry *hists__findnew + * mis-adjust symbol addresses when computing + * the history counter to increment. + */ +- if (he->ms.map != entry->ms.map) { ++ if (hists__has(hists, sym) && he->ms.map != entry->ms.map) { + if (he->ms.sym) { + u64 addr = he->ms.sym->start; + he->ms.sym = map__find_symbol(entry->ms.map, addr); diff --git a/queue-5.15/series b/queue-5.15/series index d1d549463ef..5200611264d 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -587,3 +587,5 @@ revert-arm64-dts-qcom-sm8250-switch-ufs-qmp-phy-to-new-style-of-bindings.patch ext4-fix-inode-tree-inconsistency-caused-by-enomem.patch 9p-add-missing-locking-around-taking-dentry-fid-list.patch vhost-scsi-null-ptr-dereference-in-vhost_scsi_get_req.patch +perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch +clk-imx6ul-fix-failed-to-get-parent-error.patch