From 934bbc9e61bde31726d8f67d9cebdf94eb68eba8 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 26 Dec 2022 21:31:06 -0500 Subject: [PATCH] Fixes for 6.1 Signed-off-by: Sasha Levin --- ...s-fix-lost-servers_outstanding-count.patch | 59 ++++ ...x-i915-silent-stream-programming-flo.patch | 74 ++++ ...x-stream-id-config-keep-alive-for-rt.patch | 176 +++++++++ ...t-default-audio-parameters-for-kae-s.patch | 43 +++ ...-card-fix-refcount-leak-of-cpu_ep-in.patch | 43 +++ ...lake-fix-driver-hang-during-shutdown.patch | 41 +++ ...8173-rt5650-rt5514-fix-refcount-leak.patch | 57 +++ ...8183-fix-refcount-leak-in-mt8183_mt6.patch | 73 ++++ ...m-add-missing-clk_disable_unprepare-.patch | 37 ++ ...dif-add-missing-clk_disable_unprepar.patch | 37 ++ ...670-remove-unbalanced-pm_runtime_put.patch | 42 +++ ...fix-possible-use-after-free-in-sof_e.patch | 45 +++ .../asoc-wm8994-fix-potential-deadlock.patch | 42 +++ .../cfi-fix-cfi-failure-with-kasan.patch | 53 +++ ...avoid-large-variable-on-kernel-stack.patch | 90 +++++ ...-don-t-disable-ddi-transcoder-when-s.patch | 122 +++++++ .../ima-simplify-ima_lsm_copy_rule.patch | 66 ++++ ...-make-pac-test-work-with-gcc-7-and-8.patch | 49 +++ ...he-contents-argument-of-the-lsm-hook.patch | 85 +++++ ...21-avoid-to-init-common-ralink-reset.patch | 50 +++ ...ebug_peo_args-and-redirect_to_stderr.patch | 90 +++++ ...k-v-and-q-options-in-the-right-place.patch | 86 +++++ ...l-pmu-test-to-skip-parametrized-even.patch | 57 +++ ...-quiet-mode-consistent-between-tools.patch | 333 ++++++++++++++++++ ...-config_pstore_pmsg-selects-config_r.patch | 53 +++ ...sg_lock-to-an-rt_mutex-to-avoid-prio.patch | 70 ++++ queue-6.1/series | 26 ++ 27 files changed, 1999 insertions(+) create mode 100644 queue-6.1/afs-fix-lost-servers_outstanding-count.patch create mode 100644 queue-6.1/alsa-hda-hdmi-fix-i915-silent-stream-programming-flo.patch create mode 100644 queue-6.1/alsa-hda-hdmi-fix-stream-id-config-keep-alive-for-rt.patch create mode 100644 queue-6.1/alsa-hda-hdmi-set-default-audio-parameters-for-kae-s.patch create mode 100644 queue-6.1/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch create mode 100644 queue-6.1/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch create mode 100644 queue-6.1/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch create mode 100644 queue-6.1/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch create mode 100644 queue-6.1/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch create mode 100644 queue-6.1/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch create mode 100644 queue-6.1/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch create mode 100644 queue-6.1/asoc-sof_es8336-fix-possible-use-after-free-in-sof_e.patch create mode 100644 queue-6.1/asoc-wm8994-fix-potential-deadlock.patch create mode 100644 queue-6.1/cfi-fix-cfi-failure-with-kasan.patch create mode 100644 queue-6.1/drm-amd-pm-avoid-large-variable-on-kernel-stack.patch create mode 100644 queue-6.1/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch create mode 100644 queue-6.1/ima-simplify-ima_lsm_copy_rule.patch create mode 100644 queue-6.1/lkdtm-cfi-make-pac-test-work-with-gcc-7-and-8.patch create mode 100644 queue-6.1/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch create mode 100644 queue-6.1/mips-ralink-mt7621-avoid-to-init-common-ralink-reset.patch create mode 100644 queue-6.1/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch create mode 100644 queue-6.1/perf-probe-check-v-and-q-options-in-the-right-place.patch create mode 100644 queue-6.1/perf-test-fix-all-pmu-test-to-skip-parametrized-even.patch create mode 100644 queue-6.1/perf-tools-make-quiet-mode-consistent-between-tools.patch create mode 100644 queue-6.1/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch create mode 100644 queue-6.1/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch diff --git a/queue-6.1/afs-fix-lost-servers_outstanding-count.patch b/queue-6.1/afs-fix-lost-servers_outstanding-count.patch new file mode 100644 index 00000000000..823919f2cb9 --- /dev/null +++ b/queue-6.1/afs-fix-lost-servers_outstanding-count.patch @@ -0,0 +1,59 @@ +From 4c40824a24285e577402a87c49aced86e22576b1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Dec 2022 14:30:48 +0000 +Subject: afs: Fix lost servers_outstanding count + +From: David Howells + +[ Upstream commit 36f82c93ee0bd88f1c95a52537906b8178b537f1 ] + +The afs_fs_probe_dispatcher() work function is passed a count on +net->servers_outstanding when it is scheduled (which may come via its +timer). This is passed back to the work_item, passed to the timer or +dropped at the end of the dispatcher function. + +But, at the top of the dispatcher function, there are two checks which +skip the rest of the function: if the network namespace is being destroyed +or if there are no fileservers to probe. These two return paths, however, +do not drop the count passed to the dispatcher, and so, sometimes, the +destruction of a network namespace, such as induced by rmmod of the kafs +module, may get stuck in afs_purge_servers(), waiting for +net->servers_outstanding to become zero. + +Fix this by adding the missing decrements in afs_fs_probe_dispatcher(). + +Fixes: f6cbb368bcb0 ("afs: Actively poll fileservers to maintain NAT or firewall openings") +Reported-by: Marc Dionne +Signed-off-by: David Howells +Tested-by: Marc Dionne +cc: linux-afs@lists.infradead.org +Link: https://lore.kernel.org/r/167164544917.2072364.3759519569649459359.stgit@warthog.procyon.org.uk/ +Signed-off-by: Sasha Levin +--- + fs/afs/fs_probe.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c +index 3ac5fcf98d0d..daaf3810cc92 100644 +--- a/fs/afs/fs_probe.c ++++ b/fs/afs/fs_probe.c +@@ -366,12 +366,15 @@ void afs_fs_probe_dispatcher(struct work_struct *work) + unsigned long nowj, timer_at, poll_at; + bool first_pass = true, set_timer = false; + +- if (!net->live) ++ if (!net->live) { ++ afs_dec_servers_outstanding(net); + return; ++ } + + _enter(""); + + if (list_empty(&net->fs_probe_fast) && list_empty(&net->fs_probe_slow)) { ++ afs_dec_servers_outstanding(net); + _leave(" [none]"); + return; + } +-- +2.35.1 + diff --git a/queue-6.1/alsa-hda-hdmi-fix-i915-silent-stream-programming-flo.patch b/queue-6.1/alsa-hda-hdmi-fix-i915-silent-stream-programming-flo.patch new file mode 100644 index 00000000000..145329df6e3 --- /dev/null +++ b/queue-6.1/alsa-hda-hdmi-fix-i915-silent-stream-programming-flo.patch @@ -0,0 +1,74 @@ +From 77ce8361017f498a7469dffb397e62e423f1708d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 12:18:20 +0200 +Subject: ALSA: hda/hdmi: fix i915 silent stream programming flow + +From: Kai Vehmanen + +[ Upstream commit ada261b690ecd5c2f55f0c51bdf11d852a4561a6 ] + +The i915 display codec may not successfully transition to +normal audio streaming mode, if the stream id is programmed +while codec is actively transmitting data. This can happen +when silent stream is enabled in KAE mode. + +Fix the issue by implementing a i915 specific programming +flow, where the silent streaming is temporarily stopped, +a small delay is applied to ensure display codec becomes +idle, and then proceed with reprogramming the stream ID. + +Fixes: 15175a4f2bbb ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2") +Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7353 +Signed-off-by: Kai Vehmanen +Reviewed-by: Pierre-Louis Bossart +Tested-by: Rodrigo Vivi +Link: https://lore.kernel.org/r/20221209101822.3893675-2-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_hdmi.c | 28 ++++++++++++++++++++++++++-- + 1 file changed, 26 insertions(+), 2 deletions(-) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index 21edf7a619f0..35bef8fcd240 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2878,9 +2878,33 @@ static int i915_hsw_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, + hda_nid_t pin_nid, int dev_id, u32 stream_tag, + int format) + { ++ struct hdmi_spec *spec = codec->spec; ++ int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id); ++ struct hdmi_spec_per_pin *per_pin; ++ int res; ++ ++ if (pin_idx < 0) ++ per_pin = NULL; ++ else ++ per_pin = get_pin(spec, pin_idx); ++ + haswell_verify_D0(codec, cvt_nid, pin_nid); +- return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id, +- stream_tag, format); ++ ++ if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) { ++ silent_stream_set_kae(codec, per_pin, false); ++ /* wait for pending transfers in codec to clear */ ++ usleep_range(100, 200); ++ } ++ ++ res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id, ++ stream_tag, format); ++ ++ if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) { ++ usleep_range(100, 200); ++ silent_stream_set_kae(codec, per_pin, true); ++ } ++ ++ return res; + } + + /* pin_cvt_fixup ops override for HSW+ and VLV+ */ +-- +2.35.1 + diff --git a/queue-6.1/alsa-hda-hdmi-fix-stream-id-config-keep-alive-for-rt.patch b/queue-6.1/alsa-hda-hdmi-fix-stream-id-config-keep-alive-for-rt.patch new file mode 100644 index 00000000000..544dd55901a --- /dev/null +++ b/queue-6.1/alsa-hda-hdmi-fix-stream-id-config-keep-alive-for-rt.patch @@ -0,0 +1,176 @@ +From f60ae0920c2cf8860f0fb9778ca5826699d09ef5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 12:18:22 +0200 +Subject: ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend + +From: Kai Vehmanen + +[ Upstream commit ee0b089d660021792e4ab4dda191b097ce1e964f ] + +When the new style KAE keep-alive implementation is used on compatible +Intel hardware, the clocks are maintained when codec is in D3. The +generic code in hda_cleanup_all_streams() can however interfere with +generation of audio samples in this mode, by setting the stream and +channel ids to zero. + +To get full benefit of the keepalive, set the new +no_stream_clean_at_suspend quirk bit on affected Intel hardware. When +this bit is set, stream cleanup is skipped in hda_call_codec_suspend(). + +Special handling is needed for the case when system goes to suspend. The +stream id programming can be lost in this case. This will also cause +codec->cvt_setups to be out of sync. Handle this by implementing custom +suspend/resume handlers. If keep-alive is active for any converter, set +the quirk flags no_stream_clean_at_suspend and forced_resume. Upon +resume, keepalive programming is restored if needed. + +Fixes: 15175a4f2bbb ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2") +Signed-off-by: Kai Vehmanen +Reviewed-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20221209101822.3893675-4-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + include/sound/hda_codec.h | 1 + + sound/pci/hda/hda_codec.c | 3 +- + sound/pci/hda/patch_hdmi.c | 90 +++++++++++++++++++++++++++++++++++++- + 3 files changed, 92 insertions(+), 2 deletions(-) + +diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h +index 25ec8c181688..eba23daf2c29 100644 +--- a/include/sound/hda_codec.h ++++ b/include/sound/hda_codec.h +@@ -258,6 +258,7 @@ struct hda_codec { + unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ + unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ + unsigned int forced_resume:1; /* forced resume for jack */ ++ unsigned int no_stream_clean_at_suspend:1; /* do not clean streams at suspend */ + + #ifdef CONFIG_PM + unsigned long power_on_acct; +diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c +index b4d1e658c556..edd653ece70d 100644 +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -2886,7 +2886,8 @@ static unsigned int hda_call_codec_suspend(struct hda_codec *codec) + snd_hdac_enter_pm(&codec->core); + if (codec->patch_ops.suspend) + codec->patch_ops.suspend(codec); +- hda_cleanup_all_streams(codec); ++ if (!codec->no_stream_clean_at_suspend) ++ hda_cleanup_all_streams(codec); + state = hda_set_power_state(codec, AC_PWRST_D3); + update_power_acct(codec, true); + snd_hdac_leave_pm(&codec->core); +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index 3ebe8260485b..4f2e26e67b07 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -2925,6 +2925,88 @@ static void i915_pin_cvt_fixup(struct hda_codec *codec, + } + } + ++#ifdef CONFIG_PM ++static int i915_adlp_hdmi_suspend(struct hda_codec *codec) ++{ ++ struct hdmi_spec *spec = codec->spec; ++ bool silent_streams = false; ++ int pin_idx, res; ++ ++ res = generic_hdmi_suspend(codec); ++ ++ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { ++ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); ++ ++ if (per_pin->silent_stream) { ++ silent_streams = true; ++ break; ++ } ++ } ++ ++ if (silent_streams && spec->silent_stream_type == SILENT_STREAM_KAE) { ++ /* ++ * stream-id should remain programmed when codec goes ++ * to runtime suspend ++ */ ++ codec->no_stream_clean_at_suspend = 1; ++ ++ /* ++ * the system might go to S3, in which case keep-alive ++ * must be reprogrammed upon resume ++ */ ++ codec->forced_resume = 1; ++ ++ codec_dbg(codec, "HDMI: KAE active at suspend\n"); ++ } else { ++ codec->no_stream_clean_at_suspend = 0; ++ codec->forced_resume = 0; ++ } ++ ++ return res; ++} ++ ++static int i915_adlp_hdmi_resume(struct hda_codec *codec) ++{ ++ struct hdmi_spec *spec = codec->spec; ++ int pin_idx, res; ++ ++ res = generic_hdmi_resume(codec); ++ ++ /* KAE not programmed at suspend, nothing to do here */ ++ if (!codec->no_stream_clean_at_suspend) ++ return res; ++ ++ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { ++ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); ++ ++ /* ++ * If system was in suspend with monitor connected, ++ * the codec setting may have been lost. Re-enable ++ * keep-alive. ++ */ ++ if (per_pin->silent_stream) { ++ unsigned int param; ++ ++ param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0, ++ AC_VERB_GET_CONV, 0); ++ if (!param) { ++ codec_dbg(codec, "HDMI: KAE: restore stream id\n"); ++ silent_stream_enable_i915(codec, per_pin); ++ } ++ ++ param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0, ++ AC_VERB_GET_DIGI_CONVERT_1, 0); ++ if (!(param & (AC_DIG3_KAE << 16))) { ++ codec_dbg(codec, "HDMI: KAE: restore DIG3_KAE\n"); ++ silent_stream_set_kae(codec, per_pin, true); ++ } ++ } ++ } ++ ++ return res; ++} ++#endif ++ + /* precondition and allocation for Intel codecs */ + static int alloc_intel_hdmi(struct hda_codec *codec) + { +@@ -3055,8 +3137,14 @@ static int patch_i915_adlp_hdmi(struct hda_codec *codec) + if (!res) { + spec = codec->spec; + +- if (spec->silent_stream_type) ++ if (spec->silent_stream_type) { + spec->silent_stream_type = SILENT_STREAM_KAE; ++ ++#ifdef CONFIG_PM ++ codec->patch_ops.resume = i915_adlp_hdmi_resume; ++ codec->patch_ops.suspend = i915_adlp_hdmi_suspend; ++#endif ++ } + } + + return res; +-- +2.35.1 + diff --git a/queue-6.1/alsa-hda-hdmi-set-default-audio-parameters-for-kae-s.patch b/queue-6.1/alsa-hda-hdmi-set-default-audio-parameters-for-kae-s.patch new file mode 100644 index 00000000000..564da09a881 --- /dev/null +++ b/queue-6.1/alsa-hda-hdmi-set-default-audio-parameters-for-kae-s.patch @@ -0,0 +1,43 @@ +From 05a28b7937fec11fc35265ee5070e2d9316c1f6f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 12:18:21 +0200 +Subject: ALSA: hda/hdmi: set default audio parameters for KAE silent-stream + +From: Kai Vehmanen + +[ Upstream commit b17e7ea041d8b565063632501ca4597afd105102 ] + +If the stream-id is zero, the keep-alive (KAE) will only ensure clock is +generated, but no audio samples are sent over display link. This happens +before first real audio stream is played out to a newly connected +receiver. + +Reuse the code in silent_stream_enable() to set up stream parameters +to sane defaults values, also when using the newer keep-alive flow. + +Fixes: 15175a4f2bbb ("ALSA: hda/hdmi: add keep-alive support for ADL-P and DG2") +Signed-off-by: Kai Vehmanen +Reviewed-by: Pierre-Louis Bossart +Tested-by: Rodrigo Vivi +Link: https://lore.kernel.org/r/20221209101822.3893675-3-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/hda/patch_hdmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c +index 35bef8fcd240..3ebe8260485b 100644 +--- a/sound/pci/hda/patch_hdmi.c ++++ b/sound/pci/hda/patch_hdmi.c +@@ -1738,6 +1738,7 @@ static void silent_stream_enable(struct hda_codec *codec, + + switch (spec->silent_stream_type) { + case SILENT_STREAM_KAE: ++ silent_stream_enable_i915(codec, per_pin); + silent_stream_set_kae(codec, per_pin, true); + break; + case SILENT_STREAM_I915: +-- +2.35.1 + diff --git a/queue-6.1/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch b/queue-6.1/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch new file mode 100644 index 00000000000..af8fbf55dfc --- /dev/null +++ b/queue-6.1/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch @@ -0,0 +1,43 @@ +From f4b6320e46ed11d07cfe3bbc65dea195398aa744 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 16:15:27 +0800 +Subject: ASoC: audio-graph-card: fix refcount leak of cpu_ep in + __graph_for_each_link() + +From: Wang Yufen + +[ Upstream commit 8ab2d12c726f0fde0692fa5d81d8019b3dcd62d0 ] + +The of_get_next_child() returns a node with refcount incremented, and +decrements the refcount of prev. So in the error path of the while loop, +of_node_put() needs be called for cpu_ep. + +Fixes: fce9b90c1ab7 ("ASoC: audio-graph-card: cleanup DAI link loop method - step2") +Signed-off-by: Wang Yufen +Acked-by: Kuninori Morimoto +Link: https://lore.kernel.org/r/1670228127-13835-1-git-send-email-wangyufen@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/generic/audio-graph-card.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c +index fe7cf972d44c..5daa824a4ffc 100644 +--- a/sound/soc/generic/audio-graph-card.c ++++ b/sound/soc/generic/audio-graph-card.c +@@ -485,8 +485,10 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv, + of_node_put(codec_ep); + of_node_put(codec_port); + +- if (ret < 0) ++ if (ret < 0) { ++ of_node_put(cpu_ep); + return ret; ++ } + + codec_port_old = codec_port; + } +-- +2.35.1 + diff --git a/queue-6.1/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch b/queue-6.1/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch new file mode 100644 index 00000000000..4329f29ee7b --- /dev/null +++ b/queue-6.1/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch @@ -0,0 +1,41 @@ +From fcd6706d9385b3d3c24c99d9f98286bef597ab8d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 09:53:29 +0100 +Subject: ASoC: Intel: Skylake: Fix driver hang during shutdown + +From: Cezary Rojewski + +[ Upstream commit 171107237246d66bce04f3769d33648f896b4ce3 ] + +AudioDSP cores and HDAudio links need to be turned off on shutdown to +ensure no communication or data transfer occurs during the procedure. + +Fixes: c5a76a246989 ("ASoC: Intel: Skylake: Add shutdown callback") +Signed-off-by: Cezary Rojewski +Tested-by: Lukasz Majczak +Link: https://lore.kernel.org/r/20221205085330.857665-6-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/skylake/skl.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c +index 3312b57e3c0c..7f058acd221f 100644 +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -1116,7 +1116,10 @@ static void skl_shutdown(struct pci_dev *pci) + if (!skl->init_done) + return; + +- snd_hdac_stop_streams_and_chip(bus); ++ snd_hdac_stop_streams(bus); ++ snd_hdac_ext_bus_link_power_down_all(bus); ++ skl_dsp_sleep(skl->dsp); ++ + list_for_each_entry(s, &bus->stream_list, list) { + stream = stream_to_hdac_ext_stream(s); + snd_hdac_ext_stream_decouple(bus, stream, false); +-- +2.35.1 + diff --git a/queue-6.1/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch b/queue-6.1/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch new file mode 100644 index 00000000000..304f922f651 --- /dev/null +++ b/queue-6.1/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch @@ -0,0 +1,57 @@ +From 984f6b0c53aab18c880dc1da154bea8eb07307e5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 18:04:24 +0800 +Subject: ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in + mt8173_rt5650_rt5514_dev_probe() + +From: Wang Yufen + +[ Upstream commit 3327d721114c109ba0575f86f8fda3b525404054 ] + +The node returned by of_parse_phandle() with refcount incremented, +of_node_put() needs be called when finish using it. So add it in the +error path in mt8173_rt5650_rt5514_dev_probe(). + +Fixes: 0d1d7a664288 ("ASoC: mediatek: Refine mt8173 driver and change config option") +Signed-off-by: Wang Yufen +Link: https://lore.kernel.org/r/1670234664-24246-1-git-send-email-wangyufen@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c +index 12f40c81b101..f803f121659d 100644 +--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c ++++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c +@@ -200,14 +200,16 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev) + if (!mt8173_rt5650_rt5514_dais[DAI_LINK_CODEC_I2S].codecs[0].of_node) { + dev_err(&pdev->dev, + "Property 'audio-codec' missing or invalid\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out; + } + mt8173_rt5650_rt5514_dais[DAI_LINK_CODEC_I2S].codecs[1].of_node = + of_parse_phandle(pdev->dev.of_node, "mediatek,audio-codec", 1); + if (!mt8173_rt5650_rt5514_dais[DAI_LINK_CODEC_I2S].codecs[1].of_node) { + dev_err(&pdev->dev, + "Property 'audio-codec' missing or invalid\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out; + } + mt8173_rt5650_rt5514_codec_conf[0].dlc.of_node = + mt8173_rt5650_rt5514_dais[DAI_LINK_CODEC_I2S].codecs[1].of_node; +@@ -216,6 +218,7 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev) + + ret = devm_snd_soc_register_card(&pdev->dev, card); + ++out: + of_node_put(platform_node); + return ret; + } +-- +2.35.1 + diff --git a/queue-6.1/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch b/queue-6.1/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch new file mode 100644 index 00000000000..d6bf932a475 --- /dev/null +++ b/queue-6.1/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch @@ -0,0 +1,73 @@ +From 4a42557aa492bb33943162b0a9f3be4a7daf5774 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 17:56:28 +0800 +Subject: ASoC: mediatek: mt8183: fix refcount leak in + mt8183_mt6358_ts3a227_max98357_dev_probe() + +From: Wang Yufen + +[ Upstream commit 38eef3be38ab895959c442702864212cc3beb96c ] + +The node returned by of_parse_phandle() with refcount incremented, +of_node_put() needs be called when finish using it. So add it in the +error path in mt8183_mt6358_ts3a227_max98357_dev_probe(). + +Fixes: 11c0269017b2 ("ASoC: Mediatek: MT8183: Add machine driver with TS3A227") +Signed-off-by: Wang Yufen +Link: https://lore.kernel.org/r/1670234188-23596-1-git-send-email-wangyufen@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +index a86085223677..48c14be5e3db 100644 +--- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c ++++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +@@ -677,8 +677,10 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) + } + + card = (struct snd_soc_card *)of_device_get_match_data(&pdev->dev); +- if (!card) ++ if (!card) { ++ of_node_put(platform_node); + return -EINVAL; ++ } + card->dev = &pdev->dev; + + ec_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,ec-codec", 0); +@@ -767,8 +769,10 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) + } + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); +- if (!priv) +- return -ENOMEM; ++ if (!priv) { ++ ret = -ENOMEM; ++ goto out; ++ } + + snd_soc_card_set_drvdata(card, priv); + +@@ -776,7 +780,8 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) + if (IS_ERR(priv->pinctrl)) { + dev_err(&pdev->dev, "%s devm_pinctrl_get failed\n", + __func__); +- return PTR_ERR(priv->pinctrl); ++ ret = PTR_ERR(priv->pinctrl); ++ goto out; + } + + for (i = 0; i < PIN_STATE_MAX; i++) { +@@ -809,6 +814,7 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) + + ret = devm_snd_soc_register_card(&pdev->dev, card); + ++out: + of_node_put(platform_node); + of_node_put(ec_codec); + of_node_put(hdmi_codec); +-- +2.35.1 + diff --git a/queue-6.1/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch b/queue-6.1/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch new file mode 100644 index 00000000000..973100456c1 --- /dev/null +++ b/queue-6.1/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch @@ -0,0 +1,37 @@ +From d3a17c4a987056d0753ef27deb589f0f3ce39b18 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 11:28:02 +0800 +Subject: ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in + rockchip_pdm_runtime_resume() + +From: Wang Jingjin + +[ Upstream commit ef0a098efb36660326c133af9b5a04a96a00e3ca ] + +The clk_disable_unprepare() should be called in the error handling of +rockchip_pdm_runtime_resume(). + +Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller") +Signed-off-by: Wang Jingjin +Link: https://lore.kernel.org/r/20221205032802.2422983-1-wangjingjin1@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/rockchip/rockchip_pdm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c +index a7549f827235..5b1e47bdc376 100644 +--- a/sound/soc/rockchip/rockchip_pdm.c ++++ b/sound/soc/rockchip/rockchip_pdm.c +@@ -431,6 +431,7 @@ static int rockchip_pdm_runtime_resume(struct device *dev) + + ret = clk_prepare_enable(pdm->hclk); + if (ret) { ++ clk_disable_unprepare(pdm->clk); + dev_err(pdm->dev, "hclock enable failed %d\n", ret); + return ret; + } +-- +2.35.1 + diff --git a/queue-6.1/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch b/queue-6.1/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch new file mode 100644 index 00000000000..e40a73d39ef --- /dev/null +++ b/queue-6.1/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch @@ -0,0 +1,37 @@ +From e4fce1d1aae6e9e18c49c2f45c02d4383eb65739 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Dec 2022 14:39:00 +0800 +Subject: ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in + rk_spdif_runtime_resume() + +From: Wang Jingjin + +[ Upstream commit 6d94d0090527b1763872275a7ccd44df7219b31e ] + +rk_spdif_runtime_resume() may have called clk_prepare_enable() before return +from failed branches, add missing clk_disable_unprepare() in this case. + +Fixes: f874b80e1571 ("ASoC: rockchip: Add rockchip SPDIF transceiver driver") +Signed-off-by: Wang Jingjin +Link: https://lore.kernel.org/r/20221208063900.4180790-1-wangjingjin1@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/rockchip/rockchip_spdif.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c +index 8bef572d3cbc..5b4f00457587 100644 +--- a/sound/soc/rockchip/rockchip_spdif.c ++++ b/sound/soc/rockchip/rockchip_spdif.c +@@ -88,6 +88,7 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev) + + ret = clk_prepare_enable(spdif->hclk); + if (ret) { ++ clk_disable_unprepare(spdif->mclk); + dev_err(spdif->dev, "hclk clock enable failed %d\n", ret); + return ret; + } +-- +2.35.1 + diff --git a/queue-6.1/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch b/queue-6.1/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch new file mode 100644 index 00000000000..accec763cf4 --- /dev/null +++ b/queue-6.1/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch @@ -0,0 +1,42 @@ +From 854499e52e2575efd77c865d0e887b587c90ad5d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Dec 2022 13:33:19 +0100 +Subject: ASoC: rt5670: Remove unbalanced pm_runtime_put() + +From: Hans de Goede + +[ Upstream commit 6c900dcc3f7331a67ed29739d74524e428d137fb ] + +For some reason rt5670_i2c_probe() does a pm_runtime_put() at the end +of a successful probe. But it has never done a pm_runtime_get() leading +to the following error being logged into dmesg: + + rt5670 i2c-10EC5640:00: Runtime PM usage count underflow! + +Fix this by removing the unnecessary pm_runtime_put(). + +Fixes: 64e89e5f5548 ("ASoC: rt5670: Add runtime PM support") +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20221213123319.11285-1-hdegoede@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt5670.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c +index ebac6caeb40a..a230f441559a 100644 +--- a/sound/soc/codecs/rt5670.c ++++ b/sound/soc/codecs/rt5670.c +@@ -3311,8 +3311,6 @@ static int rt5670_i2c_probe(struct i2c_client *i2c) + if (ret < 0) + goto err; + +- pm_runtime_put(&i2c->dev); +- + return 0; + err: + pm_runtime_disable(&i2c->dev); +-- +2.35.1 + diff --git a/queue-6.1/asoc-sof_es8336-fix-possible-use-after-free-in-sof_e.patch b/queue-6.1/asoc-sof_es8336-fix-possible-use-after-free-in-sof_e.patch new file mode 100644 index 00000000000..27434926eab --- /dev/null +++ b/queue-6.1/asoc-sof_es8336-fix-possible-use-after-free-in-sof_e.patch @@ -0,0 +1,45 @@ +From 130bbbe92f1d8884ada78693852fbfef33c4f483 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Dec 2022 22:37:21 +0800 +Subject: ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove() + +From: Yang Yingliang + +[ Upstream commit 1b41beaa7a58467505ec3023af8aad74f878b888 ] + +sof_es8336_remove() calls cancel_delayed_work(). However, that +function does not wait until the work function finishes. This +means that the callback function may still be running after +the driver's remove function has finished, which would result +in a use-after-free. + +Fix by calling cancel_delayed_work_sync(), which ensures that +the work is properly cancelled, no longer running, and unable +to re-schedule itself. + +Fixes: 89cdb224f2ab ("ASoC: sof_es8336: reduce pop noise on speaker") +Signed-off-by: Yang Yingliang +Acked-by: Pierre-Louis Bossart +Link: https://lore.kernel.org/r/20221205143721.3988988-1-yangyingliang@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_es8336.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c +index 70713e4b07dc..773e5d1d87d4 100644 +--- a/sound/soc/intel/boards/sof_es8336.c ++++ b/sound/soc/intel/boards/sof_es8336.c +@@ -783,7 +783,7 @@ static int sof_es8336_remove(struct platform_device *pdev) + struct snd_soc_card *card = platform_get_drvdata(pdev); + struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); + +- cancel_delayed_work(&priv->pcm_pop_work); ++ cancel_delayed_work_sync(&priv->pcm_pop_work); + gpiod_put(priv->gpio_speakers); + device_remove_software_node(priv->codec_dev); + put_device(priv->codec_dev); +-- +2.35.1 + diff --git a/queue-6.1/asoc-wm8994-fix-potential-deadlock.patch b/queue-6.1/asoc-wm8994-fix-potential-deadlock.patch new file mode 100644 index 00000000000..b774b6a0e11 --- /dev/null +++ b/queue-6.1/asoc-wm8994-fix-potential-deadlock.patch @@ -0,0 +1,42 @@ +From 1414628f8cfd9b80ce6150a360db8fe076bb270c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 10:16:57 +0100 +Subject: ASoC: wm8994: Fix potential deadlock + +From: Marek Szyprowski + +[ Upstream commit 9529dc167ffcdfd201b9f0eda71015f174095f7e ] + +Fix this by dropping wm8994->accdet_lock while calling +cancel_delayed_work_sync(&wm8994->mic_work) in wm1811_jackdet_irq(). + +Fixes: c0cc3f166525 ("ASoC: wm8994: Allow a delay between jack insertion and microphone detect") +Signed-off-by: Marek Szyprowski +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/20221209091657.1183-1-m.szyprowski@samsung.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8994.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c +index d3cfd3788f2a..8fe9a75d1235 100644 +--- a/sound/soc/codecs/wm8994.c ++++ b/sound/soc/codecs/wm8994.c +@@ -3853,7 +3853,12 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) + } else { + dev_dbg(component->dev, "Jack not detected\n"); + ++ /* Release wm8994->accdet_lock to avoid deadlock: ++ * cancel_delayed_work_sync() takes wm8994->mic_work internal ++ * lock and wm1811_mic_work takes wm8994->accdet_lock */ ++ mutex_unlock(&wm8994->accdet_lock); + cancel_delayed_work_sync(&wm8994->mic_work); ++ mutex_lock(&wm8994->accdet_lock); + + snd_soc_component_update_bits(component, WM8958_MICBIAS2, + WM8958_MICB2_DISCH, WM8958_MICB2_DISCH); +-- +2.35.1 + diff --git a/queue-6.1/cfi-fix-cfi-failure-with-kasan.patch b/queue-6.1/cfi-fix-cfi-failure-with-kasan.patch new file mode 100644 index 00000000000..97f652770dc --- /dev/null +++ b/queue-6.1/cfi-fix-cfi-failure-with-kasan.patch @@ -0,0 +1,53 @@ +From 827e3664f20241d04bc912178835e48fb8d2f30f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Dec 2022 22:57:47 +0000 +Subject: cfi: Fix CFI failure with KASAN + +From: Sami Tolvanen + +[ Upstream commit cf8016408d880afe9c5dc495af40dc2932874e77 ] + +When CFI_CLANG and KASAN are both enabled, LLVM doesn't generate a +CFI type hash for asan.module_ctor functions in translation units +where CFI is disabled, which leads to a CFI failure during boot when +do_ctors calls the affected constructors: + + CFI failure at do_basic_setup+0x64/0x90 (target: + asan.module_ctor+0x0/0x28; expected type: 0xa540670c) + +Specifically, this happens because CFI is disabled for +kernel/cfi.c. There's no reason to keep CFI disabled here anymore, so +fix the failure by not filtering out CC_FLAGS_CFI for the file. + +Note that https://reviews.llvm.org/rG3b14862f0a96 fixed the issue +where LLVM didn't emit CFI type hashes for any sanitizer constructors, +but now type hashes are emitted correctly for TUs that use CFI. + +Link: https://github.com/ClangBuiltLinux/linux/issues/1742 +Fixes: 89245600941e ("cfi: Switch to -fsanitize=kcfi") +Reported-by: Mark Rutland +Signed-off-by: Sami Tolvanen +Signed-off-by: Kees Cook +Link: https://lore.kernel.org/r/20221222225747.3538676-1-samitolvanen@google.com +Signed-off-by: Sasha Levin +--- + kernel/Makefile | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/kernel/Makefile b/kernel/Makefile +index d754e0be1176..ebc692242b68 100644 +--- a/kernel/Makefile ++++ b/kernel/Makefile +@@ -41,9 +41,6 @@ UBSAN_SANITIZE_kcov.o := n + KMSAN_SANITIZE_kcov.o := n + CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack) -fno-stack-protector + +-# Don't instrument error handlers +-CFLAGS_REMOVE_cfi.o := $(CC_FLAGS_CFI) +- + obj-y += sched/ + obj-y += locking/ + obj-y += power/ +-- +2.35.1 + diff --git a/queue-6.1/drm-amd-pm-avoid-large-variable-on-kernel-stack.patch b/queue-6.1/drm-amd-pm-avoid-large-variable-on-kernel-stack.patch new file mode 100644 index 00000000000..e75cbbb9f85 --- /dev/null +++ b/queue-6.1/drm-amd-pm-avoid-large-variable-on-kernel-stack.patch @@ -0,0 +1,90 @@ +From 93b69b4c6da579800b4e4ad460173eef30dc35e0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Dec 2022 17:36:31 +0100 +Subject: drm/amd/pm: avoid large variable on kernel stack + +From: Arnd Bergmann + +[ Upstream commit d118b18fb1da02b41df2da78cb2794b3638d89cd ] + +The activity_monitor_external[] array is too big to fit on the +kernel stack, resulting in this warning with clang: + +drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1438:12: error: stack frame size (1040) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode' [-Werror,-Wframe-larger-than] + +Use dynamic allocation instead. It should also be possible to +have single element here instead of the array, but this seems +easier. + +v2: fix up argument to sizeof() (Alex) + +Fixes: 334682ae8151 ("drm/amd/pm: enable workload type change on smu_v13_0_7") +Signed-off-by: Arnd Bergmann +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 21 ++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +index d74debc584f8..39deb06a86ba 100644 +--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c ++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +@@ -1436,7 +1436,7 @@ static int smu_v13_0_7_get_power_limit(struct smu_context *smu, + + static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf) + { +- DpmActivityMonitorCoeffIntExternal_t activity_monitor_external[PP_SMC_POWER_PROFILE_COUNT]; ++ DpmActivityMonitorCoeffIntExternal_t *activity_monitor_external; + uint32_t i, j, size = 0; + int16_t workload_type = 0; + int result = 0; +@@ -1444,6 +1444,12 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf + if (!buf) + return -EINVAL; + ++ activity_monitor_external = kcalloc(PP_SMC_POWER_PROFILE_COUNT, ++ sizeof(*activity_monitor_external), ++ GFP_KERNEL); ++ if (!activity_monitor_external) ++ return -ENOMEM; ++ + size += sysfs_emit_at(buf, size, " "); + for (i = 0; i <= PP_SMC_POWER_PROFILE_WINDOW3D; i++) + size += sysfs_emit_at(buf, size, "%-14s%s", amdgpu_pp_profile_name[i], +@@ -1456,15 +1462,17 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf + workload_type = smu_cmn_to_asic_specific_index(smu, + CMN2ASIC_MAPPING_WORKLOAD, + i); +- if (workload_type < 0) +- return -EINVAL; ++ if (workload_type < 0) { ++ result = -EINVAL; ++ goto out; ++ } + + result = smu_cmn_update_table(smu, + SMU_TABLE_ACTIVITY_MONITOR_COEFF, workload_type, + (void *)(&activity_monitor_external[i]), false); + if (result) { + dev_err(smu->adev->dev, "[%s] Failed to get activity monitor!", __func__); +- return result; ++ goto out; + } + } + +@@ -1492,7 +1500,10 @@ do { \ + PRINT_DPM_MONITOR(Fclk_BoosterFreq); + #undef PRINT_DPM_MONITOR + +- return size; ++ result = size; ++out: ++ kfree(activity_monitor_external); ++ return result; + } + + static int smu_v13_0_7_set_power_profile_mode(struct smu_context *smu, long *input, uint32_t size) +-- +2.35.1 + diff --git a/queue-6.1/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch b/queue-6.1/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch new file mode 100644 index 00000000000..69e64c23a37 --- /dev/null +++ b/queue-6.1/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch @@ -0,0 +1,122 @@ +From 9a6d138f19e4dc9bca4fbc2326abe047e5ac860b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 23 Nov 2022 14:09:26 -0800 +Subject: drm/i915/display: Don't disable DDI/Transcoder when setting phy test + pattern + +From: Khaled Almahallawy + +[ Upstream commit 3153eebb7a76e663ac76d6670dc113296de96622 ] + +Bspecs has updated recently to remove the restriction to disable +DDI/Transcoder before setting PHY test pattern. This update is to +address PHY compliance test failures observed on a port with LTTPR. +The issue is that when Transc. is disabled, the main link signals fed +to LTTPR will be dropped invalidating link training, which will affect +the quality of the phy test pattern when the transcoder is enabled again. + +v2: Update commit message (Clint) +v3: Add missing Signed-off in v2 +v4: Update Bspec and commit message for pre-gen12 (Jani) + +Bspec: 50482, 7555 +Fixes: 8cdf72711928 ("drm/i915/dp: Program vswing, pre-emphasis, test-pattern") +Cc: Imre Deak +Cc: Clint Taylor +CC: Jani Nikula +Tested-by: Khaled Almahallawy +Reviewed-by: Clint Taylor +Signed-off-by: Khaled Almahallawy +Signed-off-by: Jani Nikula +Link: https://patchwork.freedesktop.org/patch/msgid/20221123220926.170034-1-khaled.almahallawy@intel.com +(cherry picked from commit be4a847652056b067d6dc6fe0fc024a9e2e987ca) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/display/intel_dp.c | 59 ------------------------- + 1 file changed, 59 deletions(-) + +diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c +index 2b5bc95a8b0d..78b3427471bd 100644 +--- a/drivers/gpu/drm/i915/display/intel_dp.c ++++ b/drivers/gpu/drm/i915/display/intel_dp.c +@@ -3675,61 +3675,6 @@ static void intel_dp_phy_pattern_update(struct intel_dp *intel_dp, + } + } + +-static void +-intel_dp_autotest_phy_ddi_disable(struct intel_dp *intel_dp, +- const struct intel_crtc_state *crtc_state) +-{ +- struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); +- struct drm_device *dev = dig_port->base.base.dev; +- struct drm_i915_private *dev_priv = to_i915(dev); +- struct intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc); +- enum pipe pipe = crtc->pipe; +- u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value; +- +- trans_ddi_func_ctl_value = intel_de_read(dev_priv, +- TRANS_DDI_FUNC_CTL(pipe)); +- trans_conf_value = intel_de_read(dev_priv, PIPECONF(pipe)); +- dp_tp_ctl_value = intel_de_read(dev_priv, TGL_DP_TP_CTL(pipe)); +- +- trans_ddi_func_ctl_value &= ~(TRANS_DDI_FUNC_ENABLE | +- TGL_TRANS_DDI_PORT_MASK); +- trans_conf_value &= ~PIPECONF_ENABLE; +- dp_tp_ctl_value &= ~DP_TP_CTL_ENABLE; +- +- intel_de_write(dev_priv, PIPECONF(pipe), trans_conf_value); +- intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(pipe), +- trans_ddi_func_ctl_value); +- intel_de_write(dev_priv, TGL_DP_TP_CTL(pipe), dp_tp_ctl_value); +-} +- +-static void +-intel_dp_autotest_phy_ddi_enable(struct intel_dp *intel_dp, +- const struct intel_crtc_state *crtc_state) +-{ +- struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); +- struct drm_device *dev = dig_port->base.base.dev; +- struct drm_i915_private *dev_priv = to_i915(dev); +- enum port port = dig_port->base.port; +- struct intel_crtc *crtc = to_intel_crtc(dig_port->base.base.crtc); +- enum pipe pipe = crtc->pipe; +- u32 trans_ddi_func_ctl_value, trans_conf_value, dp_tp_ctl_value; +- +- trans_ddi_func_ctl_value = intel_de_read(dev_priv, +- TRANS_DDI_FUNC_CTL(pipe)); +- trans_conf_value = intel_de_read(dev_priv, PIPECONF(pipe)); +- dp_tp_ctl_value = intel_de_read(dev_priv, TGL_DP_TP_CTL(pipe)); +- +- trans_ddi_func_ctl_value |= TRANS_DDI_FUNC_ENABLE | +- TGL_TRANS_DDI_SELECT_PORT(port); +- trans_conf_value |= PIPECONF_ENABLE; +- dp_tp_ctl_value |= DP_TP_CTL_ENABLE; +- +- intel_de_write(dev_priv, PIPECONF(pipe), trans_conf_value); +- intel_de_write(dev_priv, TGL_DP_TP_CTL(pipe), dp_tp_ctl_value); +- intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(pipe), +- trans_ddi_func_ctl_value); +-} +- + static void intel_dp_process_phy_request(struct intel_dp *intel_dp, + const struct intel_crtc_state *crtc_state) + { +@@ -3748,14 +3693,10 @@ static void intel_dp_process_phy_request(struct intel_dp *intel_dp, + intel_dp_get_adjust_train(intel_dp, crtc_state, DP_PHY_DPRX, + link_status); + +- intel_dp_autotest_phy_ddi_disable(intel_dp, crtc_state); +- + intel_dp_set_signal_levels(intel_dp, crtc_state, DP_PHY_DPRX); + + intel_dp_phy_pattern_update(intel_dp, crtc_state); + +- intel_dp_autotest_phy_ddi_enable(intel_dp, crtc_state); +- + drm_dp_dpcd_write(&intel_dp->aux, DP_TRAINING_LANE0_SET, + intel_dp->train_set, crtc_state->lane_count); + +-- +2.35.1 + diff --git a/queue-6.1/ima-simplify-ima_lsm_copy_rule.patch b/queue-6.1/ima-simplify-ima_lsm_copy_rule.patch new file mode 100644 index 00000000000..3d8582f54cf --- /dev/null +++ b/queue-6.1/ima-simplify-ima_lsm_copy_rule.patch @@ -0,0 +1,66 @@ +From 1fcf58270ffd487ad8531807f4fb68b7395a4fe8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Sep 2022 20:58:03 +0800 +Subject: ima: Simplify ima_lsm_copy_rule + +From: GUO Zihua + +[ Upstream commit d57378d3aa4d864d9e590482602068af1b20c0c5 ] + +Currently ima_lsm_copy_rule() set the arg_p field of the source rule to +NULL, so that the source rule could be freed afterward. It does not make +sense for this behavior to be inside a "copy" function. So move it +outside and let the caller handle this field. + +ima_lsm_copy_rule() now produce a shallow copy of the original entry +including args_p field. Meaning only the lsm.rule and the rule itself +should be freed for the original rule. Thus, instead of calling +ima_lsm_free_rule() which frees lsm.rule as well as args_p field, free +the lsm.rule directly. + +Signed-off-by: GUO Zihua +Reviewed-by: Roberto Sassu +Signed-off-by: Mimi Zohar +Signed-off-by: Sasha Levin +--- + security/integrity/ima/ima_policy.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c +index bb3707160b01..2edff7f58c25 100644 +--- a/security/integrity/ima/ima_policy.c ++++ b/security/integrity/ima/ima_policy.c +@@ -398,12 +398,6 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) + + nentry->lsm[i].type = entry->lsm[i].type; + nentry->lsm[i].args_p = entry->lsm[i].args_p; +- /* +- * Remove the reference from entry so that the associated +- * memory will not be freed during a later call to +- * ima_lsm_free_rule(entry). +- */ +- entry->lsm[i].args_p = NULL; + + ima_filter_rule_init(nentry->lsm[i].type, Audit_equal, + nentry->lsm[i].args_p, +@@ -417,6 +411,7 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) + + static int ima_lsm_update_rule(struct ima_rule_entry *entry) + { ++ int i; + struct ima_rule_entry *nentry; + + nentry = ima_lsm_copy_rule(entry); +@@ -431,7 +426,8 @@ static int ima_lsm_update_rule(struct ima_rule_entry *entry) + * references and the entry itself. All other memory references will now + * be owned by nentry. + */ +- ima_lsm_free_rule(entry); ++ for (i = 0; i < MAX_LSM_RULES; i++) ++ ima_filter_rule_free(entry->lsm[i].rule); + kfree(entry); + + return 0; +-- +2.35.1 + diff --git a/queue-6.1/lkdtm-cfi-make-pac-test-work-with-gcc-7-and-8.patch b/queue-6.1/lkdtm-cfi-make-pac-test-work-with-gcc-7-and-8.patch new file mode 100644 index 00000000000..f84a69c7d29 --- /dev/null +++ b/queue-6.1/lkdtm-cfi-make-pac-test-work-with-gcc-7-and-8.patch @@ -0,0 +1,49 @@ +From ddb83fe757780cd35c6a9156fc1ed715862a4c67 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 17:34:41 +0000 +Subject: lkdtm: cfi: Make PAC test work with GCC 7 and 8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kristina Martsenko + +[ Upstream commit f68022ae0aeb0803450e05abc0e984027c33ef1b ] + +The CFI test uses the branch-protection=none compiler attribute to +disable PAC return address protection on a function. While newer GCC +versions support this attribute, older versions (GCC 7 and 8) instead +supported the sign-return-address=none attribute, leading to a build +failure when the test is built with older compilers. Fix it by checking +which attribute is supported and using the correct one. + +Fixes: 2e53b877dc12 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations") +Reported-by: Daniel Díaz +Signed-off-by: Kristina Martsenko +Signed-off-by: Kees Cook +Link: https://lore.kernel.org/all/CAEUSe78kDPxQmQqCWW-_9LCgJDFhAeMoVBFnX9QLx18Z4uT4VQ@mail.gmail.com/ +Signed-off-by: Sasha Levin +--- + drivers/misc/lkdtm/cfi.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/misc/lkdtm/cfi.c b/drivers/misc/lkdtm/cfi.c +index 5245cf6013c9..fc28714ae3a6 100644 +--- a/drivers/misc/lkdtm/cfi.c ++++ b/drivers/misc/lkdtm/cfi.c +@@ -54,7 +54,11 @@ static void lkdtm_CFI_FORWARD_PROTO(void) + # ifdef CONFIG_ARM64_BTI_KERNEL + # define __no_pac "branch-protection=bti" + # else +-# define __no_pac "branch-protection=none" ++# ifdef CONFIG_CC_HAS_BRANCH_PROT_PAC_RET ++# define __no_pac "branch-protection=none" ++# else ++# define __no_pac "sign-return-address=none" ++# endif + # endif + # define __no_ret_protection __noscs __attribute__((__target__(__no_pac))) + #else +-- +2.35.1 + diff --git a/queue-6.1/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch b/queue-6.1/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch new file mode 100644 index 00000000000..90652e02f70 --- /dev/null +++ b/queue-6.1/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch @@ -0,0 +1,85 @@ +From be9dd578becc5986e024e1b7d75e1e47723908a7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Dec 2022 11:54:57 -0800 +Subject: LoadPin: Ignore the "contents" argument of the LSM hooks + +From: Kees Cook + +[ Upstream commit 1a17e5b513ceebf21100027745b8731b4728edf7 ] + +LoadPin only enforces the read-only origin of kernel file reads. Whether +or not it was a partial read isn't important. Remove the overly +conservative checks so that things like partial firmware reads will +succeed (i.e. reading a firmware header). + +Fixes: 2039bda1fa8d ("LSM: Add "contents" flag to kernel_read_file hook") +Cc: Paul Moore +Cc: James Morris +Cc: "Serge E. Hallyn" +Cc: linux-security-module@vger.kernel.org +Signed-off-by: Kees Cook +Acked-by: Serge Hallyn +Tested-by: Ping-Ke Shih +Link: https://lore.kernel.org/r/20221209195453.never.494-kees@kernel.org +Signed-off-by: Sasha Levin +--- + security/loadpin/loadpin.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c +index de41621f4998..110a5ab2b46b 100644 +--- a/security/loadpin/loadpin.c ++++ b/security/loadpin/loadpin.c +@@ -122,21 +122,11 @@ static void loadpin_sb_free_security(struct super_block *mnt_sb) + } + } + +-static int loadpin_read_file(struct file *file, enum kernel_read_file_id id, +- bool contents) ++static int loadpin_check(struct file *file, enum kernel_read_file_id id) + { + struct super_block *load_root; + const char *origin = kernel_read_file_id_str(id); + +- /* +- * If we will not know that we'll be seeing the full contents +- * then we cannot trust a load will be complete and unchanged +- * off disk. Treat all contents=false hooks as if there were +- * no associated file struct. +- */ +- if (!contents) +- file = NULL; +- + /* If the file id is excluded, ignore the pinning. */ + if ((unsigned int)id < ARRAY_SIZE(ignore_read_file_id) && + ignore_read_file_id[id]) { +@@ -192,9 +182,25 @@ static int loadpin_read_file(struct file *file, enum kernel_read_file_id id, + return 0; + } + ++static int loadpin_read_file(struct file *file, enum kernel_read_file_id id, ++ bool contents) ++{ ++ /* ++ * LoadPin only cares about the _origin_ of a file, not its ++ * contents, so we can ignore the "are full contents available" ++ * argument here. ++ */ ++ return loadpin_check(file, id); ++} ++ + static int loadpin_load_data(enum kernel_load_data_id id, bool contents) + { +- return loadpin_read_file(NULL, (enum kernel_read_file_id) id, contents); ++ /* ++ * LoadPin only cares about the _origin_ of a file, not its ++ * contents, so a NULL file is passed, and we can ignore the ++ * state of "contents". ++ */ ++ return loadpin_check(NULL, (enum kernel_read_file_id) id); + } + + static struct security_hook_list loadpin_hooks[] __lsm_ro_after_init = { +-- +2.35.1 + diff --git a/queue-6.1/mips-ralink-mt7621-avoid-to-init-common-ralink-reset.patch b/queue-6.1/mips-ralink-mt7621-avoid-to-init-common-ralink-reset.patch new file mode 100644 index 00000000000..ef3a4e145a7 --- /dev/null +++ b/queue-6.1/mips-ralink-mt7621-avoid-to-init-common-ralink-reset.patch @@ -0,0 +1,50 @@ +From 4b47dfabd1767f2391cabba375cc48c050fac361 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 17 Dec 2022 08:48:06 +0100 +Subject: MIPS: ralink: mt7621: avoid to init common ralink reset controller + +From: Sergio Paracuellos + +[ Upstream commit 76ce51798cb16738a4a28a6662e7344aaf7ef769 ] + +Commit 38a8553b0a22 ("clk: ralink: make system controller node a reset provider") +make system controller a reset provider for mt7621 ralink SoCs. Ralink init code +also tries to start previous common reset controller which at the end tries to +find device tree node 'ralink,rt2880-reset'. mt7621 device tree file is not +using at all this node anymore. Hence avoid to init this common reset controller +for mt7621 ralink SoCs to avoid 'Failed to find reset controller node' boot +error trace error. + +Fixes: 64b2d6ffff86 ("staging: mt7621-dts: align resets with binding documentation") +Signed-off-by: Sergio Paracuellos +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/ralink/of.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c +index ea8072acf8d9..01c132bc33d5 100644 +--- a/arch/mips/ralink/of.c ++++ b/arch/mips/ralink/of.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "common.h" + +@@ -81,7 +82,8 @@ static int __init plat_of_setup(void) + __dt_register_buses(soc_info.compatible, "palmbus"); + + /* make sure that the reset controller is setup early */ +- ralink_rst_init(); ++ if (ralink_soc != MT762X_SOC_MT7621AT) ++ ralink_rst_init(); + + return 0; + } +-- +2.35.1 + diff --git a/queue-6.1/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch b/queue-6.1/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch new file mode 100644 index 00000000000..d0ef6250aeb --- /dev/null +++ b/queue-6.1/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch @@ -0,0 +1,90 @@ +From c0f4859534a2297fa69474f8073d88904d2e7355 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Dec 2022 11:57:00 +0800 +Subject: perf debug: Set debug_peo_args and redirect_to_stderr variable to + correct values in perf_quiet_option() + +From: Yang Jihong + +[ Upstream commit 188ac720d364035008a54d249cf47b4cc100f819 ] + +When perf uses quiet mode, perf_quiet_option() sets the 'debug_peo_args' +variable to -1, and display_attr() incorrectly determines the value of +'debug_peo_args'. As a result, unexpected information is displayed. + +Before: + + # perf record --quiet -- ls > /dev/null + ------------------------------------------------------------ + perf_event_attr: + size 128 + { sample_period, sample_freq } 4000 + sample_type IP|TID|TIME|PERIOD + read_format ID|LOST + disabled 1 + inherit 1 + mmap 1 + comm 1 + freq 1 + enable_on_exec 1 + task 1 + precise_ip 3 + sample_id_all 1 + exclude_guest 1 + mmap2 1 + comm_exec 1 + ksymbol 1 + bpf_event 1 + ------------------------------------------------------------ + ... + +After: + # perf record --quiet -- ls > /dev/null + # + +redirect_to_stderr is a similar problem. + +Fixes: f78eaef0e0493f60 ("perf tools: Allow to force redirect pr_debug to stderr.") +Fixes: ccd26741f5e6bdf2 ("perf tool: Provide an option to print perf_event_open args and return value") +Suggested-by: Adrian Hunter +Reviewed-by: Adrian Hunter +Signed-off-by: Yang Jihong +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: Carsten Haitzler +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Leo Yan +Cc: Mark Rutland +Cc: martin.lau@kernel.org +Cc: Masami Hiramatsu +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Ravi Bangoria +Cc: Ravi Bangoria +Link: https://lore.kernel.org/r/20221220035702.188413-2-yangjihong1@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/debug.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c +index 65e6c22f38e4..190e818a0717 100644 +--- a/tools/perf/util/debug.c ++++ b/tools/perf/util/debug.c +@@ -241,6 +241,10 @@ int perf_quiet_option(void) + opt++; + } + ++ /* For debug variables that are used as bool types, set to 0. */ ++ redirect_to_stderr = 0; ++ debug_peo_args = 0; ++ + return 0; + } + +-- +2.35.1 + diff --git a/queue-6.1/perf-probe-check-v-and-q-options-in-the-right-place.patch b/queue-6.1/perf-probe-check-v-and-q-options-in-the-right-place.patch new file mode 100644 index 00000000000..6c8c1c5e515 --- /dev/null +++ b/queue-6.1/perf-probe-check-v-and-q-options-in-the-right-place.patch @@ -0,0 +1,86 @@ +From f9eb3ca979bfda6748755a0e13e18263da4aa07d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Dec 2022 11:57:02 +0800 +Subject: perf probe: Check -v and -q options in the right place + +From: Yang Jihong + +[ Upstream commit 8b269b75551227796c1ddac2dbdb2ba504158c61 ] + +Check the -q and -v options first to return earlier on error. + +Before: + + # perf probe -q -v test + probe-definition(0): test + symbol:test file:(null) line:0 offset:0 return:0 lazy:(null) + 0 arguments + Error: -v and -q are exclusive. + +After: + + # perf probe -q -v test + Error: -v and -q are exclusive. + +Fixes: 5e17b28f1e246b98 ("perf probe: Add --quiet option to suppress output result message") +Reviewed-by: Adrian Hunter +Signed-off-by: Yang Jihong +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: Carsten Haitzler +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Leo Yan +Cc: Mark Rutland +Cc: Martin KaFai Lau +Cc: Masami Hiramatsu +Cc: Masami Hiramatsu +Cc: Namhyung Kim +Cc: Peter Zijlstra +Cc: Ravi Bangoria +Link: https://lore.kernel.org/r/20221220035702.188413-4-yangjihong1@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/builtin-probe.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c +index 2ae50fc9e597..ed73d0b89ca2 100644 +--- a/tools/perf/builtin-probe.c ++++ b/tools/perf/builtin-probe.c +@@ -612,6 +612,15 @@ __cmd_probe(int argc, const char **argv) + + argc = parse_options(argc, argv, options, probe_usage, + PARSE_OPT_STOP_AT_NON_OPTION); ++ ++ if (quiet) { ++ if (verbose != 0) { ++ pr_err(" Error: -v and -q are exclusive.\n"); ++ return -EINVAL; ++ } ++ verbose = -1; ++ } ++ + if (argc > 0) { + if (strcmp(argv[0], "-") == 0) { + usage_with_options_msg(probe_usage, options, +@@ -633,14 +642,6 @@ __cmd_probe(int argc, const char **argv) + if (ret) + return ret; + +- if (quiet) { +- if (verbose != 0) { +- pr_err(" Error: -v and -q are exclusive.\n"); +- return -EINVAL; +- } +- verbose = -1; +- } +- + if (probe_conf.max_probes == 0) + probe_conf.max_probes = MAX_PROBES; + +-- +2.35.1 + diff --git a/queue-6.1/perf-test-fix-all-pmu-test-to-skip-parametrized-even.patch b/queue-6.1/perf-test-fix-all-pmu-test-to-skip-parametrized-even.patch new file mode 100644 index 00000000000..75ce29a597d --- /dev/null +++ b/queue-6.1/perf-test-fix-all-pmu-test-to-skip-parametrized-even.patch @@ -0,0 +1,57 @@ +From 0f3e9cdfa52d959bd083ef2a15dc5746e06b0d96 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Dec 2022 17:30:08 +0100 +Subject: perf test: Fix "all PMU test" to skip parametrized events + +From: Michael Petlan + +[ Upstream commit b50d691e50e600fab82b423be871860537d75dc9 ] + +Parametrized events are not only a powerpc domain. They occur on other +platforms too (e.g. aarch64). They should be ignored in this testcase, +since proper setup of the parameters is out of scope of this script. + +Let's not filter them out by PMU name, but rather based on the fact that +they expect a parameter. + +Fixes: 451ed8058c69a3fe ("perf test: Fix "all PMU test" to skip hv_24x7/hv_gpci tests on powerpc") +Signed-off-by: Michael Petlan +Cc: Athira Rajeev +Cc: Disha Goel +Cc: Ian Rogers +Cc: Michael Ellerman +Cc: Nageswara R Sastry +Link: https://lore.kernel.org/r/20221219163008.9691-1-mpetlan@redhat.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/tests/shell/stat_all_pmu.sh | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/tools/perf/tests/shell/stat_all_pmu.sh b/tools/perf/tests/shell/stat_all_pmu.sh +index 9c9ef33e0b3c..c77955419173 100755 +--- a/tools/perf/tests/shell/stat_all_pmu.sh ++++ b/tools/perf/tests/shell/stat_all_pmu.sh +@@ -4,17 +4,8 @@ + + set -e + +-for p in $(perf list --raw-dump pmu); do +- # In powerpc, skip the events for hv_24x7 and hv_gpci. +- # These events needs input values to be filled in for +- # core, chip, partition id based on system. +- # Example: hv_24x7/CPM_ADJUNCT_INST,domain=?,core=?/ +- # hv_gpci/event,partition_id=?/ +- # Hence skip these events for ppc. +- if echo "$p" |grep -Eq 'hv_24x7|hv_gpci' ; then +- echo "Skipping: Event '$p' in powerpc" +- continue +- fi ++# Test all PMU events; however exclude parametrized ones (name contains '?') ++for p in $(perf list --raw-dump pmu | sed 's/[[:graph:]]\+?[[:graph:]]\+[[:space:]]//g'); do + echo "Testing $p" + result=$(perf stat -e "$p" true 2>&1) + if ! echo "$result" | grep -q "$p" && ! echo "$result" | grep -q "" ; then +-- +2.35.1 + diff --git a/queue-6.1/perf-tools-make-quiet-mode-consistent-between-tools.patch b/queue-6.1/perf-tools-make-quiet-mode-consistent-between-tools.patch new file mode 100644 index 00000000000..acd275006d1 --- /dev/null +++ b/queue-6.1/perf-tools-make-quiet-mode-consistent-between-tools.patch @@ -0,0 +1,333 @@ +From caedc2efa089c0e23813fe670d889ea5577e1f1e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 Oct 2022 10:41:36 +0100 +Subject: perf tools: Make quiet mode consistent between tools + +From: James Clark + +[ Upstream commit a527c2c1e2d43e9f145f5d0c5d6ac0bdf5220e22 ] + +Use the global quiet variable everywhere so that all tools hide warnings +in quiet mode and update the documentation to reflect this. + +'perf probe' claimed that errors are not printed in quiet mode but I +don't see this so remove it from the docs. + +Signed-off-by: James Clark +Cc: Adrian Hunter +Cc: Alexander Shishkin +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Link: https://lore.kernel.org/r/20221018094137.783081-3-james.clark@arm.com +Signed-off-by: Arnaldo Carvalho de Melo +Stable-dep-of: 8b269b755512 ("perf probe: Check -v and -q options in the right place") +Signed-off-by: Sasha Levin +--- + tools/perf/Documentation/perf-annotate.txt | 2 +- + tools/perf/Documentation/perf-diff.txt | 2 +- + tools/perf/Documentation/perf-lock.txt | 2 +- + tools/perf/Documentation/perf-probe.txt | 2 +- + tools/perf/Documentation/perf-record.txt | 2 +- + tools/perf/Documentation/perf-report.txt | 2 +- + tools/perf/Documentation/perf-stat.txt | 4 ++-- + tools/perf/bench/numa.c | 9 +++++---- + tools/perf/builtin-annotate.c | 2 +- + tools/perf/builtin-diff.c | 2 +- + tools/perf/builtin-lock.c | 2 +- + tools/perf/builtin-probe.c | 7 +++---- + tools/perf/builtin-record.c | 2 +- + tools/perf/builtin-report.c | 2 +- + tools/perf/builtin-stat.c | 8 ++++---- + tools/perf/util/stat.h | 1 - + 16 files changed, 25 insertions(+), 26 deletions(-) + +diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt +index 18fcc52809fb..980fe2c29275 100644 +--- a/tools/perf/Documentation/perf-annotate.txt ++++ b/tools/perf/Documentation/perf-annotate.txt +@@ -41,7 +41,7 @@ OPTIONS + + -q:: + --quiet:: +- Do not show any message. (Suppress -v) ++ Do not show any warnings or messages. (Suppress -v) + + -n:: + --show-nr-samples:: +diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt +index be65bd55ab2a..f3067a4af294 100644 +--- a/tools/perf/Documentation/perf-diff.txt ++++ b/tools/perf/Documentation/perf-diff.txt +@@ -75,7 +75,7 @@ OPTIONS + + -q:: + --quiet:: +- Do not show any message. (Suppress -v) ++ Do not show any warnings or messages. (Suppress -v) + + -f:: + --force:: +diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt +index 3b1e16563b79..4958a1ffa1cc 100644 +--- a/tools/perf/Documentation/perf-lock.txt ++++ b/tools/perf/Documentation/perf-lock.txt +@@ -42,7 +42,7 @@ COMMON OPTIONS + + -q:: + --quiet:: +- Do not show any message. (Suppress -v) ++ Do not show any warnings or messages. (Suppress -v) + + -D:: + --dump-raw-trace:: +diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt +index 080981d38d7b..7f8e8ba3a787 100644 +--- a/tools/perf/Documentation/perf-probe.txt ++++ b/tools/perf/Documentation/perf-probe.txt +@@ -57,7 +57,7 @@ OPTIONS + + -q:: + --quiet:: +- Be quiet (do not show any messages including errors). ++ Do not show any warnings or messages. + Can not use with -v. + + -a:: +diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt +index e41ae950fdc3..9ea6d44aca58 100644 +--- a/tools/perf/Documentation/perf-record.txt ++++ b/tools/perf/Documentation/perf-record.txt +@@ -282,7 +282,7 @@ OPTIONS + + -q:: + --quiet:: +- Don't print any message, useful for scripting. ++ Don't print any warnings or messages, useful for scripting. + + -v:: + --verbose:: +diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt +index 4533db2ee56b..4fa509b15948 100644 +--- a/tools/perf/Documentation/perf-report.txt ++++ b/tools/perf/Documentation/perf-report.txt +@@ -27,7 +27,7 @@ OPTIONS + + -q:: + --quiet:: +- Do not show any message. (Suppress -v) ++ Do not show any warnings or messages. (Suppress -v) + + -n:: + --show-nr-samples:: +diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt +index d7ff1867feda..18abdc1dce05 100644 +--- a/tools/perf/Documentation/perf-stat.txt ++++ b/tools/perf/Documentation/perf-stat.txt +@@ -354,8 +354,8 @@ forbids the event merging logic from sharing events between groups and + may be used to increase accuracy in this case. + + --quiet:: +-Don't print output. This is useful with perf stat record below to only +-write data to the perf.data file. ++Don't print output, warnings or messages. This is useful with perf stat ++record below to only write data to the perf.data file. + + STAT RECORD + ----------- +diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c +index e78dedf9e682..9717c6c17433 100644 +--- a/tools/perf/bench/numa.c ++++ b/tools/perf/bench/numa.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -116,7 +117,6 @@ struct params { + long bytes_thread; + + int nr_tasks; +- bool show_quiet; + + bool show_convergence; + bool measure_convergence; +@@ -197,7 +197,8 @@ static const struct option options[] = { + OPT_BOOLEAN('c', "show_convergence", &p0.show_convergence, "show convergence details, " + "convergence is reached when each process (all its threads) is running on a single NUMA node."), + OPT_BOOLEAN('m', "measure_convergence", &p0.measure_convergence, "measure convergence latency"), +- OPT_BOOLEAN('q', "quiet" , &p0.show_quiet, "quiet mode"), ++ OPT_BOOLEAN('q', "quiet" , &quiet, ++ "quiet mode (do not show any warnings or messages)"), + OPT_BOOLEAN('S', "serialize-startup", &p0.serialize_startup,"serialize thread startup"), + + /* Special option string parsing callbacks: */ +@@ -1474,7 +1475,7 @@ static int init(void) + /* char array in count_process_nodes(): */ + BUG_ON(g->p.nr_nodes < 0); + +- if (g->p.show_quiet && !g->p.show_details) ++ if (quiet && !g->p.show_details) + g->p.show_details = -1; + + /* Some memory should be specified: */ +@@ -1553,7 +1554,7 @@ static void print_res(const char *name, double val, + if (!name) + name = "main,"; + +- if (!g->p.show_quiet) ++ if (!quiet) + printf(" %-30s %15.3f, %-15s %s\n", name, val, txt_unit, txt_short); + else + printf(" %14.3f %s\n", val, txt_long); +diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c +index f839e69492e8..517d928c00e3 100644 +--- a/tools/perf/builtin-annotate.c ++++ b/tools/perf/builtin-annotate.c +@@ -525,7 +525,7 @@ int cmd_annotate(int argc, const char **argv) + OPT_BOOLEAN('f', "force", &data.force, "don't complain, do it"), + OPT_INCR('v', "verbose", &verbose, + "be more verbose (show symbol address, etc)"), +- OPT_BOOLEAN('q', "quiet", &quiet, "do now show any message"), ++ OPT_BOOLEAN('q', "quiet", &quiet, "do now show any warnings or messages"), + OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, + "dump raw trace in ASCII"), + #ifdef HAVE_GTK2_SUPPORT +diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c +index d925096dd7f0..ed07cc6cca56 100644 +--- a/tools/perf/builtin-diff.c ++++ b/tools/perf/builtin-diff.c +@@ -1260,7 +1260,7 @@ static const char * const diff_usage[] = { + static const struct option options[] = { + OPT_INCR('v', "verbose", &verbose, + "be more verbose (show symbol address, etc)"), +- OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), ++ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), + OPT_BOOLEAN('b', "baseline-only", &show_baseline_only, + "Show only items with match in baseline"), + OPT_CALLBACK('c', "compute", &compute, +diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c +index 9722d4ab2e55..66520712a167 100644 +--- a/tools/perf/builtin-lock.c ++++ b/tools/perf/builtin-lock.c +@@ -1869,7 +1869,7 @@ int cmd_lock(int argc, const char **argv) + "file", "vmlinux pathname"), + OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, + "file", "kallsyms pathname"), +- OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), ++ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), + OPT_END() + }; + +diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c +index f62298f5db3b..2ae50fc9e597 100644 +--- a/tools/perf/builtin-probe.c ++++ b/tools/perf/builtin-probe.c +@@ -40,7 +40,6 @@ static struct { + int command; /* Command short_name */ + bool list_events; + bool uprobes; +- bool quiet; + bool target_used; + int nevents; + struct perf_probe_event events[MAX_PROBES]; +@@ -514,8 +513,8 @@ __cmd_probe(int argc, const char **argv) + struct option options[] = { + OPT_INCR('v', "verbose", &verbose, + "be more verbose (show parsed arguments, etc)"), +- OPT_BOOLEAN('q', "quiet", ¶ms.quiet, +- "be quiet (do not show any messages)"), ++ OPT_BOOLEAN('q', "quiet", &quiet, ++ "be quiet (do not show any warnings or messages)"), + OPT_CALLBACK_DEFAULT('l', "list", NULL, "[GROUP:]EVENT", + "list up probe events", + opt_set_filter_with_command, DEFAULT_LIST_FILTER), +@@ -634,7 +633,7 @@ __cmd_probe(int argc, const char **argv) + if (ret) + return ret; + +- if (params.quiet) { ++ if (quiet) { + if (verbose != 0) { + pr_err(" Error: -v and -q are exclusive.\n"); + return -EINVAL; +diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c +index e128b855ddde..59f3d98a0196 100644 +--- a/tools/perf/builtin-record.c ++++ b/tools/perf/builtin-record.c +@@ -3388,7 +3388,7 @@ static struct option __record_options[] = { + &record_parse_callchain_opt), + OPT_INCR('v', "verbose", &verbose, + "be more verbose (show counter open errors, etc)"), +- OPT_BOOLEAN('q', "quiet", &quiet, "don't print any message"), ++ OPT_BOOLEAN('q', "quiet", &quiet, "don't print any warnings or messages"), + OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat, + "per thread counts"), + OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"), +diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c +index 8361890176c2..b6d77d3da64f 100644 +--- a/tools/perf/builtin-report.c ++++ b/tools/perf/builtin-report.c +@@ -1222,7 +1222,7 @@ int cmd_report(int argc, const char **argv) + "input file name"), + OPT_INCR('v', "verbose", &verbose, + "be more verbose (show symbol address, etc)"), +- OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any message"), ++ OPT_BOOLEAN('q', "quiet", &quiet, "Do not show any warnings or messages"), + OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, + "dump raw trace in ASCII"), + OPT_BOOLEAN(0, "stats", &report.stats_mode, "Display event stats"), +diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c +index d726c3d3d83c..978fdc60b4e8 100644 +--- a/tools/perf/builtin-stat.c ++++ b/tools/perf/builtin-stat.c +@@ -1024,7 +1024,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) + /* Do not print anything if we record to the pipe. */ + if (STAT_RECORD && perf_stat.data.is_pipe) + return; +- if (stat_config.quiet) ++ if (quiet) + return; + + evlist__print_counters(evsel_list, &stat_config, &target, ts, argc, argv); +@@ -1274,8 +1274,8 @@ static struct option stat_options[] = { + "print summary for interval mode"), + OPT_BOOLEAN(0, "no-csv-summary", &stat_config.no_csv_summary, + "don't print 'summary' for CSV summary output"), +- OPT_BOOLEAN(0, "quiet", &stat_config.quiet, +- "don't print output (useful with record)"), ++ OPT_BOOLEAN(0, "quiet", &quiet, ++ "don't print any output, messages or warnings (useful with record)"), + OPT_CALLBACK(0, "cputype", &evsel_list, "hybrid cpu type", + "Only enable events on applying cpu with this type " + "for hybrid platform (e.g. core or atom)", +@@ -2278,7 +2278,7 @@ int cmd_stat(int argc, const char **argv) + goto out; + } + +- if (!output && !stat_config.quiet) { ++ if (!output && !quiet) { + struct timespec tm; + mode = append_file ? "a" : "w"; + +diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h +index 141f1ba940cc..bcb1cd68fb52 100644 +--- a/tools/perf/util/stat.h ++++ b/tools/perf/util/stat.h +@@ -139,7 +139,6 @@ struct perf_stat_config { + bool metric_no_group; + bool metric_no_merge; + bool stop_read_counter; +- bool quiet; + bool iostat_run; + char *user_requested_cpu_list; + bool system_wide; +-- +2.35.1 + diff --git a/queue-6.1/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch b/queue-6.1/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch new file mode 100644 index 00000000000..a0a72b7bca1 --- /dev/null +++ b/queue-6.1/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch @@ -0,0 +1,53 @@ +From 69184d74eb18f56d705c5fa535b0fc7f850a9cce Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Dec 2022 05:18:55 +0000 +Subject: pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES + +From: John Stultz + +[ Upstream commit 2f4fec5943407318b9523f01ce1f5d668c028332 ] + +In commit 76d62f24db07 ("pstore: Switch pmsg_lock to an rt_mutex +to avoid priority inversion") I changed a lock to an rt_mutex. + +However, its possible that CONFIG_RT_MUTEXES is not enabled, +which then results in a build failure, as the 0day bot detected: + https://lore.kernel.org/linux-mm/202212211244.TwzWZD3H-lkp@intel.com/ + +Thus this patch changes CONFIG_PSTORE_PMSG to select +CONFIG_RT_MUTEXES, which ensures the build will not fail. + +Cc: Wei Wang +Cc: Midas Chien +Cc: Connor O'Brien +Cc: Kees Cook +Cc: Anton Vorontsov +Cc: Colin Cross +Cc: Tony Luck +Cc: kernel test robot +Cc: kernel-team@android.com +Fixes: 76d62f24db07 ("pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion") +Reported-by: kernel test robot +Signed-off-by: John Stultz +Signed-off-by: Kees Cook +Link: https://lore.kernel.org/r/20221221051855.15761-1-jstultz@google.com +Signed-off-by: Sasha Levin +--- + fs/pstore/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig +index 8adabde685f1..c49d554cc9ae 100644 +--- a/fs/pstore/Kconfig ++++ b/fs/pstore/Kconfig +@@ -126,6 +126,7 @@ config PSTORE_CONSOLE + config PSTORE_PMSG + bool "Log user space messages" + depends on PSTORE ++ select RT_MUTEXES + help + When the option is enabled, pstore will export a character + interface /dev/pmsg0 to log user space messages. On reboot +-- +2.35.1 + diff --git a/queue-6.1/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch b/queue-6.1/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch new file mode 100644 index 00000000000..d00ec2cba48 --- /dev/null +++ b/queue-6.1/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch @@ -0,0 +1,70 @@ +From 4b968b2b75202fea623d9550213cfa025958ea95 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Dec 2022 23:18:34 +0000 +Subject: pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion + +From: John Stultz + +[ Upstream commit 76d62f24db07f22ccf9bc18ca793c27d4ebef721 ] + +Wei Wang reported seeing priority inversion caused latencies +caused by contention on pmsg_lock, and suggested it be switched +to a rt_mutex. + +I was initially hesitant this would help, as the tasks in that +trace all seemed to be SCHED_NORMAL, so the benefit would be +limited to only nice boosting. + +However, another similar issue was raised where the priority +inversion was seen did involve a blocked RT task so it is clear +this would be helpful in that case. + +Cc: Wei Wang +Cc: Midas Chien +Cc: Connor O'Brien +Cc: Kees Cook +Cc: Anton Vorontsov +Cc: Colin Cross +Cc: Tony Luck +Cc: kernel-team@android.com +Fixes: 9d5438f462ab ("pstore: Add pmsg - user-space accessible pstore object") +Reported-by: Wei Wang +Signed-off-by: John Stultz +Signed-off-by: Kees Cook +Link: https://lore.kernel.org/r/20221214231834.3711880-1-jstultz@google.com +Signed-off-by: Sasha Levin +--- + fs/pstore/pmsg.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c +index d8542ec2f38c..18cf94b597e0 100644 +--- a/fs/pstore/pmsg.c ++++ b/fs/pstore/pmsg.c +@@ -7,9 +7,10 @@ + #include + #include + #include ++#include + #include "internal.h" + +-static DEFINE_MUTEX(pmsg_lock); ++static DEFINE_RT_MUTEX(pmsg_lock); + + static ssize_t write_pmsg(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +@@ -28,9 +29,9 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf, + if (!access_ok(buf, count)) + return -EFAULT; + +- mutex_lock(&pmsg_lock); ++ rt_mutex_lock(&pmsg_lock); + ret = psinfo->write_user(&record, buf); +- mutex_unlock(&pmsg_lock); ++ rt_mutex_unlock(&pmsg_lock); + return ret ? ret : count; + } + +-- +2.35.1 + diff --git a/queue-6.1/series b/queue-6.1/series index a66d40ff77f..bdb5e574080 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1066,3 +1066,29 @@ orangefs-fix-kmemleak-in-orangefs_prepare_debugfs_he.patch orangefs-fix-kmemleak-in-orangefs_sysfs_init.patch orangefs-fix-kmemleak-in-orangefs_-kernel-client-_de.patch hwmon-jc42-fix-missing-unlock-on-error-in-jc42_write.patch +asoc-sof_es8336-fix-possible-use-after-free-in-sof_e.patch +asoc-intel-skylake-fix-driver-hang-during-shutdown.patch +asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch +asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch +asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch +asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch +alsa-hda-hdmi-fix-i915-silent-stream-programming-flo.patch +alsa-hda-hdmi-set-default-audio-parameters-for-kae-s.patch +alsa-hda-hdmi-fix-stream-id-config-keep-alive-for-rt.patch +asoc-wm8994-fix-potential-deadlock.patch +asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch +asoc-rt5670-remove-unbalanced-pm_runtime_put.patch +drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch +loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch +lkdtm-cfi-make-pac-test-work-with-gcc-7-and-8.patch +pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch +drm-amd-pm-avoid-large-variable-on-kernel-stack.patch +perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch +perf-tools-make-quiet-mode-consistent-between-tools.patch +perf-probe-check-v-and-q-options-in-the-right-place.patch +mips-ralink-mt7621-avoid-to-init-common-ralink-reset.patch +perf-test-fix-all-pmu-test-to-skip-parametrized-even.patch +afs-fix-lost-servers_outstanding-count.patch +cfi-fix-cfi-failure-with-kasan.patch +pstore-make-sure-config_pstore_pmsg-selects-config_r.patch +ima-simplify-ima_lsm_copy_rule.patch -- 2.47.3