]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Sun, 17 Jan 2021 21:27:09 +0000 (16:27 -0500)
committerSasha Levin <sashal@kernel.org>
Sun, 17 Jan 2021 21:27:09 +0000 (16:27 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
26 files changed:
queue-5.4/acpi-scan-add-stub-acpi_create_platform_device-for-c.patch [new file with mode: 0644]
queue-5.4/arc-build-add-boot_targets-to-phony.patch [new file with mode: 0644]
queue-5.4/arc-build-add-uimage.lzma-to-the-top-level-target.patch [new file with mode: 0644]
queue-5.4/arc-build-move-symlink-creation-to-arch-arc-makefile.patch [new file with mode: 0644]
queue-5.4/arc-build-remove-non-existing-bootpimage-from-kbuild.patch [new file with mode: 0644]
queue-5.4/arch-arc-add-copy_user_page-to-asm-page.h-to-fix-bui.patch [new file with mode: 0644]
queue-5.4/arm-picoxcell-fix-missing-interrupt-parent-propertie.patch [new file with mode: 0644]
queue-5.4/bfq-fix-computation-of-shallow-depth.patch [new file with mode: 0644]
queue-5.4/btrfs-fix-transaction-leak-and-crash-after-ro-remoun.patch [new file with mode: 0644]
queue-5.4/dmaengine-stm32-mdma-fix-stm32_mdma_very_high_priori.patch [new file with mode: 0644]
queue-5.4/drm-amdgpu-fix-a-gpu-hang-issue-when-remove-device.patch [new file with mode: 0644]
queue-5.4/drm-msm-call-msm_init_vram-before-binding-the-gpu.patch [new file with mode: 0644]
queue-5.4/ethernet-ucc_geth-fix-definition-and-size-of-ucc_get.patch [new file with mode: 0644]
queue-5.4/habanalabs-fix-memleak-in-hl_device_reset.patch [new file with mode: 0644]
queue-5.4/habanalabs-register-to-pci-shutdown-callback.patch [new file with mode: 0644]
queue-5.4/hwmon-pwm-fan-ensure-that-calculation-doesn-t-discar.patch [new file with mode: 0644]
queue-5.4/lib-raid6-let-unroll-rules-work-with-macos-userland.patch [new file with mode: 0644]
queue-5.4/misdn-dsp-select-config_bitreverse.patch [new file with mode: 0644]
queue-5.4/net-ethernet-fs_enet-add-missing-module_license.patch [new file with mode: 0644]
queue-5.4/netfilter-ipset-fixes-possible-oops-in-mtype_resize.patch [new file with mode: 0644]
queue-5.4/nvme-pci-mark-samsung-pm1725a-as-ignore_dev_subnqn.patch [new file with mode: 0644]
queue-5.4/nvmet-rdma-fix-list_del-corruption-on-queue-establis.patch [new file with mode: 0644]
queue-5.4/regulator-bd718x7-add-enable-times.patch [new file with mode: 0644]
queue-5.4/selftests-fix-the-return-value-for-udp-gro-test.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/usb-typec-fix-copy-paste-error-for-nvidia-alt-mode-d.patch [new file with mode: 0644]

diff --git a/queue-5.4/acpi-scan-add-stub-acpi_create_platform_device-for-c.patch b/queue-5.4/acpi-scan-add-stub-acpi_create_platform_device-for-c.patch
new file mode 100644 (file)
index 0000000..6b6687f
--- /dev/null
@@ -0,0 +1,41 @@
+From 4552891023063a36bddd12f9a7a44dc5f13caafc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 31 Dec 2020 19:35:25 +0800
+Subject: ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI
+
+From: Shawn Guo <shawn.guo@linaro.org>
+
+[ Upstream commit ee61cfd955a64a58ed35cbcfc54068fcbd486945 ]
+
+It adds a stub acpi_create_platform_device() for !CONFIG_ACPI build, so
+that caller doesn't have to deal with !CONFIG_ACPI build issue.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/acpi.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/include/linux/acpi.h b/include/linux/acpi.h
+index ce29a014e591c..dd6170357ec72 100644
+--- a/include/linux/acpi.h
++++ b/include/linux/acpi.h
+@@ -837,6 +837,13 @@ static inline int acpi_device_modalias(struct device *dev,
+       return -ENODEV;
+ }
++static inline struct platform_device *
++acpi_create_platform_device(struct acpi_device *adev,
++                          struct property_entry *properties)
++{
++      return NULL;
++}
++
+ static inline bool acpi_dma_supported(struct acpi_device *adev)
+ {
+       return false;
+-- 
+2.27.0
+
diff --git a/queue-5.4/arc-build-add-boot_targets-to-phony.patch b/queue-5.4/arc-build-add-boot_targets-to-phony.patch
new file mode 100644 (file)
index 0000000..8652790
--- /dev/null
@@ -0,0 +1,51 @@
+From 5d3fb13adc7a1183deb271b538d7add38ef8b804 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 22 Nov 2020 04:36:54 +0900
+Subject: ARC: build: add boot_targets to PHONY
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 0cfccb3c04934cdef42ae26042139f16e805b5f7 ]
+
+The top-level boot_targets (uImage and uImage.*) should be phony
+targets. They just let Kbuild descend into arch/arc/boot/ and create
+files there.
+
+If a file exists in the top directory with the same name, the boot
+image will not be created.
+
+You can confirm it by the following steps:
+
+  $ export CROSS_COMPILE=<your-arc-compiler-prefix>
+  $ make -s ARCH=arc defconfig all   # vmlinux will be built
+  $ touch uImage.gz
+  $ make ARCH=arc uImage.gz
+  CALL    scripts/atomic/check-atomics.sh
+  CALL    scripts/checksyscalls.sh
+  CHK     include/generated/compile.h
+  # arch/arc/boot/uImage.gz is not created
+
+Specify the targets as PHONY to fix this.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arc/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index b0b119ebd9e9f..c95b950389ba6 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -92,6 +92,7 @@ boot         := arch/arc/boot
+ boot_targets := uImage uImage.bin uImage.gz uImage.lzma
++PHONY += $(boot_targets)
+ $(boot_targets): vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+-- 
+2.27.0
+
diff --git a/queue-5.4/arc-build-add-uimage.lzma-to-the-top-level-target.patch b/queue-5.4/arc-build-add-uimage.lzma-to-the-top-level-target.patch
new file mode 100644 (file)
index 0000000..38af133
--- /dev/null
@@ -0,0 +1,39 @@
+From cdcf817925025694cfca3c87d68c769309384720 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 22 Nov 2020 04:36:53 +0900
+Subject: ARC: build: add uImage.lzma to the top-level target
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit f2712ec76a5433e5ec9def2bd52a95df1f96d050 ]
+
+arch/arc/boot/Makefile supports uImage.lzma, but you cannot do
+'make uImage.lzma' because the corresponding target is missing
+in arch/arc/Makefile. Add it.
+
+I also changed the assignment operator '+=' to ':=' since this is the
+only place where we expect this variable to be set.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arc/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index 5e5699acefef4..b0b119ebd9e9f 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -90,7 +90,7 @@ libs-y               += arch/arc/lib/ $(LIBGCC)
+ boot          := arch/arc/boot
+-boot_targets += uImage uImage.bin uImage.gz
++boot_targets := uImage uImage.bin uImage.gz uImage.lzma
+ $(boot_targets): vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+-- 
+2.27.0
+
diff --git a/queue-5.4/arc-build-move-symlink-creation-to-arch-arc-makefile.patch b/queue-5.4/arc-build-move-symlink-creation-to-arch-arc-makefile.patch
new file mode 100644 (file)
index 0000000..7ec2baf
--- /dev/null
@@ -0,0 +1,140 @@
+From a375f196a87ea3bed19e69ad72675a5f9efbfc92 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 22 Nov 2020 04:36:55 +0900
+Subject: ARC: build: move symlink creation to arch/arc/Makefile to avoid race
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit c5e6ae563c802c4d828d42e134af64004db2e58c ]
+
+If you run 'make uImage uImage.gz' with the parallel option, uImage.gz
+will be created by two threads simultaneously.
+
+This is because arch/arc/Makefile does not specify the dependency
+between uImage and uImage.gz. Hence, GNU Make assumes they can be
+built in parallel. One thread descends into arch/arc/boot/ to create
+uImage, and another to create uImage.gz.
+
+Please notice the same log is displayed twice in the following steps:
+
+  $ export CROSS_COMPILE=<your-arc-compiler-prefix>
+  $ make -s ARCH=arc defconfig
+  $ make -j$(nproc) ARCH=arc uImage uImage.gz
+  [ snip ]
+    LD      vmlinux
+    SORTTAB vmlinux
+    SYSMAP  System.map
+    OBJCOPY arch/arc/boot/vmlinux.bin
+    OBJCOPY arch/arc/boot/vmlinux.bin
+    GZIP    arch/arc/boot/vmlinux.bin.gz
+    GZIP    arch/arc/boot/vmlinux.bin.gz
+    UIMAGE  arch/arc/boot/uImage.gz
+    UIMAGE  arch/arc/boot/uImage.gz
+  Image Name:   Linux-5.10.0-rc4-00003-g62f23044
+  Created:      Sun Nov 22 02:52:26 2020
+  Image Type:   ARC Linux Kernel Image (gzip compressed)
+  Data Size:    2109376 Bytes = 2059.94 KiB = 2.01 MiB
+  Load Address: 80000000
+  Entry Point:  80004000
+    Image arch/arc/boot/uImage is ready
+  Image Name:   Linux-5.10.0-rc4-00003-g62f23044
+  Created:      Sun Nov 22 02:52:26 2020
+  Image Type:   ARC Linux Kernel Image (gzip compressed)
+  Data Size:    2815455 Bytes = 2749.47 KiB = 2.69 MiB
+  Load Address: 80000000
+  Entry Point:  80004000
+
+This is a race between the two threads trying to write to the same file
+arch/arc/boot/uImage.gz. This is a potential problem that can generate
+a broken file.
+
+I fixed a similar problem for ARM by commit 3939f3345050 ("ARM: 8418/1:
+add boot image dependencies to not generate invalid images").
+
+I highly recommend to avoid such build rules that cause a race condition.
+
+Move the uImage rule to arch/arc/Makefile.
+
+Another strangeness is that arch/arc/boot/Makefile compares the
+timestamps between $(obj)/uImage and $(obj)/uImage.*:
+
+  $(obj)/uImage: $(obj)/uImage.$(suffix-y)
+          @ln -sf $(notdir $<) $@
+          @echo '  Image $@ is ready'
+
+This does not work as expected since $(obj)/uImage is a symlink.
+The symlink should be created in a phony target rule.
+
+I used $(kecho) instead of echo to suppress the message
+'Image arch/arc/boot/uImage is ready' when the -s option is given.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arc/Makefile      | 13 ++++++++++++-
+ arch/arc/boot/Makefile | 11 +----------
+ 2 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index c95b950389ba6..6f05e509889f6 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -90,11 +90,22 @@ libs-y             += arch/arc/lib/ $(LIBGCC)
+ boot          := arch/arc/boot
+-boot_targets := uImage uImage.bin uImage.gz uImage.lzma
++boot_targets := uImage.bin uImage.gz uImage.lzma
+ PHONY += $(boot_targets)
+ $(boot_targets): vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
++uimage-default-y                      := uImage.bin
++uimage-default-$(CONFIG_KERNEL_GZIP)  := uImage.gz
++uimage-default-$(CONFIG_KERNEL_LZMA)  := uImage.lzma
++
++PHONY += uImage
++uImage: $(uimage-default-y)
++      @ln -sf $< $(boot)/uImage
++      @$(kecho) '  Image $(boot)/uImage is ready'
++
++CLEAN_FILES += $(boot)/uImage
++
+ archclean:
+       $(Q)$(MAKE) $(clean)=$(boot)
+diff --git a/arch/arc/boot/Makefile b/arch/arc/boot/Makefile
+index 538b92f4dd253..3b1f8a69a89ef 100644
+--- a/arch/arc/boot/Makefile
++++ b/arch/arc/boot/Makefile
+@@ -1,5 +1,5 @@
+ # SPDX-License-Identifier: GPL-2.0
+-targets := vmlinux.bin vmlinux.bin.gz uImage
++targets := vmlinux.bin vmlinux.bin.gz
+ # uImage build relies on mkimage being availble on your host for ARC target
+ # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage
+@@ -13,11 +13,6 @@ LINUX_START_TEXT = $$(readelf -h vmlinux | \
+ UIMAGE_LOADADDR    = $(CONFIG_LINUX_LINK_BASE)
+ UIMAGE_ENTRYADDR   = $(LINUX_START_TEXT)
+-suffix-y := bin
+-suffix-$(CONFIG_KERNEL_GZIP)  := gz
+-suffix-$(CONFIG_KERNEL_LZMA)  := lzma
+-
+-targets += uImage
+ targets += uImage.bin
+ targets += uImage.gz
+ targets += uImage.lzma
+@@ -42,7 +37,3 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
+ $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
+       $(call if_changed,uimage,lzma)
+-
+-$(obj)/uImage: $(obj)/uImage.$(suffix-y)
+-      @ln -sf $(notdir $<) $@
+-      @echo '  Image $@ is ready'
+-- 
+2.27.0
+
diff --git a/queue-5.4/arc-build-remove-non-existing-bootpimage-from-kbuild.patch b/queue-5.4/arc-build-remove-non-existing-bootpimage-from-kbuild.patch
new file mode 100644 (file)
index 0000000..dad6c3d
--- /dev/null
@@ -0,0 +1,64 @@
+From 2e98ddcec49937ea5be24e81f5c508d64c7ec224 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 22 Nov 2020 04:36:52 +0900
+Subject: ARC: build: remove non-existing bootpImage from KBUILD_IMAGE
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 9836720911cfec25d3fbdead1c438bf87e0f2841 ]
+
+The deb-pkg builds for ARCH=arc fail.
+
+  $ export CROSS_COMPILE=<your-arc-compiler-prefix>
+  $ make -s ARCH=arc defconfig
+  $ make ARCH=arc bindeb-pkg
+  SORTTAB vmlinux
+  SYSMAP  System.map
+  MODPOST Module.symvers
+  make KERNELRELEASE=5.10.0-rc4 ARCH=arc KBUILD_BUILD_VERSION=2 -f ./Makefile intdeb-pkg
+  sh ./scripts/package/builddeb
+  cp: cannot stat 'arch/arc/boot/bootpImage': No such file or directory
+  make[4]: *** [scripts/Makefile.package:87: intdeb-pkg] Error 1
+  make[3]: *** [Makefile:1527: intdeb-pkg] Error 2
+  make[2]: *** [debian/rules:13: binary-arch] Error 2
+  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
+  make[1]: *** [scripts/Makefile.package:83: bindeb-pkg] Error 2
+  make: *** [Makefile:1527: bindeb-pkg] Error 2
+
+The reason is obvious; arch/arc/Makefile sets $(boot)/bootpImage as
+the default image, but there is no rule to build it.
+
+Remove the meaningless KBUILD_IMAGE assignment so it will fallback
+to the default vmlinux. With this change, you can build the deb package.
+
+I removed the 'bootpImage' target as well. At best, it provides
+'make bootpImage' as an alias of 'make vmlinux', but I do not see
+much sense in doing so.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arc/Makefile | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index f1c44cccf8d6c..5e5699acefef4 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -90,12 +90,6 @@ libs-y              += arch/arc/lib/ $(LIBGCC)
+ boot          := arch/arc/boot
+-#default target for make without any arguments.
+-KBUILD_IMAGE  := $(boot)/bootpImage
+-
+-all:  bootpImage
+-bootpImage: vmlinux
+-
+ boot_targets += uImage uImage.bin uImage.gz
+ $(boot_targets): vmlinux
+-- 
+2.27.0
+
diff --git a/queue-5.4/arch-arc-add-copy_user_page-to-asm-page.h-to-fix-bui.patch b/queue-5.4/arch-arc-add-copy_user_page-to-asm-page.h-to-fix-bui.patch
new file mode 100644 (file)
index 0000000..28045dd
--- /dev/null
@@ -0,0 +1,51 @@
+From a553f64e36ef12874677530b725791fa8775fdfc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 4 Jan 2021 19:44:53 -0800
+Subject: arch/arc: add copy_user_page() to <asm/page.h> to fix build error on
+ ARC
+
+From: Randy Dunlap <rdunlap@infradead.org>
+
+[ Upstream commit 8a48c0a3360bf2bf4f40c980d0ec216e770e58ee ]
+
+fs/dax.c uses copy_user_page() but ARC does not provide that interface,
+resulting in a build error.
+
+Provide copy_user_page() in <asm/page.h>.
+
+../fs/dax.c: In function 'copy_cow_page_dax':
+../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
+Cc: Vineet Gupta <vgupta@synopsys.com>
+Cc: linux-snps-arc@lists.infradead.org
+Cc: Dan Williams <dan.j.williams@intel.com>
+#Acked-by: Vineet Gupta <vgupta@synopsys.com> # v1
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Matthew Wilcox <willy@infradead.org>
+Cc: Jan Kara <jack@suse.cz>
+Cc: linux-fsdevel@vger.kernel.org
+Cc: linux-nvdimm@lists.01.org
+#Reviewed-by: Ira Weiny <ira.weiny@intel.com> # v2
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arc/include/asm/page.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h
+index 0a32e8cfd074d..bcd1920ae75a3 100644
+--- a/arch/arc/include/asm/page.h
++++ b/arch/arc/include/asm/page.h
+@@ -10,6 +10,7 @@
+ #ifndef __ASSEMBLY__
+ #define clear_page(paddr)             memset((paddr), 0, PAGE_SIZE)
++#define copy_user_page(to, from, vaddr, pg)   copy_page(to, from)
+ #define copy_page(to, from)           memcpy((to), (from), PAGE_SIZE)
+ struct vm_area_struct;
+-- 
+2.27.0
+
diff --git a/queue-5.4/arm-picoxcell-fix-missing-interrupt-parent-propertie.patch b/queue-5.4/arm-picoxcell-fix-missing-interrupt-parent-propertie.patch
new file mode 100644 (file)
index 0000000..c412f7f
--- /dev/null
@@ -0,0 +1,66 @@
+From 54c65110c185a2f0d6dfd73bf24453ebef14e874 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 30 Dec 2020 16:20:05 +0100
+Subject: ARM: picoxcell: fix missing interrupt-parent properties
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+[ Upstream commit bac717171971176b78c72d15a8b6961764ab197f ]
+
+dtc points out that the interrupts for some devices are not parsable:
+
+picoxcell-pc3x2.dtsi:45.19-49.5: Warning (interrupts_property): /paxi/gem@30000: Missing interrupt-parent
+picoxcell-pc3x2.dtsi:51.21-55.5: Warning (interrupts_property): /paxi/dmac@40000: Missing interrupt-parent
+picoxcell-pc3x2.dtsi:57.21-61.5: Warning (interrupts_property): /paxi/dmac@50000: Missing interrupt-parent
+picoxcell-pc3x2.dtsi:233.21-237.5: Warning (interrupts_property): /rwid-axi/axi2pico@c0000000: Missing interrupt-parent
+
+There are two VIC instances, so it's not clear which one needs to be
+used. I found the BSP sources that reference VIC0, so use that:
+
+https://github.com/r1mikey/meta-picoxcell/blob/master/recipes-kernel/linux/linux-picochip-3.0/0001-picoxcell-support-for-Picochip-picoXcell-SoC.patch
+
+Acked-by: Jamie Iles <jamie@jamieiles.com>
+Link: https://lore.kernel.org/r/20201230152010.3914962-1-arnd@kernel.org'
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/boot/dts/picoxcell-pc3x2.dtsi | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/boot/dts/picoxcell-pc3x2.dtsi b/arch/arm/boot/dts/picoxcell-pc3x2.dtsi
+index 5ae8607883395..3fcc86d7b735f 100644
+--- a/arch/arm/boot/dts/picoxcell-pc3x2.dtsi
++++ b/arch/arm/boot/dts/picoxcell-pc3x2.dtsi
+@@ -45,18 +45,21 @@
+               emac: gem@30000 {
+                       compatible = "cadence,gem";
+                       reg = <0x30000 0x10000>;
++                      interrupt-parent = <&vic0>;
+                       interrupts = <31>;
+               };
+               dmac1: dmac@40000 {
+                       compatible = "snps,dw-dmac";
+                       reg = <0x40000 0x10000>;
++                      interrupt-parent = <&vic0>;
+                       interrupts = <25>;
+               };
+               dmac2: dmac@50000 {
+                       compatible = "snps,dw-dmac";
+                       reg = <0x50000 0x10000>;
++                      interrupt-parent = <&vic0>;
+                       interrupts = <26>;
+               };
+@@ -234,6 +237,7 @@
+               axi2pico@c0000000 {
+                       compatible = "picochip,axi2pico-pc3x2";
+                       reg = <0xc0000000 0x10000>;
++                      interrupt-parent = <&vic0>;
+                       interrupts = <13 14 15 16 17 18 19 20 21>;
+               };
+       };
+-- 
+2.27.0
+
diff --git a/queue-5.4/bfq-fix-computation-of-shallow-depth.patch b/queue-5.4/bfq-fix-computation-of-shallow-depth.patch
new file mode 100644 (file)
index 0000000..0777f71
--- /dev/null
@@ -0,0 +1,58 @@
+From 9c93883631318c38c122dc81c5b8b54ed0f68ea3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Dec 2020 10:44:33 +0100
+Subject: bfq: Fix computation of shallow depth
+
+From: Jan Kara <jack@suse.cz>
+
+[ Upstream commit 6d4d273588378c65915acaf7b2ee74e9dd9c130a ]
+
+BFQ computes number of tags it allows to be allocated for each request type
+based on tag bitmap. However it uses 1 << bitmap.shift as number of
+available tags which is wrong. 'shift' is just an internal bitmap value
+containing logarithm of how many bits bitmap uses in each bitmap word.
+Thus number of tags allowed for some request types can be far to low.
+Use proper bitmap.depth which has the number of tags instead.
+
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ block/bfq-iosched.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
+index ba32adaeefdd0..7d19aae015aeb 100644
+--- a/block/bfq-iosched.c
++++ b/block/bfq-iosched.c
+@@ -6320,13 +6320,13 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd,
+        * limit 'something'.
+        */
+       /* no more than 50% of tags for async I/O */
+-      bfqd->word_depths[0][0] = max((1U << bt->sb.shift) >> 1, 1U);
++      bfqd->word_depths[0][0] = max(bt->sb.depth >> 1, 1U);
+       /*
+        * no more than 75% of tags for sync writes (25% extra tags
+        * w.r.t. async I/O, to prevent async I/O from starving sync
+        * writes)
+        */
+-      bfqd->word_depths[0][1] = max(((1U << bt->sb.shift) * 3) >> 2, 1U);
++      bfqd->word_depths[0][1] = max((bt->sb.depth * 3) >> 2, 1U);
+       /*
+        * In-word depths in case some bfq_queue is being weight-
+@@ -6336,9 +6336,9 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd,
+        * shortage.
+        */
+       /* no more than ~18% of tags for async I/O */
+-      bfqd->word_depths[1][0] = max(((1U << bt->sb.shift) * 3) >> 4, 1U);
++      bfqd->word_depths[1][0] = max((bt->sb.depth * 3) >> 4, 1U);
+       /* no more than ~37% of tags for sync writes (~20% extra tags) */
+-      bfqd->word_depths[1][1] = max(((1U << bt->sb.shift) * 6) >> 4, 1U);
++      bfqd->word_depths[1][1] = max((bt->sb.depth * 6) >> 4, 1U);
+       for (i = 0; i < 2; i++)
+               for (j = 0; j < 2; j++)
+-- 
+2.27.0
+
diff --git a/queue-5.4/btrfs-fix-transaction-leak-and-crash-after-ro-remoun.patch b/queue-5.4/btrfs-fix-transaction-leak-and-crash-after-ro-remoun.patch
new file mode 100644 (file)
index 0000000..17dc0b9
--- /dev/null
@@ -0,0 +1,686 @@
+From 226753fa69811ebbbf8074ae108e66ea112f7a9d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 14 Dec 2020 10:10:45 +0000
+Subject: btrfs: fix transaction leak and crash after RO remount caused by
+ qgroup rescan
+
+From: Filipe Manana <fdmanana@suse.com>
+
+[ Upstream commit cb13eea3b49055bd78e6ddf39defd6340f7379fc ]
+
+If we remount a filesystem in RO mode while the qgroup rescan worker is
+running, we can end up having it still running after the remount is done,
+and at unmount time we may end up with an open transaction that ends up
+never getting committed. If that happens we end up with several memory
+leaks and can crash when hardware acceleration is unavailable for crc32c.
+Possibly it can lead to other nasty surprises too, due to use-after-free
+issues.
+
+The following steps explain how the problem happens.
+
+1) We have a filesystem mounted in RW mode and the qgroup rescan worker is
+   running;
+
+2) We remount the filesystem in RO mode, and never stop/pause the rescan
+   worker, so after the remount the rescan worker is still running. The
+   important detail here is that the rescan task is still running after
+   the remount operation committed any ongoing transaction through its
+   call to btrfs_commit_super();
+
+3) The rescan is still running, and after the remount completed, the
+   rescan worker started a transaction, after it finished iterating all
+   leaves of the extent tree, to update the qgroup status item in the
+   quotas tree. It does not commit the transaction, it only releases its
+   handle on the transaction;
+
+4) A filesystem unmount operation starts shortly after;
+
+5) The unmount task, at close_ctree(), stops the transaction kthread,
+   which had not had a chance to commit the open transaction since it was
+   sleeping and the commit interval (default of 30 seconds) has not yet
+   elapsed since the last time it committed a transaction;
+
+6) So after stopping the transaction kthread we still have the transaction
+   used to update the qgroup status item open. At close_ctree(), when the
+   filesystem is in RO mode and no transaction abort happened (or the
+   filesystem is in error mode), we do not expect to have any transaction
+   open, so we do not call btrfs_commit_super();
+
+7) We then proceed to destroy the work queues, free the roots and block
+   groups, etc. After that we drop the last reference on the btree inode
+   by calling iput() on it. Since there are dirty pages for the btree
+   inode, corresponding to the COWed extent buffer for the quotas btree,
+   btree_write_cache_pages() is invoked to flush those dirty pages. This
+   results in creating a bio and submitting it, which makes us end up at
+   btrfs_submit_metadata_bio();
+
+8) At btrfs_submit_metadata_bio() we end up at the if-then-else branch
+   that calls btrfs_wq_submit_bio(), because check_async_write() returned
+   a value of 1. This value of 1 is because we did not have hardware
+   acceleration available for crc32c, so BTRFS_FS_CSUM_IMPL_FAST was not
+   set in fs_info->flags;
+
+9) Then at btrfs_wq_submit_bio() we call btrfs_queue_work() against the
+   workqueue at fs_info->workers, which was already freed before by the
+   call to btrfs_stop_all_workers() at close_ctree(). This results in an
+   invalid memory access due to a use-after-free, leading to a crash.
+
+When this happens, before the crash there are several warnings triggered,
+since we have reserved metadata space in a block group, the delayed refs
+reservation, etc:
+
+  ------------[ cut here ]------------
+  WARNING: CPU: 4 PID: 1729896 at fs/btrfs/block-group.c:125 btrfs_put_block_group+0x63/0xa0 [btrfs]
+  Modules linked in: btrfs dm_snapshot dm_thin_pool (...)
+  CPU: 4 PID: 1729896 Comm: umount Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  RIP: 0010:btrfs_put_block_group+0x63/0xa0 [btrfs]
+  Code: f0 01 00 00 48 39 c2 75 (...)
+  RSP: 0018:ffffb270826bbdd8 EFLAGS: 00010206
+  RAX: 0000000000000001 RBX: ffff947ed73e4000 RCX: ffff947ebc8b29c8
+  RDX: 0000000000000001 RSI: ffffffffc0b150a0 RDI: ffff947ebc8b2800
+  RBP: ffff947ebc8b2800 R08: 0000000000000000 R09: 0000000000000000
+  R10: 0000000000000000 R11: 0000000000000001 R12: ffff947ed73e4110
+  R13: ffff947ed73e4160 R14: ffff947ebc8b2988 R15: dead000000000100
+  FS:  00007f15edfea840(0000) GS:ffff9481ad600000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: 00007f37e2893320 CR3: 0000000138f68001 CR4: 00000000003706e0
+  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+  Call Trace:
+   btrfs_free_block_groups+0x17f/0x2f0 [btrfs]
+   close_ctree+0x2ba/0x2fa [btrfs]
+   generic_shutdown_super+0x6c/0x100
+   kill_anon_super+0x14/0x30
+   btrfs_kill_super+0x12/0x20 [btrfs]
+   deactivate_locked_super+0x31/0x70
+   cleanup_mnt+0x100/0x160
+   task_work_run+0x68/0xb0
+   exit_to_user_mode_prepare+0x1bb/0x1c0
+   syscall_exit_to_user_mode+0x4b/0x260
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f15ee221ee7
+  Code: ff 0b 00 f7 d8 64 89 01 48 (...)
+  RSP: 002b:00007ffe9470f0f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
+  RAX: 0000000000000000 RBX: 00007f15ee347264 RCX: 00007f15ee221ee7
+  RDX: ffffffffffffff78 RSI: 0000000000000000 RDI: 000056169701d000
+  RBP: 0000561697018a30 R08: 0000000000000000 R09: 00007f15ee2e2be0
+  R10: 000056169701efe0 R11: 0000000000000246 R12: 0000000000000000
+  R13: 000056169701d000 R14: 0000561697018b40 R15: 0000561697018c60
+  irq event stamp: 0
+  hardirqs last  enabled at (0): [<0000000000000000>] 0x0
+  hardirqs last disabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last  enabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last disabled at (0): [<0000000000000000>] 0x0
+  ---[ end trace dd74718fef1ed5c6 ]---
+  ------------[ cut here ]------------
+  WARNING: CPU: 2 PID: 1729896 at fs/btrfs/block-rsv.c:459 btrfs_release_global_block_rsv+0x70/0xc0 [btrfs]
+  Modules linked in: btrfs dm_snapshot dm_thin_pool (...)
+  CPU: 2 PID: 1729896 Comm: umount Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  RIP: 0010:btrfs_release_global_block_rsv+0x70/0xc0 [btrfs]
+  Code: 48 83 bb b0 03 00 00 00 (...)
+  RSP: 0018:ffffb270826bbdd8 EFLAGS: 00010206
+  RAX: 000000000033c000 RBX: ffff947ed73e4000 RCX: 0000000000000000
+  RDX: 0000000000000001 RSI: ffffffffc0b0d8c1 RDI: 00000000ffffffff
+  RBP: ffff947ebc8b7000 R08: 0000000000000001 R09: 0000000000000000
+  R10: 0000000000000000 R11: 0000000000000001 R12: ffff947ed73e4110
+  R13: ffff947ed73e5278 R14: dead000000000122 R15: dead000000000100
+  FS:  00007f15edfea840(0000) GS:ffff9481aca00000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: 0000561a79f76e20 CR3: 0000000138f68006 CR4: 00000000003706e0
+  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+  Call Trace:
+   btrfs_free_block_groups+0x24c/0x2f0 [btrfs]
+   close_ctree+0x2ba/0x2fa [btrfs]
+   generic_shutdown_super+0x6c/0x100
+   kill_anon_super+0x14/0x30
+   btrfs_kill_super+0x12/0x20 [btrfs]
+   deactivate_locked_super+0x31/0x70
+   cleanup_mnt+0x100/0x160
+   task_work_run+0x68/0xb0
+   exit_to_user_mode_prepare+0x1bb/0x1c0
+   syscall_exit_to_user_mode+0x4b/0x260
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f15ee221ee7
+  Code: ff 0b 00 f7 d8 64 89 01 (...)
+  RSP: 002b:00007ffe9470f0f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
+  RAX: 0000000000000000 RBX: 00007f15ee347264 RCX: 00007f15ee221ee7
+  RDX: ffffffffffffff78 RSI: 0000000000000000 RDI: 000056169701d000
+  RBP: 0000561697018a30 R08: 0000000000000000 R09: 00007f15ee2e2be0
+  R10: 000056169701efe0 R11: 0000000000000246 R12: 0000000000000000
+  R13: 000056169701d000 R14: 0000561697018b40 R15: 0000561697018c60
+  irq event stamp: 0
+  hardirqs last  enabled at (0): [<0000000000000000>] 0x0
+  hardirqs last disabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last  enabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last disabled at (0): [<0000000000000000>] 0x0
+  ---[ end trace dd74718fef1ed5c7 ]---
+  ------------[ cut here ]------------
+  WARNING: CPU: 2 PID: 1729896 at fs/btrfs/block-group.c:3377 btrfs_free_block_groups+0x25d/0x2f0 [btrfs]
+  Modules linked in: btrfs dm_snapshot dm_thin_pool (...)
+  CPU: 5 PID: 1729896 Comm: umount Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  RIP: 0010:btrfs_free_block_groups+0x25d/0x2f0 [btrfs]
+  Code: ad de 49 be 22 01 00 (...)
+  RSP: 0018:ffffb270826bbde8 EFLAGS: 00010206
+  RAX: ffff947ebeae1d08 RBX: ffff947ed73e4000 RCX: 0000000000000000
+  RDX: 0000000000000001 RSI: ffff947e9d823ae8 RDI: 0000000000000246
+  RBP: ffff947ebeae1d08 R08: 0000000000000000 R09: 0000000000000000
+  R10: 0000000000000000 R11: 0000000000000001 R12: ffff947ebeae1c00
+  R13: ffff947ed73e5278 R14: dead000000000122 R15: dead000000000100
+  FS:  00007f15edfea840(0000) GS:ffff9481ad200000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: 00007f1475d98ea8 CR3: 0000000138f68005 CR4: 00000000003706e0
+  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+  Call Trace:
+   close_ctree+0x2ba/0x2fa [btrfs]
+   generic_shutdown_super+0x6c/0x100
+   kill_anon_super+0x14/0x30
+   btrfs_kill_super+0x12/0x20 [btrfs]
+   deactivate_locked_super+0x31/0x70
+   cleanup_mnt+0x100/0x160
+   task_work_run+0x68/0xb0
+   exit_to_user_mode_prepare+0x1bb/0x1c0
+   syscall_exit_to_user_mode+0x4b/0x260
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f15ee221ee7
+  Code: ff 0b 00 f7 d8 64 89 (...)
+  RSP: 002b:00007ffe9470f0f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
+  RAX: 0000000000000000 RBX: 00007f15ee347264 RCX: 00007f15ee221ee7
+  RDX: ffffffffffffff78 RSI: 0000000000000000 RDI: 000056169701d000
+  RBP: 0000561697018a30 R08: 0000000000000000 R09: 00007f15ee2e2be0
+  R10: 000056169701efe0 R11: 0000000000000246 R12: 0000000000000000
+  R13: 000056169701d000 R14: 0000561697018b40 R15: 0000561697018c60
+  irq event stamp: 0
+  hardirqs last  enabled at (0): [<0000000000000000>] 0x0
+  hardirqs last disabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last  enabled at (0): [<ffffffff8bcae560>] copy_process+0x8a0/0x1d70
+  softirqs last disabled at (0): [<0000000000000000>] 0x0
+  ---[ end trace dd74718fef1ed5c8 ]---
+  BTRFS info (device sdc): space_info 4 has 268238848 free, is not full
+  BTRFS info (device sdc): space_info total=268435456, used=114688, pinned=0, reserved=16384, may_use=0, readonly=65536
+  BTRFS info (device sdc): global_block_rsv: size 0 reserved 0
+  BTRFS info (device sdc): trans_block_rsv: size 0 reserved 0
+  BTRFS info (device sdc): chunk_block_rsv: size 0 reserved 0
+  BTRFS info (device sdc): delayed_block_rsv: size 0 reserved 0
+  BTRFS info (device sdc): delayed_refs_rsv: size 524288 reserved 0
+
+And the crash, which only happens when we do not have crc32c hardware
+acceleration, produces the following trace immediately after those
+warnings:
+
+  stack segment: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI
+  CPU: 2 PID: 1749129 Comm: umount Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  RIP: 0010:btrfs_queue_work+0x36/0x190 [btrfs]
+  Code: 54 55 53 48 89 f3 (...)
+  RSP: 0018:ffffb27082443ae8 EFLAGS: 00010282
+  RAX: 0000000000000004 RBX: ffff94810ee9ad90 RCX: 0000000000000000
+  RDX: 0000000000000001 RSI: ffff94810ee9ad90 RDI: ffff947ed8ee75a0
+  RBP: a56b6b6b6b6b6b6b R08: 0000000000000000 R09: 0000000000000000
+  R10: 0000000000000007 R11: 0000000000000001 R12: ffff947fa9b435a8
+  R13: ffff94810ee9ad90 R14: 0000000000000000 R15: ffff947e93dc0000
+  FS:  00007f3cfe974840(0000) GS:ffff9481ac600000(0000) knlGS:0000000000000000
+  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+  CR2: 00007f1b42995a70 CR3: 0000000127638003 CR4: 00000000003706e0
+  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+  Call Trace:
+   btrfs_wq_submit_bio+0xb3/0xd0 [btrfs]
+   btrfs_submit_metadata_bio+0x44/0xc0 [btrfs]
+   submit_one_bio+0x61/0x70 [btrfs]
+   btree_write_cache_pages+0x414/0x450 [btrfs]
+   ? kobject_put+0x9a/0x1d0
+   ? trace_hardirqs_on+0x1b/0xf0
+   ? _raw_spin_unlock_irqrestore+0x3c/0x60
+   ? free_debug_processing+0x1e1/0x2b0
+   do_writepages+0x43/0xe0
+   ? lock_acquired+0x199/0x490
+   __writeback_single_inode+0x59/0x650
+   writeback_single_inode+0xaf/0x120
+   write_inode_now+0x94/0xd0
+   iput+0x187/0x2b0
+   close_ctree+0x2c6/0x2fa [btrfs]
+   generic_shutdown_super+0x6c/0x100
+   kill_anon_super+0x14/0x30
+   btrfs_kill_super+0x12/0x20 [btrfs]
+   deactivate_locked_super+0x31/0x70
+   cleanup_mnt+0x100/0x160
+   task_work_run+0x68/0xb0
+   exit_to_user_mode_prepare+0x1bb/0x1c0
+   syscall_exit_to_user_mode+0x4b/0x260
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f3cfebabee7
+  Code: ff 0b 00 f7 d8 64 89 01 (...)
+  RSP: 002b:00007ffc9c9a05f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
+  RAX: 0000000000000000 RBX: 00007f3cfecd1264 RCX: 00007f3cfebabee7
+  RDX: ffffffffffffff78 RSI: 0000000000000000 RDI: 0000562b6b478000
+  RBP: 0000562b6b473a30 R08: 0000000000000000 R09: 00007f3cfec6cbe0
+  R10: 0000562b6b479fe0 R11: 0000000000000246 R12: 0000000000000000
+  R13: 0000562b6b478000 R14: 0000562b6b473b40 R15: 0000562b6b473c60
+  Modules linked in: btrfs dm_snapshot dm_thin_pool (...)
+  ---[ end trace dd74718fef1ed5cc ]---
+
+Finally when we remove the btrfs module (rmmod btrfs), there are several
+warnings about objects that were allocated from our slabs but were never
+freed, consequence of the transaction that was never committed and got
+leaked:
+
+  =============================================================================
+  BUG btrfs_delayed_ref_head (Tainted: G    B   W        ): Objects remaining in btrfs_delayed_ref_head on __kmem_cache_shutdown()
+  -----------------------------------------------------------------------------
+
+  INFO: Slab 0x0000000094c2ae56 objects=24 used=2 fp=0x000000002bfa2521 flags=0x17fffc000010200
+  CPU: 5 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   slab_err+0xb7/0xdc
+   ? lock_acquired+0x199/0x490
+   __kmem_cache_shutdown+0x1ac/0x3c0
+   ? lock_release+0x20e/0x4c0
+   kmem_cache_destroy+0x55/0x120
+   btrfs_delayed_ref_exit+0x11/0x35 [btrfs]
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 f5 (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  INFO: Object 0x0000000050cbdd61 @offset=12104
+  INFO: Allocated in btrfs_add_delayed_tree_ref+0xbb/0x480 [btrfs] age=1894 cpu=6 pid=1729873
+       __slab_alloc.isra.0+0x109/0x1c0
+       kmem_cache_alloc+0x7bb/0x830
+       btrfs_add_delayed_tree_ref+0xbb/0x480 [btrfs]
+       btrfs_free_tree_block+0x128/0x360 [btrfs]
+       __btrfs_cow_block+0x489/0x5f0 [btrfs]
+       btrfs_cow_block+0xf7/0x220 [btrfs]
+       btrfs_search_slot+0x62a/0xc40 [btrfs]
+       btrfs_del_orphan_item+0x65/0xd0 [btrfs]
+       btrfs_find_orphan_roots+0x1bf/0x200 [btrfs]
+       open_ctree+0x125a/0x18a0 [btrfs]
+       btrfs_mount_root.cold+0x13/0xed [btrfs]
+       legacy_get_tree+0x30/0x60
+       vfs_get_tree+0x28/0xe0
+       fc_mount+0xe/0x40
+       vfs_kern_mount.part.0+0x71/0x90
+       btrfs_mount+0x13b/0x3e0 [btrfs]
+  INFO: Freed in __btrfs_run_delayed_refs+0x1117/0x1290 [btrfs] age=4292 cpu=2 pid=1729526
+       kmem_cache_free+0x34c/0x3c0
+       __btrfs_run_delayed_refs+0x1117/0x1290 [btrfs]
+       btrfs_run_delayed_refs+0x81/0x210 [btrfs]
+       commit_cowonly_roots+0xfb/0x300 [btrfs]
+       btrfs_commit_transaction+0x367/0xc40 [btrfs]
+       sync_filesystem+0x74/0x90
+       generic_shutdown_super+0x22/0x100
+       kill_anon_super+0x14/0x30
+       btrfs_kill_super+0x12/0x20 [btrfs]
+       deactivate_locked_super+0x31/0x70
+       cleanup_mnt+0x100/0x160
+       task_work_run+0x68/0xb0
+       exit_to_user_mode_prepare+0x1bb/0x1c0
+       syscall_exit_to_user_mode+0x4b/0x260
+       entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  INFO: Object 0x0000000086e9b0ff @offset=12776
+  INFO: Allocated in btrfs_add_delayed_tree_ref+0xbb/0x480 [btrfs] age=1900 cpu=6 pid=1729873
+       __slab_alloc.isra.0+0x109/0x1c0
+       kmem_cache_alloc+0x7bb/0x830
+       btrfs_add_delayed_tree_ref+0xbb/0x480 [btrfs]
+       btrfs_alloc_tree_block+0x2bf/0x360 [btrfs]
+       alloc_tree_block_no_bg_flush+0x4f/0x60 [btrfs]
+       __btrfs_cow_block+0x12d/0x5f0 [btrfs]
+       btrfs_cow_block+0xf7/0x220 [btrfs]
+       btrfs_search_slot+0x62a/0xc40 [btrfs]
+       btrfs_del_orphan_item+0x65/0xd0 [btrfs]
+       btrfs_find_orphan_roots+0x1bf/0x200 [btrfs]
+       open_ctree+0x125a/0x18a0 [btrfs]
+       btrfs_mount_root.cold+0x13/0xed [btrfs]
+       legacy_get_tree+0x30/0x60
+       vfs_get_tree+0x28/0xe0
+       fc_mount+0xe/0x40
+       vfs_kern_mount.part.0+0x71/0x90
+  INFO: Freed in __btrfs_run_delayed_refs+0x1117/0x1290 [btrfs] age=3141 cpu=6 pid=1729803
+       kmem_cache_free+0x34c/0x3c0
+       __btrfs_run_delayed_refs+0x1117/0x1290 [btrfs]
+       btrfs_run_delayed_refs+0x81/0x210 [btrfs]
+       btrfs_write_dirty_block_groups+0x17d/0x3d0 [btrfs]
+       commit_cowonly_roots+0x248/0x300 [btrfs]
+       btrfs_commit_transaction+0x367/0xc40 [btrfs]
+       close_ctree+0x113/0x2fa [btrfs]
+       generic_shutdown_super+0x6c/0x100
+       kill_anon_super+0x14/0x30
+       btrfs_kill_super+0x12/0x20 [btrfs]
+       deactivate_locked_super+0x31/0x70
+       cleanup_mnt+0x100/0x160
+       task_work_run+0x68/0xb0
+       exit_to_user_mode_prepare+0x1bb/0x1c0
+       syscall_exit_to_user_mode+0x4b/0x260
+       entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  kmem_cache_destroy btrfs_delayed_ref_head: Slab cache still has objects
+  CPU: 5 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   kmem_cache_destroy+0x119/0x120
+   btrfs_delayed_ref_exit+0x11/0x35 [btrfs]
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 f5 0b (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  =============================================================================
+  BUG btrfs_delayed_tree_ref (Tainted: G    B   W        ): Objects remaining in btrfs_delayed_tree_ref on __kmem_cache_shutdown()
+  -----------------------------------------------------------------------------
+
+  INFO: Slab 0x0000000011f78dc0 objects=37 used=2 fp=0x0000000032d55d91 flags=0x17fffc000010200
+  CPU: 3 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   slab_err+0xb7/0xdc
+   ? lock_acquired+0x199/0x490
+   __kmem_cache_shutdown+0x1ac/0x3c0
+   ? lock_release+0x20e/0x4c0
+   kmem_cache_destroy+0x55/0x120
+   btrfs_delayed_ref_exit+0x1d/0x35 [btrfs]
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 f5 (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  INFO: Object 0x000000001a340018 @offset=4408
+  INFO: Allocated in btrfs_add_delayed_tree_ref+0x9e/0x480 [btrfs] age=1917 cpu=6 pid=1729873
+       __slab_alloc.isra.0+0x109/0x1c0
+       kmem_cache_alloc+0x7bb/0x830
+       btrfs_add_delayed_tree_ref+0x9e/0x480 [btrfs]
+       btrfs_free_tree_block+0x128/0x360 [btrfs]
+       __btrfs_cow_block+0x489/0x5f0 [btrfs]
+       btrfs_cow_block+0xf7/0x220 [btrfs]
+       btrfs_search_slot+0x62a/0xc40 [btrfs]
+       btrfs_del_orphan_item+0x65/0xd0 [btrfs]
+       btrfs_find_orphan_roots+0x1bf/0x200 [btrfs]
+       open_ctree+0x125a/0x18a0 [btrfs]
+       btrfs_mount_root.cold+0x13/0xed [btrfs]
+       legacy_get_tree+0x30/0x60
+       vfs_get_tree+0x28/0xe0
+       fc_mount+0xe/0x40
+       vfs_kern_mount.part.0+0x71/0x90
+       btrfs_mount+0x13b/0x3e0 [btrfs]
+  INFO: Freed in __btrfs_run_delayed_refs+0x63d/0x1290 [btrfs] age=4167 cpu=4 pid=1729795
+       kmem_cache_free+0x34c/0x3c0
+       __btrfs_run_delayed_refs+0x63d/0x1290 [btrfs]
+       btrfs_run_delayed_refs+0x81/0x210 [btrfs]
+       btrfs_commit_transaction+0x60/0xc40 [btrfs]
+       create_subvol+0x56a/0x990 [btrfs]
+       btrfs_mksubvol+0x3fb/0x4a0 [btrfs]
+       __btrfs_ioctl_snap_create+0x119/0x1a0 [btrfs]
+       btrfs_ioctl_snap_create+0x58/0x80 [btrfs]
+       btrfs_ioctl+0x1a92/0x36f0 [btrfs]
+       __x64_sys_ioctl+0x83/0xb0
+       do_syscall_64+0x33/0x80
+       entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  INFO: Object 0x000000002b46292a @offset=13648
+  INFO: Allocated in btrfs_add_delayed_tree_ref+0x9e/0x480 [btrfs] age=1923 cpu=6 pid=1729873
+       __slab_alloc.isra.0+0x109/0x1c0
+       kmem_cache_alloc+0x7bb/0x830
+       btrfs_add_delayed_tree_ref+0x9e/0x480 [btrfs]
+       btrfs_alloc_tree_block+0x2bf/0x360 [btrfs]
+       alloc_tree_block_no_bg_flush+0x4f/0x60 [btrfs]
+       __btrfs_cow_block+0x12d/0x5f0 [btrfs]
+       btrfs_cow_block+0xf7/0x220 [btrfs]
+       btrfs_search_slot+0x62a/0xc40 [btrfs]
+       btrfs_del_orphan_item+0x65/0xd0 [btrfs]
+       btrfs_find_orphan_roots+0x1bf/0x200 [btrfs]
+       open_ctree+0x125a/0x18a0 [btrfs]
+       btrfs_mount_root.cold+0x13/0xed [btrfs]
+       legacy_get_tree+0x30/0x60
+       vfs_get_tree+0x28/0xe0
+       fc_mount+0xe/0x40
+       vfs_kern_mount.part.0+0x71/0x90
+  INFO: Freed in __btrfs_run_delayed_refs+0x63d/0x1290 [btrfs] age=3164 cpu=6 pid=1729803
+       kmem_cache_free+0x34c/0x3c0
+       __btrfs_run_delayed_refs+0x63d/0x1290 [btrfs]
+       btrfs_run_delayed_refs+0x81/0x210 [btrfs]
+       commit_cowonly_roots+0xfb/0x300 [btrfs]
+       btrfs_commit_transaction+0x367/0xc40 [btrfs]
+       close_ctree+0x113/0x2fa [btrfs]
+       generic_shutdown_super+0x6c/0x100
+       kill_anon_super+0x14/0x30
+       btrfs_kill_super+0x12/0x20 [btrfs]
+       deactivate_locked_super+0x31/0x70
+       cleanup_mnt+0x100/0x160
+       task_work_run+0x68/0xb0
+       exit_to_user_mode_prepare+0x1bb/0x1c0
+       syscall_exit_to_user_mode+0x4b/0x260
+       entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  kmem_cache_destroy btrfs_delayed_tree_ref: Slab cache still has objects
+  CPU: 5 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   kmem_cache_destroy+0x119/0x120
+   btrfs_delayed_ref_exit+0x1d/0x35 [btrfs]
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 f5 (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  =============================================================================
+  BUG btrfs_delayed_extent_op (Tainted: G    B   W        ): Objects remaining in btrfs_delayed_extent_op on __kmem_cache_shutdown()
+  -----------------------------------------------------------------------------
+
+  INFO: Slab 0x00000000f145ce2f objects=22 used=1 fp=0x00000000af0f92cf flags=0x17fffc000010200
+  CPU: 5 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   slab_err+0xb7/0xdc
+   ? lock_acquired+0x199/0x490
+   __kmem_cache_shutdown+0x1ac/0x3c0
+   ? __mutex_unlock_slowpath+0x45/0x2a0
+   kmem_cache_destroy+0x55/0x120
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 f5 (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  INFO: Object 0x000000004cf95ea8 @offset=6264
+  INFO: Allocated in btrfs_alloc_tree_block+0x1e0/0x360 [btrfs] age=1931 cpu=6 pid=1729873
+       __slab_alloc.isra.0+0x109/0x1c0
+       kmem_cache_alloc+0x7bb/0x830
+       btrfs_alloc_tree_block+0x1e0/0x360 [btrfs]
+       alloc_tree_block_no_bg_flush+0x4f/0x60 [btrfs]
+       __btrfs_cow_block+0x12d/0x5f0 [btrfs]
+       btrfs_cow_block+0xf7/0x220 [btrfs]
+       btrfs_search_slot+0x62a/0xc40 [btrfs]
+       btrfs_del_orphan_item+0x65/0xd0 [btrfs]
+       btrfs_find_orphan_roots+0x1bf/0x200 [btrfs]
+       open_ctree+0x125a/0x18a0 [btrfs]
+       btrfs_mount_root.cold+0x13/0xed [btrfs]
+       legacy_get_tree+0x30/0x60
+       vfs_get_tree+0x28/0xe0
+       fc_mount+0xe/0x40
+       vfs_kern_mount.part.0+0x71/0x90
+       btrfs_mount+0x13b/0x3e0 [btrfs]
+  INFO: Freed in __btrfs_run_delayed_refs+0xabd/0x1290 [btrfs] age=3173 cpu=6 pid=1729803
+       kmem_cache_free+0x34c/0x3c0
+       __btrfs_run_delayed_refs+0xabd/0x1290 [btrfs]
+       btrfs_run_delayed_refs+0x81/0x210 [btrfs]
+       commit_cowonly_roots+0xfb/0x300 [btrfs]
+       btrfs_commit_transaction+0x367/0xc40 [btrfs]
+       close_ctree+0x113/0x2fa [btrfs]
+       generic_shutdown_super+0x6c/0x100
+       kill_anon_super+0x14/0x30
+       btrfs_kill_super+0x12/0x20 [btrfs]
+       deactivate_locked_super+0x31/0x70
+       cleanup_mnt+0x100/0x160
+       task_work_run+0x68/0xb0
+       exit_to_user_mode_prepare+0x1bb/0x1c0
+       syscall_exit_to_user_mode+0x4b/0x260
+       entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  kmem_cache_destroy btrfs_delayed_extent_op: Slab cache still has objects
+  CPU: 3 PID: 1729921 Comm: rmmod Tainted: G    B   W         5.10.0-rc4-btrfs-next-73 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
+  Call Trace:
+   dump_stack+0x8d/0xb5
+   kmem_cache_destroy+0x119/0x120
+   exit_btrfs_fs+0xa/0x59 [btrfs]
+   __x64_sys_delete_module+0x194/0x260
+   ? fpregs_assert_state_consistent+0x1e/0x40
+   ? exit_to_user_mode_prepare+0x55/0x1c0
+   ? trace_hardirqs_on+0x1b/0xf0
+   do_syscall_64+0x33/0x80
+   entry_SYSCALL_64_after_hwframe+0x44/0xa9
+  RIP: 0033:0x7f693e305897
+  Code: 73 01 c3 48 8b 0d f9 (...)
+  RSP: 002b:00007ffcf73eb508 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
+  RAX: ffffffffffffffda RBX: 0000559df504f760 RCX: 00007f693e305897
+  RDX: 000000000000000a RSI: 0000000000000800 RDI: 0000559df504f7c8
+  RBP: 00007ffcf73eb568 R08: 0000000000000000 R09: 0000000000000000
+  R10: 00007f693e378ac0 R11: 0000000000000206 R12: 00007ffcf73eb740
+  R13: 00007ffcf73ec5a6 R14: 0000559df504f2a0 R15: 0000559df504f760
+  BTRFS: state leak: start 30408704 end 30425087 state 1 in tree 1 refs 1
+
+Fix this issue by having the remount path stop the qgroup rescan worker
+when we are remounting RO and teach the rescan worker to stop when a
+remount is in progress. If later a remount in RW mode happens, we are
+already resuming the qgroup rescan worker through the call to
+btrfs_qgroup_rescan_resume(), so we do not need to worry about that.
+
+Tested-by: Fabian Vogt <fvogt@suse.com>
+Reviewed-by: Josef Bacik <josef@toxicpanda.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/qgroup.c | 13 ++++++++++---
+ fs/btrfs/super.c  |  8 ++++++++
+ 2 files changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
+index d9246fb8cea65..cd8e81c02f63f 100644
+--- a/fs/btrfs/qgroup.c
++++ b/fs/btrfs/qgroup.c
+@@ -3144,6 +3144,12 @@ out:
+       return ret;
+ }
++static bool rescan_should_stop(struct btrfs_fs_info *fs_info)
++{
++      return btrfs_fs_closing(fs_info) ||
++              test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
++}
++
+ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work)
+ {
+       struct btrfs_fs_info *fs_info = container_of(work, struct btrfs_fs_info,
+@@ -3152,6 +3158,7 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work)
+       struct btrfs_trans_handle *trans = NULL;
+       int err = -ENOMEM;
+       int ret = 0;
++      bool stopped = false;
+       path = btrfs_alloc_path();
+       if (!path)
+@@ -3164,7 +3171,7 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work)
+       path->skip_locking = 1;
+       err = 0;
+-      while (!err && !btrfs_fs_closing(fs_info)) {
++      while (!err && !(stopped = rescan_should_stop(fs_info))) {
+               trans = btrfs_start_transaction(fs_info->fs_root, 0);
+               if (IS_ERR(trans)) {
+                       err = PTR_ERR(trans);
+@@ -3207,7 +3214,7 @@ out:
+       }
+       mutex_lock(&fs_info->qgroup_rescan_lock);
+-      if (!btrfs_fs_closing(fs_info))
++      if (!stopped)
+               fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN;
+       if (trans) {
+               ret = update_qgroup_status_item(trans);
+@@ -3226,7 +3233,7 @@ out:
+       btrfs_end_transaction(trans);
+-      if (btrfs_fs_closing(fs_info)) {
++      if (stopped) {
+               btrfs_info(fs_info, "qgroup scan paused");
+       } else if (err >= 0) {
+               btrfs_info(fs_info, "qgroup scan completed%s",
+diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
+index 6a2ae208ff80a..1a69bdb96fb2a 100644
+--- a/fs/btrfs/super.c
++++ b/fs/btrfs/super.c
+@@ -1792,6 +1792,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
+               btrfs_scrub_cancel(fs_info);
+               btrfs_pause_balance(fs_info);
++              /*
++               * Pause the qgroup rescan worker if it is running. We don't want
++               * it to be still running after we are in RO mode, as after that,
++               * by the time we unmount, it might have left a transaction open,
++               * so we would leak the transaction and/or crash.
++               */
++              btrfs_qgroup_wait_for_completion(fs_info, false);
++
+               ret = btrfs_commit_super(fs_info);
+               if (ret)
+                       goto restore;
+-- 
+2.27.0
+
diff --git a/queue-5.4/dmaengine-stm32-mdma-fix-stm32_mdma_very_high_priori.patch b/queue-5.4/dmaengine-stm32-mdma-fix-stm32_mdma_very_high_priori.patch
new file mode 100644 (file)
index 0000000..6c4ec23
--- /dev/null
@@ -0,0 +1,35 @@
+From d43c67a57b708f5ebfec91970330169468443209 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 4 Jan 2021 15:20:45 +0100
+Subject: dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value
+
+From: Amelie Delaunay <amelie.delaunay@foss.st.com>
+
+[ Upstream commit e1263f9277bad198c2acc8092a41aea1edbea0e4 ]
+
+STM32_MDMA_VERY_HIGH_PRIORITY is b11 not 0x11, so fix it with 0x3.
+
+Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
+Link: https://lore.kernel.org/r/20210104142045.25583-1-amelie.delaunay@foss.st.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/stm32-mdma.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
+index ee1cbf3be75d5..718f0779ac598 100644
+--- a/drivers/dma/stm32-mdma.c
++++ b/drivers/dma/stm32-mdma.c
+@@ -199,7 +199,7 @@
+ #define STM32_MDMA_MAX_CHANNELS               63
+ #define STM32_MDMA_MAX_REQUESTS               256
+ #define STM32_MDMA_MAX_BURST          128
+-#define STM32_MDMA_VERY_HIGH_PRIORITY 0x11
++#define STM32_MDMA_VERY_HIGH_PRIORITY 0x3
+ enum stm32_mdma_trigger_mode {
+       STM32_MDMA_BUFFER,
+-- 
+2.27.0
+
diff --git a/queue-5.4/drm-amdgpu-fix-a-gpu-hang-issue-when-remove-device.patch b/queue-5.4/drm-amdgpu-fix-a-gpu-hang-issue-when-remove-device.patch
new file mode 100644 (file)
index 0000000..d884ff9
--- /dev/null
@@ -0,0 +1,50 @@
+From c11969dcf785745bef97388c2de87ac011536e85 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 30 Dec 2020 19:45:15 +0800
+Subject: drm/amdgpu: fix a GPU hang issue when remove device
+
+From: Dennis Li <Dennis.Li@amd.com>
+
+[ Upstream commit 88e21af1b3f887d217f2fb14fc7e7d3cd87ebf57 ]
+
+When GFXOFF is enabled and GPU is idle, driver will fail to access some
+registers. Therefore change to disable power gating before all access
+registers with MMIO.
+
+Dmesg log is as following:
+amdgpu 0000:03:00.0: amdgpu: amdgpu: finishing device.
+amdgpu: cp queue pipe 4 queue 0 preemption failed
+amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2
+amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706
+amdgpu 0000:03:00.0: amdgpu: failed to write reg 2890 wait reg 28a2
+amdgpu 0000:03:00.0: amdgpu: failed to write reg 1a6f4 wait reg 1a706
+
+Signed-off-by: Dennis Li <Dennis.Li@amd.com>
+Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 29141bff4b572..3b3fc9a426e91 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -2057,11 +2057,11 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
+       if (adev->gmc.xgmi.num_physical_nodes > 1)
+               amdgpu_xgmi_remove_device(adev);
+-      amdgpu_amdkfd_device_fini(adev);
+-
+       amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
+       amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
++      amdgpu_amdkfd_device_fini(adev);
++
+       /* need to disable SMC first */
+       for (i = 0; i < adev->num_ip_blocks; i++) {
+               if (!adev->ip_blocks[i].status.hw)
+-- 
+2.27.0
+
diff --git a/queue-5.4/drm-msm-call-msm_init_vram-before-binding-the-gpu.patch b/queue-5.4/drm-msm-call-msm_init_vram-before-binding-the-gpu.patch
new file mode 100644 (file)
index 0000000..fabf97e
--- /dev/null
@@ -0,0 +1,47 @@
+From b3d6e97ef2e026e06fe28a394edb60b427bb3ca4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 30 Dec 2020 17:29:42 +0200
+Subject: drm/msm: Call msm_init_vram before binding the gpu
+
+From: Craig Tatlor <ctatlor97@gmail.com>
+
+[ Upstream commit d863f0c7b536288e2bd40cbc01c10465dd226b11 ]
+
+vram.size is needed when binding a gpu without an iommu and is defined
+in msm_init_vram(), so run that before binding it.
+
+Signed-off-by: Craig Tatlor <ctatlor97@gmail.com>
+Reviewed-by: Brian Masney <masneyb@onstation.org>
+Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/msm/msm_drv.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
+index 108632a1f2438..8d9d86c76a4e9 100644
+--- a/drivers/gpu/drm/msm/msm_drv.c
++++ b/drivers/gpu/drm/msm/msm_drv.c
+@@ -432,14 +432,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
+       drm_mode_config_init(ddev);
+-      /* Bind all our sub-components: */
+-      ret = component_bind_all(dev, ddev);
++      ret = msm_init_vram(ddev);
+       if (ret)
+               goto err_destroy_mdss;
+-      ret = msm_init_vram(ddev);
++      /* Bind all our sub-components: */
++      ret = component_bind_all(dev, ddev);
+       if (ret)
+-              goto err_msm_uninit;
++              goto err_destroy_mdss;
+       if (!dev->dma_parms) {
+               dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
+-- 
+2.27.0
+
diff --git a/queue-5.4/ethernet-ucc_geth-fix-definition-and-size-of-ucc_get.patch b/queue-5.4/ethernet-ucc_geth-fix-definition-and-size-of-ucc_get.patch
new file mode 100644 (file)
index 0000000..bbcbb3b
--- /dev/null
@@ -0,0 +1,64 @@
+From 197a8752d85f960ce221287c53702bdb86b6afd9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 18 Dec 2020 11:55:37 +0100
+Subject: ethernet: ucc_geth: fix definition and size of
+ ucc_geth_tx_global_pram
+
+From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+
+[ Upstream commit 887078de2a23689e29d6fa1b75d7cbc544c280be ]
+
+Table 8-53 in the QUICC Engine Reference manual shows definitions of
+fields up to a size of 192 bytes, not just 128. But in table 8-111,
+one does find the text
+
+  Base Address of the Global Transmitter Parameter RAM Page. [...]
+  The user needs to allocate 128 bytes for this page. The address must
+  be aligned to the page size.
+
+I've checked both rev. 7 (11/2015) and rev. 9 (05/2018) of the manual;
+they both have this inconsistency (and the table numbers are the
+same).
+
+Adding a bit of debug printing, on my board the struct
+ucc_geth_tx_global_pram is allocated at offset 0x880, while
+the (opaque) ucc_geth_thread_data_tx gets allocated immediately
+afterwards, at 0x900. So whatever the engine writes into the thread
+data overlaps with the tail of the global tx pram (and devmem says
+that something does get written during a simple ping).
+
+I haven't observed any failure that could be attributed to this, but
+it seems to be the kind of thing that would be extremely hard to
+debug. So extend the struct definition so that we do allocate 192
+bytes.
+
+Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/freescale/ucc_geth.h | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
+index a86a42131fc71..b00fbef612cfe 100644
+--- a/drivers/net/ethernet/freescale/ucc_geth.h
++++ b/drivers/net/ethernet/freescale/ucc_geth.h
+@@ -576,7 +576,14 @@ struct ucc_geth_tx_global_pram {
+       u32 vtagtable[0x8];     /* 8 4-byte VLAN tags */
+       u32 tqptr;              /* a base pointer to the Tx Queues Memory
+                                  Region */
+-      u8 res2[0x80 - 0x74];
++      u8 res2[0x78 - 0x74];
++      u64 snums_en;
++      u32 l2l3baseptr;        /* top byte consists of a few other bit fields */
++
++      u16 mtu[8];
++      u8 res3[0xa8 - 0x94];
++      u32 wrrtablebase;       /* top byte is reserved */
++      u8 res4[0xc0 - 0xac];
+ } __packed;
+ /* structure representing Extended Filtering Global Parameters in PRAM */
+-- 
+2.27.0
+
diff --git a/queue-5.4/habanalabs-fix-memleak-in-hl_device_reset.patch b/queue-5.4/habanalabs-fix-memleak-in-hl_device_reset.patch
new file mode 100644 (file)
index 0000000..4907158
--- /dev/null
@@ -0,0 +1,44 @@
+From 6590e2cff052795be105a928afb47b3bac689741 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 26 Dec 2020 15:27:14 +0800
+Subject: habanalabs: Fix memleak in hl_device_reset
+
+From: Dinghao Liu <dinghao.liu@zju.edu.cn>
+
+[ Upstream commit b000700d6db50c933ce8b661154e26cf4ad06dba ]
+
+When kzalloc() fails, we should execute hl_mmu_fini()
+to release the MMU module. It's the same when
+hl_ctx_init() fails.
+
+Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
+Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
+Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/habanalabs/device.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c
+index 3eeb1920ddb43..3486bf33474d9 100644
+--- a/drivers/misc/habanalabs/device.c
++++ b/drivers/misc/habanalabs/device.c
+@@ -959,6 +959,7 @@ again:
+                                               GFP_KERNEL);
+               if (!hdev->kernel_ctx) {
+                       rc = -ENOMEM;
++                      hl_mmu_fini(hdev);
+                       goto out_err;
+               }
+@@ -970,6 +971,7 @@ again:
+                               "failed to init kernel ctx in hard reset\n");
+                       kfree(hdev->kernel_ctx);
+                       hdev->kernel_ctx = NULL;
++                      hl_mmu_fini(hdev);
+                       goto out_err;
+               }
+       }
+-- 
+2.27.0
+
diff --git a/queue-5.4/habanalabs-register-to-pci-shutdown-callback.patch b/queue-5.4/habanalabs-register-to-pci-shutdown-callback.patch
new file mode 100644 (file)
index 0000000..519912a
--- /dev/null
@@ -0,0 +1,36 @@
+From e8cc253dba743c6f99c53a11fa74a493ff9ccbe4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 14 Dec 2020 12:52:06 +0200
+Subject: habanalabs: register to pci shutdown callback
+
+From: Oded Gabbay <ogabbay@kernel.org>
+
+[ Upstream commit fcaebc7354188b0d708c79df4390fbabd4d9799d ]
+
+We need to make sure our device is idle when rebooting a virtual
+machine. This is done in the driver level.
+
+The firmware will later handle FLR but we want to be extra safe and
+stop the devices until the FLR is handled.
+
+Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/habanalabs/habanalabs_drv.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/misc/habanalabs/habanalabs_drv.c b/drivers/misc/habanalabs/habanalabs_drv.c
+index 8c342fb499ca6..ae50bd55f30af 100644
+--- a/drivers/misc/habanalabs/habanalabs_drv.c
++++ b/drivers/misc/habanalabs/habanalabs_drv.c
+@@ -443,6 +443,7 @@ static struct pci_driver hl_pci_driver = {
+       .id_table = ids,
+       .probe = hl_pci_probe,
+       .remove = hl_pci_remove,
++      .shutdown = hl_pci_remove,
+       .driver.pm = &hl_pm_ops,
+ };
+-- 
+2.27.0
+
diff --git a/queue-5.4/hwmon-pwm-fan-ensure-that-calculation-doesn-t-discar.patch b/queue-5.4/hwmon-pwm-fan-ensure-that-calculation-doesn-t-discar.patch
new file mode 100644 (file)
index 0000000..16b774a
--- /dev/null
@@ -0,0 +1,61 @@
+From 636c17f79d55221b87635180bbcaf5b6ac02410d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 15 Dec 2020 10:20:30 +0100
+Subject: hwmon: (pwm-fan) Ensure that calculation doesn't discard big period
+ values
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+
+[ Upstream commit 1eda52334e6d13eb1a85f713ce06dd39342b5020 ]
+
+With MAX_PWM being defined to 255 the code
+
+       unsigned long period;
+       ...
+       period = ctx->pwm->args.period;
+       state.duty_cycle = DIV_ROUND_UP(pwm * (period - 1), MAX_PWM);
+
+calculates a too small value for duty_cycle if the configured period is
+big (either by discarding the 64 bit value ctx->pwm->args.period or by
+overflowing the multiplication). As this results in a too slow fan and
+so maybe an overheating machine better be safe than sorry and error out
+in .probe.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Link: https://lore.kernel.org/r/20201215092031.152243-1-u.kleine-koenig@pengutronix.de
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hwmon/pwm-fan.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
+index c88ce77fe6763..df6f042fb605e 100644
+--- a/drivers/hwmon/pwm-fan.c
++++ b/drivers/hwmon/pwm-fan.c
+@@ -330,8 +330,18 @@ static int pwm_fan_probe(struct platform_device *pdev)
+       ctx->pwm_value = MAX_PWM;
+-      /* Set duty cycle to maximum allowed and enable PWM output */
+       pwm_init_state(ctx->pwm, &state);
++      /*
++       * __set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
++       * long. Check this here to prevent the fan running at a too low
++       * frequency.
++       */
++      if (state.period > ULONG_MAX / MAX_PWM + 1) {
++              dev_err(dev, "Configured period too big\n");
++              return -EINVAL;
++      }
++
++      /* Set duty cycle to maximum allowed and enable PWM output */
+       state.duty_cycle = ctx->pwm->args.period - 1;
+       state.enabled = true;
+-- 
+2.27.0
+
diff --git a/queue-5.4/lib-raid6-let-unroll-rules-work-with-macos-userland.patch b/queue-5.4/lib-raid6-let-unroll-rules-work-with-macos-userland.patch
new file mode 100644 (file)
index 0000000..ce5acef
--- /dev/null
@@ -0,0 +1,41 @@
+From c8812aa7dbf0b4ea178f238288ce5d82d345b745 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 23 Dec 2020 15:23:25 +0900
+Subject: lib/raid6: Let $(UNROLL) rules work with macOS userland
+
+From: John Millikin <john@john-millikin.com>
+
+[ Upstream commit 0c36d88cff4d72149f94809303c5180b6f716d39 ]
+
+Older versions of BSD awk are fussy about the order of '-v' and '-f'
+flags, and require a space after the flag name. This causes build
+failures on platforms with an old awk, such as macOS and NetBSD.
+
+Since GNU awk and modern versions of BSD awk (distributed with
+FreeBSD/OpenBSD) are fine with either form, the definition of
+'cmd_unroll' can be trivially tweaked to let the lib/raid6 Makefile
+work with both old and new awk flag dialects.
+
+Signed-off-by: John Millikin <john@john-millikin.com>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ lib/raid6/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
+index 0083b5cc646c9..d4d56ca6eafce 100644
+--- a/lib/raid6/Makefile
++++ b/lib/raid6/Makefile
+@@ -48,7 +48,7 @@ endif
+ endif
+ quiet_cmd_unroll = UNROLL  $@
+-      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$* < $< > $@
++      cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
+ targets += int1.c int2.c int4.c int8.c int16.c int32.c
+ $(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE
+-- 
+2.27.0
+
diff --git a/queue-5.4/misdn-dsp-select-config_bitreverse.patch b/queue-5.4/misdn-dsp-select-config_bitreverse.patch
new file mode 100644 (file)
index 0000000..c778a5f
--- /dev/null
@@ -0,0 +1,37 @@
+From 2f151994a6bc434c2b2184771e995f9ad5c65e09 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 3 Jan 2021 22:36:22 +0100
+Subject: misdn: dsp: select CONFIG_BITREVERSE
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+[ Upstream commit 51049bd903a81307f751babe15a1df8d197884e8 ]
+
+Without this, we run into a link error
+
+arm-linux-gnueabi-ld: drivers/isdn/mISDN/dsp_audio.o: in function `dsp_audio_generate_law_tables':
+(.text+0x30c): undefined reference to `byte_rev_table'
+arm-linux-gnueabi-ld: drivers/isdn/mISDN/dsp_audio.o:(.text+0x5e4): more undefined references to `byte_rev_table' follow
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/isdn/mISDN/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/isdn/mISDN/Kconfig b/drivers/isdn/mISDN/Kconfig
+index 26cf0ac9c4ad0..c9a53c2224728 100644
+--- a/drivers/isdn/mISDN/Kconfig
++++ b/drivers/isdn/mISDN/Kconfig
+@@ -13,6 +13,7 @@ if MISDN != n
+ config MISDN_DSP
+       tristate "Digital Audio Processing of transparent data"
+       depends on MISDN
++      select BITREVERSE
+       help
+         Enable support for digital audio processing capability.
+-- 
+2.27.0
+
diff --git a/queue-5.4/net-ethernet-fs_enet-add-missing-module_license.patch b/queue-5.4/net-ethernet-fs_enet-add-missing-module_license.patch
new file mode 100644 (file)
index 0000000..d246dd4
--- /dev/null
@@ -0,0 +1,48 @@
+From 240c40f0615358568885b4a76511d10ac05ee216 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Jan 2021 20:15:15 +1100
+Subject: net: ethernet: fs_enet: Add missing MODULE_LICENSE
+
+From: Michael Ellerman <mpe@ellerman.id.au>
+
+[ Upstream commit 445c6198fe7be03b7d38e66fe8d4b3187bc251d4 ]
+
+Since commit 1d6cd3929360 ("modpost: turn missing MODULE_LICENSE()
+into error") the ppc32_allmodconfig build fails with:
+
+  ERROR: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/freescale/fs_enet/mii-fec.o
+  ERROR: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/freescale/fs_enet/mii-bitbang.o
+
+Add the missing MODULE_LICENSEs to fix the build. Both files include a
+copyright header indicating they are GPL v2.
+
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c | 1 +
+ drivers/net/ethernet/freescale/fs_enet/mii-fec.c     | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
+index c8e5d889bd81f..21de56345503f 100644
+--- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
++++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
+@@ -223,3 +223,4 @@ static struct platform_driver fs_enet_bb_mdio_driver = {
+ };
+ module_platform_driver(fs_enet_bb_mdio_driver);
++MODULE_LICENSE("GPL");
+diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
+index 1582d82483eca..4e6a9c5d8af55 100644
+--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
++++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
+@@ -224,3 +224,4 @@ static struct platform_driver fs_enet_fec_mdio_driver = {
+ };
+ module_platform_driver(fs_enet_fec_mdio_driver);
++MODULE_LICENSE("GPL");
+-- 
+2.27.0
+
diff --git a/queue-5.4/netfilter-ipset-fixes-possible-oops-in-mtype_resize.patch b/queue-5.4/netfilter-ipset-fixes-possible-oops-in-mtype_resize.patch
new file mode 100644 (file)
index 0000000..f93143c
--- /dev/null
@@ -0,0 +1,80 @@
+From ab44eb780af0f1d97cbdd40b895fbe2b526fd2df Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 17 Dec 2020 11:53:40 +0300
+Subject: netfilter: ipset: fixes possible oops in mtype_resize
+
+From: Vasily Averin <vvs@virtuozzo.com>
+
+[ Upstream commit 2b33d6ffa9e38f344418976b06057e2fc2aa9e2a ]
+
+currently mtype_resize() can cause oops
+
+        t = ip_set_alloc(htable_size(htable_bits));
+        if (!t) {
+                ret = -ENOMEM;
+                goto out;
+        }
+        t->hregion = ip_set_alloc(ahash_sizeof_regions(htable_bits));
+
+Increased htable_bits can force htable_size() to return 0.
+In own turn ip_set_alloc(0) returns not 0 but ZERO_SIZE_PTR,
+so follwoing access to t->hregion should trigger an OOPS.
+
+Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
+Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/netfilter/ipset/ip_set_hash_gen.h | 22 +++++++++++++---------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
+index 1a58cfdb862d6..500de37858ac8 100644
+--- a/net/netfilter/ipset/ip_set_hash_gen.h
++++ b/net/netfilter/ipset/ip_set_hash_gen.h
+@@ -630,7 +630,7 @@ mtype_resize(struct ip_set *set, bool retried)
+       struct htype *h = set->data;
+       struct htable *t, *orig;
+       u8 htable_bits;
+-      size_t dsize = set->dsize;
++      size_t hsize, dsize = set->dsize;
+ #ifdef IP_SET_HASH_WITH_NETS
+       u8 flags;
+       struct mtype_elem *tmp;
+@@ -654,14 +654,12 @@ mtype_resize(struct ip_set *set, bool retried)
+ retry:
+       ret = 0;
+       htable_bits++;
+-      if (!htable_bits) {
+-              /* In case we have plenty of memory :-) */
+-              pr_warn("Cannot increase the hashsize of set %s further\n",
+-                      set->name);
+-              ret = -IPSET_ERR_HASH_FULL;
+-              goto out;
+-      }
+-      t = ip_set_alloc(htable_size(htable_bits));
++      if (!htable_bits)
++              goto hbwarn;
++      hsize = htable_size(htable_bits);
++      if (!hsize)
++              goto hbwarn;
++      t = ip_set_alloc(hsize);
+       if (!t) {
+               ret = -ENOMEM;
+               goto out;
+@@ -803,6 +801,12 @@ cleanup:
+       if (ret == -EAGAIN)
+               goto retry;
+       goto out;
++
++hbwarn:
++      /* In case we have plenty of memory :-) */
++      pr_warn("Cannot increase the hashsize of set %s further\n", set->name);
++      ret = -IPSET_ERR_HASH_FULL;
++      goto out;
+ }
+ /* Get the current number of elements and ext_size in the set  */
+-- 
+2.27.0
+
diff --git a/queue-5.4/nvme-pci-mark-samsung-pm1725a-as-ignore_dev_subnqn.patch b/queue-5.4/nvme-pci-mark-samsung-pm1725a-as-ignore_dev_subnqn.patch
new file mode 100644 (file)
index 0000000..28a7491
--- /dev/null
@@ -0,0 +1,41 @@
+From 60d86d14184867b48e3d8b560633ee579864736f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 4 Dec 2020 21:46:57 +0530
+Subject: nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN
+
+From: Gopal Tiwari <gtiwari@redhat.com>
+
+[ Upstream commit 7ee5c78ca3895d44e918c38332921983ed678be0 ]
+
+A system with more than one of these SSDs will only have one usable.
+Hence the kernel fails to detect nvme devices due to duplicate cntlids.
+
+[    6.274554] nvme nvme1: Duplicate cntlid 33 with nvme0, rejecting
+[    6.274566] nvme nvme1: Removing after probe failure status: -22
+
+Adding the NVME_QUIRK_IGNORE_DEV_SUBNQN quirk to resolves the issue.
+
+Signed-off-by: Gopal Tiwari <gtiwari@redhat.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/host/pci.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
+index 9b1fc8633cfe1..ef93bd3ed339c 100644
+--- a/drivers/nvme/host/pci.c
++++ b/drivers/nvme/host/pci.c
+@@ -3145,7 +3145,8 @@ static const struct pci_device_id nvme_id_table[] = {
+       { PCI_DEVICE(0x144d, 0xa821),   /* Samsung PM1725 */
+               .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
+       { PCI_DEVICE(0x144d, 0xa822),   /* Samsung PM1725a */
+-              .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
++              .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
++                              NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+       { PCI_DEVICE(0x1d1d, 0x1f1f),   /* LighNVM qemu device */
+               .driver_data = NVME_QUIRK_LIGHTNVM, },
+       { PCI_DEVICE(0x1d1d, 0x2807),   /* CNEX WL */
+-- 
+2.27.0
+
diff --git a/queue-5.4/nvmet-rdma-fix-list_del-corruption-on-queue-establis.patch b/queue-5.4/nvmet-rdma-fix-list_del-corruption-on-queue-establis.patch
new file mode 100644 (file)
index 0000000..8e5cde9
--- /dev/null
@@ -0,0 +1,52 @@
+From ed7938312fd9219cffdd34a9bb887d54afa25268 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Jan 2021 10:46:54 +0200
+Subject: nvmet-rdma: Fix list_del corruption on queue establishment failure
+
+From: Israel Rukshin <israelr@nvidia.com>
+
+[ Upstream commit 9ceb7863537748c67fa43ac4f2f565819bbd36e4 ]
+
+When a queue is in NVMET_RDMA_Q_CONNECTING state, it may has some
+requests at rsp_wait_list. In case a disconnect occurs at this
+state, no one will empty this list and will return the requests to
+free_rsps list. Normally nvmet_rdma_queue_established() free those
+requests after moving the queue to NVMET_RDMA_Q_LIVE state, but in
+this case __nvmet_rdma_queue_disconnect() is called before. The
+crash happens at nvmet_rdma_free_rsps() when calling
+list_del(&rsp->free_list), because the request exists only at
+the wait list. To fix the issue, simply clear rsp_wait_list when
+destroying the queue.
+
+Signed-off-by: Israel Rukshin <israelr@nvidia.com>
+Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvme/target/rdma.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
+index b5314164479e9..50e2007092bc0 100644
+--- a/drivers/nvme/target/rdma.c
++++ b/drivers/nvme/target/rdma.c
+@@ -1351,6 +1351,16 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
+       spin_lock_irqsave(&queue->state_lock, flags);
+       switch (queue->state) {
+       case NVMET_RDMA_Q_CONNECTING:
++              while (!list_empty(&queue->rsp_wait_list)) {
++                      struct nvmet_rdma_rsp *rsp;
++
++                      rsp = list_first_entry(&queue->rsp_wait_list,
++                                             struct nvmet_rdma_rsp,
++                                             wait_list);
++                      list_del(&rsp->wait_list);
++                      nvmet_rdma_put_rsp(rsp);
++              }
++              fallthrough;
+       case NVMET_RDMA_Q_LIVE:
+               queue->state = NVMET_RDMA_Q_DISCONNECTING;
+               disconnect = true;
+-- 
+2.27.0
+
diff --git a/queue-5.4/regulator-bd718x7-add-enable-times.patch b/queue-5.4/regulator-bd718x7-add-enable-times.patch
new file mode 100644 (file)
index 0000000..75c3bab
--- /dev/null
@@ -0,0 +1,290 @@
+From 25db8485a4ed076aaec7668513c73e8c6c8e7543 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 18 Dec 2020 19:38:07 +0100
+Subject: regulator: bd718x7: Add enable times
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Guido Günther <agx@sigxcpu.org>
+
+[ Upstream commit 3b66e4a8e58a85af3212c7117d7a29c9ef6679a2 ]
+
+Use the typical startup times from the data sheet so boards get a
+reasonable default. Not setting any enable time can lead to board hangs
+when e.g. clocks are enabled too soon afterwards.
+
+This fixes gpu power domain resume on the Librem 5.
+
+[Moved #defines into driver, seems to be general agreement and avoids any
+cross tree issues -- broonie]
+
+Signed-off-by: Guido Günther <agx@sigxcpu.org>
+Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+Link: https://lore.kernel.org/r/41fb2ed19f584f138336344e2297ae7301f72b75.1608316658.git.agx@sigxcpu.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/regulator/bd718x7-regulator.c | 57 +++++++++++++++++++++++++++
+ 1 file changed, 57 insertions(+)
+
+diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
+index bdab46a5c4617..6c431456d2983 100644
+--- a/drivers/regulator/bd718x7-regulator.c
++++ b/drivers/regulator/bd718x7-regulator.c
+@@ -15,6 +15,36 @@
+ #include <linux/regulator/of_regulator.h>
+ #include <linux/slab.h>
++/* Typical regulator startup times as per data sheet in uS */
++#define BD71847_BUCK1_STARTUP_TIME 144
++#define BD71847_BUCK2_STARTUP_TIME 162
++#define BD71847_BUCK3_STARTUP_TIME 162
++#define BD71847_BUCK4_STARTUP_TIME 240
++#define BD71847_BUCK5_STARTUP_TIME 270
++#define BD71847_BUCK6_STARTUP_TIME 200
++#define BD71847_LDO1_STARTUP_TIME  440
++#define BD71847_LDO2_STARTUP_TIME  370
++#define BD71847_LDO3_STARTUP_TIME  310
++#define BD71847_LDO4_STARTUP_TIME  400
++#define BD71847_LDO5_STARTUP_TIME  530
++#define BD71847_LDO6_STARTUP_TIME  400
++
++#define BD71837_BUCK1_STARTUP_TIME 160
++#define BD71837_BUCK2_STARTUP_TIME 180
++#define BD71837_BUCK3_STARTUP_TIME 180
++#define BD71837_BUCK4_STARTUP_TIME 180
++#define BD71837_BUCK5_STARTUP_TIME 160
++#define BD71837_BUCK6_STARTUP_TIME 240
++#define BD71837_BUCK7_STARTUP_TIME 220
++#define BD71837_BUCK8_STARTUP_TIME 200
++#define BD71837_LDO1_STARTUP_TIME  440
++#define BD71837_LDO2_STARTUP_TIME  370
++#define BD71837_LDO3_STARTUP_TIME  310
++#define BD71837_LDO4_STARTUP_TIME  400
++#define BD71837_LDO5_STARTUP_TIME  310
++#define BD71837_LDO6_STARTUP_TIME  400
++#define BD71837_LDO7_STARTUP_TIME  530
++
+ /*
+  * BUCK1/2/3/4
+  * BUCK1RAMPRATE[1:0] BUCK1 DVS ramp rate setting
+@@ -495,6 +525,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD718XX_REG_BUCK1_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK1_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck1_set_hw_dvs_levels,
+               },
+@@ -519,6 +550,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD718XX_REG_BUCK2_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK2_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck2_set_hw_dvs_levels,
+               },
+@@ -547,6 +579,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .linear_range_selectors = bd71847_buck3_volt_range_sel,
+                       .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK3_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -574,6 +607,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_range_mask = BD71847_BUCK4_RANGE_MASK,
+                       .linear_range_selectors = bd71847_buck4_volt_range_sel,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK4_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -596,6 +630,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK,
+                       .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK5_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -620,6 +655,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK,
+                       .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71847_BUCK6_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -646,6 +682,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .linear_range_selectors = bd718xx_ldo1_volt_range_sel,
+                       .enable_reg = BD718XX_REG_LDO1_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO1_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -668,6 +705,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .n_voltages = ARRAY_SIZE(ldo_2_volts),
+                       .enable_reg = BD718XX_REG_LDO2_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO2_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -691,6 +729,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = BD718XX_LDO3_MASK,
+                       .enable_reg = BD718XX_REG_LDO3_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO3_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -714,6 +753,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = BD718XX_LDO4_MASK,
+                       .enable_reg = BD718XX_REG_LDO4_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO4_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -740,6 +780,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .linear_range_selectors = bd71847_ldo5_volt_range_sel,
+                       .enable_reg = BD718XX_REG_LDO5_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO5_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -765,6 +806,7 @@ static const struct bd718xx_regulator_data bd71847_regulators[] = {
+                       .vsel_mask = BD718XX_LDO6_MASK,
+                       .enable_reg = BD718XX_REG_LDO6_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71847_LDO6_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -791,6 +833,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD718XX_REG_BUCK1_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK1_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck1_set_hw_dvs_levels,
+               },
+@@ -815,6 +858,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD718XX_REG_BUCK2_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK2_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck2_set_hw_dvs_levels,
+               },
+@@ -839,6 +883,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD71837_REG_BUCK3_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK3_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck3_set_hw_dvs_levels,
+               },
+@@ -863,6 +908,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = DVS_BUCK_RUN_MASK,
+                       .enable_reg = BD71837_REG_BUCK4_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK4_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+                       .of_parse_cb = buck4_set_hw_dvs_levels,
+               },
+@@ -891,6 +937,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .linear_range_selectors = bd71837_buck5_volt_range_sel,
+                       .enable_reg = BD718XX_REG_1ST_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK5_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -915,6 +962,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD71837_BUCK6_MASK,
+                       .enable_reg = BD718XX_REG_2ND_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK6_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -937,6 +985,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD718XX_3RD_NODVS_BUCK_MASK,
+                       .enable_reg = BD718XX_REG_3RD_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK7_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -961,6 +1010,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD718XX_4TH_NODVS_BUCK_MASK,
+                       .enable_reg = BD718XX_REG_4TH_NODVS_BUCK_CTRL,
+                       .enable_mask = BD718XX_BUCK_EN,
++                      .enable_time = BD71837_BUCK8_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -987,6 +1037,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .linear_range_selectors = bd718xx_ldo1_volt_range_sel,
+                       .enable_reg = BD718XX_REG_LDO1_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO1_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1009,6 +1060,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .n_voltages = ARRAY_SIZE(ldo_2_volts),
+                       .enable_reg = BD718XX_REG_LDO2_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO2_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1032,6 +1084,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD718XX_LDO3_MASK,
+                       .enable_reg = BD718XX_REG_LDO3_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO3_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1055,6 +1108,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD718XX_LDO4_MASK,
+                       .enable_reg = BD718XX_REG_LDO4_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO4_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1080,6 +1134,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD71837_LDO5_MASK,
+                       .enable_reg = BD718XX_REG_LDO5_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO5_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1107,6 +1162,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD718XX_LDO6_MASK,
+                       .enable_reg = BD718XX_REG_LDO6_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO6_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+@@ -1132,6 +1188,7 @@ static const struct bd718xx_regulator_data bd71837_regulators[] = {
+                       .vsel_mask = BD71837_LDO7_MASK,
+                       .enable_reg = BD71837_REG_LDO7_VOLT,
+                       .enable_mask = BD718XX_LDO_EN,
++                      .enable_time = BD71837_LDO7_STARTUP_TIME,
+                       .owner = THIS_MODULE,
+               },
+               .init = {
+-- 
+2.27.0
+
diff --git a/queue-5.4/selftests-fix-the-return-value-for-udp-gro-test.patch b/queue-5.4/selftests-fix-the-return-value-for-udp-gro-test.patch
new file mode 100644 (file)
index 0000000..b8b4d0c
--- /dev/null
@@ -0,0 +1,138 @@
+From 6c8e3b57673e7799a02a2e82365dedd34d0fa113 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Jan 2021 18:17:40 +0800
+Subject: selftests: fix the return value for UDP GRO test
+
+From: Po-Hsu Lin <po-hsu.lin@canonical.com>
+
+[ Upstream commit 3503ee6c0bec5f173d606359e6384a5ef85492fb ]
+
+The udpgro.sh will always return 0 (unless the bpf selftest was not
+build first) even if there are some failed sub test-cases.
+
+Therefore the kselftest framework will report this case is OK.
+
+Check and return the exit status of each test to make it easier to
+spot real failures.
+
+Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/net/udpgro.sh | 34 +++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+
+diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh
+index ac2a30be9b325..f8a19f548ae9d 100755
+--- a/tools/testing/selftests/net/udpgro.sh
++++ b/tools/testing/selftests/net/udpgro.sh
+@@ -5,6 +5,14 @@
+ readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
++# set global exit status, but never reset nonzero one.
++check_err()
++{
++      if [ $ret -eq 0 ]; then
++              ret=$1
++      fi
++}
++
+ cleanup() {
+       local -r jobs="$(jobs -p)"
+       local -r ns="$(ip netns list|grep $PEER_NS)"
+@@ -44,7 +52,9 @@ run_one() {
+       # Hack: let bg programs complete the startup
+       sleep 0.1
+       ./udpgso_bench_tx ${tx_args}
++      ret=$?
+       wait $(jobs -p)
++      return $ret
+ }
+ run_test() {
+@@ -87,8 +97,10 @@ run_one_nat() {
+       sleep 0.1
+       ./udpgso_bench_tx ${tx_args}
++      ret=$?
+       kill -INT $pid
+       wait $(jobs -p)
++      return $ret
+ }
+ run_one_2sock() {
+@@ -110,7 +122,9 @@ run_one_2sock() {
+       sleep 0.1
+       # first UDP GSO socket should be closed at this point
+       ./udpgso_bench_tx ${tx_args}
++      ret=$?
+       wait $(jobs -p)
++      return $ret
+ }
+ run_nat_test() {
+@@ -131,36 +145,54 @@ run_all() {
+       local -r core_args="-l 4"
+       local -r ipv4_args="${core_args} -4 -D 192.168.1.1"
+       local -r ipv6_args="${core_args} -6 -D 2001:db8::1"
++      ret=0
+       echo "ipv4"
+       run_test "no GRO" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400"
++      check_err $?
+       # explicitly check we are not receiving UDP_SEGMENT cmsg (-S -1)
+       # when GRO does not take place
+       run_test "no GRO chk cmsg" "${ipv4_args} -M 10 -s 1400" "-4 -n 10 -l 1400 -S -1"
++      check_err $?
+       # the GSO packets are aggregated because:
+       # * veth schedule napi after each xmit
+       # * segmentation happens in BH context, veth napi poll is delayed after
+       #   the transmission of the last segment
+       run_test "GRO" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720"
++      check_err $?
+       run_test "GRO chk cmsg" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472"
++      check_err $?
+       run_test "GRO with custom segment size" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720"
++      check_err $?
+       run_test "GRO with custom segment size cmsg" "${ipv4_args} -M 1 -s 14720 -S 500 " "-4 -n 1 -l 14720 -S 500"
++      check_err $?
+       run_nat_test "bad GRO lookup" "${ipv4_args} -M 1 -s 14720 -S 0" "-n 10 -l 1472"
++      check_err $?
+       run_2sock_test "multiple GRO socks" "${ipv4_args} -M 1 -s 14720 -S 0 " "-4 -n 1 -l 14720 -S 1472"
++      check_err $?
+       echo "ipv6"
+       run_test "no GRO" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400"
++      check_err $?
+       run_test "no GRO chk cmsg" "${ipv6_args} -M 10 -s 1400" "-n 10 -l 1400 -S -1"
++      check_err $?
+       run_test "GRO" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520"
++      check_err $?
+       run_test "GRO chk cmsg" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 1 -l 14520 -S 1452"
++      check_err $?
+       run_test "GRO with custom segment size" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520"
++      check_err $?
+       run_test "GRO with custom segment size cmsg" "${ipv6_args} -M 1 -s 14520 -S 500" "-n 1 -l 14520 -S 500"
++      check_err $?
+       run_nat_test "bad GRO lookup" "${ipv6_args} -M 1 -s 14520 -S 0" "-n 10 -l 1452"
++      check_err $?
+       run_2sock_test "multiple GRO socks" "${ipv6_args} -M 1 -s 14520 -S 0 " "-n 1 -l 14520 -S 1452"
++      check_err $?
++      return $ret
+ }
+ if [ ! -f ../bpf/xdp_dummy.o ]; then
+@@ -180,3 +212,5 @@ elif [[ $1 == "__subprocess_2sock" ]]; then
+       shift
+       run_one_2sock $@
+ fi
++
++exit $?
+-- 
+2.27.0
+
index 109a18e5a128951a1d168f0557ec9485e56fc041..f898794befcf194cb27f1e7befd2b15b4314b1c3 100644 (file)
@@ -22,3 +22,28 @@ ext4-don-t-leak-old-mountpoint-samples.patch
 smb3-remove-unused-flag-passed-into-close-functions.patch
 cifs-fix-interrupted-close-commands.patch
 dm-integrity-fix-flush-with-external-metadata-device.patch
+arc-build-remove-non-existing-bootpimage-from-kbuild.patch
+arc-build-add-uimage.lzma-to-the-top-level-target.patch
+arc-build-add-boot_targets-to-phony.patch
+arc-build-move-symlink-creation-to-arch-arc-makefile.patch
+netfilter-ipset-fixes-possible-oops-in-mtype_resize.patch
+btrfs-fix-transaction-leak-and-crash-after-ro-remoun.patch
+regulator-bd718x7-add-enable-times.patch
+ethernet-ucc_geth-fix-definition-and-size-of-ucc_get.patch
+habanalabs-register-to-pci-shutdown-callback.patch
+habanalabs-fix-memleak-in-hl_device_reset.patch
+hwmon-pwm-fan-ensure-that-calculation-doesn-t-discar.patch
+lib-raid6-let-unroll-rules-work-with-macos-userland.patch
+dmaengine-stm32-mdma-fix-stm32_mdma_very_high_priori.patch
+bfq-fix-computation-of-shallow-depth.patch
+arch-arc-add-copy_user_page-to-asm-page.h-to-fix-bui.patch
+misdn-dsp-select-config_bitreverse.patch
+net-ethernet-fs_enet-add-missing-module_license.patch
+selftests-fix-the-return-value-for-udp-gro-test.patch
+nvme-pci-mark-samsung-pm1725a-as-ignore_dev_subnqn.patch
+nvmet-rdma-fix-list_del-corruption-on-queue-establis.patch
+drm-amdgpu-fix-a-gpu-hang-issue-when-remove-device.patch
+usb-typec-fix-copy-paste-error-for-nvidia-alt-mode-d.patch
+acpi-scan-add-stub-acpi_create_platform_device-for-c.patch
+drm-msm-call-msm_init_vram-before-binding-the-gpu.patch
+arm-picoxcell-fix-missing-interrupt-parent-propertie.patch
diff --git a/queue-5.4/usb-typec-fix-copy-paste-error-for-nvidia-alt-mode-d.patch b/queue-5.4/usb-typec-fix-copy-paste-error-for-nvidia-alt-mode-d.patch
new file mode 100644 (file)
index 0000000..90eb971
--- /dev/null
@@ -0,0 +1,38 @@
+From e99be7b4be97523912529b6b7d23d588b9737280 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 6 Jan 2021 00:16:05 +0000
+Subject: usb: typec: Fix copy paste error for NVIDIA alt-mode description
+
+From: Peter Robinson <pbrobinson@gmail.com>
+
+[ Upstream commit 41952a66015466c3208aac96b14ffd92e0943589 ]
+
+The name of the module for the NVIDIA alt-mode is incorrect as it
+looks to be a copy-paste error from the entry above, update it to
+the correct typec_nvidia module name.
+
+Cc: Ajay Gupta <ajayg@nvidia.com>
+Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
+Link: https://lore.kernel.org/r/20210106001605.167917-1-pbrobinson@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/usb/typec/altmodes/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/usb/typec/altmodes/Kconfig b/drivers/usb/typec/altmodes/Kconfig
+index 187690fd1a5bd..60d375e9c3c7c 100644
+--- a/drivers/usb/typec/altmodes/Kconfig
++++ b/drivers/usb/typec/altmodes/Kconfig
+@@ -20,6 +20,6 @@ config TYPEC_NVIDIA_ALTMODE
+         to enable support for VirtualLink devices with NVIDIA GPUs.
+         To compile this driver as a module, choose M here: the
+-        module will be called typec_displayport.
++        module will be called typec_nvidia.
+ endmenu
+-- 
+2.27.0
+