From: Sasha Levin Date: Tue, 27 Dec 2022 02:31:08 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v5.15.86~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec260c1410164941a935fe440044256e70c42f97;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/afs-fix-lost-servers_outstanding-count.patch b/queue-5.15/afs-fix-lost-servers_outstanding-count.patch new file mode 100644 index 00000000000..a6630aeca1c --- /dev/null +++ b/queue-5.15/afs-fix-lost-servers_outstanding-count.patch @@ -0,0 +1,59 @@ +From eeaaeed5f4b042ca71e50e191443efc23fcc4cd5 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-5.15/alsa-asoc-hda-move-rename-snd_hdac_ext_stop_streams-.patch b/queue-5.15/alsa-asoc-hda-move-rename-snd_hdac_ext_stop_streams-.patch new file mode 100644 index 00000000000..256fe829ee6 --- /dev/null +++ b/queue-5.15/alsa-asoc-hda-move-rename-snd_hdac_ext_stop_streams-.patch @@ -0,0 +1,140 @@ +From 9e54923f011258ad4e482fd0c28f35ed6ae130e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 16 Dec 2021 17:11:27 -0600 +Subject: ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to + hdac_stream.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +[ Upstream commit 12054f0ce8be7d2003ec068ab27c9eb608397b98 ] + +snd_hdac_ext_stop_streams() has really nothing to do with the +extension, it just loops over the bus streams. + +Move it to the hdac_stream layer and rename to remove the 'ext' +prefix and add the precision that the chip will also be stopped. + +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Kai Vehmanen +Reviewed-by: Péter Ujfalusi +Reviewed-by: Ranjani Sridharan +Reviewed-by: Cezary Rojewski +Link: https://lore.kernel.org/r/20211216231128.344321-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Takashi Iwai +Stable-dep-of: 171107237246 ("ASoC: Intel: Skylake: Fix driver hang during shutdown") +Signed-off-by: Sasha Levin +--- + include/sound/hdaudio.h | 1 + + include/sound/hdaudio_ext.h | 1 - + sound/hda/ext/hdac_ext_stream.c | 17 ----------------- + sound/hda/hdac_stream.c | 16 ++++++++++++++++ + sound/soc/intel/skylake/skl.c | 4 ++-- + 5 files changed, 19 insertions(+), 20 deletions(-) + +diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h +index 22af68b01426..6a90ce405e60 100644 +--- a/include/sound/hdaudio.h ++++ b/include/sound/hdaudio.h +@@ -558,6 +558,7 @@ int snd_hdac_stream_set_params(struct hdac_stream *azx_dev, + void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start); + void snd_hdac_stream_clear(struct hdac_stream *azx_dev); + void snd_hdac_stream_stop(struct hdac_stream *azx_dev); ++void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus); + void snd_hdac_stream_reset(struct hdac_stream *azx_dev); + void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set, + unsigned int streams, unsigned int reg); +diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h +index d4e31ea16aba..56ea5cde5e63 100644 +--- a/include/sound/hdaudio_ext.h ++++ b/include/sound/hdaudio_ext.h +@@ -92,7 +92,6 @@ void snd_hdac_ext_stream_decouple_locked(struct hdac_bus *bus, + struct hdac_ext_stream *azx_dev, bool decouple); + void snd_hdac_ext_stream_decouple(struct hdac_bus *bus, + struct hdac_ext_stream *azx_dev, bool decouple); +-void snd_hdac_ext_stop_streams(struct hdac_bus *bus); + + int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus, + struct hdac_ext_stream *stream, u32 value); +diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c +index 37154ed43bd5..c09652da43ff 100644 +--- a/sound/hda/ext/hdac_ext_stream.c ++++ b/sound/hda/ext/hdac_ext_stream.c +@@ -475,23 +475,6 @@ int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus, + } + EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_get_spbmaxfifo); + +- +-/** +- * snd_hdac_ext_stop_streams - stop all stream if running +- * @bus: HD-audio core bus +- */ +-void snd_hdac_ext_stop_streams(struct hdac_bus *bus) +-{ +- struct hdac_stream *stream; +- +- if (bus->chip_init) { +- list_for_each_entry(stream, &bus->stream_list, list) +- snd_hdac_stream_stop(stream); +- snd_hdac_bus_stop_chip(bus); +- } +-} +-EXPORT_SYMBOL_GPL(snd_hdac_ext_stop_streams); +- + /** + * snd_hdac_ext_stream_drsm_enable - enable DMA resume for a stream + * @bus: HD-audio core bus +diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c +index aa7955fdf68a..f3582012d22f 100644 +--- a/sound/hda/hdac_stream.c ++++ b/sound/hda/hdac_stream.c +@@ -142,6 +142,22 @@ void snd_hdac_stream_stop(struct hdac_stream *azx_dev) + } + EXPORT_SYMBOL_GPL(snd_hdac_stream_stop); + ++/** ++ * snd_hdac_stop_streams_and_chip - stop all streams and chip if running ++ * @bus: HD-audio core bus ++ */ ++void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus) ++{ ++ struct hdac_stream *stream; ++ ++ if (bus->chip_init) { ++ list_for_each_entry(stream, &bus->stream_list, list) ++ snd_hdac_stream_stop(stream); ++ snd_hdac_bus_stop_chip(bus); ++ } ++} ++EXPORT_SYMBOL_GPL(snd_hdac_stop_streams_and_chip); ++ + /** + * snd_hdac_stream_reset - reset a stream + * @azx_dev: HD-audio core stream to reset +diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c +index 5b1a15e39912..148ddf4cace0 100644 +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -439,7 +439,7 @@ static int skl_free(struct hdac_bus *bus) + + skl->init_done = 0; /* to be sure */ + +- snd_hdac_ext_stop_streams(bus); ++ snd_hdac_stop_streams_and_chip(bus); + + if (bus->irq >= 0) + free_irq(bus->irq, (void *)bus); +@@ -1096,7 +1096,7 @@ static void skl_shutdown(struct pci_dev *pci) + if (!skl->init_done) + return; + +- snd_hdac_ext_stop_streams(bus); ++ snd_hdac_stop_streams_and_chip(bus); + 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-5.15/alsa-hda-add-snd_hdac_stop_streams-helper.patch b/queue-5.15/alsa-hda-add-snd_hdac_stop_streams-helper.patch new file mode 100644 index 00000000000..eb840dd26f2 --- /dev/null +++ b/queue-5.15/alsa-hda-add-snd_hdac_stop_streams-helper.patch @@ -0,0 +1,95 @@ +From c7192e6c2a5777b335cd436b88847a8bcae5449d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Sep 2022 14:10:38 +0200 +Subject: ALSA: hda: add snd_hdac_stop_streams() helper +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +[ Upstream commit 24ad3835a6db4f8857975effa6bf47730371a5ff ] + +Minor code reuse, no functionality change. + +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Bard Liao +Reviewed-by: Péter Ujfalusi +Reviewed-by: Kai Vehmanen +Link: https://lore.kernel.org/r/20220919121041.43463-6-pierre-louis.bossart@linux.intel.com +Signed-off-by: Takashi Iwai +Stable-dep-of: 171107237246 ("ASoC: Intel: Skylake: Fix driver hang during shutdown") +Signed-off-by: Sasha Levin +--- + include/sound/hdaudio.h | 1 + + sound/hda/hdac_stream.c | 17 ++++++++++++++--- + sound/pci/hda/hda_controller.c | 4 +--- + 3 files changed, 16 insertions(+), 6 deletions(-) + +diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h +index 6a90ce405e60..658fccdc8660 100644 +--- a/include/sound/hdaudio.h ++++ b/include/sound/hdaudio.h +@@ -558,6 +558,7 @@ int snd_hdac_stream_set_params(struct hdac_stream *azx_dev, + void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start); + void snd_hdac_stream_clear(struct hdac_stream *azx_dev); + void snd_hdac_stream_stop(struct hdac_stream *azx_dev); ++void snd_hdac_stop_streams(struct hdac_bus *bus); + void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus); + void snd_hdac_stream_reset(struct hdac_stream *azx_dev); + void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set, +diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c +index f3582012d22f..eea22cf72aef 100644 +--- a/sound/hda/hdac_stream.c ++++ b/sound/hda/hdac_stream.c +@@ -142,17 +142,28 @@ void snd_hdac_stream_stop(struct hdac_stream *azx_dev) + } + EXPORT_SYMBOL_GPL(snd_hdac_stream_stop); + ++/** ++ * snd_hdac_stop_streams - stop all streams ++ * @bus: HD-audio core bus ++ */ ++void snd_hdac_stop_streams(struct hdac_bus *bus) ++{ ++ struct hdac_stream *stream; ++ ++ list_for_each_entry(stream, &bus->stream_list, list) ++ snd_hdac_stream_stop(stream); ++} ++EXPORT_SYMBOL_GPL(snd_hdac_stop_streams); ++ + /** + * snd_hdac_stop_streams_and_chip - stop all streams and chip if running + * @bus: HD-audio core bus + */ + void snd_hdac_stop_streams_and_chip(struct hdac_bus *bus) + { +- struct hdac_stream *stream; + + if (bus->chip_init) { +- list_for_each_entry(stream, &bus->stream_list, list) +- snd_hdac_stream_stop(stream); ++ snd_hdac_stop_streams(bus); + snd_hdac_bus_stop_chip(bus); + } + } +diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c +index 75dcb14ff20a..0ff286b7b66b 100644 +--- a/sound/pci/hda/hda_controller.c ++++ b/sound/pci/hda/hda_controller.c +@@ -1033,10 +1033,8 @@ EXPORT_SYMBOL_GPL(azx_init_chip); + void azx_stop_all_streams(struct azx *chip) + { + struct hdac_bus *bus = azx_bus(chip); +- struct hdac_stream *s; + +- list_for_each_entry(s, &bus->stream_list, list) +- snd_hdac_stream_stop(s); ++ snd_hdac_stop_streams(bus); + } + EXPORT_SYMBOL_GPL(azx_stop_all_streams); + +-- +2.35.1 + diff --git a/queue-5.15/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch b/queue-5.15/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch new file mode 100644 index 00000000000..2077a63e637 --- /dev/null +++ b/queue-5.15/asoc-audio-graph-card-fix-refcount-leak-of-cpu_ep-in.patch @@ -0,0 +1,43 @@ +From a139c7a87193d0e96d1912208562c9a22e9f843a 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 28cbcdb56857..89814f68ff56 100644 +--- a/sound/soc/generic/audio-graph-card.c ++++ b/sound/soc/generic/audio-graph-card.c +@@ -483,8 +483,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-5.15/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch b/queue-5.15/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch new file mode 100644 index 00000000000..23b8269bbb9 --- /dev/null +++ b/queue-5.15/asoc-intel-skylake-fix-driver-hang-during-shutdown.patch @@ -0,0 +1,41 @@ +From 8f6779c9b0b8490d681f6ed8d31b5d333c9004a0 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 148ddf4cace0..46bb3b8bd5af 100644 +--- a/sound/soc/intel/skylake/skl.c ++++ b/sound/soc/intel/skylake/skl.c +@@ -1096,7 +1096,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-5.15/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch b/queue-5.15/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch new file mode 100644 index 00000000000..6c9438764e0 --- /dev/null +++ b/queue-5.15/asoc-mediatek-mt8173-rt5650-rt5514-fix-refcount-leak.patch @@ -0,0 +1,57 @@ +From 5a3728632c25250fc57b776767a976e506cee769 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 390da5bf727e..9421b919d462 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; +@@ -219,6 +221,7 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev) + dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", + __func__, ret); + ++out: + of_node_put(platform_node); + return ret; + } +-- +2.35.1 + diff --git a/queue-5.15/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch b/queue-5.15/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch new file mode 100644 index 00000000000..fd572e41ad0 --- /dev/null +++ b/queue-5.15/asoc-mediatek-mt8183-fix-refcount-leak-in-mt8183_mt6.patch @@ -0,0 +1,73 @@ +From e7a50c59606062bcb864e5c99d41af3cf2e28480 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 a56c1e87d564..4dab1ee69ec0 100644 +--- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c ++++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +@@ -647,8 +647,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); +@@ -737,8 +739,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); + +@@ -746,7 +750,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++) { +@@ -779,6 +784,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-5.15/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch b/queue-5.15/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch new file mode 100644 index 00000000000..1d97f5c733f --- /dev/null +++ b/queue-5.15/asoc-rockchip-pdm-add-missing-clk_disable_unprepare-.patch @@ -0,0 +1,37 @@ +From eceba461c44bc6fb83a9a300a989d1fe316740bf 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 38bd603eeb45..7c0b0fe326c2 100644 +--- a/sound/soc/rockchip/rockchip_pdm.c ++++ b/sound/soc/rockchip/rockchip_pdm.c +@@ -368,6 +368,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-5.15/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch b/queue-5.15/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch new file mode 100644 index 00000000000..88a3c0d6cfe --- /dev/null +++ b/queue-5.15/asoc-rockchip-spdif-add-missing-clk_disable_unprepar.patch @@ -0,0 +1,37 @@ +From 47e8c401e99e359f48c91dff98ac47114ed09ef4 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 d027ca4b1796..09a25d84fee6 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-5.15/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch b/queue-5.15/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch new file mode 100644 index 00000000000..7d95583a858 --- /dev/null +++ b/queue-5.15/asoc-rt5670-remove-unbalanced-pm_runtime_put.patch @@ -0,0 +1,42 @@ +From 8504c370529574ae34e96df5e1edf685572b0339 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 ecbaf129a6e3..51b385575a5c 100644 +--- a/sound/soc/codecs/rt5670.c ++++ b/sound/soc/codecs/rt5670.c +@@ -3313,8 +3313,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-5.15/asoc-wm8994-fix-potential-deadlock.patch b/queue-5.15/asoc-wm8994-fix-potential-deadlock.patch new file mode 100644 index 00000000000..96ff71c0837 --- /dev/null +++ b/queue-5.15/asoc-wm8994-fix-potential-deadlock.patch @@ -0,0 +1,42 @@ +From 8acecbfeab5db1a9ebfef9fa100bfcfd352c273d 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 f117ec0c489f..6759db92f6c4 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-5.15/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch b/queue-5.15/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch new file mode 100644 index 00000000000..557804c7605 --- /dev/null +++ b/queue-5.15/drm-i915-display-don-t-disable-ddi-transcoder-when-s.patch @@ -0,0 +1,122 @@ +From ffdeffe6eb90fe4c07fd88cc0dac94074a09cebd 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 1ccdf2da042b..64a15b636e8d 100644 +--- a/drivers/gpu/drm/i915/display/intel_dp.c ++++ b/drivers/gpu/drm/i915/display/intel_dp.c +@@ -3245,61 +3245,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) + { +@@ -3317,14 +3262,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-5.15/ima-simplify-ima_lsm_copy_rule.patch b/queue-5.15/ima-simplify-ima_lsm_copy_rule.patch new file mode 100644 index 00000000000..ff1dcef635a --- /dev/null +++ b/queue-5.15/ima-simplify-ima_lsm_copy_rule.patch @@ -0,0 +1,66 @@ +From db60216119a1dca76828700797b859888c77945b 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 844d69f6ac00..ed43d30682ff 100644 +--- a/security/integrity/ima/ima_policy.c ++++ b/security/integrity/ima/ima_policy.c +@@ -391,12 +391,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, +@@ -410,6 +404,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); +@@ -424,7 +419,8 @@ static int ima_lsm_update_rule(struct ima_rule_entry *entry) + * references and the entry itself. All other memory refrences 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-5.15/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch b/queue-5.15/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch new file mode 100644 index 00000000000..083b58d5d83 --- /dev/null +++ b/queue-5.15/loadpin-ignore-the-contents-argument-of-the-lsm-hook.patch @@ -0,0 +1,85 @@ +From adee6bd6107417ec4e963b498511a0f4e39e243e 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 b12f7d986b1e..5fce105a372d 100644 +--- a/security/loadpin/loadpin.c ++++ b/security/loadpin/loadpin.c +@@ -118,21 +118,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]) { +@@ -187,9 +177,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-5.15/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch b/queue-5.15/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch new file mode 100644 index 00000000000..756cf5a3791 --- /dev/null +++ b/queue-5.15/perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch @@ -0,0 +1,90 @@ +From 2d407dc1b2ce1a2e05cbf633182c4e003e899cdf 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-5.15/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch b/queue-5.15/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch new file mode 100644 index 00000000000..ec67bef240d --- /dev/null +++ b/queue-5.15/pstore-make-sure-config_pstore_pmsg-selects-config_r.patch @@ -0,0 +1,53 @@ +From ad88f2a0e832ce8cca22c471bb908f279ebfdcfd 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-5.15/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch b/queue-5.15/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch new file mode 100644 index 00000000000..39aff4ab8ff --- /dev/null +++ b/queue-5.15/pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch @@ -0,0 +1,70 @@ +From 6c615333ce4781c582eb6d5fda3b4533ed132658 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-5.15/series b/queue-5.15/series index 1394e235963..2b456d378a8 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -685,3 +685,20 @@ orangefs-fix-kmemleak-in-orangefs_-kernel-client-_de.patch tools-include-add-_ret_ip_-and-math-definitions-to-k.patch kvm-selftests-fix-build-regression-by-using-accessor.patch hwmon-jc42-fix-missing-unlock-on-error-in-jc42_write.patch +alsa-asoc-hda-move-rename-snd_hdac_ext_stop_streams-.patch +alsa-hda-add-snd_hdac_stop_streams-helper.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 +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 +pstore-switch-pmsg_lock-to-an-rt_mutex-to-avoid-prio.patch +perf-debug-set-debug_peo_args-and-redirect_to_stderr.patch +afs-fix-lost-servers_outstanding-count.patch +pstore-make-sure-config_pstore_pmsg-selects-config_r.patch +ima-simplify-ima_lsm_copy_rule.patch