From: Greg Kroah-Hartman Date: Fri, 1 May 2026 10:45:33 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v6.12.86~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75a58f55bdbd71707feb3e7902bf7a73fce362c5;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: alsa-aoa-i2sbus-fix-of-node-lifetime-handling.patch alsa-ctxfi-add-fallback-to-default-rsr-for-s-pdif.patch alsa-seq_oss-return-full-count-for-successful-seq_fullsize-writes.patch --- diff --git a/queue-6.1/alsa-aoa-i2sbus-fix-of-node-lifetime-handling.patch b/queue-6.1/alsa-aoa-i2sbus-fix-of-node-lifetime-handling.patch new file mode 100644 index 0000000000..d0a2263bf2 --- /dev/null +++ b/queue-6.1/alsa-aoa-i2sbus-fix-of-node-lifetime-handling.patch @@ -0,0 +1,86 @@ +From 4ec93f070eda6b765b62efcaed9241c3b3b0b6ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C3=A1ssio=20Gabriel?= +Date: Mon, 30 Mar 2026 01:00:34 -0300 +Subject: ALSA: aoa: i2sbus: fix OF node lifetime handling +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cássio Gabriel + +commit 4ec93f070eda6b765b62efcaed9241c3b3b0b6ad upstream. + +i2sbus_add_dev() keeps the matched "sound" child pointer after +for_each_child_of_node() has dropped the iterator reference. Take an +extra reference before saving that node and drop it after the +layout-id/device-id lookup is complete. + +The function also stores np in dev->sound.ofdev.dev.of_node without +taking a reference for the embedded soundbus device. Since i2sbus +overrides the embedded platform device release callback, balance that +reference explicitly in the local error path and in i2sbus_release_dev(). + +Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") +Cc: stable@vger.kernel.org +Signed-off-by: Cássio Gabriel +Link: https://patch.msgid.link/20260330-aoa-i2sbus-ofnode-lifetime-v1-1-51c309f4ff06@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/aoa/soundbus/i2sbus/core.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/sound/aoa/soundbus/i2sbus/core.c ++++ b/sound/aoa/soundbus/i2sbus/core.c +@@ -83,6 +83,7 @@ static void i2sbus_release_dev(struct de + for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) + free_irq(i2sdev->interrupts[i], i2sdev); + i2sbus_control_remove_dev(i2sdev->control, i2sdev); ++ of_node_put(i2sdev->sound.ofdev.dev.of_node); + mutex_destroy(&i2sdev->lock); + kfree(i2sdev); + } +@@ -148,7 +149,6 @@ static int i2sbus_get_and_fixup_rsrc(str + } + + /* Returns 1 if added, 0 for otherwise; don't return a negative value! */ +-/* FIXME: look at device node refcounting */ + static int i2sbus_add_dev(struct macio_dev *macio, + struct i2sbus_control *control, + struct device_node *np) +@@ -179,8 +179,9 @@ static int i2sbus_add_dev(struct macio_d + i = 0; + for_each_child_of_node(np, child) { + if (of_node_name_eq(child, "sound")) { ++ of_node_put(sound); + i++; +- sound = child; ++ sound = of_node_get(child); + } + } + if (i == 1) { +@@ -206,6 +207,7 @@ static int i2sbus_add_dev(struct macio_d + } + } + } ++ of_node_put(sound); + /* for the time being, until we can handle non-layout-id + * things in some fabric, refuse to attach if there is no + * layout-id property or we haven't been forced to attach. +@@ -220,7 +222,7 @@ static int i2sbus_add_dev(struct macio_d + mutex_init(&dev->lock); + spin_lock_init(&dev->low_lock); + dev->sound.ofdev.archdata.dma_mask = macio->ofdev.archdata.dma_mask; +- dev->sound.ofdev.dev.of_node = np; ++ dev->sound.ofdev.dev.of_node = of_node_get(np); + dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.archdata.dma_mask; + dev->sound.ofdev.dev.parent = &macio->ofdev.dev; + dev->sound.ofdev.dev.release = i2sbus_release_dev; +@@ -328,6 +330,7 @@ static int i2sbus_add_dev(struct macio_d + for (i=0;i<3;i++) + release_and_free_resource(dev->allocated_resource[i]); + mutex_destroy(&dev->lock); ++ of_node_put(dev->sound.ofdev.dev.of_node); + kfree(dev); + return 0; + } diff --git a/queue-6.1/alsa-ctxfi-add-fallback-to-default-rsr-for-s-pdif.patch b/queue-6.1/alsa-ctxfi-add-fallback-to-default-rsr-for-s-pdif.patch new file mode 100644 index 0000000000..4f1735803e --- /dev/null +++ b/queue-6.1/alsa-ctxfi-add-fallback-to-default-rsr-for-s-pdif.patch @@ -0,0 +1,44 @@ +From 7d61662197ecdc458e33e475b6ada7f6da61d364 Mon Sep 17 00:00:00 2001 +From: Harin Lee +Date: Mon, 6 Apr 2026 16:49:13 +0900 +Subject: ALSA: ctxfi: Add fallback to default RSR for S/PDIF + +From: Harin Lee + +commit 7d61662197ecdc458e33e475b6ada7f6da61d364 upstream. + +spdif_passthru_playback_get_resources() uses atc->pll_rate as the RSR +for the MSR calculation loop. However, pll_rate is only updated in +atc_pll_init() and not in hw_pll_init(), so it remains 0 after the +card init. + +When spdif_passthru_playback_setup() skips atc_pll_init() for +32000 Hz, (rsr * desc.msr) always becomes 0, causing the loop to spin +indefinitely. + +Add fallback to use atc->rsr when atc->pll_rate is 0. This reflects +the hardware state, since hw_card_init() already configures the PLL +to the default RSR. + +Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge") +Cc: stable@vger.kernel.org +Signed-off-by: Harin Lee +Link: https://patch.msgid.link/20260406074913.217374-1-me@harin.net +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/ctxfi/ctatc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/pci/ctxfi/ctatc.c ++++ b/sound/pci/ctxfi/ctatc.c +@@ -791,7 +791,8 @@ static int spdif_passthru_playback_get_r + struct src *src; + int err; + int n_amixer = apcm->substream->runtime->channels, i; +- unsigned int pitch, rsr = atc->pll_rate; ++ unsigned int pitch; ++ unsigned int rsr = atc->pll_rate ? atc->pll_rate : atc->rsr; + + /* first release old resources */ + atc_pcm_release_resources(atc, apcm); diff --git a/queue-6.1/alsa-seq_oss-return-full-count-for-successful-seq_fullsize-writes.patch b/queue-6.1/alsa-seq_oss-return-full-count-for-successful-seq_fullsize-writes.patch new file mode 100644 index 0000000000..003ffed676 --- /dev/null +++ b/queue-6.1/alsa-seq_oss-return-full-count-for-successful-seq_fullsize-writes.patch @@ -0,0 +1,49 @@ +From bbc6c0dda54fc0ad8f8aed0b796c23e186e1a188 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C3=A1ssio=20Gabriel?= +Date: Tue, 24 Mar 2026 16:59:41 -0300 +Subject: ALSA: seq_oss: return full count for successful SEQ_FULLSIZE writes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cássio Gabriel + +commit bbc6c0dda54fc0ad8f8aed0b796c23e186e1a188 upstream. + +snd_seq_oss_write() currently returns the raw load_patch() callback +result for SEQ_FULLSIZE events. + +That callback is documented as returning 0 on success and -errno on +failure, but snd_seq_oss_write() is the file write path and should +report the number of user bytes consumed on success. Some in-tree +backends also return backend-specific positive values, which can still +be shorter than the original write size. + +Return the full byte count for successful SEQ_FULLSIZE writes. +Preserve negative errors and convert any nonnegative completion to the +original count. + +Cc: stable@vger.kernel.org +Signed-off-by: Cássio Gabriel +Link: https://patch.msgid.link/20260324-alsa-seq-oss-fullsize-write-return-v1-1-66d448510538@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/seq/oss/seq_oss_rw.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/core/seq/oss/seq_oss_rw.c ++++ b/sound/core/seq/oss/seq_oss_rw.c +@@ -101,9 +101,9 @@ snd_seq_oss_write(struct seq_oss_devinfo + break; + } + fmt = (*(unsigned short *)rec.c) & 0xffff; +- /* FIXME the return value isn't correct */ +- return snd_seq_oss_synth_load_patch(dp, rec.s.dev, +- fmt, buf, 0, count); ++ err = snd_seq_oss_synth_load_patch(dp, rec.s.dev, ++ fmt, buf, 0, count); ++ return err < 0 ? err : count; + } + if (ev_is_long(&rec)) { + /* extended code */ diff --git a/queue-6.1/series b/queue-6.1/series index f2c1698bdd..08744feb90 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -191,3 +191,6 @@ lib-ts_kmp-fix-integer-overflow-in-pattern-length-calculation.patch media-i2c-imx219-check-return-value-of-devm_gpiod_get_optional-in-imx219_probe.patch net-qrtr-ns-fix-use-after-free-in-driver-remove.patch ext2-reject-inodes-with-zero-i_nlink-and-valid-mode-in-ext2_iget.patch +alsa-aoa-i2sbus-fix-of-node-lifetime-handling.patch +alsa-ctxfi-add-fallback-to-default-rsr-for-s-pdif.patch +alsa-seq_oss-return-full-count-for-successful-seq_fullsize-writes.patch