From b853f64643d0db0b2fc09e8fc9ebca20d30d1b9f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 10 Mar 2025 14:23:16 +0100 Subject: [PATCH] 6.13-stable patches added patches: alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch fprobe-always-unregister-fgraph-function-from-ops.patch fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch nvme-tcp-fix-a-c2htermreq-error-message.patch --- ...tek-fix-incorrect-is_reachable-usage.patch | 69 ++++++++++++++ ...-replaced-have_function_graph_retval.patch | 38 ++++++++ ...-unregister-fgraph-function-from-ops.patch | 76 +++++++++++++++ ...en-to-unregister-from-function-graph.patch | 93 +++++++++++++++++++ ...e-tcp-fix-a-c2htermreq-error-message.patch | 33 +++++++ queue-6.13/series | 5 + 6 files changed, 314 insertions(+) create mode 100644 queue-6.13/alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch create mode 100644 queue-6.13/arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch create mode 100644 queue-6.13/fprobe-always-unregister-fgraph-function-from-ops.patch create mode 100644 queue-6.13/fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch create mode 100644 queue-6.13/nvme-tcp-fix-a-c2htermreq-error-message.patch diff --git a/queue-6.13/alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch b/queue-6.13/alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch new file mode 100644 index 0000000000..1feaf28fe6 --- /dev/null +++ b/queue-6.13/alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch @@ -0,0 +1,69 @@ +From d0bbe332669c5db32c8c92bc967f8e7f8d460ddf Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 4 Mar 2025 15:25:55 +0100 +Subject: ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage + +From: Arnd Bergmann + +commit d0bbe332669c5db32c8c92bc967f8e7f8d460ddf upstream. + +The alternative path leads to a build error after a recent change: + +sound/pci/hda/patch_realtek.c: In function 'alc233_fixup_lenovo_low_en_micmute_led': +include/linux/stddef.h:9:14: error: called object is not a function or function pointer + 9 | #define NULL ((void *)0) + | ^ +sound/pci/hda/patch_realtek.c:5041:49: note: in expansion of macro 'NULL' + 5041 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL + | ^~~~ +sound/pci/hda/patch_realtek.c:5063:9: note: in expansion of macro 'alc233_fixup_lenovo_line2_mic_hotkey' + 5063 | alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action); + +Using IS_REACHABLE() is somewhat questionable here anyway since it +leads to the input code not working when the HDA driver is builtin +but input is in a loadable module. Replace this with a hard compile-time +dependency on CONFIG_INPUT. In practice this won't chance much +other than solve the compiler error because it is rare to require +sound output but no input support. + +Fixes: f603b159231b ("ALSA: hda/realtek - add supported Mic Mute LED for Lenovo platform") +Signed-off-by: Arnd Bergmann +Link: https://patch.msgid.link/20250304142620.582191-1-arnd@kernel.org +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/Kconfig | 1 + + sound/pci/hda/patch_realtek.c | 5 ----- + 2 files changed, 1 insertion(+), 5 deletions(-) + +--- a/sound/pci/hda/Kconfig ++++ b/sound/pci/hda/Kconfig +@@ -208,6 +208,7 @@ comment "Set to Y if you want auto-loadi + + config SND_HDA_CODEC_REALTEK + tristate "Build Realtek HD-audio codec support" ++ depends on INPUT + select SND_HDA_GENERIC + select SND_HDA_GENERIC_LEDS + select SND_HDA_SCODEC_COMPONENT +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -5002,7 +5002,6 @@ static void alc298_fixup_samsung_amp_v2_ + alc298_samsung_v2_init_amps(codec, 4); + } + +-#if IS_REACHABLE(CONFIG_INPUT) + static void gpio2_mic_hotkey_event(struct hda_codec *codec, + struct hda_jack_callback *event) + { +@@ -5111,10 +5110,6 @@ static void alc233_fixup_lenovo_line2_mi + spec->kb_dev = NULL; + } + } +-#else /* INPUT */ +-#define alc280_fixup_hp_gpio2_mic_hotkey NULL +-#define alc233_fixup_lenovo_line2_mic_hotkey NULL +-#endif /* INPUT */ + + static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, + const struct hda_fixup *fix, int action) diff --git a/queue-6.13/arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch b/queue-6.13/arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch new file mode 100644 index 0000000000..5a27b1f18c --- /dev/null +++ b/queue-6.13/arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch @@ -0,0 +1,38 @@ +From f458b2165d7ac0f2401fff48f19c8f864e7e1e38 Mon Sep 17 00:00:00 2001 +From: Lukas Bulwahn +Date: Fri, 17 Jan 2025 07:55:22 -0500 +Subject: arm64: Kconfig: Remove selecting replaced HAVE_FUNCTION_GRAPH_RETVAL + +From: Lukas Bulwahn + +commit f458b2165d7ac0f2401fff48f19c8f864e7e1e38 upstream. + +Commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs") +replaces the config HAVE_FUNCTION_GRAPH_RETVAL with the config +HAVE_FUNCTION_GRAPH_FREGS, and it replaces all the select commands in the +various architecture Kconfig files. In the arm64 architecture, the commit +adds the 'select HAVE_FUNCTION_GRAPH_FREGS', but misses to remove the +'select HAVE_FUNCTION_GRAPH_RETVAL', i.e., the select on the replaced +config. + +Remove selecting the replaced config. No functional change, just cleanup. + +Fixes: a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs") +Signed-off-by: Lukas Bulwahn +Link: https://lore.kernel.org/r/20250117125522.99071-1-lukas.bulwahn@redhat.com +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -221,7 +221,6 @@ config ARM64 + select HAVE_FUNCTION_ERROR_INJECTION + select HAVE_FUNCTION_GRAPH_FREGS + select HAVE_FUNCTION_GRAPH_TRACER +- select HAVE_FUNCTION_GRAPH_RETVAL + select HAVE_GCC_PLUGINS + select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \ + HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI diff --git a/queue-6.13/fprobe-always-unregister-fgraph-function-from-ops.patch b/queue-6.13/fprobe-always-unregister-fgraph-function-from-ops.patch new file mode 100644 index 0000000000..9ee2473780 --- /dev/null +++ b/queue-6.13/fprobe-always-unregister-fgraph-function-from-ops.patch @@ -0,0 +1,76 @@ +From ded9140622358a154efb3a777025fa7f7ae2c2d9 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Thu, 20 Feb 2025 15:20:12 -0500 +Subject: fprobe: Always unregister fgraph function from ops + +From: Steven Rostedt + +commit ded9140622358a154efb3a777025fa7f7ae2c2d9 upstream. + +When the last fprobe is removed, it calls unregister_ftrace_graph() to +remove the graph_ops from function graph. The issue is when it does so, it +calls return before removing the function from its graph ops via +ftrace_set_filter_ips(). This leaves the last function lingering in the +fprobe's fgraph ops and if a probe is added it also enables that last +function (even though the callback will just drop it, it does add unneeded +overhead to make that call). + + # echo "f:myevent1 kernel_clone" >> /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions +kernel_clone (1) tramp: 0xffffffffc02f3000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 + + # echo "f:myevent2 schedule_timeout" >> /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions +kernel_clone (1) tramp: 0xffffffffc02f3000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 +schedule_timeout (1) tramp: 0xffffffffc02f3000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 + + # > /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions + + # echo "f:myevent3 kmem_cache_free" >> /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions +kmem_cache_free (1) tramp: 0xffffffffc0219000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 +schedule_timeout (1) tramp: 0xffffffffc0219000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 + +The above enabled a fprobe on kernel_clone, and then on schedule_timeout. +The content of the enabled_functions shows the functions that have a +callback attached to them. The fprobe attached to those functions +properly. Then the fprobes were cleared, and enabled_functions was empty +after that. But after adding a fprobe on kmem_cache_free, the +enabled_functions shows that the schedule_timeout was attached again. This +is because it was still left in the fprobe ops that is used to tell +function graph what functions it wants callbacks from. + +Cc: stable@vger.kernel.org +Cc: Mark Rutland +Cc: Mathieu Desnoyers +Cc: Andrew Morton +Cc: Sven Schnelle +Cc: Vasily Gorbik +Cc: Alexander Gordeev +Link: https://lore.kernel.org/20250220202055.393254452@goodmis.org +Fixes: 4346ba1604093 ("fprobe: Rewrite fprobe on function-graph tracer") +Tested-by: Heiko Carstens +Acked-by: Masami Hiramatsu (Google) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/fprobe.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/kernel/trace/fprobe.c ++++ b/kernel/trace/fprobe.c +@@ -374,11 +374,9 @@ static void fprobe_graph_remove_ips(unsi + lockdep_assert_held(&fprobe_mutex); + + fprobe_graph_active--; +- if (!fprobe_graph_active) { +- /* Q: should we unregister it ? */ ++ /* Q: should we unregister it ? */ ++ if (!fprobe_graph_active) + unregister_ftrace_graph(&fprobe_graph_ops); +- return; +- } + + ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0); + } diff --git a/queue-6.13/fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch b/queue-6.13/fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch new file mode 100644 index 0000000000..67b042ae76 --- /dev/null +++ b/queue-6.13/fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch @@ -0,0 +1,93 @@ +From ca26554a1498bc905c4a39fb42d55d93f3ae8df2 Mon Sep 17 00:00:00 2001 +From: Steven Rostedt +Date: Thu, 20 Feb 2025 15:20:13 -0500 +Subject: fprobe: Fix accounting of when to unregister from function graph + +From: Steven Rostedt + +commit ca26554a1498bc905c4a39fb42d55d93f3ae8df2 upstream. + +When adding a new fprobe, it will update the function hash to the +functions the fprobe is attached to and register with function graph to +have it call the registered functions. The fprobe_graph_active variable +keeps track of the number of fprobes that are using function graph. + +If two fprobes attach to the same function, it increments the +fprobe_graph_active for each of them. But when they are removed, the first +fprobe to be removed will see that the function it is attached to is also +used by another fprobe and it will not remove that function from +function_graph. The logic will skip decrementing the fprobe_graph_active +variable. + +This causes the fprobe_graph_active variable to not go to zero when all +fprobes are removed, and in doing so it does not unregister from +function graph. As the fgraph ops hash will now be empty, and an empty +filter hash means all functions are enabled, this triggers function graph +to add a callback to the fprobe infrastructure for every function! + + # echo "f:myevent1 kernel_clone" >> /sys/kernel/tracing/dynamic_events + # echo "f:myevent2 kernel_clone%return" >> /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions +kernel_clone (1) tramp: 0xffffffffc0024000 (ftrace_graph_func+0x0/0x60) ->ftrace_graph_func+0x0/0x60 + + # > /sys/kernel/tracing/dynamic_events + # cat /sys/kernel/tracing/enabled_functions +trace_initcall_start_cb (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +run_init_process (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +try_to_run_init_process (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +x86_pmu_show_pmu_cap (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +cleanup_rapl_pmus (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +uncore_free_pcibus_map (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +uncore_types_exit (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +uncore_pci_exit.part.0 (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +kvm_shutdown (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +vmx_dump_msrs (1) tramp: 0xffffffffc0026000 (function_trace_call+0x0/0x170) ->function_trace_call+0x0/0x170 +[..] + + # cat /sys/kernel/tracing/enabled_functions | wc -l +54702 + +If a fprobe is being removed and all its functions are also traced by +other fprobes, still decrement the fprobe_graph_active counter. + +Cc: stable@vger.kernel.org +Cc: Mark Rutland +Cc: Mathieu Desnoyers +Cc: Andrew Morton +Cc: Sven Schnelle +Cc: Vasily Gorbik +Cc: Alexander Gordeev +Link: https://lore.kernel.org/20250220202055.565129766@goodmis.org +Fixes: 4346ba1604093 ("fprobe: Rewrite fprobe on function-graph tracer") +Closes: https://lore.kernel.org/all/20250217114918.10397-A-hca@linux.ibm.com/ +Reported-by: Heiko Carstens +Tested-by: Heiko Carstens +Acked-by: Masami Hiramatsu (Google) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/fprobe.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/kernel/trace/fprobe.c ++++ b/kernel/trace/fprobe.c +@@ -378,7 +378,8 @@ static void fprobe_graph_remove_ips(unsi + if (!fprobe_graph_active) + unregister_ftrace_graph(&fprobe_graph_ops); + +- ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0); ++ if (num) ++ ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0); + } + + static int symbols_cmp(const void *a, const void *b) +@@ -648,8 +649,7 @@ int unregister_fprobe(struct fprobe *fp) + } + del_fprobe_hash(fp); + +- if (count) +- fprobe_graph_remove_ips(addrs, count); ++ fprobe_graph_remove_ips(addrs, count); + + kfree_rcu(hlist_array, rcu); + fp->hlist_array = NULL; diff --git a/queue-6.13/nvme-tcp-fix-a-c2htermreq-error-message.patch b/queue-6.13/nvme-tcp-fix-a-c2htermreq-error-message.patch new file mode 100644 index 0000000000..7928cd42db --- /dev/null +++ b/queue-6.13/nvme-tcp-fix-a-c2htermreq-error-message.patch @@ -0,0 +1,33 @@ +From afb41b08c44e5386f2f52fa859010ac4afd2b66f Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi +Date: Mon, 24 Feb 2025 15:40:58 +0100 +Subject: nvme-tcp: Fix a C2HTermReq error message + +From: Maurizio Lombardi + +commit afb41b08c44e5386f2f52fa859010ac4afd2b66f upstream. + +In H2CTermReq, a FES with value 0x05 means "R2T Limit Exceeded"; but +in C2HTermReq the same value has a different meaning (Data Transfer Limit +Exceeded). + +Fixes: 84e009042d0f ("nvme-tcp: add basic support for the C2HTermReq PDU") +Signed-off-by: Maurizio Lombardi +Reviewed-by: Sagi Grimberg +Signed-off-by: Keith Busch +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/tcp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvme/host/tcp.c ++++ b/drivers/nvme/host/tcp.c +@@ -788,7 +788,7 @@ static void nvme_tcp_handle_c2h_term(str + [NVME_TCP_FES_PDU_SEQ_ERR] = "PDU Sequence Error", + [NVME_TCP_FES_HDR_DIGEST_ERR] = "Header Digest Error", + [NVME_TCP_FES_DATA_OUT_OF_RANGE] = "Data Transfer Out Of Range", +- [NVME_TCP_FES_R2T_LIMIT_EXCEEDED] = "R2T Limit Exceeded", ++ [NVME_TCP_FES_DATA_LIMIT_EXCEEDED] = "Data Transfer Limit Exceeded", + [NVME_TCP_FES_UNSUPPORTED_PARAM] = "Unsupported Parameter", + }; + diff --git a/queue-6.13/series b/queue-6.13/series index f40be21998..f8a1d21ec4 100644 --- a/queue-6.13/series +++ b/queue-6.13/series @@ -200,3 +200,8 @@ iio-hid-sensor-prox-split-difference-from-multiple-c.patch dt-bindings-iio-dac-adi-axi-adc-fix-ad7606-pwm-names.patch iio-adc-ad7606-fix-wrong-scale-available.patch kbuild-hdrcheck-fix-cross-build-with-clang.patch +arm64-kconfig-remove-selecting-replaced-have_function_graph_retval.patch +fprobe-always-unregister-fgraph-function-from-ops.patch +fprobe-fix-accounting-of-when-to-unregister-from-function-graph.patch +alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch +nvme-tcp-fix-a-c2htermreq-error-message.patch -- 2.47.2