]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 14:56:20 +0000 (15:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 14:56:20 +0000 (15:56 +0100)
added patches:
mmc-block-be-sure-to-wait-while-busy-in-cqe-error-recovery.patch
revert-btrfs-add-dmesg-output-for-first-mount-and-last-unmount-of-a-filesystem.patch

queue-5.10/mmc-block-be-sure-to-wait-while-busy-in-cqe-error-recovery.patch [new file with mode: 0644]
queue-5.10/revert-btrfs-add-dmesg-output-for-first-mount-and-last-unmount-of-a-filesystem.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/mmc-block-be-sure-to-wait-while-busy-in-cqe-error-recovery.patch b/queue-5.10/mmc-block-be-sure-to-wait-while-busy-in-cqe-error-recovery.patch
new file mode 100644 (file)
index 0000000..c4ede5a
--- /dev/null
@@ -0,0 +1,69 @@
+From c616696a902987352426fdaeec1b0b3240949e6b Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Fri, 3 Nov 2023 10:47:17 +0200
+Subject: mmc: block: Be sure to wait while busy in CQE error recovery
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+commit c616696a902987352426fdaeec1b0b3240949e6b upstream.
+
+STOP command does not guarantee to wait while busy, but subsequent command
+MMC_CMDQ_TASK_MGMT to discard the queue will fail if the card is busy, so
+be sure to wait by employing mmc_poll_for_busy().
+
+Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests")
+Cc: stable@vger.kernel.org
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Reviewed-by: Avri Altman <avri.altman@wdc.com>
+Reviewed-by: Christian Loehle <christian.loehle@arm.com>
+Link: https://lore.kernel.org/r/20231103084720.6886-4-adrian.hunter@intel.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Tested-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/core/core.c    |    2 ++
+ drivers/mmc/core/mmc_ops.c |    3 ++-
+ drivers/mmc/core/mmc_ops.h |    1 +
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/core/core.c
++++ b/drivers/mmc/core/core.c
+@@ -553,6 +553,8 @@ int mmc_cqe_recovery(struct mmc_host *ho
+       cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT;
+       mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
++      mmc_poll_for_busy(host->card, MMC_CQE_RECOVERY_TIMEOUT, MMC_BUSY_IO);
++
+       memset(&cmd, 0, sizeof(cmd));
+       cmd.opcode       = MMC_CMDQ_TASK_MGMT;
+       cmd.arg          = 1; /* Discard entire queue */
+--- a/drivers/mmc/core/mmc_ops.c
++++ b/drivers/mmc/core/mmc_ops.c
+@@ -452,7 +452,7 @@ static int mmc_busy_status(struct mmc_ca
+       u32 status = 0;
+       int err;
+-      if (host->ops->card_busy) {
++      if (busy_cmd != MMC_BUSY_IO && host->ops->card_busy) {
+               *busy = host->ops->card_busy(host);
+               return 0;
+       }
+@@ -473,6 +473,7 @@ static int mmc_busy_status(struct mmc_ca
+               err = R1_STATUS(status) ? -EIO : 0;
+               break;
+       case MMC_BUSY_HPI:
++      case MMC_BUSY_IO:
+               break;
+       default:
+               err = -EINVAL;
+--- a/drivers/mmc/core/mmc_ops.h
++++ b/drivers/mmc/core/mmc_ops.h
+@@ -14,6 +14,7 @@ enum mmc_busy_cmd {
+       MMC_BUSY_CMD6,
+       MMC_BUSY_ERASE,
+       MMC_BUSY_HPI,
++      MMC_BUSY_IO,
+ };
+ struct mmc_host;
diff --git a/queue-5.10/revert-btrfs-add-dmesg-output-for-first-mount-and-last-unmount-of-a-filesystem.patch b/queue-5.10/revert-btrfs-add-dmesg-output-for-first-mount-and-last-unmount-of-a-filesystem.patch
new file mode 100644 (file)
index 0000000..ab8459b
--- /dev/null
@@ -0,0 +1,54 @@
+From 910164f3394f3f2036b5655eae72c49f9b0ad800 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Mon, 11 Dec 2023 15:52:30 +0100
+Subject: Revert "btrfs: add dmesg output for first mount and last unmount of a filesystem"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit 2d6c2238acf8043ec71cdede3542efd54e02798a which is
+commit 2db313205f8b96eea467691917138d646bb50aef upstream.
+
+As pointed out by many, the disk_super structure is NOT initialized
+before it is dereferenced in the function
+fs/btrfs/disk-io.c:open_ctree() that this commit adds, so something went
+wrong here.
+
+Revert it for now until it gets straightened out.
+
+Link: https://lore.kernel.org/r/5b0eb360-3765-40e1-854a-9da6d97eb405@roeck-us.net
+Link: https://lore.kernel.org/r/20231209172836.GA2154579@dev-arch.thelio-3990X
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Reported-by: Nathan Chancellor <nathan@kernel.org>
+Cc: Anand Jain <anand.jain@oracle.com>
+Cc: Qu Wenruo <wqu@suse.com>
+Cc: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/disk-io.c |    1 -
+ fs/btrfs/super.c   |    5 +----
+ 2 files changed, 1 insertion(+), 5 deletions(-)
+
+--- a/fs/btrfs/disk-io.c
++++ b/fs/btrfs/disk-io.c
+@@ -2972,7 +2972,6 @@ int __cold open_ctree(struct super_block
+               goto fail_alloc;
+       }
+-      btrfs_info(fs_info, "first mount of filesystem %pU", disk_super->fsid);
+       /*
+        * Verify the type first, if that or the checksum value are
+        * corrupted, we'll find out
+--- a/fs/btrfs/super.c
++++ b/fs/btrfs/super.c
+@@ -318,10 +318,7 @@ void __btrfs_panic(struct btrfs_fs_info
+ static void btrfs_put_super(struct super_block *sb)
+ {
+-      struct btrfs_fs_info *fs_info = btrfs_sb(sb);
+-
+-      btrfs_info(fs_info, "last unmount of filesystem %pU", fs_info->fs_devices->fsid);
+-      close_ctree(fs_info);
++      close_ctree(btrfs_sb(sb));
+ }
+ enum {
index c28dd86272fa1e7e44fab4d54c65acc0faf0595c..fed046385b04587b27b8f4961d6c9feafbb4ab10 100644 (file)
@@ -88,3 +88,5 @@ netfilter-nft_set_pipapo-skip-inactive-elements-during-set-walk.patch
 platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch
 tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch
 platform-x86-asus-wmi-document-the-dgpu_disable-sysfs-attribute.patch
+mmc-block-be-sure-to-wait-while-busy-in-cqe-error-recovery.patch
+revert-btrfs-add-dmesg-output-for-first-mount-and-last-unmount-of-a-filesystem.patch