From 51e8a0eb33458db25252faa05565b34a57e48ad1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 25 Jul 2024 15:49:01 +0200 Subject: [PATCH] 6.10-stable patches 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 --- ...onize-dma-channel-when-dma-is-paused.patch | 40 +++++++++ ...skip-useless-ports-for-static-blocks.patch | 89 +++++++++++++++++++ ...cntl-close-race-recovery-compat-path.patch | 54 +++++++++++ queue-6.10/series | 3 + 4 files changed, 186 insertions(+) create mode 100644 queue-6.10/alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch create mode 100644 queue-6.10/alsa-seq-ump-skip-useless-ports-for-static-blocks.patch create mode 100644 queue-6.10/filelock-fix-fcntl-close-race-recovery-compat-path.patch 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 index 00000000000..5259150fc33 --- /dev/null +++ b/queue-6.10/alsa-pcm_dmaengine-don-t-synchronize-dma-channel-when-dma-is-paused.patch @@ -0,0 +1,40 @@ +From 88e98af9f4b5b0d60c1fe7f7f2701b5467691e75 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +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 + +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 +Cc: +Link: https://patch.msgid.link/1721198693-27636-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..f2389a95d5d --- /dev/null +++ b/queue-6.10/alsa-seq-ump-skip-useless-ports-for-static-blocks.patch @@ -0,0 +1,89 @@ +From 3bfd7c0ba184de99e9f5083b29e5308f30767265 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 17 Jul 2024 10:33:01 +0200 +Subject: ALSA: seq: ump: Skip useless ports for static blocks + +From: Takashi Iwai + +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: +Link: https://patch.msgid.link/20240717083322.25892-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..76a8a581729 --- /dev/null +++ b/queue-6.10/filelock-fix-fcntl-close-race-recovery-compat-path.patch @@ -0,0 +1,54 @@ +From f8138f2ad2f745b9a1c696a05b749eabe44337ea Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Tue, 23 Jul 2024 17:03:56 +0200 +Subject: filelock: Fix fcntl/close race recovery compat path + +From: Jann Horn + +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 +Link: https://lore.kernel.org/r/20240723-fs-lock-recover-compatfix-v1-1-148096719529@google.com +Signed-off-by: Christian Brauner +Signed-off-by: Greg Kroah-Hartman +--- + 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; + } + } diff --git a/queue-6.10/series b/queue-6.10/series index cc9bab7847d..c5443e499b3 100644 --- a/queue-6.10/series +++ b/queue-6.10/series @@ -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 -- 2.47.3