From a0cc76f1ca84a2b1aefc4ccbdd9700880ebcbaa2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 16 Sep 2022 11:44:10 +0200 Subject: [PATCH] 5.15-stable patches added patches: acpi-resource-skip-irq-override-on-amd-zen-platforms.patch mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch soc-fsl-select-fsl_guts-driver-for-dpio.patch usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch usb-gadget-f_uac2-fix-superspeed-transfer.patch --- ...ip-irq-override-on-amd-zen-platforms.patch | 50 +++++++++++ ...irst-pfnmap-mappings-in-unmap_region.patch | 49 ++++++++++ ...-unionization-of-nfs_inode.nrequests.patch | 41 +++++++++ queue-5.15/series | 6 ++ ...-fsl-select-fsl_guts-driver-for-dpio.patch | 41 +++++++++ ...clean-up-some-inconsistent-indenting.patch | 57 ++++++++++++ ...adget-f_uac2-fix-superspeed-transfer.patch | 90 +++++++++++++++++++ 7 files changed, 334 insertions(+) create mode 100644 queue-5.15/acpi-resource-skip-irq-override-on-amd-zen-platforms.patch create mode 100644 queue-5.15/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch create mode 100644 queue-5.15/nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch create mode 100644 queue-5.15/soc-fsl-select-fsl_guts-driver-for-dpio.patch create mode 100644 queue-5.15/usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch create mode 100644 queue-5.15/usb-gadget-f_uac2-fix-superspeed-transfer.patch diff --git a/queue-5.15/acpi-resource-skip-irq-override-on-amd-zen-platforms.patch b/queue-5.15/acpi-resource-skip-irq-override-on-amd-zen-platforms.patch new file mode 100644 index 00000000000..c895c35a6e4 --- /dev/null +++ b/queue-5.15/acpi-resource-skip-irq-override-on-amd-zen-platforms.patch @@ -0,0 +1,50 @@ +From 9946e39fe8d0a5da9eb947d8e40a7ef204ba016e Mon Sep 17 00:00:00 2001 +From: Chuanhong Guo +Date: Tue, 12 Jul 2022 10:00:58 +0800 +Subject: ACPI: resource: skip IRQ override on AMD Zen platforms + +From: Chuanhong Guo + +commit 9946e39fe8d0a5da9eb947d8e40a7ef204ba016e upstream. + +IRQ override isn't needed on modern AMD Zen systems. +There's an active low keyboard IRQ on AMD Ryzen 6000 and it will stay +this way on newer platforms. This IRQ override breaks keyboards for +almost all Ryzen 6000 laptops currently on the market. + +Skip this IRQ override for all AMD Zen platforms because this IRQ +override is supposed to be a workaround for buggy ACPI DSDT and we can't +have a long list of all future AMD CPUs/Laptops in the kernel code. +If a device with buggy ACPI DSDT shows up, a separated list containing +just them should be created. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=216118 +Suggested-by: Mario Limonciello +Signed-off-by: Chuanhong Guo +Acked-by: Mario Limonciello +Tested-by: XiaoYan Li +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/resource.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -416,6 +416,16 @@ static bool acpi_dev_irq_override(u32 gs + { + int i; + ++#ifdef CONFIG_X86 ++ /* ++ * IRQ override isn't needed on modern AMD Zen systems and ++ * this override breaks active low IRQs on AMD Ryzen 6000 and ++ * newer systems. Skip it. ++ */ ++ if (boot_cpu_has(X86_FEATURE_ZEN)) ++ return false; ++#endif ++ + for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) { + const struct irq_override_cmp *entry = &skip_override_table[i]; + diff --git a/queue-5.15/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch b/queue-5.15/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch new file mode 100644 index 00000000000..6f82d40e027 --- /dev/null +++ b/queue-5.15/mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch @@ -0,0 +1,49 @@ +From jannh@google.com Fri Sep 16 11:29:18 2022 +From: Jann Horn +Date: Thu, 15 Sep 2022 16:25:19 +0200 +Subject: mm: Fix TLB flush for not-first PFNMAP mappings in unmap_region() +To: stable@vger.kernel.org, Greg Kroah-Hartman +Cc: Hugh Dickins , Peter Zijlstra +Message-ID: <20220915142519.2941949-1-jannh@google.com> + +From: Jann Horn + +This is a stable-specific patch. +I botched the stable-specific rewrite of +commit b67fbebd4cf98 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas"): +As Hugh pointed out, unmap_region() actually operates on a list of VMAs, +and the variable "vma" merely points to the first VMA in that list. +So if we want to check whether any of the VMAs we're operating on is +PFNMAP or MIXEDMAP, we have to iterate through the list and check each VMA. + +Signed-off-by: Jann Horn +Signed-off-by: Greg Kroah-Hartman +--- + mm/mmap.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/mm/mmap.c ++++ b/mm/mmap.c +@@ -2638,6 +2638,7 @@ static void unmap_region(struct mm_struc + { + struct vm_area_struct *next = vma_next(mm, prev); + struct mmu_gather tlb; ++ struct vm_area_struct *cur_vma; + + lru_add_drain(); + tlb_gather_mmu(&tlb, mm); +@@ -2652,8 +2653,12 @@ static void unmap_region(struct mm_struc + * concurrent flush in this region has to be coming through the rmap, + * and we synchronize against that using the rmap lock. + */ +- if ((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0) +- tlb_flush_mmu(&tlb); ++ for (cur_vma = vma; cur_vma; cur_vma = cur_vma->vm_next) { ++ if ((cur_vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) != 0) { ++ tlb_flush_mmu(&tlb); ++ break; ++ } ++ } + + free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS, + next ? next->vm_start : USER_PGTABLES_CEILING); diff --git a/queue-5.15/nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch b/queue-5.15/nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch new file mode 100644 index 00000000000..af0dee7f1e3 --- /dev/null +++ b/queue-5.15/nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch @@ -0,0 +1,41 @@ +From 0ebeebcf59601bcfa0284f4bb7abdec051eb856d Mon Sep 17 00:00:00 2001 +From: Dave Wysochanski +Date: Sun, 10 Oct 2021 18:23:13 -0400 +Subject: NFS: Fix WARN_ON due to unionization of nfs_inode.nrequests + +From: Dave Wysochanski + +commit 0ebeebcf59601bcfa0284f4bb7abdec051eb856d upstream. + +Fixes the following WARN_ON +WARNING: CPU: 2 PID: 18678 at fs/nfs/inode.c:123 nfs_clear_inode+0x3b/0x50 [nfs] +... +Call Trace: + nfs4_evict_inode+0x57/0x70 [nfsv4] + evict+0xd1/0x180 + dispose_list+0x48/0x60 + evict_inodes+0x156/0x190 + generic_shutdown_super+0x37/0x110 + nfs_kill_super+0x1d/0x40 [nfs] + deactivate_locked_super+0x36/0xa0 + +Signed-off-by: Dave Wysochanski +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/nfs_fs.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/include/linux/nfs_fs.h ++++ b/include/linux/nfs_fs.h +@@ -593,7 +593,9 @@ bool nfs_commit_end(struct nfs_mds_commi + static inline int + nfs_have_writebacks(struct inode *inode) + { +- return atomic_long_read(&NFS_I(inode)->nrequests) != 0; ++ if (S_ISREG(inode->i_mode)) ++ return atomic_long_read(&NFS_I(inode)->nrequests) != 0; ++ return 0; + } + + /* diff --git a/queue-5.15/series b/queue-5.15/series index f0785c417e7..6e1ed857baa 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -1,3 +1,5 @@ +nfs-fix-warn_on-due-to-unionization-of-nfs_inode.nrequests.patch +acpi-resource-skip-irq-override-on-amd-zen-platforms.patch arm-dts-imx-align-spi-nor-node-name-with-dtschema.patch arm-dts-imx6qdl-kontron-samx6i-fix-spi-flash-compati.patch arm-dts-at91-fix-low-limit-for-cpu-regulator.patch @@ -25,3 +27,7 @@ net-dsa-hellcreek-print-warning-only-once.patch perf-arm_pmu_platform-fix-tests-for-platform_get_irq.patch platform-x86-acer-wmi-acer-aspire-one-aod270-packard.patch usb-storage-add-asus-0x0b05-0x1932-to-ignore_uas.patch +mm-fix-tlb-flush-for-not-first-pfnmap-mappings-in-unmap_region.patch +soc-fsl-select-fsl_guts-driver-for-dpio.patch +usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch +usb-gadget-f_uac2-fix-superspeed-transfer.patch diff --git a/queue-5.15/soc-fsl-select-fsl_guts-driver-for-dpio.patch b/queue-5.15/soc-fsl-select-fsl_guts-driver-for-dpio.patch new file mode 100644 index 00000000000..6ad2614f0cb --- /dev/null +++ b/queue-5.15/soc-fsl-select-fsl_guts-driver-for-dpio.patch @@ -0,0 +1,41 @@ +From 9a472613f5bccf1b36837423495ae592a9c5182f Mon Sep 17 00:00:00 2001 +From: Mathew McBride +Date: Thu, 1 Sep 2022 05:21:49 +0000 +Subject: soc: fsl: select FSL_GUTS driver for DPIO + +From: Mathew McBride + +commit 9a472613f5bccf1b36837423495ae592a9c5182f upstream. + +The soc/fsl/dpio driver will perform a soc_device_match() +to determine the optimal cache settings for a given CPU core. + +If FSL_GUTS is not enabled, this search will fail and +the driver will not configure cache stashing for the given +DPIO, and a string of "unknown SoC" messages will appear: + +fsl_mc_dpio dpio.7: unknown SoC version +fsl_mc_dpio dpio.6: unknown SoC version +fsl_mc_dpio dpio.5: unknown SoC version + +Fixes: 51da14e96e9b ("soc: fsl: dpio: configure cache stashing destination") +Signed-off-by: Mathew McBride +Reviewed-by: Ioana Ciornei +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220901052149.23873-2-matt@traverse.com.au' +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/fsl/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/soc/fsl/Kconfig ++++ b/drivers/soc/fsl/Kconfig +@@ -24,6 +24,7 @@ config FSL_MC_DPIO + tristate "QorIQ DPAA2 DPIO driver" + depends on FSL_MC_BUS + select SOC_BUS ++ select FSL_GUTS + help + Driver for the DPAA2 DPIO object. A DPIO provides queue and + buffer management facilities for software to interact with diff --git a/queue-5.15/usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch b/queue-5.15/usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch new file mode 100644 index 00000000000..6f05aabaeb4 --- /dev/null +++ b/queue-5.15/usb-gadget-f_uac2-clean-up-some-inconsistent-indenting.patch @@ -0,0 +1,57 @@ +From 18d6b39ee8959c6e513750879b52fd215533cc87 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Thu, 2 Sep 2021 23:47:58 +0100 +Subject: usb: gadget: f_uac2: clean up some inconsistent indenting + +From: Colin Ian King + +commit 18d6b39ee8959c6e513750879b52fd215533cc87 upstream. + +There are bunch of statements where the indentation is not correct, +clean these up. + +Signed-off-by: Colin Ian King +Link: https://lore.kernel.org/r/20210902224758.57600-1-colin.king@canonical.com +Signed-off-by: Jack Pham +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/function/f_uac2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/usb/gadget/function/f_uac2.c ++++ b/drivers/usb/gadget/function/f_uac2.c +@@ -760,15 +760,15 @@ static void setup_headers(struct f_uac2_ + headers[i++] = USBDHDR(&out_clk_src_desc); + headers[i++] = USBDHDR(&usb_out_it_desc); + +- if (FUOUT_EN(opts)) +- headers[i++] = USBDHDR(out_feature_unit_desc); +- } ++ if (FUOUT_EN(opts)) ++ headers[i++] = USBDHDR(out_feature_unit_desc); ++ } + + if (EPIN_EN(opts)) { + headers[i++] = USBDHDR(&io_in_it_desc); + +- if (FUIN_EN(opts)) +- headers[i++] = USBDHDR(in_feature_unit_desc); ++ if (FUIN_EN(opts)) ++ headers[i++] = USBDHDR(in_feature_unit_desc); + + headers[i++] = USBDHDR(&usb_in_ot_desc); + } +@@ -776,10 +776,10 @@ static void setup_headers(struct f_uac2_ + if (EPOUT_EN(opts)) + headers[i++] = USBDHDR(&io_out_ot_desc); + +- if (FUOUT_EN(opts) || FUIN_EN(opts)) +- headers[i++] = USBDHDR(ep_int_desc); ++ if (FUOUT_EN(opts) || FUIN_EN(opts)) ++ headers[i++] = USBDHDR(ep_int_desc); + +- if (EPOUT_EN(opts)) { ++ if (EPOUT_EN(opts)) { + headers[i++] = USBDHDR(&std_as_out_if0_desc); + headers[i++] = USBDHDR(&std_as_out_if1_desc); + headers[i++] = USBDHDR(&as_out_hdr_desc); diff --git a/queue-5.15/usb-gadget-f_uac2-fix-superspeed-transfer.patch b/queue-5.15/usb-gadget-f_uac2-fix-superspeed-transfer.patch new file mode 100644 index 00000000000..74c63ab850d --- /dev/null +++ b/queue-5.15/usb-gadget-f_uac2-fix-superspeed-transfer.patch @@ -0,0 +1,90 @@ +From f511aef2ebe5377d4c263842f2e0c0b8e274e8e5 Mon Sep 17 00:00:00 2001 +From: Jing Leng +Date: Wed, 20 Jul 2022 18:48:15 -0700 +Subject: usb: gadget: f_uac2: fix superspeed transfer + +From: Jing Leng + +commit f511aef2ebe5377d4c263842f2e0c0b8e274e8e5 upstream. + +On page 362 of the USB3.2 specification ( +https://usb.org/sites/default/files/usb_32_20210125.zip), +The 'SuperSpeed Endpoint Companion Descriptor' shall only be returned +by Enhanced SuperSpeed devices that are operating at Gen X speed. +Each endpoint described in an interface is followed by a 'SuperSpeed +Endpoint Companion Descriptor'. + +If users use SuperSpeed UDC, host can't recognize the device if endpoint +doesn't have 'SuperSpeed Endpoint Companion Descriptor' followed. + +Currently in the uac2 driver code: +1. ss_epout_desc_comp follows ss_epout_desc; +2. ss_epin_fback_desc_comp follows ss_epin_fback_desc; +3. ss_epin_desc_comp follows ss_epin_desc; +4. Only ss_ep_int_desc endpoint doesn't have 'SuperSpeed Endpoint +Companion Descriptor' followed, so we should add it. + +Fixes: eaf6cbe09920 ("usb: gadget: f_uac2: add volume and mute support") +Cc: stable +Signed-off-by: Jing Leng +Signed-off-by: Jack Pham +Link: https://lore.kernel.org/r/20220721014815.14453-1-quic_jackp@quicinc.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/function/f_uac2.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +--- a/drivers/usb/gadget/function/f_uac2.c ++++ b/drivers/usb/gadget/function/f_uac2.c +@@ -281,6 +281,12 @@ static struct usb_endpoint_descriptor ss + .bInterval = 4, + }; + ++static struct usb_ss_ep_comp_descriptor ss_ep_int_desc_comp = { ++ .bLength = sizeof(ss_ep_int_desc_comp), ++ .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, ++ .wBytesPerInterval = cpu_to_le16(6), ++}; ++ + /* Audio Streaming OUT Interface - Alt0 */ + static struct usb_interface_descriptor std_as_out_if0_desc = { + .bLength = sizeof std_as_out_if0_desc, +@@ -594,7 +600,8 @@ static struct usb_descriptor_header *ss_ + (struct usb_descriptor_header *)&in_feature_unit_desc, + (struct usb_descriptor_header *)&io_out_ot_desc, + +- (struct usb_descriptor_header *)&ss_ep_int_desc, ++ (struct usb_descriptor_header *)&ss_ep_int_desc, ++ (struct usb_descriptor_header *)&ss_ep_int_desc_comp, + + (struct usb_descriptor_header *)&std_as_out_if0_desc, + (struct usb_descriptor_header *)&std_as_out_if1_desc, +@@ -721,6 +728,7 @@ static void setup_headers(struct f_uac2_ + struct usb_ss_ep_comp_descriptor *epout_desc_comp = NULL; + struct usb_ss_ep_comp_descriptor *epin_desc_comp = NULL; + struct usb_ss_ep_comp_descriptor *epin_fback_desc_comp = NULL; ++ struct usb_ss_ep_comp_descriptor *ep_int_desc_comp = NULL; + struct usb_endpoint_descriptor *epout_desc; + struct usb_endpoint_descriptor *epin_desc; + struct usb_endpoint_descriptor *epin_fback_desc; +@@ -748,6 +756,7 @@ static void setup_headers(struct f_uac2_ + epin_fback_desc = &ss_epin_fback_desc; + epin_fback_desc_comp = &ss_epin_fback_desc_comp; + ep_int_desc = &ss_ep_int_desc; ++ ep_int_desc_comp = &ss_ep_int_desc_comp; + } + + i = 0; +@@ -776,8 +785,11 @@ static void setup_headers(struct f_uac2_ + if (EPOUT_EN(opts)) + headers[i++] = USBDHDR(&io_out_ot_desc); + +- if (FUOUT_EN(opts) || FUIN_EN(opts)) ++ if (FUOUT_EN(opts) || FUIN_EN(opts)) { + headers[i++] = USBDHDR(ep_int_desc); ++ if (ep_int_desc_comp) ++ headers[i++] = USBDHDR(ep_int_desc_comp); ++ } + + if (EPOUT_EN(opts)) { + headers[i++] = USBDHDR(&std_as_out_if0_desc); -- 2.47.3