From 41206587da1f12cddc3372bef790a030fe41dd1a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 30 Mar 2024 10:51:44 +0100 Subject: [PATCH] 6.1-stable patches added patches: block-do-not-force-full-zone-append-completion-in-req_bio_endio.patch btrfs-zoned-don-t-skip-block-groups-with-100-zone-unusable.patch btrfs-zoned-use-zone-aware-sb-location-for-scrub.patch drm-amdkfd-fix-tlb-flush-after-unmap-for-gfx9.4.2.patch drm-vmwgfx-create-debugfs-ttm_resource_manager-entry-only-if-needed.patch exec-fix-nommu-linux_binprm-exec-in-transfer_args_to_stack.patch gpio-cdev-sanitize-the-label-before-requesting-the-interrupt.patch hexagon-vmlinux.lds.s-handle-attributes-section.patch mmc-core-avoid-negative-index-with-array-access.patch mmc-core-initialize-mmc_blk_ioc_data.patch mmc-sdhci-omap-re-tuning-is-needed-after-a-pm-transition-to-support-emmc-hs200-mode.patch net-ll_temac-platform_get_resource-replaced-by-wrong-function.patch nouveau-dmem-handle-kcalloc-allocation-failure.patch thermal-devfreq_cooling-fix-perf-state-when-calculate-dfc-res_util.patch wifi-iwlwifi-fw-don-t-always-use-fw-dump-trig.patch wifi-mac80211-check-clear-fast-rx-for-non-4addr-sta-vlan-changes.patch --- ...e-append-completion-in-req_bio_endio.patch | 53 ++++++++ ...-block-groups-with-100-zone-unusable.patch | 45 +++++++ ...use-zone-aware-sb-location-for-scrub.patch | 52 ++++++++ ...x-tlb-flush-after-unmap-for-gfx9.4.2.patch | 32 +++++ ...esource_manager-entry-only-if-needed.patch | 78 +++++++++++ ...inprm-exec-in-transfer_args_to_stack.patch | 42 ++++++ ...abel-before-requesting-the-interrupt.patch | 126 ++++++++++++++++++ ...inux.lds.s-handle-attributes-section.patch | 43 ++++++ ...oid-negative-index-with-array-access.patch | 37 +++++ ...mmc-core-initialize-mmc_blk_ioc_data.patch | 41 ++++++ ...ransition-to-support-emmc-hs200-mode.patch | 65 +++++++++ ..._resource-replaced-by-wrong-function.patch | 41 ++++++ ...em-handle-kcalloc-allocation-failure.patch | 63 +++++++++ queue-6.1/series | 16 +++ ...rf-state-when-calculate-dfc-res_util.patch | 41 ++++++ ...ifi-fw-don-t-always-use-fw-dump-trig.patch | 60 +++++++++ ...st-rx-for-non-4addr-sta-vlan-changes.patch | 44 ++++++ 17 files changed, 879 insertions(+) create mode 100644 queue-6.1/block-do-not-force-full-zone-append-completion-in-req_bio_endio.patch create mode 100644 queue-6.1/btrfs-zoned-don-t-skip-block-groups-with-100-zone-unusable.patch create mode 100644 queue-6.1/btrfs-zoned-use-zone-aware-sb-location-for-scrub.patch create mode 100644 queue-6.1/drm-amdkfd-fix-tlb-flush-after-unmap-for-gfx9.4.2.patch create mode 100644 queue-6.1/drm-vmwgfx-create-debugfs-ttm_resource_manager-entry-only-if-needed.patch create mode 100644 queue-6.1/exec-fix-nommu-linux_binprm-exec-in-transfer_args_to_stack.patch create mode 100644 queue-6.1/gpio-cdev-sanitize-the-label-before-requesting-the-interrupt.patch create mode 100644 queue-6.1/hexagon-vmlinux.lds.s-handle-attributes-section.patch create mode 100644 queue-6.1/mmc-core-avoid-negative-index-with-array-access.patch create mode 100644 queue-6.1/mmc-core-initialize-mmc_blk_ioc_data.patch create mode 100644 queue-6.1/mmc-sdhci-omap-re-tuning-is-needed-after-a-pm-transition-to-support-emmc-hs200-mode.patch create mode 100644 queue-6.1/net-ll_temac-platform_get_resource-replaced-by-wrong-function.patch create mode 100644 queue-6.1/nouveau-dmem-handle-kcalloc-allocation-failure.patch create mode 100644 queue-6.1/thermal-devfreq_cooling-fix-perf-state-when-calculate-dfc-res_util.patch create mode 100644 queue-6.1/wifi-iwlwifi-fw-don-t-always-use-fw-dump-trig.patch create mode 100644 queue-6.1/wifi-mac80211-check-clear-fast-rx-for-non-4addr-sta-vlan-changes.patch diff --git a/queue-6.1/block-do-not-force-full-zone-append-completion-in-req_bio_endio.patch b/queue-6.1/block-do-not-force-full-zone-append-completion-in-req_bio_endio.patch new file mode 100644 index 00000000000..a629018a427 --- /dev/null +++ b/queue-6.1/block-do-not-force-full-zone-append-completion-in-req_bio_endio.patch @@ -0,0 +1,53 @@ +From 55251fbdf0146c252ceff146a1bb145546f3e034 Mon Sep 17 00:00:00 2001 +From: Damien Le Moal +Date: Thu, 28 Mar 2024 09:43:40 +0900 +Subject: block: Do not force full zone append completion in req_bio_endio() + +From: Damien Le Moal + +commit 55251fbdf0146c252ceff146a1bb145546f3e034 upstream. + +This reverts commit 748dc0b65ec2b4b7b3dbd7befcc4a54fdcac7988. + +Partial zone append completions cannot be supported as there is no +guarantees that the fragmented data will be written sequentially in the +same manner as with a full command. Commit 748dc0b65ec2 ("block: fix +partial zone append completion handling in req_bio_endio()") changed +req_bio_endio() to always advance a partially failed BIO by its full +length, but this can lead to incorrect accounting. So revert this +change and let low level device drivers handle this case by always +failing completely zone append operations. With this revert, users will +still see an IO error for a partially completed zone append BIO. + +Fixes: 748dc0b65ec2 ("block: fix partial zone append completion handling in req_bio_endio()") +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20240328004409.594888-2-dlemoal@kernel.org +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + block/blk-mq.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +--- a/block/blk-mq.c ++++ b/block/blk-mq.c +@@ -761,16 +761,11 @@ static void req_bio_endio(struct request + /* + * Partial zone append completions cannot be supported as the + * BIO fragments may end up not being written sequentially. +- * For such case, force the completed nbytes to be equal to +- * the BIO size so that bio_advance() sets the BIO remaining +- * size to 0 and we end up calling bio_endio() before returning. + */ +- if (bio->bi_iter.bi_size != nbytes) { ++ if (bio->bi_iter.bi_size != nbytes) + bio->bi_status = BLK_STS_IOERR; +- nbytes = bio->bi_iter.bi_size; +- } else { ++ else + bio->bi_iter.bi_sector = rq->__sector; +- } + } + + bio_advance(bio, nbytes); diff --git a/queue-6.1/btrfs-zoned-don-t-skip-block-groups-with-100-zone-unusable.patch b/queue-6.1/btrfs-zoned-don-t-skip-block-groups-with-100-zone-unusable.patch new file mode 100644 index 00000000000..a9a96c6c635 --- /dev/null +++ b/queue-6.1/btrfs-zoned-don-t-skip-block-groups-with-100-zone-unusable.patch @@ -0,0 +1,45 @@ +From a8b70c7f8600bc77d03c0b032c0662259b9e615e Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 21 Feb 2024 07:35:52 -0800 +Subject: btrfs: zoned: don't skip block groups with 100% zone unusable + +From: Johannes Thumshirn + +commit a8b70c7f8600bc77d03c0b032c0662259b9e615e upstream. + +Commit f4a9f219411f ("btrfs: do not delete unused block group if it may be +used soon") changed the behaviour of deleting unused block-groups on zoned +filesystems. Starting with this commit, we're using +btrfs_space_info_used() to calculate the number of used bytes in a +space_info. But btrfs_space_info_used() also accounts +btrfs_space_info::bytes_zone_unusable as used bytes. + +So if a block group is 100% zone_unusable it is skipped from the deletion +step. + +In order not to skip fully zone_unusable block-groups, also check if the +block-group has bytes left that can be used on a zoned filesystem. + +Fixes: f4a9f219411f ("btrfs: do not delete unused block group if it may be used soon") +CC: stable@vger.kernel.org # 6.1+ +Reviewed-by: Filipe Manana +Signed-off-by: Johannes Thumshirn +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/block-group.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/block-group.c ++++ b/fs/btrfs/block-group.c +@@ -1413,7 +1413,8 @@ void btrfs_delete_unused_bgs(struct btrf + * needing to allocate extents from the block group. + */ + used = btrfs_space_info_used(space_info, true); +- if (space_info->total_bytes - block_group->length < used) { ++ if (space_info->total_bytes - block_group->length < used && ++ block_group->zone_unusable < block_group->length) { + /* + * Add a reference for the list, compensate for the ref + * drop under the "next" label for the diff --git a/queue-6.1/btrfs-zoned-use-zone-aware-sb-location-for-scrub.patch b/queue-6.1/btrfs-zoned-use-zone-aware-sb-location-for-scrub.patch new file mode 100644 index 00000000000..16032df71aa --- /dev/null +++ b/queue-6.1/btrfs-zoned-use-zone-aware-sb-location-for-scrub.patch @@ -0,0 +1,52 @@ +From 74098a989b9c3370f768140b7783a7aaec2759b3 Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Mon, 26 Feb 2024 16:39:13 +0100 +Subject: btrfs: zoned: use zone aware sb location for scrub + +From: Johannes Thumshirn + +commit 74098a989b9c3370f768140b7783a7aaec2759b3 upstream. + +At the moment scrub_supers() doesn't grab the super block's location via +the zoned device aware btrfs_sb_log_location() but via btrfs_sb_offset(). + +This leads to checksum errors on 'scrub' as we're not accessing the +correct location of the super block. + +So use btrfs_sb_log_location() for getting the super blocks location on +scrub. + +Reported-by: WA AM +Link: http://lore.kernel.org/linux-btrfs/CANU2Z0EvUzfYxczLgGUiREoMndE9WdQnbaawV5Fv5gNXptPUKw@mail.gmail.com +CC: stable@vger.kernel.org # 5.15+ +Reviewed-by: Qu Wenruo +Reviewed-by: Naohiro Aota +Signed-off-by: Johannes Thumshirn +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/scrub.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/scrub.c ++++ b/fs/btrfs/scrub.c +@@ -4177,7 +4177,17 @@ static noinline_for_stack int scrub_supe + gen = fs_info->last_trans_committed; + + for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { +- bytenr = btrfs_sb_offset(i); ++ ret = btrfs_sb_log_location(scrub_dev, i, 0, &bytenr); ++ if (ret == -ENOENT) ++ break; ++ ++ if (ret) { ++ spin_lock(&sctx->stat_lock); ++ sctx->stat.super_errors++; ++ spin_unlock(&sctx->stat_lock); ++ continue; ++ } ++ + if (bytenr + BTRFS_SUPER_INFO_SIZE > + scrub_dev->commit_total_bytes) + break; diff --git a/queue-6.1/drm-amdkfd-fix-tlb-flush-after-unmap-for-gfx9.4.2.patch b/queue-6.1/drm-amdkfd-fix-tlb-flush-after-unmap-for-gfx9.4.2.patch new file mode 100644 index 00000000000..f4f5b38e1c5 --- /dev/null +++ b/queue-6.1/drm-amdkfd-fix-tlb-flush-after-unmap-for-gfx9.4.2.patch @@ -0,0 +1,32 @@ +From 1210e2f1033dc56b666c9f6dfb761a2d3f9f5d6c Mon Sep 17 00:00:00 2001 +From: Eric Huang +Date: Wed, 20 Mar 2024 15:53:47 -0400 +Subject: drm/amdkfd: fix TLB flush after unmap for GFX9.4.2 + +From: Eric Huang + +commit 1210e2f1033dc56b666c9f6dfb761a2d3f9f5d6c upstream. + +TLB flush after unmap accidentially was removed on +gfx9.4.2. It is to add it back. + +Signed-off-by: Eric Huang +Reviewed-by: Harish Kasiviswanathan +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +@@ -1349,7 +1349,7 @@ void kfd_flush_tlb(struct kfd_process_de + + static inline bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev) + { +- return KFD_GC_VERSION(dev) > IP_VERSION(9, 4, 2) || ++ return KFD_GC_VERSION(dev) >= IP_VERSION(9, 4, 2) || + (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) && dev->sdma_fw_version >= 18) || + KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0); + } diff --git a/queue-6.1/drm-vmwgfx-create-debugfs-ttm_resource_manager-entry-only-if-needed.patch b/queue-6.1/drm-vmwgfx-create-debugfs-ttm_resource_manager-entry-only-if-needed.patch new file mode 100644 index 00000000000..43e39678317 --- /dev/null +++ b/queue-6.1/drm-vmwgfx-create-debugfs-ttm_resource_manager-entry-only-if-needed.patch @@ -0,0 +1,78 @@ +From 4be9075fec0a639384ed19975634b662bfab938f Mon Sep 17 00:00:00 2001 +From: Jocelyn Falempe +Date: Tue, 12 Mar 2024 10:35:12 +0100 +Subject: drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed + +From: Jocelyn Falempe + +commit 4be9075fec0a639384ed19975634b662bfab938f upstream. + +The driver creates /sys/kernel/debug/dri/0/mob_ttm even when the +corresponding ttm_resource_manager is not allocated. +This leads to a crash when trying to read from this file. + +Add a check to create mob_ttm, system_mob_ttm, and gmr_ttm debug file +only when the corresponding ttm_resource_manager is allocated. + +crash> bt +PID: 3133409 TASK: ffff8fe4834a5000 CPU: 3 COMMAND: "grep" + #0 [ffffb954506b3b20] machine_kexec at ffffffffb2a6bec3 + #1 [ffffb954506b3b78] __crash_kexec at ffffffffb2bb598a + #2 [ffffb954506b3c38] crash_kexec at ffffffffb2bb68c1 + #3 [ffffb954506b3c50] oops_end at ffffffffb2a2a9b1 + #4 [ffffb954506b3c70] no_context at ffffffffb2a7e913 + #5 [ffffb954506b3cc8] __bad_area_nosemaphore at ffffffffb2a7ec8c + #6 [ffffb954506b3d10] do_page_fault at ffffffffb2a7f887 + #7 [ffffb954506b3d40] page_fault at ffffffffb360116e + [exception RIP: ttm_resource_manager_debug+0x11] + RIP: ffffffffc04afd11 RSP: ffffb954506b3df0 RFLAGS: 00010246 + RAX: ffff8fe41a6d1200 RBX: 0000000000000000 RCX: 0000000000000940 + RDX: 0000000000000000 RSI: ffffffffc04b4338 RDI: 0000000000000000 + RBP: ffffb954506b3e08 R8: ffff8fee3ffad000 R9: 0000000000000000 + R10: ffff8fe41a76a000 R11: 0000000000000001 R12: 00000000ffffffff + R13: 0000000000000001 R14: ffff8fe5bb6f3900 R15: ffff8fe41a6d1200 + ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 + #8 [ffffb954506b3e00] ttm_resource_manager_show at ffffffffc04afde7 [ttm] + #9 [ffffb954506b3e30] seq_read at ffffffffb2d8f9f3 + RIP: 00007f4c4eda8985 RSP: 00007ffdbba9e9f8 RFLAGS: 00000246 + RAX: ffffffffffffffda RBX: 000000000037e000 RCX: 00007f4c4eda8985 + RDX: 000000000037e000 RSI: 00007f4c41573000 RDI: 0000000000000003 + RBP: 000000000037e000 R8: 0000000000000000 R9: 000000000037fe30 + R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4c41573000 + R13: 0000000000000003 R14: 00007f4c41572010 R15: 0000000000000003 + ORIG_RAX: 0000000000000000 CS: 0033 SS: 002b + +Signed-off-by: Jocelyn Falempe +Fixes: af4a25bbe5e7 ("drm/vmwgfx: Add debugfs entries for various ttm resource managers") +Cc: +Reviewed-by: Zack Rusin +Link: https://patchwork.freedesktop.org/patch/msgid/20240312093551.196609-1-jfalempe@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +@@ -1429,12 +1429,15 @@ static void vmw_debugfs_resource_manager + root, "system_ttm"); + ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_VRAM), + root, "vram_ttm"); +- ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_GMR), +- root, "gmr_ttm"); +- ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_MOB), +- root, "mob_ttm"); +- ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_SYSTEM), +- root, "system_mob_ttm"); ++ if (vmw->has_gmr) ++ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_GMR), ++ root, "gmr_ttm"); ++ if (vmw->has_mob) { ++ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_MOB), ++ root, "mob_ttm"); ++ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_SYSTEM), ++ root, "system_mob_ttm"); ++ } + } + + static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, diff --git a/queue-6.1/exec-fix-nommu-linux_binprm-exec-in-transfer_args_to_stack.patch b/queue-6.1/exec-fix-nommu-linux_binprm-exec-in-transfer_args_to_stack.patch new file mode 100644 index 00000000000..7c376023c7b --- /dev/null +++ b/queue-6.1/exec-fix-nommu-linux_binprm-exec-in-transfer_args_to_stack.patch @@ -0,0 +1,42 @@ +From 2aea94ac14d1e0a8ae9e34febebe208213ba72f7 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Wed, 20 Mar 2024 11:26:07 -0700 +Subject: exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack() + +From: Max Filippov + +commit 2aea94ac14d1e0a8ae9e34febebe208213ba72f7 upstream. + +In NOMMU kernel the value of linux_binprm::p is the offset inside the +temporary program arguments array maintained in separate pages in the +linux_binprm::page. linux_binprm::exec being a copy of linux_binprm::p +thus must be adjusted when that array is copied to the user stack. +Without that adjustment the value passed by the NOMMU kernel to the ELF +program in the AT_EXECFN entry of the aux array doesn't make any sense +and it may break programs that try to access memory pointed to by that +entry. + +Adjust linux_binprm::exec before the successful return from the +transfer_args_to_stack(). + +Cc: +Fixes: b6a2fea39318 ("mm: variable length argument support") +Fixes: 5edc2a5123a7 ("binfmt_elf_fdpic: wire up AT_EXECFD, AT_EXECFN, AT_SECURE") +Signed-off-by: Max Filippov +Link: https://lore.kernel.org/r/20240320182607.1472887-1-jcmvbkbc@gmail.com +Signed-off-by: Kees Cook +Signed-off-by: Greg Kroah-Hartman +--- + fs/exec.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/exec.c ++++ b/fs/exec.c +@@ -896,6 +896,7 @@ int transfer_args_to_stack(struct linux_ + goto out; + } + ++ bprm->exec += *sp_location - MAX_ARG_PAGES * PAGE_SIZE; + *sp_location = sp; + + out: diff --git a/queue-6.1/gpio-cdev-sanitize-the-label-before-requesting-the-interrupt.patch b/queue-6.1/gpio-cdev-sanitize-the-label-before-requesting-the-interrupt.patch new file mode 100644 index 00000000000..73c1a6cdbce --- /dev/null +++ b/queue-6.1/gpio-cdev-sanitize-the-label-before-requesting-the-interrupt.patch @@ -0,0 +1,126 @@ +From b34490879baa847d16fc529c8ea6e6d34f004b38 Mon Sep 17 00:00:00 2001 +From: Bartosz Golaszewski +Date: Mon, 25 Mar 2024 10:02:42 +0100 +Subject: gpio: cdev: sanitize the label before requesting the interrupt + +From: Bartosz Golaszewski + +commit b34490879baa847d16fc529c8ea6e6d34f004b38 upstream. + +When an interrupt is requested, a procfs directory is created under +"/proc/irq//