From: Greg Kroah-Hartman Date: Tue, 3 Nov 2020 19:54:56 +0000 (+0100) Subject: 5.9-stable patches X-Git-Tag: v4.14.204~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18dc5d8f04741b9e57a64e359416a889b25908ed;p=thirdparty%2Fkernel%2Fstable-queue.git 5.9-stable patches added patches: arm-aspeed-g5-do-not-set-sirq-polarity.patch arm-config-aspeed-fix-selection-of-media-drivers.patch arm-dts-mt7623-add-missing-pause-for-switchport.patch arm-dts-s5pv210-fix-pinctrl-property-of-vibrator-en-regulator-in-aries.patch arm-s3c24xx-fix-missing-system-reset.patch arm-samsung-fix-pm-debug-build-with-debug_ll-but-mmu.patch arm64-berlin-select-dw_apb_timer_of.patch arm64-change-.weak-to-sym_func_start_weak_pi-for-arch-arm64-lib-mem-.s.patch arm64-dts-marvell-espressobin-add-ethernet-switch-aliases.patch cachefiles-handle-readpage-error-correctly.patch coresight-cti-initialize-dynamic-sysfs-attributes.patch cpufreq-schedutil-always-call-driver-if-cpufreq_need_update_limits-is-set.patch device-property-don-t-clear-secondary-pointer-for-shared-primary-firmware-node.patch device-property-keep-secondary-firmware-node-secondary-by-type.patch drm-amd-pm-fix-pp_dpm_fclk.patch drm-amd-pm-increase-mclk-switch-threshold-to-200-us.patch drm-amd-psp-fix-sysfs-cannot-create-duplicate-filename.patch drm-amd-swsmu-add-missing-feature-map-for-sienna_cichlid.patch drm-amdgpu-correct-the-cu-and-rb-info-for-sienna-cichlid.patch drm-amdgpu-swsmu-drop-smu-i2c-bus-on-navi1x.patch hil-parisc-disable-hil-driver-when-it-gets-stuck.patch kvm-arm64-fix-aarch32-handling-of-dbgd-ccint-scrext-and-dbgvcr.patch kvm-x86-fix-null-dereference-at-kvm_msr_ignored_check.patch null_blk-synchronization-fix-for-zoned-device.patch staging-comedi-cb_pcidas-allow-2-channel-commands-for-ao-subdevice.patch staging-fieldbus-anybuss-jump-to-correct-label-in-an-error-path.patch staging-octeon-drop-on-uncorrectable-alignment-or-fcs-error.patch staging-octeon-repair-fixed-link-support.patch stop_machine-rcu-mark-functions-as-notrace.patch time-prevent-undefined-behaviour-in-timespec64_to_ns.patch time-sched_clock-mark-sched_clock_read_begin-retry-as-notrace.patch tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch vdpa-mlx5-fix-error-return-in-map_direct_mr.patch vhost_vdpa-return-efault-if-copy_from_user-fails.patch --- diff --git a/queue-5.9/arm-aspeed-g5-do-not-set-sirq-polarity.patch b/queue-5.9/arm-aspeed-g5-do-not-set-sirq-polarity.patch new file mode 100644 index 00000000000..43de8065c2f --- /dev/null +++ b/queue-5.9/arm-aspeed-g5-do-not-set-sirq-polarity.patch @@ -0,0 +1,45 @@ +From c82bf6e133d30e0f9172a20807814fa28aef0f67 Mon Sep 17 00:00:00 2001 +From: Joel Stanley +Date: Wed, 12 Aug 2020 20:54:00 +0930 +Subject: ARM: aspeed: g5: Do not set sirq polarity + +From: Joel Stanley + +commit c82bf6e133d30e0f9172a20807814fa28aef0f67 upstream. + +A feature was added to the aspeed vuart driver to configure the vuart +interrupt (sirq) polarity according to the LPC/eSPI strapping register. + +Systems that depend on a active low behaviour (sirq_polarity set to 0) +such as OpenPower boxes also use LPC, so this relationship does not +hold. Jeremy confirms that the s2600st which is strapped for eSPI also +does not have this relationship. + +The property was added for a Tyan S7106 system which is not supported +in the kernel tree. Should this or other systems wish to use this +feature of the driver they should add it to the machine specific device +tree. + +Fixes: c791fc76bc72 ("arm: dts: aspeed: Add vuart aspeed,sirq-polarity-sense...") +Signed-off-by: Joel Stanley +Tested-by: Jeremy Kerr +Reviewed-by: Jeremy Kerr +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200812112400.2406734-1-joel@jms.id.au +Signed-off-by: Joel Stanley +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/aspeed-g5.dtsi | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm/boot/dts/aspeed-g5.dtsi ++++ b/arch/arm/boot/dts/aspeed-g5.dtsi +@@ -425,7 +425,6 @@ + interrupts = <8>; + clocks = <&syscon ASPEED_CLK_APB>; + no-loopback-test; +- aspeed,sirq-polarity-sense = <&syscon 0x70 25>; + status = "disabled"; + }; + diff --git a/queue-5.9/arm-config-aspeed-fix-selection-of-media-drivers.patch b/queue-5.9/arm-config-aspeed-fix-selection-of-media-drivers.patch new file mode 100644 index 00000000000..03c0a23e60b --- /dev/null +++ b/queue-5.9/arm-config-aspeed-fix-selection-of-media-drivers.patch @@ -0,0 +1,58 @@ +From 98c3f0a1b3ef83f6be6b212c970bee795e1a0467 Mon Sep 17 00:00:00 2001 +From: Joel Stanley +Date: Wed, 26 Aug 2020 16:49:16 +0930 +Subject: ARM: config: aspeed: Fix selection of media drivers + +From: Joel Stanley + +commit 98c3f0a1b3ef83f6be6b212c970bee795e1a0467 upstream. + +In the 5.7 merge window the media kconfig was restructued. For most +platforms these changes set CONFIG_MEDIA_SUPPORT_FILTER=y which keeps +unwanted drivers disabled. + +The exception is if a config sets EMBEDDED or EXPERT (see b0cd4fb27665). +In that case the filter is set to =n, causing a bunch of DVB tuner drivers +(MEDIA_TUNER_*) to be accidentally enabled. This was noticed as it blew +out the build time for the Aspeed defconfigs. + +Enabling the filter means the Aspeed config also needs to set +CONFIG_MEDIA_PLATFORM_SUPPORT=y in order to have the CONFIG_VIDEO_ASPEED +driver enabled. + +Fixes: 06b93644f4d1 ("media: Kconfig: add an option to filter in/out platform drivers") +Fixes: b0cd4fb27665 ("media: Kconfig: on !EMBEDDED && !EXPERT, enable driver filtering") +Signed-off-by: Joel Stanley +Cc: stable@vger.kernel.org +CC: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/configs/aspeed_g4_defconfig | 3 ++- + arch/arm/configs/aspeed_g5_defconfig | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/arm/configs/aspeed_g4_defconfig ++++ b/arch/arm/configs/aspeed_g4_defconfig +@@ -160,7 +160,8 @@ CONFIG_SENSORS_TMP421=y + CONFIG_SENSORS_W83773G=y + CONFIG_WATCHDOG_SYSFS=y + CONFIG_MEDIA_SUPPORT=y +-CONFIG_MEDIA_CAMERA_SUPPORT=y ++CONFIG_MEDIA_SUPPORT_FILTER=y ++CONFIG_MEDIA_PLATFORM_SUPPORT=y + CONFIG_V4L_PLATFORM_DRIVERS=y + CONFIG_VIDEO_ASPEED=y + CONFIG_DRM=y +--- a/arch/arm/configs/aspeed_g5_defconfig ++++ b/arch/arm/configs/aspeed_g5_defconfig +@@ -175,7 +175,8 @@ CONFIG_SENSORS_TMP421=y + CONFIG_SENSORS_W83773G=y + CONFIG_WATCHDOG_SYSFS=y + CONFIG_MEDIA_SUPPORT=y +-CONFIG_MEDIA_CAMERA_SUPPORT=y ++CONFIG_MEDIA_SUPPORT_FILTER=y ++CONFIG_MEDIA_PLATFORM_SUPPORT=y + CONFIG_V4L_PLATFORM_DRIVERS=y + CONFIG_VIDEO_ASPEED=y + CONFIG_DRM=y diff --git a/queue-5.9/arm-dts-mt7623-add-missing-pause-for-switchport.patch b/queue-5.9/arm-dts-mt7623-add-missing-pause-for-switchport.patch new file mode 100644 index 00000000000..2be7018af41 --- /dev/null +++ b/queue-5.9/arm-dts-mt7623-add-missing-pause-for-switchport.patch @@ -0,0 +1,33 @@ +From 36f0a5fc5284838c544218666c63ee8cfa46a9c3 Mon Sep 17 00:00:00 2001 +From: Frank Wunderlich +Date: Mon, 7 Sep 2020 09:05:17 +0200 +Subject: arm: dts: mt7623: add missing pause for switchport + +From: Frank Wunderlich + +commit 36f0a5fc5284838c544218666c63ee8cfa46a9c3 upstream. + +port6 of mt7530 switch (= cpu port 0) on bananapi-r2 misses pause option +which causes rx drops on running iperf. + +Fixes: f4ff257cd160 ("arm: dts: mt7623: add support for Bananapi R2 (BPI-R2) board") +Signed-off-by: Frank Wunderlich +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200907070517.51715-1-linux@fw-web.de +Signed-off-by: Matthias Brugger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts ++++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +@@ -192,6 +192,7 @@ + fixed-link { + speed = <1000>; + full-duplex; ++ pause; + }; + }; + }; diff --git a/queue-5.9/arm-dts-s5pv210-fix-pinctrl-property-of-vibrator-en-regulator-in-aries.patch b/queue-5.9/arm-dts-s5pv210-fix-pinctrl-property-of-vibrator-en-regulator-in-aries.patch new file mode 100644 index 00000000000..daef3f29059 --- /dev/null +++ b/queue-5.9/arm-dts-s5pv210-fix-pinctrl-property-of-vibrator-en-regulator-in-aries.patch @@ -0,0 +1,34 @@ +From 2c6658c607a3af2ed7bd41dc57a3dd31537d023e Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 7 Sep 2020 18:11:20 +0200 +Subject: ARM: dts: s5pv210: fix pinctrl property of "vibrator-en" regulator in Aries + +From: Krzysztof Kozlowski + +commit 2c6658c607a3af2ed7bd41dc57a3dd31537d023e upstream. + +Fix typo in pinctrl property of "vibrator-en" fixed regulator in Aries +family of boards. The error caused lack of pin configuration for the +GPIO used in vibrator. + +Fixes: 04568cb58a43 ("ARM: dts: s5pv210: Disable pull for vibrator enable GPIO on Aries boards") +Signed-off-by: Krzysztof Kozlowski +Cc: +Link: https://lore.kernel.org/r/20200907161141.31034-5-krzk@kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/s5pv210-aries.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/s5pv210-aries.dtsi ++++ b/arch/arm/boot/dts/s5pv210-aries.dtsi +@@ -66,7 +66,7 @@ + gpio = <&gpj1 1 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; +- pinctr-0 = <&vibrator_ena>; ++ pinctrl-0 = <&vibrator_ena>; + }; + + touchkey_vdd: regulator-fixed-1 { diff --git a/queue-5.9/arm-s3c24xx-fix-missing-system-reset.patch b/queue-5.9/arm-s3c24xx-fix-missing-system-reset.patch new file mode 100644 index 00000000000..82ca9615c7d --- /dev/null +++ b/queue-5.9/arm-s3c24xx-fix-missing-system-reset.patch @@ -0,0 +1,36 @@ +From f6d7cde84f6c5551586c8b9b68d70f8e6dc9a000 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Tue, 4 Aug 2020 21:26:49 +0200 +Subject: ARM: s3c24xx: fix missing system reset + +From: Krzysztof Kozlowski + +commit f6d7cde84f6c5551586c8b9b68d70f8e6dc9a000 upstream. + +Commit f6361c6b3880 ("ARM: S3C24XX: remove separate restart code") +removed usage of the watchdog reset platform code in favor of the +Samsung SoC watchdog driver. However the latter was not selected thus +S3C24xx platforms lost reset abilities. + +Cc: +Fixes: f6361c6b3880 ("ARM: S3C24XX: remove separate restart code") +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -506,8 +506,10 @@ config ARCH_S3C24XX + select HAVE_S3C2410_WATCHDOG if WATCHDOG + select HAVE_S3C_RTC if RTC_CLASS + select NEED_MACH_IO_H ++ select S3C2410_WATCHDOG + select SAMSUNG_ATAGS + select USE_OF ++ select WATCHDOG + help + Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 + and S3C2450 SoCs based systems, such as the Simtec Electronics BAST diff --git a/queue-5.9/arm-samsung-fix-pm-debug-build-with-debug_ll-but-mmu.patch b/queue-5.9/arm-samsung-fix-pm-debug-build-with-debug_ll-but-mmu.patch new file mode 100644 index 00000000000..807bcc3e7f7 --- /dev/null +++ b/queue-5.9/arm-samsung-fix-pm-debug-build-with-debug_ll-but-mmu.patch @@ -0,0 +1,40 @@ +From 7be0d19c751b02db778ca95e3274d5ea7f31891c Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Thu, 10 Sep 2020 17:41:49 +0200 +Subject: ARM: samsung: fix PM debug build with DEBUG_LL but !MMU +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Krzysztof Kozlowski + +commit 7be0d19c751b02db778ca95e3274d5ea7f31891c upstream. + +Selecting CONFIG_SAMSUNG_PM_DEBUG (depending on CONFIG_DEBUG_LL) but +without CONFIG_MMU leads to build errors: + + arch/arm/plat-samsung/pm-debug.c: In function ‘s3c_pm_uart_base’: + arch/arm/plat-samsung/pm-debug.c:57:2: error: + implicit declaration of function ‘debug_ll_addr’ [-Werror=implicit-function-declaration] + +Fixes: 99b2fc2b8b40 ("ARM: SAMSUNG: Use debug_ll_addr() to get UART base address") +Reported-by: kernel test robot +Signed-off-by: Krzysztof Kozlowski +Cc: +Link: https://lore.kernel.org/r/20200910154150.3318-1-krzk@kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/plat-samsung/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/plat-samsung/Kconfig ++++ b/arch/arm/plat-samsung/Kconfig +@@ -241,6 +241,7 @@ config SAMSUNG_PM_DEBUG + depends on PM && DEBUG_KERNEL + depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on DEBUG_EXYNOS_UART || DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART ++ depends on DEBUG_LL && MMU + help + Say Y here if you want verbose debugging from the PM Suspend and + Resume code. See diff --git a/queue-5.9/arm64-berlin-select-dw_apb_timer_of.patch b/queue-5.9/arm64-berlin-select-dw_apb_timer_of.patch new file mode 100644 index 00000000000..9ed94019d01 --- /dev/null +++ b/queue-5.9/arm64-berlin-select-dw_apb_timer_of.patch @@ -0,0 +1,32 @@ +From b0fc70ce1f028e14a37c186d9f7a55e51439b83a Mon Sep 17 00:00:00 2001 +From: Jisheng Zhang +Date: Fri, 9 Oct 2020 15:08:31 +0800 +Subject: arm64: berlin: Select DW_APB_TIMER_OF + +From: Jisheng Zhang + +commit b0fc70ce1f028e14a37c186d9f7a55e51439b83a upstream. + +Berlin SoCs always contain some DW APB timers which can be used as an +always-on broadcast timer. + +Link: https://lore.kernel.org/r/20201009150536.214181fb@xhacker.debian +Cc: # v3.14+ +Signed-off-by: Jisheng Zhang +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/Kconfig.platforms | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/Kconfig.platforms ++++ b/arch/arm64/Kconfig.platforms +@@ -54,6 +54,7 @@ config ARCH_BCM_IPROC + config ARCH_BERLIN + bool "Marvell Berlin SoC Family" + select DW_APB_ICTL ++ select DW_APB_TIMER_OF + select GPIOLIB + select PINCTRL + help diff --git a/queue-5.9/arm64-change-.weak-to-sym_func_start_weak_pi-for-arch-arm64-lib-mem-.s.patch b/queue-5.9/arm64-change-.weak-to-sym_func_start_weak_pi-for-arch-arm64-lib-mem-.s.patch new file mode 100644 index 00000000000..dc2808f74ff --- /dev/null +++ b/queue-5.9/arm64-change-.weak-to-sym_func_start_weak_pi-for-arch-arm64-lib-mem-.s.patch @@ -0,0 +1,75 @@ +From ec9d78070de986ecf581ea204fd322af4d2477ec Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Thu, 29 Oct 2020 11:19:51 -0700 +Subject: arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S + +From: Fangrui Song + +commit ec9d78070de986ecf581ea204fd322af4d2477ec upstream. + +Commit 39d114ddc682 ("arm64: add KASAN support") added .weak directives to +arch/arm64/lib/mem*.S instead of changing the existing SYM_FUNC_START_PI +macros. This can lead to the assembly snippet `.weak memcpy ... .globl +memcpy` which will produce a STB_WEAK memcpy with GNU as but STB_GLOBAL +memcpy with LLVM's integrated assembler before LLVM 12. LLVM 12 (since +https://reviews.llvm.org/D90108) will error on such an overridden symbol +binding. + +Use the appropriate SYM_FUNC_START_WEAK_PI instead. + +Fixes: 39d114ddc682 ("arm64: add KASAN support") +Reported-by: Sami Tolvanen +Signed-off-by: Fangrui Song +Tested-by: Sami Tolvanen +Tested-by: Nick Desaulniers +Reviewed-by: Nick Desaulniers +Cc: +Link: https://lore.kernel.org/r/20201029181951.1866093-1-maskray@google.com +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/lib/memcpy.S | 3 +-- + arch/arm64/lib/memmove.S | 3 +-- + arch/arm64/lib/memset.S | 3 +-- + 3 files changed, 3 insertions(+), 6 deletions(-) + +--- a/arch/arm64/lib/memcpy.S ++++ b/arch/arm64/lib/memcpy.S +@@ -56,9 +56,8 @@ + stp \reg1, \reg2, [\ptr], \val + .endm + +- .weak memcpy + SYM_FUNC_START_ALIAS(__memcpy) +-SYM_FUNC_START_PI(memcpy) ++SYM_FUNC_START_WEAK_PI(memcpy) + #include "copy_template.S" + ret + SYM_FUNC_END_PI(memcpy) +--- a/arch/arm64/lib/memmove.S ++++ b/arch/arm64/lib/memmove.S +@@ -45,9 +45,8 @@ C_h .req x12 + D_l .req x13 + D_h .req x14 + +- .weak memmove + SYM_FUNC_START_ALIAS(__memmove) +-SYM_FUNC_START_PI(memmove) ++SYM_FUNC_START_WEAK_PI(memmove) + cmp dstin, src + b.lo __memcpy + add tmp1, src, count +--- a/arch/arm64/lib/memset.S ++++ b/arch/arm64/lib/memset.S +@@ -42,9 +42,8 @@ dst .req x8 + tmp3w .req w9 + tmp3 .req x9 + +- .weak memset + SYM_FUNC_START_ALIAS(__memset) +-SYM_FUNC_START_PI(memset) ++SYM_FUNC_START_WEAK_PI(memset) + mov dst, dstin /* Preserve return value. */ + and A_lw, val, #255 + orr A_lw, A_lw, A_lw, lsl #8 diff --git a/queue-5.9/arm64-dts-marvell-espressobin-add-ethernet-switch-aliases.patch b/queue-5.9/arm64-dts-marvell-espressobin-add-ethernet-switch-aliases.patch new file mode 100644 index 00000000000..3280c1fd6d5 --- /dev/null +++ b/queue-5.9/arm64-dts-marvell-espressobin-add-ethernet-switch-aliases.patch @@ -0,0 +1,142 @@ +From b64d814257b027e29a474bcd660f6372490138c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Mon, 7 Sep 2020 13:27:17 +0200 +Subject: arm64: dts: marvell: espressobin: Add ethernet switch aliases +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit b64d814257b027e29a474bcd660f6372490138c7 upstream. + +Espressobin boards have 3 ethernet ports and some of them got assigned more +then one MAC address. MAC addresses are stored in U-Boot environment. + +Since commit a2c7023f7075c ("net: dsa: read mac address from DT for slave +device") kernel can use MAC addresses from DT for particular DSA port. + +Currently Espressobin DTS file contains alias just for ethernet0. + +This patch defines additional ethernet aliases in Espressobin DTS files, so +bootloader can fill correct MAC address for DSA switch ports if more MAC +addresses were specified. + +DT alias ethernet1 is used for wan port, DT aliases ethernet2 and ethernet3 +are used for lan ports for both Espressobin revisions (V5 and V7). + +Fixes: 5253cb8c00a6f ("arm64: dts: marvell: espressobin: add ethernet alias") +Cc: # a2c7023f7075c: dsa: read mac address +Signed-off-by: Pali Rohár +Reviewed-by: Andrew Lunn +Reviewed-by: Andre Heider +Signed-off-by: Gregory CLEMENT +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts | 10 ++++++-- + arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts | 10 ++++++-- + arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi | 12 ++++++---- + 3 files changed, 24 insertions(+), 8 deletions(-) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts +@@ -20,17 +20,23 @@ + compatible = "globalscale,espressobin-v7-emmc", "globalscale,espressobin-v7", + "globalscale,espressobin", "marvell,armada3720", + "marvell,armada3710"; ++ ++ aliases { ++ /* ethernet1 is wan port */ ++ ethernet1 = &switch0port3; ++ ethernet3 = &switch0port1; ++ }; + }; + + &switch0 { + ports { +- port@1 { ++ switch0port1: port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&switch0phy0>; + }; + +- port@3 { ++ switch0port3: port@3 { + reg = <3>; + label = "wan"; + phy-handle = <&switch0phy2>; +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts +@@ -19,17 +19,23 @@ + model = "Globalscale Marvell ESPRESSOBin Board V7"; + compatible = "globalscale,espressobin-v7", "globalscale,espressobin", + "marvell,armada3720", "marvell,armada3710"; ++ ++ aliases { ++ /* ethernet1 is wan port */ ++ ethernet1 = &switch0port3; ++ ethernet3 = &switch0port1; ++ }; + }; + + &switch0 { + ports { +- port@1 { ++ switch0port1: port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&switch0phy0>; + }; + +- port@3 { ++ switch0port3: port@3 { + reg = <3>; + label = "wan"; + phy-handle = <&switch0phy2>; +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi +@@ -13,6 +13,10 @@ + / { + aliases { + ethernet0 = ð0; ++ /* for dsa slave device */ ++ ethernet1 = &switch0port1; ++ ethernet2 = &switch0port2; ++ ethernet3 = &switch0port3; + serial0 = &uart0; + serial1 = &uart1; + }; +@@ -120,7 +124,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- port@0 { ++ switch0port0: port@0 { + reg = <0>; + label = "cpu"; + ethernet = <ð0>; +@@ -131,19 +135,19 @@ + }; + }; + +- port@1 { ++ switch0port1: port@1 { + reg = <1>; + label = "wan"; + phy-handle = <&switch0phy0>; + }; + +- port@2 { ++ switch0port2: port@2 { + reg = <2>; + label = "lan0"; + phy-handle = <&switch0phy1>; + }; + +- port@3 { ++ switch0port3: port@3 { + reg = <3>; + label = "lan1"; + phy-handle = <&switch0phy2>; diff --git a/queue-5.9/cachefiles-handle-readpage-error-correctly.patch b/queue-5.9/cachefiles-handle-readpage-error-correctly.patch new file mode 100644 index 00000000000..452105061e4 --- /dev/null +++ b/queue-5.9/cachefiles-handle-readpage-error-correctly.patch @@ -0,0 +1,41 @@ +From 9480b4e75b7108ee68ecf5bc6b4bd68e8031c521 Mon Sep 17 00:00:00 2001 +From: "Matthew Wilcox (Oracle)" +Date: Mon, 26 Oct 2020 09:12:10 +0000 +Subject: cachefiles: Handle readpage error correctly + +From: Matthew Wilcox (Oracle) + +commit 9480b4e75b7108ee68ecf5bc6b4bd68e8031c521 upstream. + +If ->readpage returns an error, it has already unlocked the page. + +Fixes: 5e929b33c393 ("CacheFiles: Handle truncate unlocking the page we're reading") +Cc: stable@vger.kernel.org +Signed-off-by: Matthew Wilcox (Oracle) +Signed-off-by: David Howells +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cachefiles/rdwr.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/cachefiles/rdwr.c ++++ b/fs/cachefiles/rdwr.c +@@ -121,7 +121,7 @@ static int cachefiles_read_reissue(struc + _debug("reissue read"); + ret = bmapping->a_ops->readpage(NULL, backpage); + if (ret < 0) +- goto unlock_discard; ++ goto discard; + } + + /* but the page may have been read before the monitor was installed, so +@@ -138,6 +138,7 @@ static int cachefiles_read_reissue(struc + + unlock_discard: + unlock_page(backpage); ++discard: + spin_lock_irq(&object->work_lock); + list_del(&monitor->op_link); + spin_unlock_irq(&object->work_lock); diff --git a/queue-5.9/coresight-cti-initialize-dynamic-sysfs-attributes.patch b/queue-5.9/coresight-cti-initialize-dynamic-sysfs-attributes.patch new file mode 100644 index 00000000000..6d36024dc7c --- /dev/null +++ b/queue-5.9/coresight-cti-initialize-dynamic-sysfs-attributes.patch @@ -0,0 +1,77 @@ +From 80624263fa289b3416f7ca309491f1b75e579477 Mon Sep 17 00:00:00 2001 +From: Suzuki K Poulose +Date: Thu, 29 Oct 2020 10:45:58 -0600 +Subject: coresight: cti: Initialize dynamic sysfs attributes + +From: Suzuki K Poulose + +commit 80624263fa289b3416f7ca309491f1b75e579477 upstream. + +With LOCKDEP enabled, CTI driver triggers the following splat due +to uninitialized lock class for dynamically allocated attribute +objects. + +[ 5.372901] coresight etm0: CPU0: ETM v4.0 initialized +[ 5.376694] coresight etm1: CPU1: ETM v4.0 initialized +[ 5.380785] coresight etm2: CPU2: ETM v4.0 initialized +[ 5.385851] coresight etm3: CPU3: ETM v4.0 initialized +[ 5.389808] BUG: key ffff00000564a798 has not been registered! +[ 5.392456] ------------[ cut here ]------------ +[ 5.398195] DEBUG_LOCKS_WARN_ON(1) +[ 5.398233] WARNING: CPU: 1 PID: 32 at kernel/locking/lockdep.c:4623 lockdep_init_map_waits+0x14c/0x260 +[ 5.406149] Modules linked in: +[ 5.415411] CPU: 1 PID: 32 Comm: kworker/1:1 Not tainted 5.9.0-12034-gbbe85027ce80 #51 +[ 5.418553] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT) +[ 5.426453] Workqueue: events amba_deferred_retry_func +[ 5.433299] pstate: 40000005 (nZcv daif -PAN -UAO -TCO BTYPE=--) +[ 5.438252] pc : lockdep_init_map_waits+0x14c/0x260 +[ 5.444410] lr : lockdep_init_map_waits+0x14c/0x260 +[ 5.449007] sp : ffff800012bbb720 +... + +[ 5.531561] Call trace: +[ 5.536847] lockdep_init_map_waits+0x14c/0x260 +[ 5.539027] __kernfs_create_file+0xa8/0x1c8 +[ 5.543539] sysfs_add_file_mode_ns+0xd0/0x208 +[ 5.548054] internal_create_group+0x118/0x3c8 +[ 5.552307] internal_create_groups+0x58/0xb8 +[ 5.556733] sysfs_create_groups+0x2c/0x38 +[ 5.561160] device_add+0x2d8/0x768 +[ 5.565148] device_register+0x28/0x38 +[ 5.568537] coresight_register+0xf8/0x320 +[ 5.572358] cti_probe+0x1b0/0x3f0 + +... + +Fix this by initializing the attributes when they are allocated. + +Fixes: 3c5597e39812 ("coresight: cti: Add connection information to sysfs") +Reported-by: Leo Yan +Tested-by: Leo Yan +Cc: Mike Leach +Cc: Mathieu Poirier +Signed-off-by: Suzuki K Poulose +Cc: stable +Signed-off-by: Mathieu Poirier +Link: https://lore.kernel.org/r/20201029164559.1268531-2-mathieu.poirier@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hwtracing/coresight/coresight-cti-sysfs.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/hwtracing/coresight/coresight-cti-sysfs.c ++++ b/drivers/hwtracing/coresight/coresight-cti-sysfs.c +@@ -1065,6 +1065,13 @@ static int cti_create_con_sysfs_attr(str + } + eattr->var = con; + con->con_attrs[attr_idx] = &eattr->attr.attr; ++ /* ++ * Initialize the dynamically allocated attribute ++ * to avoid LOCKDEP splat. See include/linux/sysfs.h ++ * for more details. ++ */ ++ sysfs_attr_init(con->con_attrs[attr_idx]); ++ + return 0; + } + diff --git a/queue-5.9/cpufreq-schedutil-always-call-driver-if-cpufreq_need_update_limits-is-set.patch b/queue-5.9/cpufreq-schedutil-always-call-driver-if-cpufreq_need_update_limits-is-set.patch new file mode 100644 index 00000000000..3376cd3557e --- /dev/null +++ b/queue-5.9/cpufreq-schedutil-always-call-driver-if-cpufreq_need_update_limits-is-set.patch @@ -0,0 +1,65 @@ +From d1e7c2996e988866e7ceceb4641a0886885b7889 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 29 Oct 2020 12:12:46 +0100 +Subject: cpufreq: schedutil: Always call driver if CPUFREQ_NEED_UPDATE_LIMITS is set + +From: Rafael J. Wysocki + +commit d1e7c2996e988866e7ceceb4641a0886885b7889 upstream. + +Because sugov_update_next_freq() may skip a frequency update even if +the need_freq_update flag has been set for the policy at hand, policy +limits updates may not take effect as expected. + +For example, if the intel_pstate driver operates in the passive mode +with HWP enabled, it needs to update the HWP min and max limits when +the policy min and max limits change, respectively, but that may not +happen if the target frequency does not change along with the limit +at hand. In particular, if the policy min is changed first, causing +the target frequency to be adjusted to it, and the policy max limit +is changed later to the same value, the HWP max limit will not be +updated to follow it as expected, because the target frequency is +still equal to the policy min limit and it will not change until +that limit is updated. + +To address this issue, modify get_next_freq() to let the driver +callback run if the CPUFREQ_NEED_UPDATE_LIMITS cpufreq driver flag +is set regardless of whether or not the new frequency to set is +equal to the previous one. + +Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") +Reported-by: Zhang Rui +Tested-by: Zhang Rui +Cc: 5.9+ # 5.9+: 1c534352f47f cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS ... +Cc: 5.9+ # 5.9+: a62f68f5ca53 cpufreq: Introduce cpufreq_driver_test_flags() +Signed-off-by: Rafael J. Wysocki +Acked-by: Viresh Kumar +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched/cpufreq_schedutil.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/kernel/sched/cpufreq_schedutil.c ++++ b/kernel/sched/cpufreq_schedutil.c +@@ -102,7 +102,8 @@ static bool sugov_should_update_freq(str + static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time, + unsigned int next_freq) + { +- if (sg_policy->next_freq == next_freq) ++ if (sg_policy->next_freq == next_freq && ++ !cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS)) + return false; + + sg_policy->next_freq = next_freq; +@@ -175,7 +176,8 @@ static unsigned int get_next_freq(struct + + freq = map_util_freq(util, freq, max); + +- if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update) ++ if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update && ++ !cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS)) + return sg_policy->next_freq; + + sg_policy->need_freq_update = false; diff --git a/queue-5.9/device-property-don-t-clear-secondary-pointer-for-shared-primary-firmware-node.patch b/queue-5.9/device-property-don-t-clear-secondary-pointer-for-shared-primary-firmware-node.patch new file mode 100644 index 00000000000..ad08a0add14 --- /dev/null +++ b/queue-5.9/device-property-don-t-clear-secondary-pointer-for-shared-primary-firmware-node.patch @@ -0,0 +1,50 @@ +From 99aed9227073fb34ce2880cbc7063e04185a65e1 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Thu, 22 Oct 2020 21:41:00 +0300 +Subject: device property: Don't clear secondary pointer for shared primary firmware node + +From: Andy Shevchenko + +commit 99aed9227073fb34ce2880cbc7063e04185a65e1 upstream. + +It appears that firmware nodes can be shared between devices. In such case +when a (child) device is about to be deleted, its firmware node may be shared +and ACPI_COMPANION_SET(..., NULL) call for it breaks the secondary link +of the shared primary firmware node. + +In order to prevent that, check, if the device has a parent and parent's +firmware node is shared with its child, and avoid crashing the link. + +Fixes: c15e1bdda436 ("device property: Fix the secondary firmware node handling in set_primary_fwnode()") +Reported-by: Ferry Toth +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Tested-by: Ferry Toth +Cc: 5.9+ # 5.9+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -4260,6 +4260,7 @@ static inline bool fwnode_is_primary(str + */ + void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) + { ++ struct device *parent = dev->parent; + struct fwnode_handle *fn = dev->fwnode; + + if (fwnode) { +@@ -4274,7 +4275,8 @@ void set_primary_fwnode(struct device *d + } else { + if (fwnode_is_primary(fn)) { + dev->fwnode = fn->secondary; +- fn->secondary = ERR_PTR(-ENODEV); ++ if (!(parent && fn == parent->fwnode)) ++ fn->secondary = ERR_PTR(-ENODEV); + } else { + dev->fwnode = NULL; + } diff --git a/queue-5.9/device-property-keep-secondary-firmware-node-secondary-by-type.patch b/queue-5.9/device-property-keep-secondary-firmware-node-secondary-by-type.patch new file mode 100644 index 00000000000..40b90c98d7c --- /dev/null +++ b/queue-5.9/device-property-keep-secondary-firmware-node-secondary-by-type.patch @@ -0,0 +1,55 @@ +From d5dcce0c414fcbfe4c2037b66ac69ea5f9b3f75c Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Thu, 22 Oct 2020 21:40:59 +0300 +Subject: device property: Keep secondary firmware node secondary by type + +From: Andy Shevchenko + +commit d5dcce0c414fcbfe4c2037b66ac69ea5f9b3f75c upstream. + +Behind primary and secondary we understand the type of the nodes +which might define their ordering. However, if primary node gone, +we can't maintain the ordering by definition of the linked list. +Thus, by ordering secondary node becomes first in the list. +But in this case the meaning of it is still secondary (or auxiliary). +The type of the node is maintained by the secondary pointer in it: + + secondary pointer Meaning + NULL or valid primary node + ERR_PTR(-ENODEV) secondary node + +So, if by some reason we do the following sequence of calls + + set_primary_fwnode(dev, NULL); + set_primary_fwnode(dev, primary); + +we should preserve secondary node. + +This concept is supported by the description of set_primary_fwnode() +along with implementation of set_secondary_fwnode(). Hence, fix +the commit c15e1bdda436 to follow this as well. + +Fixes: c15e1bdda436 ("device property: Fix the secondary firmware node handling in set_primary_fwnode()") +Cc: Ferry Toth +Signed-off-by: Andy Shevchenko +Reviewed-by: Heikki Krogerus +Tested-by: Ferry Toth +Cc: 5.9+ # 5.9+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -4274,7 +4274,7 @@ void set_primary_fwnode(struct device *d + } else { + if (fwnode_is_primary(fn)) { + dev->fwnode = fn->secondary; +- fn->secondary = NULL; ++ fn->secondary = ERR_PTR(-ENODEV); + } else { + dev->fwnode = NULL; + } diff --git a/queue-5.9/drm-amd-pm-fix-pp_dpm_fclk.patch b/queue-5.9/drm-amd-pm-fix-pp_dpm_fclk.patch new file mode 100644 index 00000000000..e884c052d98 --- /dev/null +++ b/queue-5.9/drm-amd-pm-fix-pp_dpm_fclk.patch @@ -0,0 +1,34 @@ +From 392d256fa26d943fb0a019fea4be80382780d3b1 Mon Sep 17 00:00:00 2001 +From: Kenneth Feng +Date: Wed, 21 Oct 2020 16:15:47 +0800 +Subject: drm/amd/pm: fix pp_dpm_fclk + +From: Kenneth Feng + +commit 392d256fa26d943fb0a019fea4be80382780d3b1 upstream. + +fclk value is missing in pp_dpm_fclk. add this to correctly show the current value. + +Signed-off-by: Kenneth Feng +Reviewed-by: Likun Gao +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 5.9.x +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c ++++ b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c +@@ -447,6 +447,9 @@ static int sienna_cichlid_get_smu_metric + case METRICS_CURR_DCEFCLK: + *value = metrics->CurrClock[PPCLK_DCEFCLK]; + break; ++ case METRICS_CURR_FCLK: ++ *value = metrics->CurrClock[PPCLK_FCLK]; ++ break; + case METRICS_AVERAGE_GFXCLK: + if (metrics->AverageGfxActivity <= SMU_11_0_7_GFX_BUSY_THRESHOLD) + *value = metrics->AverageGfxclkFrequencyPostDs; diff --git a/queue-5.9/drm-amd-pm-increase-mclk-switch-threshold-to-200-us.patch b/queue-5.9/drm-amd-pm-increase-mclk-switch-threshold-to-200-us.patch new file mode 100644 index 00000000000..2251c8a4cdb --- /dev/null +++ b/queue-5.9/drm-amd-pm-increase-mclk-switch-threshold-to-200-us.patch @@ -0,0 +1,35 @@ +From 83da6eea3af669ee0b1f1bc05ffd6150af984994 Mon Sep 17 00:00:00 2001 +From: Evan Quan +Date: Wed, 2 Sep 2020 16:10:10 +0800 +Subject: drm/amd/pm: increase mclk switch threshold to 200 us + +From: Evan Quan + +commit 83da6eea3af669ee0b1f1bc05ffd6150af984994 upstream. + +To avoid underflow seen on Polaris10 with some 3440x1440 +144Hz displays. As the threshold of 190 us cuts too close +to minVBlankTime of 192 us. + +Signed-off-by: Evan Quan +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +@@ -2873,7 +2873,7 @@ static int smu7_vblank_too_short(struct + if (hwmgr->is_kicker) + switch_limit_us = data->is_memory_gddr5 ? 450 : 150; + else +- switch_limit_us = data->is_memory_gddr5 ? 190 : 150; ++ switch_limit_us = data->is_memory_gddr5 ? 200 : 150; + break; + case CHIP_VEGAM: + switch_limit_us = 30; diff --git a/queue-5.9/drm-amd-psp-fix-sysfs-cannot-create-duplicate-filename.patch b/queue-5.9/drm-amd-psp-fix-sysfs-cannot-create-duplicate-filename.patch new file mode 100644 index 00000000000..9f70e917a26 --- /dev/null +++ b/queue-5.9/drm-amd-psp-fix-sysfs-cannot-create-duplicate-filename.patch @@ -0,0 +1,35 @@ +From f1bcddffe46b349a82445a8d9efd5f5fcb72557f Mon Sep 17 00:00:00 2001 +From: Andrey Grodzovsky +Date: Fri, 16 Oct 2020 10:50:44 -0400 +Subject: drm/amd/psp: Fix sysfs: cannot create duplicate filename + +From: Andrey Grodzovsky + +commit f1bcddffe46b349a82445a8d9efd5f5fcb72557f upstream. + +psp sysfs not cleaned up on driver unload for sienna_cichlid + +Fixes: ce87c98db428e7 ("drm/amdgpu: Include sienna_cichlid in USBC PD FW support.") +Signed-off-by: Andrey Grodzovsky +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 5.9.x +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +@@ -206,7 +206,8 @@ static int psp_sw_fini(void *handle) + adev->psp.ta_fw = NULL; + } + +- if (adev->asic_type == CHIP_NAVI10) ++ if (adev->asic_type == CHIP_NAVI10 || ++ adev->asic_type == CHIP_SIENNA_CICHLID) + psp_sysfs_fini(adev); + + return 0; diff --git a/queue-5.9/drm-amd-swsmu-add-missing-feature-map-for-sienna_cichlid.patch b/queue-5.9/drm-amd-swsmu-add-missing-feature-map-for-sienna_cichlid.patch new file mode 100644 index 00000000000..5d2c9348328 --- /dev/null +++ b/queue-5.9/drm-amd-swsmu-add-missing-feature-map-for-sienna_cichlid.patch @@ -0,0 +1,53 @@ +From d48d7484d8dca1d4577fc53f1f826e68420d00eb Mon Sep 17 00:00:00 2001 +From: Kevin Wang +Date: Fri, 16 Oct 2020 11:07:47 +0800 +Subject: drm/amd/swsmu: add missing feature map for sienna_cichlid + +From: Kevin Wang + +commit d48d7484d8dca1d4577fc53f1f826e68420d00eb upstream. + +it will cause smu sysfs node of "pp_features" show error. + +Signed-off-by: Kevin Wang +Reviewed-by: Likun Gao +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 5.9.x +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/amd/powerplay/inc/smu_types.h | 1 + + drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c | 3 +++ + 2 files changed, 4 insertions(+) + +--- a/drivers/gpu/drm/amd/powerplay/inc/smu_types.h ++++ b/drivers/gpu/drm/amd/powerplay/inc/smu_types.h +@@ -217,6 +217,7 @@ enum smu_clk_type { + __SMU_DUMMY_MAP(DPM_MP0CLK), \ + __SMU_DUMMY_MAP(DPM_LINK), \ + __SMU_DUMMY_MAP(DPM_DCEFCLK), \ ++ __SMU_DUMMY_MAP(DPM_XGMI), \ + __SMU_DUMMY_MAP(DS_GFXCLK), \ + __SMU_DUMMY_MAP(DS_SOCCLK), \ + __SMU_DUMMY_MAP(DS_LCLK), \ +--- a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c ++++ b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c +@@ -150,14 +150,17 @@ static struct cmn2asic_mapping sienna_ci + FEA_MAP(DPM_GFXCLK), + FEA_MAP(DPM_GFX_GPO), + FEA_MAP(DPM_UCLK), ++ FEA_MAP(DPM_FCLK), + FEA_MAP(DPM_SOCCLK), + FEA_MAP(DPM_MP0CLK), + FEA_MAP(DPM_LINK), + FEA_MAP(DPM_DCEFCLK), ++ FEA_MAP(DPM_XGMI), + FEA_MAP(MEM_VDDCI_SCALING), + FEA_MAP(MEM_MVDD_SCALING), + FEA_MAP(DS_GFXCLK), + FEA_MAP(DS_SOCCLK), ++ FEA_MAP(DS_FCLK), + FEA_MAP(DS_LCLK), + FEA_MAP(DS_DCEFCLK), + FEA_MAP(DS_UCLK), diff --git a/queue-5.9/drm-amdgpu-correct-the-cu-and-rb-info-for-sienna-cichlid.patch b/queue-5.9/drm-amdgpu-correct-the-cu-and-rb-info-for-sienna-cichlid.patch new file mode 100644 index 00000000000..d7ae4f7d00a --- /dev/null +++ b/queue-5.9/drm-amdgpu-correct-the-cu-and-rb-info-for-sienna-cichlid.patch @@ -0,0 +1,53 @@ +From 687e79c0feb4243b141b1e9a20adba3c0ec66f7f Mon Sep 17 00:00:00 2001 +From: Likun Gao +Date: Thu, 22 Oct 2020 00:50:07 +0800 +Subject: drm/amdgpu: correct the cu and rb info for sienna cichlid + +From: Likun Gao + +commit 687e79c0feb4243b141b1e9a20adba3c0ec66f7f upstream. + +Skip disabled sa to correct the cu_info and active_rbs for sienna cichlid. + +Signed-off-by: Likun Gao +Reviewed-by: Hawking Zhang +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 5.9.x +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +@@ -4537,12 +4537,17 @@ static void gfx_v10_0_setup_rb(struct am + int i, j; + u32 data; + u32 active_rbs = 0; ++ u32 bitmap; + u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / + adev->gfx.config.max_sh_per_se; + + mutex_lock(&adev->grbm_idx_mutex); + for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { + for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { ++ bitmap = i * adev->gfx.config.max_sh_per_se + j; ++ if ((adev->asic_type == CHIP_SIENNA_CICHLID) && ++ ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1)) ++ continue; + gfx_v10_0_select_se_sh(adev, i, j, 0xffffffff); + data = gfx_v10_0_get_rb_active_bitmap(adev); + active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) * +@@ -8761,6 +8766,10 @@ static int gfx_v10_0_get_cu_info(struct + mutex_lock(&adev->grbm_idx_mutex); + for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { + for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { ++ bitmap = i * adev->gfx.config.max_sh_per_se + j; ++ if ((adev->asic_type == CHIP_SIENNA_CICHLID) && ++ ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1)) ++ continue; + mask = 1; + ao_bitmap = 0; + counter = 0; diff --git a/queue-5.9/drm-amdgpu-swsmu-drop-smu-i2c-bus-on-navi1x.patch b/queue-5.9/drm-amdgpu-swsmu-drop-smu-i2c-bus-on-navi1x.patch new file mode 100644 index 00000000000..ad3b9b1ed18 --- /dev/null +++ b/queue-5.9/drm-amdgpu-swsmu-drop-smu-i2c-bus-on-navi1x.patch @@ -0,0 +1,64 @@ +From 10105d0c9763f058f6a9a09f78397d5bf94dc94c Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 26 Oct 2020 17:30:28 -0400 +Subject: drm/amdgpu/swsmu: drop smu i2c bus on navi1x + +From: Alex Deucher + +commit 10105d0c9763f058f6a9a09f78397d5bf94dc94c upstream. + +Stop registering the SMU i2c bus on navi1x. This leads to instability +issues when userspace processes mess with the bus and also seems to +cause display stability issues in some cases. + +Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1314 +Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1341 +Reviewed-by: Evan Quan +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 26 -------------------------- + 1 file changed, 26 deletions(-) + +--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c ++++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +@@ -2463,37 +2463,11 @@ static const struct i2c_algorithm navi10 + .functionality = navi10_i2c_func, + }; + +-static int navi10_i2c_control_init(struct smu_context *smu, struct i2c_adapter *control) +-{ +- struct amdgpu_device *adev = to_amdgpu_device(control); +- int res; +- +- control->owner = THIS_MODULE; +- control->class = I2C_CLASS_SPD; +- control->dev.parent = &adev->pdev->dev; +- control->algo = &navi10_i2c_algo; +- snprintf(control->name, sizeof(control->name), "AMDGPU SMU"); +- +- res = i2c_add_adapter(control); +- if (res) +- DRM_ERROR("Failed to register hw i2c, err: %d\n", res); +- +- return res; +-} +- +-static void navi10_i2c_control_fini(struct smu_context *smu, struct i2c_adapter *control) +-{ +- i2c_del_adapter(control); +-} +- +- + static const struct pptable_funcs navi10_ppt_funcs = { + .get_allowed_feature_mask = navi10_get_allowed_feature_mask, + .set_default_dpm_table = navi10_set_default_dpm_table, + .dpm_set_vcn_enable = navi10_dpm_set_vcn_enable, + .dpm_set_jpeg_enable = navi10_dpm_set_jpeg_enable, +- .i2c_init = navi10_i2c_control_init, +- .i2c_fini = navi10_i2c_control_fini, + .print_clk_levels = navi10_print_clk_levels, + .force_clk_levels = navi10_force_clk_levels, + .populate_umd_state_clk = navi10_populate_umd_state_clk, diff --git a/queue-5.9/hil-parisc-disable-hil-driver-when-it-gets-stuck.patch b/queue-5.9/hil-parisc-disable-hil-driver-when-it-gets-stuck.patch new file mode 100644 index 00000000000..7e9357b881e --- /dev/null +++ b/queue-5.9/hil-parisc-disable-hil-driver-when-it-gets-stuck.patch @@ -0,0 +1,136 @@ +From 879bc2d27904354b98ca295b6168718e045c4aa2 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 19 Oct 2020 16:57:50 +0200 +Subject: hil/parisc: Disable HIL driver when it gets stuck + +From: Helge Deller + +commit 879bc2d27904354b98ca295b6168718e045c4aa2 upstream. + +When starting a HP machine with HIL driver but without an HIL keyboard +or HIL mouse attached, it may happen that data written to the HIL loop +gets stuck (e.g. because the transaction queue is full). Usually one +will then have to reboot the machine because all you see is and endless +output of: + Transaction add failed: transaction already queued? + +In the higher layers hp_sdc_enqueue_transaction() is called to queued up +a HIL packet. This function returns an error code, and this patch adds +the necessary checks for this return code and disables the HIL driver if +further packets can't be sent. + +Tested on a HP 730 and a HP 715/64 machine. + +Signed-off-by: Helge Deller +Cc: +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/serio/hil_mlc.c | 21 ++++++++++++++++++--- + drivers/input/serio/hp_sdc_mlc.c | 8 ++++---- + include/linux/hil_mlc.h | 2 +- + 3 files changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/input/serio/hil_mlc.c ++++ b/drivers/input/serio/hil_mlc.c +@@ -74,7 +74,7 @@ EXPORT_SYMBOL(hil_mlc_unregister); + static LIST_HEAD(hil_mlcs); + static DEFINE_RWLOCK(hil_mlcs_lock); + static struct timer_list hil_mlcs_kicker; +-static int hil_mlcs_probe; ++static int hil_mlcs_probe, hil_mlc_stop; + + static void hil_mlcs_process(unsigned long unused); + static DECLARE_TASKLET_DISABLED_OLD(hil_mlcs_tasklet, hil_mlcs_process); +@@ -702,9 +702,13 @@ static int hilse_donode(hil_mlc *mlc) + if (!mlc->ostarted) { + mlc->ostarted = 1; + mlc->opacket = pack; +- mlc->out(mlc); ++ rc = mlc->out(mlc); + nextidx = HILSEN_DOZE; + write_unlock_irqrestore(&mlc->lock, flags); ++ if (rc) { ++ hil_mlc_stop = 1; ++ return 1; ++ } + break; + } + mlc->ostarted = 0; +@@ -715,8 +719,13 @@ static int hilse_donode(hil_mlc *mlc) + + case HILSE_CTS: + write_lock_irqsave(&mlc->lock, flags); +- nextidx = mlc->cts(mlc) ? node->bad : node->good; ++ rc = mlc->cts(mlc); ++ nextidx = rc ? node->bad : node->good; + write_unlock_irqrestore(&mlc->lock, flags); ++ if (rc) { ++ hil_mlc_stop = 1; ++ return 1; ++ } + break; + + default: +@@ -780,6 +789,12 @@ static void hil_mlcs_process(unsigned lo + + static void hil_mlcs_timer(struct timer_list *unused) + { ++ if (hil_mlc_stop) { ++ /* could not send packet - stop immediately. */ ++ pr_warn(PREFIX "HIL seems stuck - Disabling HIL MLC.\n"); ++ return; ++ } ++ + hil_mlcs_probe = 1; + tasklet_schedule(&hil_mlcs_tasklet); + /* Re-insert the periodic task. */ +--- a/drivers/input/serio/hp_sdc_mlc.c ++++ b/drivers/input/serio/hp_sdc_mlc.c +@@ -210,7 +210,7 @@ static int hp_sdc_mlc_cts(hil_mlc *mlc) + priv->tseq[2] = 1; + priv->tseq[3] = 0; + priv->tseq[4] = 0; +- __hp_sdc_enqueue_transaction(&priv->trans); ++ return __hp_sdc_enqueue_transaction(&priv->trans); + busy: + return 1; + done: +@@ -219,7 +219,7 @@ static int hp_sdc_mlc_cts(hil_mlc *mlc) + return 0; + } + +-static void hp_sdc_mlc_out(hil_mlc *mlc) ++static int hp_sdc_mlc_out(hil_mlc *mlc) + { + struct hp_sdc_mlc_priv_s *priv; + +@@ -234,7 +234,7 @@ static void hp_sdc_mlc_out(hil_mlc *mlc) + do_data: + if (priv->emtestmode) { + up(&mlc->osem); +- return; ++ return 0; + } + /* Shouldn't be sending commands when loop may be busy */ + BUG_ON(down_trylock(&mlc->csem)); +@@ -296,7 +296,7 @@ static void hp_sdc_mlc_out(hil_mlc *mlc) + BUG_ON(down_trylock(&mlc->csem)); + } + enqueue: +- hp_sdc_enqueue_transaction(&priv->trans); ++ return hp_sdc_enqueue_transaction(&priv->trans); + } + + static int __init hp_sdc_mlc_init(void) +--- a/include/linux/hil_mlc.h ++++ b/include/linux/hil_mlc.h +@@ -103,7 +103,7 @@ struct hilse_node { + + /* Methods for back-end drivers, e.g. hp_sdc_mlc */ + typedef int (hil_mlc_cts) (hil_mlc *mlc); +-typedef void (hil_mlc_out) (hil_mlc *mlc); ++typedef int (hil_mlc_out) (hil_mlc *mlc); + typedef int (hil_mlc_in) (hil_mlc *mlc, suseconds_t timeout); + + struct hil_mlc_devinfo { diff --git a/queue-5.9/kvm-arm64-fix-aarch32-handling-of-dbgd-ccint-scrext-and-dbgvcr.patch b/queue-5.9/kvm-arm64-fix-aarch32-handling-of-dbgd-ccint-scrext-and-dbgvcr.patch new file mode 100644 index 00000000000..8cac787a9e2 --- /dev/null +++ b/queue-5.9/kvm-arm64-fix-aarch32-handling-of-dbgd-ccint-scrext-and-dbgvcr.patch @@ -0,0 +1,59 @@ +From 4a1c2c7f63c52ccb11770b5ae25920a6b79d3548 Mon Sep 17 00:00:00 2001 +From: Marc Zyngier +Date: Thu, 29 Oct 2020 17:24:09 +0000 +Subject: KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR + +From: Marc Zyngier + +commit 4a1c2c7f63c52ccb11770b5ae25920a6b79d3548 upstream. + +The DBGD{CCINT,SCRext} and DBGVCR register entries in the cp14 array +are missing their target register, resulting in all accesses being +targetted at the guard sysreg (indexed by __INVALID_SYSREG__). + +Point the emulation code at the actual register entries. + +Fixes: bdfb4b389c8d ("arm64: KVM: add trap handlers for AArch32 debug registers") +Signed-off-by: Marc Zyngier +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20201029172409.2768336-1-maz@kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/include/asm/kvm_host.h | 1 + + arch/arm64/kvm/sys_regs.c | 6 +++--- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- a/arch/arm64/include/asm/kvm_host.h ++++ b/arch/arm64/include/asm/kvm_host.h +@@ -231,6 +231,7 @@ enum vcpu_sysreg { + #define cp14_DBGWCR0 (DBGWCR0_EL1 * 2) + #define cp14_DBGWVR0 (DBGWVR0_EL1 * 2) + #define cp14_DBGDCCINT (MDCCINT_EL1 * 2) ++#define cp14_DBGVCR (DBGVCR32_EL2 * 2) + + #define NR_COPRO_REGS (NR_SYS_REGS * 2) + +--- a/arch/arm64/kvm/sys_regs.c ++++ b/arch/arm64/kvm/sys_regs.c +@@ -1881,9 +1881,9 @@ static const struct sys_reg_desc cp14_re + { Op1( 0), CRn( 0), CRm( 1), Op2( 0), trap_raz_wi }, + DBG_BCR_BVR_WCR_WVR(1), + /* DBGDCCINT */ +- { Op1( 0), CRn( 0), CRm( 2), Op2( 0), trap_debug32 }, ++ { Op1( 0), CRn( 0), CRm( 2), Op2( 0), trap_debug32, NULL, cp14_DBGDCCINT }, + /* DBGDSCRext */ +- { Op1( 0), CRn( 0), CRm( 2), Op2( 2), trap_debug32 }, ++ { Op1( 0), CRn( 0), CRm( 2), Op2( 2), trap_debug32, NULL, cp14_DBGDSCRext }, + DBG_BCR_BVR_WCR_WVR(2), + /* DBGDTR[RT]Xint */ + { Op1( 0), CRn( 0), CRm( 3), Op2( 0), trap_raz_wi }, +@@ -1898,7 +1898,7 @@ static const struct sys_reg_desc cp14_re + { Op1( 0), CRn( 0), CRm( 6), Op2( 2), trap_raz_wi }, + DBG_BCR_BVR_WCR_WVR(6), + /* DBGVCR */ +- { Op1( 0), CRn( 0), CRm( 7), Op2( 0), trap_debug32 }, ++ { Op1( 0), CRn( 0), CRm( 7), Op2( 0), trap_debug32, NULL, cp14_DBGVCR }, + DBG_BCR_BVR_WCR_WVR(7), + DBG_BCR_BVR_WCR_WVR(8), + DBG_BCR_BVR_WCR_WVR(9), diff --git a/queue-5.9/kvm-x86-fix-null-dereference-at-kvm_msr_ignored_check.patch b/queue-5.9/kvm-x86-fix-null-dereference-at-kvm_msr_ignored_check.patch new file mode 100644 index 00000000000..70e2cd014b1 --- /dev/null +++ b/queue-5.9/kvm-x86-fix-null-dereference-at-kvm_msr_ignored_check.patch @@ -0,0 +1,51 @@ +From d383b3146d805a743658225c8973f5d38c6fedf4 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 30 Oct 2020 16:14:14 +0100 +Subject: KVM: x86: Fix NULL dereference at kvm_msr_ignored_check() + +From: Takashi Iwai + +commit d383b3146d805a743658225c8973f5d38c6fedf4 upstream. + +The newly introduced kvm_msr_ignored_check() tries to print error or +debug messages via vcpu_*() macros, but those may cause Oops when NULL +vcpu is passed for KVM_GET_MSRS ioctl. + +Fix it by replacing the print calls with kvm_*() macros. + +(Note that this will leave vcpu argument completely unused in the + function, but I didn't touch it to make the fix as small as + possible. A clean up may be applied later.) + +Fixes: 12bc2132b15e ("KVM: X86: Do the same ignore_msrs check for feature msrs") +BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178280 +Cc: +Signed-off-by: Takashi Iwai +Message-Id: <20201030151414.20165-1-tiwai@suse.de> +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -259,13 +259,13 @@ static int kvm_msr_ignored_check(struct + + if (ignore_msrs) { + if (report_ignored_msrs) +- vcpu_unimpl(vcpu, "ignored %s: 0x%x data 0x%llx\n", +- op, msr, data); ++ kvm_pr_unimpl(vcpu, "ignored %s: 0x%x data 0x%llx\n", ++ op, msr, data); + /* Mask the error */ + return 0; + } else { +- vcpu_debug_ratelimited(vcpu, "unhandled %s: 0x%x data 0x%llx\n", +- op, msr, data); ++ kvm_debug_ratelimited(vcpu, "unhandled %s: 0x%x data 0x%llx\n", ++ op, msr, data); + return 1; + } + } diff --git a/queue-5.9/null_blk-synchronization-fix-for-zoned-device.patch b/queue-5.9/null_blk-synchronization-fix-for-zoned-device.patch new file mode 100644 index 00000000000..06222093ddd --- /dev/null +++ b/queue-5.9/null_blk-synchronization-fix-for-zoned-device.patch @@ -0,0 +1,92 @@ +From 35bc10b2eafbb701064b94f283b77c54d3304842 Mon Sep 17 00:00:00 2001 +From: Kanchan Joshi +Date: Mon, 28 Sep 2020 15:25:49 +0530 +Subject: null_blk: synchronization fix for zoned device + +From: Kanchan Joshi + +commit 35bc10b2eafbb701064b94f283b77c54d3304842 upstream. + +Parallel write,read,zone-mgmt operations accessing/altering zone state +and write-pointer may get into race. Avoid the situation by using a new +spinlock for zoned device. +Concurrent zone-appends (on a zone) returning same write-pointer issue +is also avoided using this lock. + +Cc: stable@vger.kernel.org +Fixes: e0489ed5daeb ("null_blk: Support REQ_OP_ZONE_APPEND") +Signed-off-by: Kanchan Joshi +Reviewed-by: Damien Le Moal +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/null_blk.h | 1 + + drivers/block/null_blk_zoned.c | 22 ++++++++++++++++++---- + 2 files changed, 19 insertions(+), 4 deletions(-) + +--- a/drivers/block/null_blk.h ++++ b/drivers/block/null_blk.h +@@ -44,6 +44,7 @@ struct nullb_device { + unsigned int nr_zones; + struct blk_zone *zones; + sector_t zone_size_sects; ++ spinlock_t zone_lock; + + unsigned long size; /* device size in MB */ + unsigned long completion_nsec; /* time in ns to complete a request */ +--- a/drivers/block/null_blk_zoned.c ++++ b/drivers/block/null_blk_zoned.c +@@ -45,6 +45,7 @@ int null_init_zoned_dev(struct nullb_dev + if (!dev->zones) + return -ENOMEM; + ++ spin_lock_init(&dev->zone_lock); + if (dev->zone_nr_conv >= dev->nr_zones) { + dev->zone_nr_conv = dev->nr_zones - 1; + pr_info("changed the number of conventional zones to %u", +@@ -131,8 +132,11 @@ int null_report_zones(struct gendisk *di + * So use a local copy to avoid corruption of the device zone + * array. + */ ++ spin_lock_irq(&dev->zone_lock); + memcpy(&zone, &dev->zones[first_zone + i], + sizeof(struct blk_zone)); ++ spin_unlock_irq(&dev->zone_lock); ++ + error = cb(&zone, i, data); + if (error) + return error; +@@ -277,18 +281,28 @@ static blk_status_t null_zone_mgmt(struc + blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd, enum req_opf op, + sector_t sector, sector_t nr_sectors) + { ++ blk_status_t sts; ++ struct nullb_device *dev = cmd->nq->dev; ++ ++ spin_lock_irq(&dev->zone_lock); + switch (op) { + case REQ_OP_WRITE: +- return null_zone_write(cmd, sector, nr_sectors, false); ++ sts = null_zone_write(cmd, sector, nr_sectors, false); ++ break; + case REQ_OP_ZONE_APPEND: +- return null_zone_write(cmd, sector, nr_sectors, true); ++ sts = null_zone_write(cmd, sector, nr_sectors, true); ++ break; + case REQ_OP_ZONE_RESET: + case REQ_OP_ZONE_RESET_ALL: + case REQ_OP_ZONE_OPEN: + case REQ_OP_ZONE_CLOSE: + case REQ_OP_ZONE_FINISH: +- return null_zone_mgmt(cmd, op, sector); ++ sts = null_zone_mgmt(cmd, op, sector); ++ break; + default: +- return null_process_cmd(cmd, op, sector, nr_sectors); ++ sts = null_process_cmd(cmd, op, sector, nr_sectors); + } ++ spin_unlock_irq(&dev->zone_lock); ++ ++ return sts; + } diff --git a/queue-5.9/series b/queue-5.9/series index c23aa2240ca..3f973b7a8b7 100644 --- a/queue-5.9/series +++ b/queue-5.9/series @@ -353,3 +353,37 @@ mmc-sdhci-use-auto-cmd-auto-select-only-when-v4_mode-is-true.patch memory-tegra-remove-gpu-from-drm-iommu-group.patch memory-brcmstb_dpfe-fix-memory-leak.patch futex-adjust-absolute-futex-timeouts-with-per-time-namespace-offset.patch +drm-amdgpu-swsmu-drop-smu-i2c-bus-on-navi1x.patch +drm-amd-pm-increase-mclk-switch-threshold-to-200-us.patch +drm-amd-pm-fix-pp_dpm_fclk.patch +drm-amd-swsmu-add-missing-feature-map-for-sienna_cichlid.patch +drm-amd-psp-fix-sysfs-cannot-create-duplicate-filename.patch +drm-amdgpu-correct-the-cu-and-rb-info-for-sienna-cichlid.patch +tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch +arm64-berlin-select-dw_apb_timer_of.patch +cachefiles-handle-readpage-error-correctly.patch +hil-parisc-disable-hil-driver-when-it-gets-stuck.patch +arm-dts-mt7623-add-missing-pause-for-switchport.patch +arm-aspeed-g5-do-not-set-sirq-polarity.patch +arm-dts-s5pv210-fix-pinctrl-property-of-vibrator-en-regulator-in-aries.patch +arm-config-aspeed-fix-selection-of-media-drivers.patch +arm-samsung-fix-pm-debug-build-with-debug_ll-but-mmu.patch +arm-s3c24xx-fix-missing-system-reset.patch +arm64-change-.weak-to-sym_func_start_weak_pi-for-arch-arm64-lib-mem-.s.patch +arm64-dts-marvell-espressobin-add-ethernet-switch-aliases.patch +null_blk-synchronization-fix-for-zoned-device.patch +coresight-cti-initialize-dynamic-sysfs-attributes.patch +device-property-keep-secondary-firmware-node-secondary-by-type.patch +device-property-don-t-clear-secondary-pointer-for-shared-primary-firmware-node.patch +kvm-x86-fix-null-dereference-at-kvm_msr_ignored_check.patch +kvm-arm64-fix-aarch32-handling-of-dbgd-ccint-scrext-and-dbgvcr.patch +stop_machine-rcu-mark-functions-as-notrace.patch +staging-fieldbus-anybuss-jump-to-correct-label-in-an-error-path.patch +staging-comedi-cb_pcidas-allow-2-channel-commands-for-ao-subdevice.patch +staging-octeon-repair-fixed-link-support.patch +staging-octeon-drop-on-uncorrectable-alignment-or-fcs-error.patch +cpufreq-schedutil-always-call-driver-if-cpufreq_need_update_limits-is-set.patch +vhost_vdpa-return-efault-if-copy_from_user-fails.patch +vdpa-mlx5-fix-error-return-in-map_direct_mr.patch +time-prevent-undefined-behaviour-in-timespec64_to_ns.patch +time-sched_clock-mark-sched_clock_read_begin-retry-as-notrace.patch diff --git a/queue-5.9/staging-comedi-cb_pcidas-allow-2-channel-commands-for-ao-subdevice.patch b/queue-5.9/staging-comedi-cb_pcidas-allow-2-channel-commands-for-ao-subdevice.patch new file mode 100644 index 00000000000..9446ff65704 --- /dev/null +++ b/queue-5.9/staging-comedi-cb_pcidas-allow-2-channel-commands-for-ao-subdevice.patch @@ -0,0 +1,41 @@ +From 647a6002cb41d358d9ac5de101a8a6dc74748a59 Mon Sep 17 00:00:00 2001 +From: Ian Abbott +Date: Wed, 21 Oct 2020 13:21:42 +0100 +Subject: staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice + +From: Ian Abbott + +commit 647a6002cb41d358d9ac5de101a8a6dc74748a59 upstream. + +The "cb_pcidas" driver supports asynchronous commands on the analog +output (AO) subdevice for those boards that have an AO FIFO. The code +(in `cb_pcidas_ao_check_chanlist()` and `cb_pcidas_ao_cmd()`) to +validate and set up the command supports output to a single channel or +to two channels simultaneously (the boards have two AO channels). +However, the code in `cb_pcidas_auto_attach()` that initializes the +subdevices neglects to initialize the AO subdevice's `len_chanlist` +member, leaving it set to 0, but the Comedi core will "correct" it to 1 +if the driver neglected to set it. This limits commands to use a single +channel (either channel 0 or 1), but the limit should be two channels. +Set the AO subdevice's `len_chanlist` member to be the same value as the +`n_chan` member, which will be 2. + +Cc: +Signed-off-by: Ian Abbott +Link: https://lore.kernel.org/r/20201021122142.81628-1-abbotti@mev.co.uk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/comedi/drivers/cb_pcidas.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/staging/comedi/drivers/cb_pcidas.c ++++ b/drivers/staging/comedi/drivers/cb_pcidas.c +@@ -1342,6 +1342,7 @@ static int cb_pcidas_auto_attach(struct + if (dev->irq && board->has_ao_fifo) { + dev->write_subdev = s; + s->subdev_flags |= SDF_CMD_WRITE; ++ s->len_chanlist = s->n_chan; + s->do_cmdtest = cb_pcidas_ao_cmdtest; + s->do_cmd = cb_pcidas_ao_cmd; + s->cancel = cb_pcidas_ao_cancel; diff --git a/queue-5.9/staging-fieldbus-anybuss-jump-to-correct-label-in-an-error-path.patch b/queue-5.9/staging-fieldbus-anybuss-jump-to-correct-label-in-an-error-path.patch new file mode 100644 index 00000000000..ecfe0e9d0aa --- /dev/null +++ b/queue-5.9/staging-fieldbus-anybuss-jump-to-correct-label-in-an-error-path.patch @@ -0,0 +1,35 @@ +From 7e97e4cbf30026b49b0145c3bfe06087958382c5 Mon Sep 17 00:00:00 2001 +From: Jing Xiangfeng +Date: Mon, 12 Oct 2020 21:24:04 +0800 +Subject: staging: fieldbus: anybuss: jump to correct label in an error path + +From: Jing Xiangfeng + +commit 7e97e4cbf30026b49b0145c3bfe06087958382c5 upstream. + +In current code, controller_probe() misses to call ida_simple_remove() +in an error path. Jump to correct label to fix it. + +Fixes: 17614978ed34 ("staging: fieldbus: anybus-s: support the Arcx anybus controller") +Reviewed-by: Sven Van Asbroeck +Signed-off-by: Jing Xiangfeng +Cc: stable +Link: https://lore.kernel.org/r/20201012132404.113031-1-jingxiangfeng@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/fieldbus/anybuss/arcx-anybus.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c ++++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c +@@ -293,7 +293,7 @@ static int controller_probe(struct platf + regulator = devm_regulator_register(dev, &can_power_desc, &config); + if (IS_ERR(regulator)) { + err = PTR_ERR(regulator); +- goto out_reset; ++ goto out_ida; + } + /* make controller info visible to userspace */ + cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL); diff --git a/queue-5.9/staging-octeon-drop-on-uncorrectable-alignment-or-fcs-error.patch b/queue-5.9/staging-octeon-drop-on-uncorrectable-alignment-or-fcs-error.patch new file mode 100644 index 00000000000..a327c7368fd --- /dev/null +++ b/queue-5.9/staging-octeon-drop-on-uncorrectable-alignment-or-fcs-error.patch @@ -0,0 +1,90 @@ +From 49d28ebdf1e30d806410eefc7de0a7a1ca5d747c Mon Sep 17 00:00:00 2001 +From: Alexander Sverdlin +Date: Fri, 16 Oct 2020 16:56:30 +0200 +Subject: staging: octeon: Drop on uncorrectable alignment or FCS error + +From: Alexander Sverdlin + +commit 49d28ebdf1e30d806410eefc7de0a7a1ca5d747c upstream. + +Currently in case of alignment or FCS error if the packet cannot be +corrected it's still not dropped. Report the error properly and drop the +packet while making the code around a little bit more readable. + +Fixes: 80ff0fd3ab64 ("Staging: Add octeon-ethernet driver files.") +Signed-off-by: Alexander Sverdlin +Cc: stable +Link: https://lore.kernel.org/r/20201016145630.41852-1-alexander.sverdlin@nokia.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/octeon/ethernet-rx.c | 34 +++++++++++++++++++--------------- + 1 file changed, 19 insertions(+), 15 deletions(-) + +--- a/drivers/staging/octeon/ethernet-rx.c ++++ b/drivers/staging/octeon/ethernet-rx.c +@@ -69,15 +69,17 @@ static inline int cvm_oct_check_rcv_erro + else + port = work->word1.cn38xx.ipprt; + +- if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) { ++ if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) + /* + * Ignore length errors on min size packets. Some + * equipment incorrectly pads packets to 64+4FCS + * instead of 60+4FCS. Note these packets still get + * counted as frame errors. + */ +- } else if (work->word2.snoip.err_code == 5 || +- work->word2.snoip.err_code == 7) { ++ return 0; ++ ++ if (work->word2.snoip.err_code == 5 || ++ work->word2.snoip.err_code == 7) { + /* + * We received a packet with either an alignment error + * or a FCS error. This may be signalling that we are +@@ -108,7 +110,10 @@ static inline int cvm_oct_check_rcv_erro + /* Port received 0xd5 preamble */ + work->packet_ptr.s.addr += i + 1; + work->word1.len -= i + 5; +- } else if ((*ptr & 0xf) == 0xd) { ++ return 0; ++ } ++ ++ if ((*ptr & 0xf) == 0xd) { + /* Port received 0xd preamble */ + work->packet_ptr.s.addr += i; + work->word1.len -= i + 4; +@@ -118,21 +123,20 @@ static inline int cvm_oct_check_rcv_erro + ((*(ptr + 1) & 0xf) << 4); + ptr++; + } +- } else { +- printk_ratelimited("Port %d unknown preamble, packet dropped\n", +- port); +- cvm_oct_free_work(work); +- return 1; ++ return 0; + } ++ ++ printk_ratelimited("Port %d unknown preamble, packet dropped\n", ++ port); ++ cvm_oct_free_work(work); ++ return 1; + } +- } else { +- printk_ratelimited("Port %d receive error code %d, packet dropped\n", +- port, work->word2.snoip.err_code); +- cvm_oct_free_work(work); +- return 1; + } + +- return 0; ++ printk_ratelimited("Port %d receive error code %d, packet dropped\n", ++ port, work->word2.snoip.err_code); ++ cvm_oct_free_work(work); ++ return 1; + } + + static void copy_segments_to_skb(struct cvmx_wqe *work, struct sk_buff *skb) diff --git a/queue-5.9/staging-octeon-repair-fixed-link-support.patch b/queue-5.9/staging-octeon-repair-fixed-link-support.patch new file mode 100644 index 00000000000..fc2b3457fa8 --- /dev/null +++ b/queue-5.9/staging-octeon-repair-fixed-link-support.patch @@ -0,0 +1,63 @@ +From 179f5dc36b0a1aa31538d7d8823deb65c39847b3 Mon Sep 17 00:00:00 2001 +From: Alexander Sverdlin +Date: Fri, 16 Oct 2020 12:18:57 +0200 +Subject: staging: octeon: repair "fixed-link" support + +From: Alexander Sverdlin + +commit 179f5dc36b0a1aa31538d7d8823deb65c39847b3 upstream. + +The PHYs must be registered once in device probe function, not in device +open callback because it's only possible to register them once. + +Fixes: a25e278020bf ("staging: octeon: support fixed-link phys") +Signed-off-by: Alexander Sverdlin +Cc: stable +Link: https://lore.kernel.org/r/20201016101858.11374-1-alexander.sverdlin@nokia.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/octeon/ethernet-mdio.c | 6 ------ + drivers/staging/octeon/ethernet.c | 9 +++++++++ + 2 files changed, 9 insertions(+), 6 deletions(-) + +--- a/drivers/staging/octeon/ethernet-mdio.c ++++ b/drivers/staging/octeon/ethernet-mdio.c +@@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_ + + phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0); + if (!phy_node && of_phy_is_fixed_link(priv->of_node)) { +- int rc; +- +- rc = of_phy_register_fixed_link(priv->of_node); +- if (rc) +- return rc; +- + phy_node = of_node_get(priv->of_node); + } + if (!phy_node) +--- a/drivers/staging/octeon/ethernet.c ++++ b/drivers/staging/octeon/ethernet.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -892,6 +893,14 @@ static int cvm_oct_probe(struct platform + break; + } + ++ if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) { ++ if (of_phy_register_fixed_link(priv->of_node)) { ++ netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n", ++ interface, priv->port); ++ dev->netdev_ops = NULL; ++ } ++ } ++ + if (!dev->netdev_ops) { + free_netdev(dev); + } else if (register_netdev(dev) < 0) { diff --git a/queue-5.9/stop_machine-rcu-mark-functions-as-notrace.patch b/queue-5.9/stop_machine-rcu-mark-functions-as-notrace.patch new file mode 100644 index 00000000000..c31a22b696b --- /dev/null +++ b/queue-5.9/stop_machine-rcu-mark-functions-as-notrace.patch @@ -0,0 +1,58 @@ +From 4230e2deaa484b385aa01d598b2aea8e7f2660a6 Mon Sep 17 00:00:00 2001 +From: Zong Li +Date: Wed, 21 Oct 2020 15:38:39 +0800 +Subject: stop_machine, rcu: Mark functions as notrace + +From: Zong Li + +commit 4230e2deaa484b385aa01d598b2aea8e7f2660a6 upstream. + +Some architectures assume that the stopped CPUs don't make function calls +to traceable functions when they are in the stopped state. See also commit +cb9d7fd51d9f ("watchdog: Mark watchdog touch functions as notrace"). + +Violating this assumption causes kernel crashes when switching tracer on +RISC-V. + +Mark rcu_momentary_dyntick_idle() and stop_machine_yield() notrace to +prevent this. + +Fixes: 4ecf0a43e729 ("processor: get rid of cpu_relax_yield") +Fixes: 366237e7b083 ("stop_machine: Provide RCU quiescent state in multi_cpu_stop()") +Signed-off-by: Zong Li +Signed-off-by: Thomas Gleixner +Tested-by: Atish Patra +Tested-by: Colin Ian King +Acked-by: Steven Rostedt (VMware) +Acked-by: Paul E. McKenney +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20201021073839.43935-1-zong.li@sifive.com +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/rcu/tree.c | 2 +- + kernel/stop_machine.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/rcu/tree.c ++++ b/kernel/rcu/tree.c +@@ -416,7 +416,7 @@ bool rcu_eqs_special_set(int cpu) + * + * The caller must have disabled interrupts and must not be idle. + */ +-void rcu_momentary_dyntick_idle(void) ++notrace void rcu_momentary_dyntick_idle(void) + { + int special; + +--- a/kernel/stop_machine.c ++++ b/kernel/stop_machine.c +@@ -178,7 +178,7 @@ static void ack_state(struct multi_stop_ + set_state(msdata, msdata->state + 1); + } + +-void __weak stop_machine_yield(const struct cpumask *cpumask) ++notrace void __weak stop_machine_yield(const struct cpumask *cpumask) + { + cpu_relax(); + } diff --git a/queue-5.9/time-prevent-undefined-behaviour-in-timespec64_to_ns.patch b/queue-5.9/time-prevent-undefined-behaviour-in-timespec64_to_ns.patch new file mode 100644 index 00000000000..e73e6d58615 --- /dev/null +++ b/queue-5.9/time-prevent-undefined-behaviour-in-timespec64_to_ns.patch @@ -0,0 +1,69 @@ +From cb47755725da7b90fecbb2aa82ac3b24a7adb89b Mon Sep 17 00:00:00 2001 +From: Zeng Tao +Date: Tue, 1 Sep 2020 17:30:13 +0800 +Subject: time: Prevent undefined behaviour in timespec64_to_ns() + +From: Zeng Tao + +commit cb47755725da7b90fecbb2aa82ac3b24a7adb89b upstream. + +UBSAN reports: + +Undefined behaviour in ./include/linux/time64.h:127:27 +signed integer overflow: +17179869187 * 1000000000 cannot be represented in type 'long long int' +Call Trace: + timespec64_to_ns include/linux/time64.h:127 [inline] + set_cpu_itimer+0x65c/0x880 kernel/time/itimer.c:180 + do_setitimer+0x8e/0x740 kernel/time/itimer.c:245 + __x64_sys_setitimer+0x14c/0x2c0 kernel/time/itimer.c:336 + do_syscall_64+0xa1/0x540 arch/x86/entry/common.c:295 + +Commit bd40a175769d ("y2038: itimer: change implementation to timespec64") +replaced the original conversion which handled time clamping correctly with +timespec64_to_ns() which has no overflow protection. + +Fix it in timespec64_to_ns() as this is not necessarily limited to the +usage in itimers. + +[ tglx: Added comment and adjusted the fixes tag ] + +Fixes: 361a3bf00582 ("time64: Add time64.h header and define struct timespec64") +Signed-off-by: Zeng Tao +Signed-off-by: Thomas Gleixner +Reviewed-by: Arnd Bergmann +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/1598952616-6416-1-git-send-email-prime.zeng@hisilicon.com +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/time64.h | 4 ++++ + kernel/time/itimer.c | 4 ---- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/include/linux/time64.h ++++ b/include/linux/time64.h +@@ -124,6 +124,10 @@ static inline bool timespec64_valid_sett + */ + static inline s64 timespec64_to_ns(const struct timespec64 *ts) + { ++ /* Prevent multiplication overflow */ ++ if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) ++ return KTIME_MAX; ++ + return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; + } + +--- a/kernel/time/itimer.c ++++ b/kernel/time/itimer.c +@@ -172,10 +172,6 @@ static void set_cpu_itimer(struct task_s + u64 oval, nval, ointerval, ninterval; + struct cpu_itimer *it = &tsk->signal->it[clock_id]; + +- /* +- * Use the to_ktime conversion because that clamps the maximum +- * value to KTIME_MAX and avoid multiplication overflows. +- */ + nval = timespec64_to_ns(&value->it_value); + ninterval = timespec64_to_ns(&value->it_interval); + diff --git a/queue-5.9/time-sched_clock-mark-sched_clock_read_begin-retry-as-notrace.patch b/queue-5.9/time-sched_clock-mark-sched_clock_read_begin-retry-as-notrace.patch new file mode 100644 index 00000000000..e772312f579 --- /dev/null +++ b/queue-5.9/time-sched_clock-mark-sched_clock_read_begin-retry-as-notrace.patch @@ -0,0 +1,52 @@ +From 4cd2bb12981165f865d2b8ed92b446b52310ef74 Mon Sep 17 00:00:00 2001 +From: Quanyang Wang +Date: Tue, 29 Sep 2020 16:20:27 +0800 +Subject: time/sched_clock: Mark sched_clock_read_begin/retry() as notrace + +From: Quanyang Wang + +commit 4cd2bb12981165f865d2b8ed92b446b52310ef74 upstream. + +Since sched_clock_read_begin() and sched_clock_read_retry() are called +by notrace function sched_clock(), they shouldn't be traceable either, +or else ftrace_graph_caller will run into a dead loop on the path +as below (arm for instance): + + ftrace_graph_caller() + prepare_ftrace_return() + function_graph_enter() + ftrace_push_return_trace() + trace_clock_local() + sched_clock() + sched_clock_read_begin/retry() + +Fixes: 1b86abc1c645 ("sched_clock: Expose struct clock_read_data") +Signed-off-by: Quanyang Wang +Signed-off-by: Thomas Gleixner +Acked-by: Peter Zijlstra (Intel) +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20200929082027.16787-1-quanyang.wang@windriver.com +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/time/sched_clock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/time/sched_clock.c ++++ b/kernel/time/sched_clock.c +@@ -68,13 +68,13 @@ static inline u64 notrace cyc_to_ns(u64 + return (cyc * mult) >> shift; + } + +-struct clock_read_data *sched_clock_read_begin(unsigned int *seq) ++notrace struct clock_read_data *sched_clock_read_begin(unsigned int *seq) + { + *seq = raw_read_seqcount_latch(&cd.seq); + return cd.read_data + (*seq & 1); + } + +-int sched_clock_read_retry(unsigned int seq) ++notrace int sched_clock_read_retry(unsigned int seq) + { + return read_seqcount_retry(&cd.seq, seq); + } diff --git a/queue-5.9/tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch b/queue-5.9/tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch new file mode 100644 index 00000000000..c545e7c4886 --- /dev/null +++ b/queue-5.9/tty-make-fontx-ioctl-use-the-tty-pointer-they-were-actually-passed.patch @@ -0,0 +1,167 @@ +From 90bfdeef83f1d6c696039b6a917190dcbbad3220 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 26 Oct 2020 13:15:23 -0700 +Subject: tty: make FONTX ioctl use the tty pointer they were actually passed + +From: Linus Torvalds + +commit 90bfdeef83f1d6c696039b6a917190dcbbad3220 upstream. + +Some of the font tty ioctl's always used the current foreground VC for +their operations. Don't do that then. + +This fixes a data race on fg_console. + +Side note: both Michael Ellerman and Jiri Slaby point out that all these +ioctls are deprecated, and should probably have been removed long ago, +and everything seems to be using the KDFONTOP ioctl instead. + +In fact, Michael points out that it looks like busybox's loadfont +program seems to have switched over to using KDFONTOP exactly _because_ +of this bug (ahem.. 12 years ago ;-). + +Reported-by: Minh Yuan +Acked-by: Michael Ellerman +Acked-by: Jiri Slaby +Cc: Greg KH +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/vt/vt_ioctl.c | 36 +++++++++++++++++++----------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +--- a/drivers/tty/vt/vt_ioctl.c ++++ b/drivers/tty/vt/vt_ioctl.c +@@ -485,7 +485,7 @@ static int vt_k_ioctl(struct tty_struct + return 0; + } + +-static inline int do_fontx_ioctl(int cmd, ++static inline int do_fontx_ioctl(struct vc_data *vc, int cmd, + struct consolefontdesc __user *user_cfd, + struct console_font_op *op) + { +@@ -503,15 +503,16 @@ static inline int do_fontx_ioctl(int cmd + op->height = cfdarg.charheight; + op->charcount = cfdarg.charcount; + op->data = cfdarg.chardata; +- return con_font_op(vc_cons[fg_console].d, op); +- case GIO_FONTX: { ++ return con_font_op(vc, op); ++ ++ case GIO_FONTX: + op->op = KD_FONT_OP_GET; + op->flags = KD_FONT_FLAG_OLD; + op->width = 8; + op->height = cfdarg.charheight; + op->charcount = cfdarg.charcount; + op->data = cfdarg.chardata; +- i = con_font_op(vc_cons[fg_console].d, op); ++ i = con_font_op(vc, op); + if (i) + return i; + cfdarg.charheight = op->height; +@@ -519,12 +520,11 @@ static inline int do_fontx_ioctl(int cmd + if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc))) + return -EFAULT; + return 0; +- } + } + return -EINVAL; + } + +-static int vt_io_fontreset(struct console_font_op *op) ++static int vt_io_fontreset(struct vc_data *vc, struct console_font_op *op) + { + int ret; + +@@ -538,12 +538,12 @@ static int vt_io_fontreset(struct consol + + op->op = KD_FONT_OP_SET_DEFAULT; + op->data = NULL; +- ret = con_font_op(vc_cons[fg_console].d, op); ++ ret = con_font_op(vc, op); + if (ret) + return ret; + + console_lock(); +- con_set_default_unimap(vc_cons[fg_console].d); ++ con_set_default_unimap(vc); + console_unlock(); + + return 0; +@@ -585,7 +585,7 @@ static int vt_io_ioctl(struct vc_data *v + op.height = 0; + op.charcount = 256; + op.data = up; +- return con_font_op(vc_cons[fg_console].d, &op); ++ return con_font_op(vc, &op); + + case GIO_FONT: + op.op = KD_FONT_OP_GET; +@@ -594,7 +594,7 @@ static int vt_io_ioctl(struct vc_data *v + op.height = 32; + op.charcount = 256; + op.data = up; +- return con_font_op(vc_cons[fg_console].d, &op); ++ return con_font_op(vc, &op); + + case PIO_CMAP: + if (!perm) +@@ -610,13 +610,13 @@ static int vt_io_ioctl(struct vc_data *v + + fallthrough; + case GIO_FONTX: +- return do_fontx_ioctl(cmd, up, &op); ++ return do_fontx_ioctl(vc, cmd, up, &op); + + case PIO_FONTRESET: + if (!perm) + return -EPERM; + +- return vt_io_fontreset(&op); ++ return vt_io_fontreset(vc, &op); + + case PIO_SCRNMAP: + if (!perm) +@@ -1067,8 +1067,9 @@ struct compat_consolefontdesc { + }; + + static inline int +-compat_fontx_ioctl(int cmd, struct compat_consolefontdesc __user *user_cfd, +- int perm, struct console_font_op *op) ++compat_fontx_ioctl(struct vc_data *vc, int cmd, ++ struct compat_consolefontdesc __user *user_cfd, ++ int perm, struct console_font_op *op) + { + struct compat_consolefontdesc cfdarg; + int i; +@@ -1086,7 +1087,8 @@ compat_fontx_ioctl(int cmd, struct compa + op->height = cfdarg.charheight; + op->charcount = cfdarg.charcount; + op->data = compat_ptr(cfdarg.chardata); +- return con_font_op(vc_cons[fg_console].d, op); ++ return con_font_op(vc, op); ++ + case GIO_FONTX: + op->op = KD_FONT_OP_GET; + op->flags = KD_FONT_FLAG_OLD; +@@ -1094,7 +1096,7 @@ compat_fontx_ioctl(int cmd, struct compa + op->height = cfdarg.charheight; + op->charcount = cfdarg.charcount; + op->data = compat_ptr(cfdarg.chardata); +- i = con_font_op(vc_cons[fg_console].d, op); ++ i = con_font_op(vc, op); + if (i) + return i; + cfdarg.charheight = op->height; +@@ -1184,7 +1186,7 @@ long vt_compat_ioctl(struct tty_struct * + */ + case PIO_FONTX: + case GIO_FONTX: +- return compat_fontx_ioctl(cmd, up, perm, &op); ++ return compat_fontx_ioctl(vc, cmd, up, perm, &op); + + case KDFONTOP: + return compat_kdfontop_ioctl(up, perm, &op, vc); diff --git a/queue-5.9/vdpa-mlx5-fix-error-return-in-map_direct_mr.patch b/queue-5.9/vdpa-mlx5-fix-error-return-in-map_direct_mr.patch new file mode 100644 index 00000000000..499524b57db --- /dev/null +++ b/queue-5.9/vdpa-mlx5-fix-error-return-in-map_direct_mr.patch @@ -0,0 +1,46 @@ +From 7ba08e81cb4aec9724ab7674a5de49e7a341062c Mon Sep 17 00:00:00 2001 +From: Jing Xiangfeng +Date: Mon, 26 Oct 2020 15:06:37 +0800 +Subject: vdpa/mlx5: Fix error return in map_direct_mr() + +From: Jing Xiangfeng + +commit 7ba08e81cb4aec9724ab7674a5de49e7a341062c upstream. + +Fix to return the variable "err" from the error handling case instead +of "ret". + +Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") +Signed-off-by: Jing Xiangfeng +Link: https://lore.kernel.org/r/20201026070637.164321-1-jingxiangfeng@huawei.com +Signed-off-by: Michael S. Tsirkin +Acked-by: Eli Cohen +Cc: stable@vger.kernel.org +Acked-by: Jason Wang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/vdpa/mlx5/core/mr.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/vdpa/mlx5/core/mr.c ++++ b/drivers/vdpa/mlx5/core/mr.c +@@ -239,7 +239,6 @@ static int map_direct_mr(struct mlx5_vdp + u64 paend; + struct scatterlist *sg; + struct device *dma = mvdev->mdev->device; +- int ret; + + for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1); + map; map = vhost_iotlb_itree_next(map, start, mr->end - 1)) { +@@ -277,8 +276,8 @@ static int map_direct_mr(struct mlx5_vdp + done: + mr->log_size = log_entity_size; + mr->nsg = nsg; +- ret = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0); +- if (!ret) ++ err = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0); ++ if (!err) + goto err_map; + + err = create_direct_mr(mvdev, mr); diff --git a/queue-5.9/vhost_vdpa-return-efault-if-copy_from_user-fails.patch b/queue-5.9/vhost_vdpa-return-efault-if-copy_from_user-fails.patch new file mode 100644 index 00000000000..237341badd5 --- /dev/null +++ b/queue-5.9/vhost_vdpa-return-efault-if-copy_from_user-fails.patch @@ -0,0 +1,52 @@ +From 7922460e33c81f41e0d2421417228b32e6fdbe94 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 23 Oct 2020 15:08:53 +0300 +Subject: vhost_vdpa: Return -EFAULT if copy_from_user() fails + +From: Dan Carpenter + +commit 7922460e33c81f41e0d2421417228b32e6fdbe94 upstream. + +The copy_to/from_user() functions return the number of bytes which we +weren't able to copy but the ioctl should return -EFAULT if they fail. + +Fixes: a127c5bbb6a8 ("vhost-vdpa: fix backend feature ioctls") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/20201023120853.GI282278@mwanda +Signed-off-by: Michael S. Tsirkin +Cc: stable@vger.kernel.org +Acked-by: Jason Wang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/vhost/vdpa.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/vhost/vdpa.c ++++ b/drivers/vhost/vdpa.c +@@ -428,12 +428,11 @@ static long vhost_vdpa_unlocked_ioctl(st + void __user *argp = (void __user *)arg; + u64 __user *featurep = argp; + u64 features; +- long r; ++ long r = 0; + + if (cmd == VHOST_SET_BACKEND_FEATURES) { +- r = copy_from_user(&features, featurep, sizeof(features)); +- if (r) +- return r; ++ if (copy_from_user(&features, featurep, sizeof(features))) ++ return -EFAULT; + if (features & ~VHOST_VDPA_BACKEND_FEATURES) + return -EOPNOTSUPP; + vhost_set_backend_features(&v->vdev, features); +@@ -476,7 +475,8 @@ static long vhost_vdpa_unlocked_ioctl(st + break; + case VHOST_GET_BACKEND_FEATURES: + features = VHOST_VDPA_BACKEND_FEATURES; +- r = copy_to_user(featurep, &features, sizeof(features)); ++ if (copy_to_user(featurep, &features, sizeof(features))) ++ r = -EFAULT; + break; + default: + r = vhost_dev_ioctl(&v->vdev, cmd, argp);