--- /dev/null
+From 0e6b6dedf16800df0ff73ffe2bb5066514db29c2 Mon Sep 17 00:00:00 2001
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Date: Wed, 12 Jun 2024 16:15:55 +0200
+Subject: ACPI: EC: Evaluate orphan _REG under EC device
+
+From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+
+commit 0e6b6dedf16800df0ff73ffe2bb5066514db29c2 upstream.
+
+After starting to install the EC address space handler at the ACPI
+namespace root, if there is an "orphan" _REG method in the EC device's
+scope, it will not be evaluated any more. This breaks EC operation
+regions on some systems, like Asus gu605.
+
+To address this, use a wrapper around an existing ACPICA function to
+look for an "orphan" _REG method in the EC device scope and evaluate
+it if present.
+
+Fixes: 60fa6ae6e6d0 ("ACPI: EC: Install address space handler at the namespace root")
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218945
+Reported-by: VitaliiT <vitaly.torshyn@gmail.com>
+Tested-by: VitaliiT <vitaly.torshyn@gmail.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/acpi/acpica/acevents.h | 4 +++
+ drivers/acpi/acpica/evregion.c | 6 ----
+ drivers/acpi/acpica/evxfregn.c | 54 +++++++++++++++++++++++++++++++++++++++++
+ drivers/acpi/ec.c | 3 ++
+ include/acpi/acpixf.h | 4 +++
+ 5 files changed, 66 insertions(+), 5 deletions(-)
+
+--- a/drivers/acpi/acpica/acevents.h
++++ b/drivers/acpi/acpica/acevents.h
+@@ -191,6 +191,10 @@ void
+ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
+ acpi_adr_space_type space_id, u32 function);
+
++void
++acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *node,
++ acpi_adr_space_type space_id);
++
+ acpi_status
+ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
+
+--- a/drivers/acpi/acpica/evregion.c
++++ b/drivers/acpi/acpica/evregion.c
+@@ -20,10 +20,6 @@ extern u8 acpi_gbl_default_address_space
+
+ /* Local prototypes */
+
+-static void
+-acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *device_node,
+- acpi_adr_space_type space_id);
+-
+ static acpi_status
+ acpi_ev_reg_run(acpi_handle obj_handle,
+ u32 level, void *context, void **return_value);
+@@ -811,7 +807,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
+ *
+ ******************************************************************************/
+
+-static void
++void
+ acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *device_node,
+ acpi_adr_space_type space_id)
+ {
+--- a/drivers/acpi/acpica/evxfregn.c
++++ b/drivers/acpi/acpica/evxfregn.c
+@@ -304,3 +304,57 @@ acpi_execute_reg_methods(acpi_handle dev
+ }
+
+ ACPI_EXPORT_SYMBOL(acpi_execute_reg_methods)
++
++/*******************************************************************************
++ *
++ * FUNCTION: acpi_execute_orphan_reg_method
++ *
++ * PARAMETERS: device - Handle for the device
++ * space_id - The address space ID
++ *
++ * RETURN: Status
++ *
++ * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI
++ * device. This is a _REG method that has no corresponding region
++ * within the device's scope.
++ *
++ ******************************************************************************/
++acpi_status
++acpi_execute_orphan_reg_method(acpi_handle device, acpi_adr_space_type space_id)
++{
++ struct acpi_namespace_node *node;
++ acpi_status status;
++
++ ACPI_FUNCTION_TRACE(acpi_execute_orphan_reg_method);
++
++ /* Parameter validation */
++
++ if (!device) {
++ return_ACPI_STATUS(AE_BAD_PARAMETER);
++ }
++
++ status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
++ if (ACPI_FAILURE(status)) {
++ return_ACPI_STATUS(status);
++ }
++
++ /* Convert and validate the device handle */
++
++ node = acpi_ns_validate_handle(device);
++ if (node) {
++
++ /*
++ * If an "orphan" _REG method is present in the device's scope
++ * for the given address space ID, run it.
++ */
++
++ acpi_ev_execute_orphan_reg_method(node, space_id);
++ } else {
++ status = AE_BAD_PARAMETER;
++ }
++
++ (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
++ return_ACPI_STATUS(status);
++}
++
++ACPI_EXPORT_SYMBOL(acpi_execute_orphan_reg_method)
+--- a/drivers/acpi/ec.c
++++ b/drivers/acpi/ec.c
+@@ -1532,6 +1532,9 @@ static int ec_install_handlers(struct ac
+
+ if (call_reg && !test_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags)) {
+ acpi_execute_reg_methods(scope_handle, ACPI_ADR_SPACE_EC);
++ if (scope_handle != ec->handle)
++ acpi_execute_orphan_reg_method(ec->handle, ACPI_ADR_SPACE_EC);
++
+ set_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags);
+ }
+
+--- a/include/acpi/acpixf.h
++++ b/include/acpi/acpixf.h
+@@ -669,6 +669,10 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
+ acpi_adr_space_type
+ space_id))
+ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
++ acpi_execute_orphan_reg_method(acpi_handle device,
++ acpi_adr_space_type
++ space_id))
++ACPI_EXTERNAL_RETURN_STATUS(acpi_status
+ acpi_remove_address_space_handler(acpi_handle
+ device,
+ acpi_adr_space_type
--- /dev/null
+From 81ea42b9c3d61ea34d82d900ed93f4b4851f13b0 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Mon, 30 Jan 2023 13:12:33 -0800
+Subject: block: Fix the blk_mq_destroy_queue() documentation
+
+From: Bart Van Assche <bvanassche@acm.org>
+
+commit 81ea42b9c3d61ea34d82d900ed93f4b4851f13b0 upstream.
+
+Commit 2b3f056f72e5 moved a blk_put_queue() call from
+blk_mq_destroy_queue() into its callers. Reflect this change in the
+documentation block above blk_mq_destroy_queue().
+
+Cc: Christoph Hellwig <hch@lst.de>
+Cc: Sagi Grimberg <sagi@grimberg.me>
+Cc: Chaitanya Kulkarni <kch@nvidia.com>
+Cc: Keith Busch <kbusch@kernel.org>
+Fixes: 2b3f056f72e5 ("blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue")
+Signed-off-by: Bart Van Assche <bvanassche@acm.org>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Link: https://lore.kernel.org/r/20230130211233.831613-1-bvanassche@acm.org
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/blk-mq.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/block/blk-mq.c
++++ b/block/blk-mq.c
+@@ -4175,8 +4175,9 @@ EXPORT_SYMBOL(blk_mq_init_queue);
+ * blk_mq_destroy_queue - shutdown a request queue
+ * @q: request queue to shutdown
+ *
+- * This shuts down a request queue allocated by blk_mq_init_queue() and drops
+- * the initial reference. All future requests will failed with -ENODEV.
++ * This shuts down a request queue allocated by blk_mq_init_queue(). All future
++ * requests will be failed with -ENODEV. The caller is responsible for dropping
++ * the reference from blk_mq_init_queue() by calling blk_put_queue().
+ *
+ * Context: can sleep
+ */
--- /dev/null
+From d5e72c4e3256335d6fb75c2e321144f93141f4f5 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 27 Apr 2023 19:18:01 -0400
+Subject: ext4: fix lost error code reporting in __ext4_fill_super()
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+commit d5e72c4e3256335d6fb75c2e321144f93141f4f5 upstream.
+
+When code was factored out of __ext4_fill_super() into
+ext4_percpu_param_init() the error return was discarded. This meant
+that it was possible for __ext4_fill_super() to return zero,
+indicating success, without the struct super getting completely filled
+in, leading to a potential NULL pointer dereference.
+
+Reported-by: syzbot+bbf0f9a213c94f283a5c@syzkaller.appspotmail.com
+Fixes: 1f79467c8a6b ("ext4: factor out ext4_percpu_param_init() ...")
+Link: https://syzkaller.appspot.com/bug?id=6dac47d5e58af770c0055f680369586ec32e144c
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Jason Yan <yanaijie@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/super.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -5531,7 +5531,8 @@ static int __ext4_fill_super(struct fs_c
+ sbi->s_journal->j_commit_callback =
+ ext4_journal_commit_callback;
+
+- if (ext4_percpu_param_init(sbi))
++ err = ext4_percpu_param_init(sbi);
++ if (err)
+ goto failed_mount6;
+
+ if (ext4_has_feature_flex_bg(sb))
--- /dev/null
+From 856dd6c5981260b4d1aa84b78373ad54a203db48 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Thu, 20 Apr 2023 09:51:24 -0700
+Subject: ext4: fix unused iterator variable warnings
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 856dd6c5981260b4d1aa84b78373ad54a203db48 upstream.
+
+When CONFIG_QUOTA is disabled, there are warnings around unused iterator
+variables:
+
+ fs/ext4/super.c: In function 'ext4_put_super':
+ fs/ext4/super.c:1262:13: error: unused variable 'i' [-Werror=unused-variable]
+ 1262 | int i, err;
+ | ^
+ fs/ext4/super.c: In function '__ext4_fill_super':
+ fs/ext4/super.c:5200:22: error: unused variable 'i' [-Werror=unused-variable]
+ 5200 | unsigned int i;
+ | ^
+ cc1: all warnings being treated as errors
+
+The kernel has updated to GNU11, allowing the variables to be declared
+within the for loop. Do so to clear up the warnings.
+
+Fixes: dcbf87589d90 ("ext4: factor out ext4_flex_groups_free()")
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Reviewed-by: Jason Yan <yanaijie@huawei.com>
+Link: https://lore.kernel.org/r/20230420-ext4-unused-variables-super-c-v1-1-138b6db6c21c@kernel.org
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/super.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -1265,7 +1265,7 @@ static void ext4_put_super(struct super_
+ struct ext4_sb_info *sbi = EXT4_SB(sb);
+ struct ext4_super_block *es = sbi->s_es;
+ int aborted = 0;
+- int i, err;
++ int err;
+
+ /*
+ * Unregister sysfs before destroying jbd2 journal.
+@@ -1316,7 +1316,7 @@ static void ext4_put_super(struct super_
+ ext4_flex_groups_free(sbi);
+ ext4_percpu_param_destroy(sbi);
+ #ifdef CONFIG_QUOTA
+- for (i = 0; i < EXT4_MAXQUOTAS; i++)
++ for (int i = 0; i < EXT4_MAXQUOTAS; i++)
+ kfree(get_qf_name(sb, sbi, i));
+ #endif
+
+@@ -5127,7 +5127,6 @@ static int __ext4_fill_super(struct fs_c
+ ext4_fsblk_t logical_sb_block;
+ struct inode *root;
+ int ret = -ENOMEM;
+- unsigned int i;
+ int needs_recovery, has_huge_files;
+ int err = 0;
+ ext4_group_t first_not_zeroed;
+@@ -5658,7 +5657,7 @@ failed_mount:
+ #endif
+
+ #ifdef CONFIG_QUOTA
+- for (i = 0; i < EXT4_MAXQUOTAS; i++)
++ for (unsigned int i = 0; i < EXT4_MAXQUOTAS; i++)
+ kfree(get_qf_name(sb, sbi, i));
+ #endif
+ fscrypt_free_dummy_policy(&sbi->s_dummy_enc_policy);
selftests-mptcp-join-implicit-stop-transfer-after-last-check.patch
selftests-mptcp-join-check-removing-signal-subflow-endp.patch
bluetooth-eir-fix-possible-crashes-on-eir_create_adv_data.patch
+block-fix-the-blk_mq_destroy_queue-documentation.patch
+ext4-fix-lost-error-code-reporting-in-__ext4_fill_super.patch
+ext4-fix-unused-iterator-variable-warnings.patch
+acpi-ec-evaluate-orphan-_reg-under-ec-device.patch