]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 13:49:01 +0000 (15:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 13:49:01 +0000 (15:49 +0200)
added patches:
alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch
alsa-seq-ump-skip-useless-ports-for-static-blocks.patch
filelock-fix-fcntl-close-race-recovery-compat-path.patch

queue-6.10/alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch [new file with mode: 0644]
queue-6.10/alsa-seq-ump-skip-useless-ports-for-static-blocks.patch [new file with mode: 0644]
queue-6.10/filelock-fix-fcntl-close-race-recovery-compat-path.patch [new file with mode: 0644]
queue-6.10/series

diff --git a/queue-6.10/alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch b/queue-6.10/alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch
new file mode 100644 (file)
index 0000000..5259150
--- /dev/null
@@ -0,0 +1,40 @@
+From 88e98af9f4b5b0d60c1fe7f7f2701b5467691e75 Mon Sep 17 00:00:00 2001
+From: Shengjiu Wang <shengjiu.wang@nxp.com>
+Date: Wed, 17 Jul 2024 14:44:53 +0800
+Subject: ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
+
+From: Shengjiu Wang <shengjiu.wang@nxp.com>
+
+commit 88e98af9f4b5b0d60c1fe7f7f2701b5467691e75 upstream.
+
+When suspended, the DMA channel may enter PAUSE state if dmaengine_pause()
+is supported by DMA.
+At this state, dmaengine_synchronize() should not be called, otherwise
+the DMA channel can't be resumed successfully.
+
+Fixes: e8343410ddf0 ("ALSA: dmaengine: Synchronize dma channel after drop()")
+Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
+Cc: <stable@vger.kernel.org>
+Link: https://patch.msgid.link/1721198693-27636-1-git-send-email-shengjiu.wang@nxp.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/pcm_dmaengine.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/sound/core/pcm_dmaengine.c
++++ b/sound/core/pcm_dmaengine.c
+@@ -352,8 +352,12 @@ EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open
+ int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream)
+ {
+       struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
++      struct dma_tx_state state;
++      enum dma_status status;
+-      dmaengine_synchronize(prtd->dma_chan);
++      status = dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state);
++      if (status != DMA_PAUSED)
++              dmaengine_synchronize(prtd->dma_chan);
+       return 0;
+ }
diff --git a/queue-6.10/alsa-seq-ump-skip-useless-ports-for-static-blocks.patch b/queue-6.10/alsa-seq-ump-skip-useless-ports-for-static-blocks.patch
new file mode 100644 (file)
index 0000000..f2389a9
--- /dev/null
@@ -0,0 +1,89 @@
+From 3bfd7c0ba184de99e9f5083b29e5308f30767265 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 17 Jul 2024 10:33:01 +0200
+Subject: ALSA: seq: ump: Skip useless ports for static blocks
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 3bfd7c0ba184de99e9f5083b29e5308f30767265 upstream.
+
+When the UMP Endpoint is configured with static blocks, the block
+configuration will never change, hence the unused ports will be
+unchanged as well.  Creating sequencer ports for those unused ports
+is simply useless, and it might be rather confusing for users.
+The idea behind the inactive ports was for allowing connections
+from/to ports that can become usable later, but this will never
+happen for inactive groups in static blocks.
+
+Let's change the sequencer UMP binding to skip those unused ports when
+the UMP EP is with static blocks.
+
+Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device")
+Cc: <stable@vger.kernel.org>
+Link: https://patch.msgid.link/20240717083322.25892-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/seq/seq_ump_client.c |   16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/sound/core/seq/seq_ump_client.c
++++ b/sound/core/seq/seq_ump_client.c
+@@ -28,6 +28,7 @@ struct seq_ump_group {
+       int group;                      /* group index (0-based) */
+       unsigned int dir_bits;          /* directions */
+       bool active;                    /* activeness */
++      bool valid;                     /* valid group (referred by blocks) */
+       char name[64];                  /* seq port name */
+ };
+@@ -210,6 +211,13 @@ static void fill_port_info(struct snd_se
+               sprintf(port->name, "Group %d", group->group + 1);
+ }
++/* skip non-existing group for static blocks */
++static bool skip_group(struct seq_ump_client *client, struct seq_ump_group *group)
++{
++      return !group->valid &&
++              (client->ump->info.flags & SNDRV_UMP_EP_INFO_STATIC_BLOCKS);
++}
++
+ /* create a new sequencer port per UMP group */
+ static int seq_ump_group_init(struct seq_ump_client *client, int group_index)
+ {
+@@ -217,6 +225,9 @@ static int seq_ump_group_init(struct seq
+       struct snd_seq_port_info *port __free(kfree) = NULL;
+       struct snd_seq_port_callback pcallbacks;
++      if (skip_group(client, group))
++              return 0;
++
+       port = kzalloc(sizeof(*port), GFP_KERNEL);
+       if (!port)
+               return -ENOMEM;
+@@ -250,6 +261,9 @@ static void update_port_infos(struct seq
+               return;
+       for (i = 0; i < SNDRV_UMP_MAX_GROUPS; i++) {
++              if (skip_group(client, &client->groups[i]))
++                      continue;
++
+               old->addr.client = client->seq_client;
+               old->addr.port = i;
+               err = snd_seq_kernel_client_ctl(client->seq_client,
+@@ -284,6 +298,7 @@ static void update_group_attrs(struct se
+               group->dir_bits = 0;
+               group->active = 0;
+               group->group = i;
++              group->valid = false;
+       }
+       list_for_each_entry(fb, &client->ump->block_list, list) {
+@@ -291,6 +306,7 @@ static void update_group_attrs(struct se
+                       break;
+               group = &client->groups[fb->info.first_group];
+               for (i = 0; i < fb->info.num_groups; i++, group++) {
++                      group->valid = true;
+                       if (fb->info.active)
+                               group->active = 1;
+                       switch (fb->info.direction) {
diff --git a/queue-6.10/filelock-fix-fcntl-close-race-recovery-compat-path.patch b/queue-6.10/filelock-fix-fcntl-close-race-recovery-compat-path.patch
new file mode 100644 (file)
index 0000000..76a8a58
--- /dev/null
@@ -0,0 +1,54 @@
+From f8138f2ad2f745b9a1c696a05b749eabe44337ea Mon Sep 17 00:00:00 2001
+From: Jann Horn <jannh@google.com>
+Date: Tue, 23 Jul 2024 17:03:56 +0200
+Subject: filelock: Fix fcntl/close race recovery compat path
+
+From: Jann Horn <jannh@google.com>
+
+commit f8138f2ad2f745b9a1c696a05b749eabe44337ea upstream.
+
+When I wrote commit 3cad1bc01041 ("filelock: Remove locks reliably when
+fcntl/close race is detected"), I missed that there are two copies of the
+code I was patching: The normal version, and the version for 64-bit offsets
+on 32-bit kernels.
+Thanks to Greg KH for stumbling over this while doing the stable
+backport...
+
+Apply exactly the same fix to the compat path for 32-bit kernels.
+
+Fixes: c293621bbf67 ("[PATCH] stale POSIX lock handling")
+Cc: stable@kernel.org
+Link: https://bugs.chromium.org/p/project-zero/issues/detail?id=2563
+Signed-off-by: Jann Horn <jannh@google.com>
+Link: https://lore.kernel.org/r/20240723-fs-lock-recover-compatfix-v1-1-148096719529@google.com
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/locks.c |    9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -2570,8 +2570,9 @@ int fcntl_setlk64(unsigned int fd, struc
+       error = do_lock_file_wait(filp, cmd, file_lock);
+       /*
+-       * Attempt to detect a close/fcntl race and recover by releasing the
+-       * lock that was just acquired. There is no need to do that when we're
++       * Detect close/fcntl races and recover by zapping all POSIX locks
++       * associated with this file and our files_struct, just like on
++       * filp_flush(). There is no need to do that when we're
+        * unlocking though, or for OFD locks.
+        */
+       if (!error && file_lock->c.flc_type != F_UNLCK &&
+@@ -2586,9 +2587,7 @@ int fcntl_setlk64(unsigned int fd, struc
+               f = files_lookup_fd_locked(files, fd);
+               spin_unlock(&files->file_lock);
+               if (f != filp) {
+-                      file_lock->c.flc_type = F_UNLCK;
+-                      error = do_lock_file_wait(filp, cmd, file_lock);
+-                      WARN_ON_ONCE(error);
++                      locks_remove_posix(filp, files);
+                       error = -EBADF;
+               }
+       }
index cc9bab7847d0b797f8205b96d6ca8bd5c95dd362..c5443e499b3dab35ea13ae141977c2331a80d341 100644 (file)
@@ -24,3 +24,6 @@ arm64-dts-qcom-sdm630-disable-ss-instance-in-parkmode-for-usb.patch
 arm64-dts-qcom-ipq8074-disable-ss-instance-in-parkmode-for-usb.patch
 arm64-dts-qcom-sdm845-disable-ss-instance-in-parkmode-for-usb.patch
 arm64-dts-qcom-sm6115-disable-ss-instance-in-parkmode-for-usb.patch
+alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch
+alsa-seq-ump-skip-useless-ports-for-static-blocks.patch
+filelock-fix-fcntl-close-race-recovery-compat-path.patch