]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.12
authorSasha Levin <sashal@kernel.org>
Fri, 10 Jan 2025 00:09:15 +0000 (19:09 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 10 Jan 2025 00:09:15 +0000 (19:09 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.12/asoc-mediatek-disable-buffer-pre-allocation.patch [new file with mode: 0644]
queue-6.12/asoc-rt722-add-delay-time-to-wait-for-the-calibratio.patch [new file with mode: 0644]
queue-6.12/selftests-alsa-fix-circular-dependency-involving-glo.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/asoc-mediatek-disable-buffer-pre-allocation.patch b/queue-6.12/asoc-mediatek-disable-buffer-pre-allocation.patch
new file mode 100644 (file)
index 0000000..3d11975
--- /dev/null
@@ -0,0 +1,57 @@
+From 7db3ab42a25f13afdbea9f752fcad096f9b1f8dc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 19 Dec 2024 18:53:02 +0800
+Subject: ASoC: mediatek: disable buffer pre-allocation
+
+From: Chen-Yu Tsai <wenst@chromium.org>
+
+[ Upstream commit 32c9c06adb5b157ef259233775a063a43746d699 ]
+
+On Chromebooks based on Mediatek MT8195 or MT8188, the audio frontend
+(AFE) is limited to accessing a very small window (1 MiB) of memory,
+which is described as a reserved memory region in the device tree.
+
+On these two platforms, the maximum buffer size is given as 512 KiB.
+The MediaTek common code uses the same value for preallocations. This
+means that only the first two PCM substreams get preallocations, and
+then the whole space is exhausted, barring any other substreams from
+working. Since the substreams used are not always the first two, this
+means audio won't work correctly.
+
+This is observed on the MT8188 Geralt Chromebooks, on which the
+"mediatek,dai-link" property was dropped when it was upstreamed. That
+property causes the driver to only register the PCM substreams listed
+in the property, and in the order given.
+
+Instead of trying to compute an optimal value and figuring out which
+streams are used, simply disable preallocation. The PCM buffers are
+managed by the core and are allocated and released on the fly. There
+should be no impact to any of the other MediaTek platforms.
+
+Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
+Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+Link: https://patch.msgid.link/20241219105303.548437-1-wenst@chromium.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/mediatek/common/mtk-afe-platform-driver.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/mediatek/common/mtk-afe-platform-driver.c b/sound/soc/mediatek/common/mtk-afe-platform-driver.c
+index 9b72b2a7ae91..6b6330583941 100644
+--- a/sound/soc/mediatek/common/mtk-afe-platform-driver.c
++++ b/sound/soc/mediatek/common/mtk-afe-platform-driver.c
+@@ -120,8 +120,8 @@ int mtk_afe_pcm_new(struct snd_soc_component *component,
+       struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
+       size = afe->mtk_afe_hardware->buffer_bytes_max;
+-      snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
+-                                     afe->dev, size, size);
++      snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev, 0, size);
++
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(mtk_afe_pcm_new);
+-- 
+2.39.5
+
diff --git a/queue-6.12/asoc-rt722-add-delay-time-to-wait-for-the-calibratio.patch b/queue-6.12/asoc-rt722-add-delay-time-to-wait-for-the-calibratio.patch
new file mode 100644 (file)
index 0000000..14c49de
--- /dev/null
@@ -0,0 +1,47 @@
+From 839c5aea89ef871bab5a0d012204d9ac668e9610 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 18 Dec 2024 17:13:07 +0800
+Subject: ASoC: rt722: add delay time to wait for the calibration procedure
+
+From: Shuming Fan <shumingf@realtek.com>
+
+[ Upstream commit c9e3ebdc52ebe028f238c9df5162ae92483bedd5 ]
+
+The calibration procedure needs some time to finish.
+This patch adds the delay time to ensure the calibration procedure is completed correctly.
+
+Signed-off-by: Shuming Fan <shumingf@realtek.com>
+Link: https://patch.msgid.link/20241218091307.96656-1-shumingf@realtek.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/rt722-sdca.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/sound/soc/codecs/rt722-sdca.c b/sound/soc/codecs/rt722-sdca.c
+index f9f7512ca360..9a0747c4bdea 100644
+--- a/sound/soc/codecs/rt722-sdca.c
++++ b/sound/soc/codecs/rt722-sdca.c
+@@ -1467,13 +1467,18 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
+               0x008d);
+       /* check HP calibration FSM status */
+       for (loop_check = 0; loop_check < chk_cnt; loop_check++) {
++              usleep_range(10000, 11000);
+               ret = rt722_sdca_index_read(rt722, RT722_VENDOR_CALI,
+                       RT722_DAC_DC_CALI_CTL3, &calib_status);
+-              if (ret < 0 || loop_check == chk_cnt)
++              if (ret < 0)
+                       dev_dbg(&rt722->slave->dev, "calibration failed!, ret=%d\n", ret);
+               if ((calib_status & 0x0040) == 0x0)
+                       break;
+       }
++
++      if (loop_check == chk_cnt)
++              dev_dbg(&rt722->slave->dev, "%s, calibration time-out!\n", __func__);
++
+       /* Set ADC09 power entity floating control */
+       rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ADC0A_08_PDE_FLOAT_CTL,
+               0x2a12);
+-- 
+2.39.5
+
diff --git a/queue-6.12/selftests-alsa-fix-circular-dependency-involving-glo.patch b/queue-6.12/selftests-alsa-fix-circular-dependency-involving-glo.patch
new file mode 100644 (file)
index 0000000..0b0816e
--- /dev/null
@@ -0,0 +1,52 @@
+From 9c51016d4e6eb796baf65cee5557480289465e45 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 18 Dec 2024 10:59:31 +0800
+Subject: selftests/alsa: Fix circular dependency involving global-timer
+
+From: Li Zhijian <lizhijian@fujitsu.com>
+
+[ Upstream commit 55853cb829dc707427c3519f6b8686682a204368 ]
+
+The pattern rule `$(OUTPUT)/%: %.c` inadvertently included a circular
+dependency on the global-timer target due to its inclusion in
+$(TEST_GEN_PROGS_EXTENDED). This resulted in a circular dependency
+warning during the build process.
+
+To resolve this, the dependency on $(TEST_GEN_PROGS_EXTENDED) has been
+replaced with an explicit dependency on $(OUTPUT)/libatest.so. This change
+ensures that libatest.so is built before any other targets that require it,
+without creating a circular dependency.
+
+This fix addresses the following warning:
+
+make[4]: Entering directory 'tools/testing/selftests/alsa'
+make[4]: Circular default_modconfig/kselftest/alsa/global-timer <- default_modconfig/kselftest/alsa/global-timer dependency dropped.
+make[4]: Nothing to be done for 'all'.
+make[4]: Leaving directory 'tools/testing/selftests/alsa'
+
+Cc: Mark Brown <broonie@kernel.org>
+Cc: Jaroslav Kysela <perex@perex.cz>
+Cc: Takashi Iwai <tiwai@suse.com>
+Cc: Shuah Khan <shuah@kernel.org>
+Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
+Link: https://patch.msgid.link/20241218025931.914164-1-lizhijian@fujitsu.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/alsa/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile
+index 944279160fed..8dab90ad22bb 100644
+--- a/tools/testing/selftests/alsa/Makefile
++++ b/tools/testing/selftests/alsa/Makefile
+@@ -27,5 +27,5 @@ include ../lib.mk
+ $(OUTPUT)/libatest.so: conf.c alsa-local.h
+       $(CC) $(CFLAGS) -shared -fPIC $< $(LDLIBS) -o $@
+-$(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) alsa-local.h
++$(OUTPUT)/%: %.c $(OUTPUT)/libatest.so alsa-local.h
+       $(CC) $(CFLAGS) $< $(LDLIBS) -latest -o $@
+-- 
+2.39.5
+
index 3c381c9be7138bc5d5f992b4d2cb4eb669fe749d..e21373cc10bb3a2c017ecdcf83fba315e48a30b4 100644 (file)
@@ -18,3 +18,6 @@ exfat-fix-the-infinite-loop-in-__exfat_free_cluster.patch
 fuse-respect-fopen_keep_cache-on-opendir.patch
 ovl-pass-realinode-to-ovl_encode_real_fh-instead-of-.patch
 ovl-support-encoding-fid-from-inode-with-no-alias.patch
+asoc-rt722-add-delay-time-to-wait-for-the-calibratio.patch
+asoc-mediatek-disable-buffer-pre-allocation.patch
+selftests-alsa-fix-circular-dependency-involving-glo.patch