From 67e174ce82f62de88f063dd2c0b804ceed43c7ca Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 27 Dec 2020 23:33:23 -0500 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- ...dts-at91-at91sam9rl-fix-adc-triggers.patch | 62 ++++++ ...a5d3_xplained-add-pincontrol-for-usb.patch | 51 +++++ ...a5d4_xplained-add-pincontrol-for-usb.patch | 51 +++++ ...dling-of-lpae-translation-in-be-mode.patch | 55 ++++++ ...-correct-psci-compatible-used-on-exy.patch | 50 +++++ ...40-i2s-add-missed-checks-for-clk_get.patch | 44 +++++ .../asoc-pcm-drain-support-reactivation.patch | 51 +++++ ...ove-ctl-from-list-on-error-in-wm_ads.patch | 50 +++++ ...ll-pointer-dereference-in-hci_event_.patch | 49 +++++ .../cfg80211-initialize-rekey_data.patch | 36 ++++ .../checkpatch-fix-unescaped-left-brace.patch | 42 ++++ ...a-resource-leak-in-error-handling-pa.patch | 41 ++++ ...-tegra-fix-duplicated-se-clock-entry.patch | 55 ++++++ ...-fix-memleak-in-ti_fapll_synth_setup.patch | 60 ++++++ ...ers-arm_arch_timer-correct-fault-pro.patch | 70 +++++++ ...ers-cadence_ttc-fix-memory-leak-in-t.patch | 74 +++++++ ...bank-add-missing-module_device_table.patch | 45 +++++ ...q-loongson1-add-missing-module_alias.patch | 38 ++++ ...pufreq-scpi-add-missing-module_alias.patch | 38 ++++ ...q-st-add-missing-module_device_table.patch | 45 +++++ ...fix-pm-disable-depth-imbalance-in-om.patch | 45 +++++ ...-fix-return-type-of-current_desc_hdr.patch | 55 ++++++ ...ng-destroy_workqueue-on-error-in-cw1.patch | 46 +++++ ...-error-return-code-in-target_message.patch | 36 ++++ ...nav_qmss_queue-fix-error-return-code.patch | 41 ++++ ...500-fix-double-free-of-gma_connector.patch | 45 +++++ ...er-fix-return-error-code-in-omap_dmm.patch | 36 ++++ .../extcon-max77693-fix-modalias-string.patch | 34 ++++ ...ro-k147-to-descriptor-override.patch-15974 | 43 ++++ ...-t-jump-to-free-id-in-ssi_add_contro.patch | 36 ++++ ...x-integer-overflow-on-rt-calculation.patch | 52 +++++ ...ads7846-fix-unaligned-access-on-7845.patch | 43 ++++ ...yb-send-scancodes-in-addition-to-key.patch | 37 ++++ ...-upside-down-quirk-for-teclast-x98-p.patch | 47 +++++ ...si-fix-freeing-of-interrupts-on-allo.patch | 43 ++++ ...se-interval-based-rebinding-over-tcp.patch | 99 ++++++++++ ...fix-array-overflow-in-vidioc_s_audio.patch | 56 ++++++ ...memory-leak-of-debugfs-members-in-sm.patch | 47 +++++ ...ix-missing-snd_card_free-in-error-ha.patch | 38 ++++ ...-a-double-free-bug-in-memstick_check.patch | 37 ++++ ...-r592-fix-error-return-in-r592_probe.patch | 57 ++++++ ...-kconfig-dependency-bug-for-bcm47xx_.patch | 48 +++++ ...e-after-free-in-mips_cdmm_bus_discov.patch | 41 ++++ ...x-some-resources-leak-in-the-error-h.patch | 65 ++++++ ...-a-resource-leak-in-an-error-handlin.patch | 42 ++++ ...te-net.ipv4.conf.all.proxy_arp_pvlan.patch | 38 ++++ ....ipvx.conf.all.ignore_routes_with_li.patch | 111 +++++++++++ queue-4.9/net-korina-fix-return-value.patch | 43 ++++ ...nfc-s3fwrn5-release-the-nfc-firmware.patch | 41 ++++ ...ch-nfsiod-to-be-an-unbound-workqueue.patch | 52 +++++ ...lock-during-iterate-through-the-list.patch | 79 ++++++++ ...message-level-for-normal-termination.patch | 41 ++++ ...n-readdir-s-mask-for-security-label-.patch | 74 +++++++ ...text-allocation-after-processing-the.patch | 60 ++++++ ...memory-leak-when-using-user-regs-to-.patch | 45 +++++ ...dd-missing-put_device-call-in-pinctr.patch | 64 ++++++ ...fix-cpu_ftrs_always-by-removing-cpu_.patch | 68 +++++++ .../powerpc-ps3-use-dma_mapping_error.patch | 41 ++++ ...hibernation-drop-pseries_suspend_beg.patch | 73 +++++++ .../qlcnic-fix-error-code-in-probe.patch | 36 ++++ ...ma-cxgb4-validate-the-number-of-cqes.patch | 38 ++++ ...work-around-wenum-conversion-warning.patch | 61 ++++++ ...ma-rxe-compute-psn-windows-correctly.patch | 43 ++++ ...-fix-error-return-code-in-fnic_probe.patch | 38 ++++ ...fix-error-return-in-pm8001_pci_probe.patch | 41 ++++ ...avoid-type-mismatch-for-seq_buf_init.patch | 68 +++++++ queue-4.9/series | 82 ++++++++ ...eference-imbalance-in-knav_dma_probe.patch | 72 +++++++ ...-fix-reference-leak-in-knav_queue_pr.patch | 36 ++++ ...speakup-fix-uninitialized-flush_lock.patch | 39 ++++ ...ix-reference-leak-in-img_spfi_resume.patch | 41 ++++ ...-fix-reference-leak-in-ti_qspi_setup.patch | 37 ++++ ...-fix-reference-leak-in-tegra-spi-ops.patch | 46 +++++ ...sh-fix-reference-leak-in-tegra_sflas.patch | 37 ++++ ...k-fix-reference-leak-in-slink-ops-of.patch | 46 +++++ ...codecs-fix-reference-counter-leak-in.patch | 47 +++++ ..._transport-needs-to-support-the-neti.patch | 185 ++++++++++++++++++ queue-4.9/um-chan_xterm-fix-fd-leak.patch | 66 +++++++ ...x-pm-disable-depth-umbalance-in-ehci.patch | 39 ++++ ...hp-hcd-fix-memory-leak-in-oxu_create.patch | 42 ++++ ...io_remap_pfn_range-for-pci-io-memory.patch | 46 +++++ ...oid-context-switch-in-restart-handle.patch | 69 +++++++ ...ore-btf-if-the-single-stepping-is-ca.patch | 46 +++++ 83 files changed, 4307 insertions(+) create mode 100644 queue-4.9/arm-dts-at91-at91sam9rl-fix-adc-triggers.patch create mode 100644 queue-4.9/arm-dts-at91-sama5d3_xplained-add-pincontrol-for-usb.patch create mode 100644 queue-4.9/arm-dts-at91-sama5d4_xplained-add-pincontrol-for-usb.patch create mode 100644 queue-4.9/arm-p2v-fix-handling-of-lpae-translation-in-be-mode.patch create mode 100644 queue-4.9/arm64-dts-exynos-correct-psci-compatible-used-on-exy.patch create mode 100644 queue-4.9/asoc-jz4740-i2s-add-missed-checks-for-clk_get.patch create mode 100644 queue-4.9/asoc-pcm-drain-support-reactivation.patch create mode 100644 queue-4.9/asoc-wm_adsp-remove-ctl-from-list-on-error-in-wm_ads.patch create mode 100644 queue-4.9/bluetooth-fix-null-pointer-dereference-in-hci_event_.patch create mode 100644 queue-4.9/cfg80211-initialize-rekey_data.patch create mode 100644 queue-4.9/checkpatch-fix-unescaped-left-brace.patch create mode 100644 queue-4.9/clk-s2mps11-fix-a-resource-leak-in-error-handling-pa.patch create mode 100644 queue-4.9/clk-tegra-fix-duplicated-se-clock-entry.patch create mode 100644 queue-4.9/clk-ti-fix-memleak-in-ti_fapll_synth_setup.patch create mode 100644 queue-4.9/clocksource-drivers-arm_arch_timer-correct-fault-pro.patch create mode 100644 queue-4.9/clocksource-drivers-cadence_ttc-fix-memory-leak-in-t.patch create mode 100644 queue-4.9/cpufreq-highbank-add-missing-module_device_table.patch create mode 100644 queue-4.9/cpufreq-loongson1-add-missing-module_alias.patch create mode 100644 queue-4.9/cpufreq-scpi-add-missing-module_alias.patch create mode 100644 queue-4.9/cpufreq-st-add-missing-module_device_table.patch create mode 100644 queue-4.9/crypto-omap-aes-fix-pm-disable-depth-imbalance-in-om.patch create mode 100644 queue-4.9/crypto-talitos-fix-return-type-of-current_desc_hdr.patch create mode 100644 queue-4.9/cw1200-fix-missing-destroy_workqueue-on-error-in-cw1.patch create mode 100644 queue-4.9/dm-ioctl-fix-error-return-code-in-target_message.patch create mode 100644 queue-4.9/drivers-soc-ti-knav_qmss_queue-fix-error-return-code.patch create mode 100644 queue-4.9/drm-gma500-fix-double-free-of-gma_connector.patch create mode 100644 queue-4.9/drm-omap-dmm_tiler-fix-return-error-code-in-omap_dmm.patch create mode 100644 queue-4.9/extcon-max77693-fix-modalias-string.patch create mode 100644 queue-4.9/hid-i2c-hid-add-vero-k147-to-descriptor-override.patch-15974 create mode 100644 queue-4.9/hsi-omap_ssi-don-t-jump-to-free-id-in-ssi_add_contro.patch create mode 100644 queue-4.9/input-ads7846-fix-integer-overflow-on-rt-calculation.patch create mode 100644 queue-4.9/input-ads7846-fix-unaligned-access-on-7845.patch create mode 100644 queue-4.9/input-cros_ec_keyb-send-scancodes-in-addition-to-key.patch create mode 100644 queue-4.9/input-goodix-add-upside-down-quirk-for-teclast-x98-p.patch create mode 100644 queue-4.9/irqchip-alpine-msi-fix-freeing-of-interrupts-on-allo.patch create mode 100644 queue-4.9/lockd-don-t-use-interval-based-rebinding-over-tcp.patch create mode 100644 queue-4.9/media-saa7146-fix-array-overflow-in-vidioc_s_audio.patch create mode 100644 queue-4.9/media-siano-fix-memory-leak-of-debugfs-members-in-sm.patch create mode 100644 queue-4.9/media-solo6x10-fix-missing-snd_card_free-in-error-ha.patch create mode 100644 queue-4.9/memstick-fix-a-double-free-bug-in-memstick_check.patch create mode 100644 queue-4.9/memstick-r592-fix-error-return-in-r592_probe.patch create mode 100644 queue-4.9/mips-bcm47xx-fix-kconfig-dependency-bug-for-bcm47xx_.patch create mode 100644 queue-4.9/mips-cdmm-fix-use-after-free-in-mips_cdmm_bus_discov.patch create mode 100644 queue-4.9/net-allwinner-fix-some-resources-leak-in-the-error-h.patch create mode 100644 queue-4.9/net-bcmgenet-fix-a-resource-leak-in-an-error-handlin.patch create mode 100644 queue-4.9/net-evaluate-net.ipv4.conf.all.proxy_arp_pvlan.patch create mode 100644 queue-4.9/net-evaluate-net.ipvx.conf.all.ignore_routes_with_li.patch create mode 100644 queue-4.9/net-korina-fix-return-value.patch create mode 100644 queue-4.9/nfc-s3fwrn5-release-the-nfc-firmware.patch create mode 100644 queue-4.9/nfs-switch-nfsiod-to-be-an-unbound-workqueue.patch create mode 100644 queue-4.9/nfs_common-need-lock-during-iterate-through-the-list.patch create mode 100644 queue-4.9/nfsd-fix-message-level-for-normal-termination.patch create mode 100644 queue-4.9/nfsv4.2-condition-readdir-s-mask-for-security-label-.patch create mode 100644 queue-4.9/orinoco-move-context-allocation-after-processing-the.patch create mode 100644 queue-4.9/perf-record-fix-memory-leak-when-using-user-regs-to-.patch create mode 100644 queue-4.9/pinctrl-falcon-add-missing-put_device-call-in-pinctr.patch create mode 100644 queue-4.9/powerpc-feature-fix-cpu_ftrs_always-by-removing-cpu_.patch create mode 100644 queue-4.9/powerpc-ps3-use-dma_mapping_error.patch create mode 100644 queue-4.9/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch create mode 100644 queue-4.9/qlcnic-fix-error-code-in-probe.patch create mode 100644 queue-4.9/rdma-cxgb4-validate-the-number-of-cqes.patch create mode 100644 queue-4.9/rdma-mthca-work-around-wenum-conversion-warning.patch create mode 100644 queue-4.9/rdma-rxe-compute-psn-windows-correctly.patch create mode 100644 queue-4.9/scsi-fnic-fix-error-return-code-in-fnic_probe.patch create mode 100644 queue-4.9/scsi-pm80xx-fix-error-return-in-pm8001_pci_probe.patch create mode 100644 queue-4.9/seq_buf-avoid-type-mismatch-for-seq_buf_init.patch create mode 100644 queue-4.9/soc-ti-fix-reference-imbalance-in-knav_dma_probe.patch create mode 100644 queue-4.9/soc-ti-knav_qmss-fix-reference-leak-in-knav_queue_pr.patch create mode 100644 queue-4.9/speakup-fix-uninitialized-flush_lock.patch create mode 100644 queue-4.9/spi-img-spfi-fix-reference-leak-in-img_spfi_resume.patch create mode 100644 queue-4.9/spi-spi-ti-qspi-fix-reference-leak-in-ti_qspi_setup.patch create mode 100644 queue-4.9/spi-tegra114-fix-reference-leak-in-tegra-spi-ops.patch create mode 100644 queue-4.9/spi-tegra20-sflash-fix-reference-leak-in-tegra_sflas.patch create mode 100644 queue-4.9/spi-tegra20-slink-fix-reference-leak-in-slink-ops-of.patch create mode 100644 queue-4.9/staging-greybus-codecs-fix-reference-counter-leak-in.patch create mode 100644 queue-4.9/sunrpc-xprt_load_transport-needs-to-support-the-neti.patch create mode 100644 queue-4.9/um-chan_xterm-fix-fd-leak.patch create mode 100644 queue-4.9/usb-ehci-omap-fix-pm-disable-depth-umbalance-in-ehci.patch create mode 100644 queue-4.9/usb-oxu210hp-hcd-fix-memory-leak-in-oxu_create.patch create mode 100644 queue-4.9/vfio-pci-use-io_remap_pfn_range-for-pci-io-memory.patch create mode 100644 queue-4.9/watchdog-qcom-avoid-context-switch-in-restart-handle.patch create mode 100644 queue-4.9/x86-kprobes-restore-btf-if-the-single-stepping-is-ca.patch diff --git a/queue-4.9/arm-dts-at91-at91sam9rl-fix-adc-triggers.patch b/queue-4.9/arm-dts-at91-at91sam9rl-fix-adc-triggers.patch new file mode 100644 index 00000000000..2aa7f66667c --- /dev/null +++ b/queue-4.9/arm-dts-at91-at91sam9rl-fix-adc-triggers.patch @@ -0,0 +1,62 @@ +From c6bf712c2dfc589ecca8dd2b8ea24e3b80019bc8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 28 Nov 2020 23:28:17 +0100 +Subject: ARM: dts: at91: at91sam9rl: fix ADC triggers + +From: Alexandre Belloni + +[ Upstream commit 851a95da583c26e2ddeb7281e9b61f0d76ea5aba ] + +The triggers for the ADC were taken from at91sam9260 dtsi but are not +correct. + +Fixes: a4c1d6c75822 ("ARM: at91/dt: sam9rl: add lcd, adc, usb gadget and pwm support") +Signed-off-by: Alexandre Belloni +Link: https://lore.kernel.org/r/20201128222818.1910764-10-alexandre.belloni@bootlin.com +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/at91sam9rl.dtsi | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi +index 70adf940d98c0..620aa3f555f8a 100644 +--- a/arch/arm/boot/dts/at91sam9rl.dtsi ++++ b/arch/arm/boot/dts/at91sam9rl.dtsi +@@ -266,23 +266,26 @@ + atmel,adc-use-res = "highres"; + + trigger0 { +- trigger-name = "timer-counter-0"; ++ trigger-name = "external-rising"; + trigger-value = <0x1>; ++ trigger-external; + }; ++ + trigger1 { +- trigger-name = "timer-counter-1"; +- trigger-value = <0x3>; ++ trigger-name = "external-falling"; ++ trigger-value = <0x2>; ++ trigger-external; + }; + + trigger2 { +- trigger-name = "timer-counter-2"; +- trigger-value = <0x5>; ++ trigger-name = "external-any"; ++ trigger-value = <0x3>; ++ trigger-external; + }; + + trigger3 { +- trigger-name = "external"; +- trigger-value = <0x13>; +- trigger-external; ++ trigger-name = "continuous"; ++ trigger-value = <0x6>; + }; + }; + +-- +2.27.0 + diff --git a/queue-4.9/arm-dts-at91-sama5d3_xplained-add-pincontrol-for-usb.patch b/queue-4.9/arm-dts-at91-sama5d3_xplained-add-pincontrol-for-usb.patch new file mode 100644 index 00000000000..10bd7d81264 --- /dev/null +++ b/queue-4.9/arm-dts-at91-sama5d3_xplained-add-pincontrol-for-usb.patch @@ -0,0 +1,51 @@ +From dce598c5c02b4ddd6fb43708ef93f1976f60f812 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Nov 2020 14:00:19 +0200 +Subject: ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host + +From: Cristian Birsan + +[ Upstream commit e1062fa7292f1e3744db0a487c4ac0109e09b03d ] + +The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without +it the driver probes but VBus is not powered because of wrong pincontrol +configuration. + +Fixes: b7c2b61570798 ("ARM: at91: add Atmel's SAMA5D3 Xplained board") +Signed-off-by: Cristian Birsan +Signed-off-by: Alexandre Belloni +Acked-by: Ludovic Desroches +Link: https://lore.kernel.org/r/20201118120019.1257580-4-cristian.birsan@microchip.com +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/at91-sama5d3_xplained.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts +index 5a53fcf542abb..07133c5ad2944 100644 +--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts ++++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts +@@ -231,6 +231,11 @@ + atmel,pins = + ; /* PE9, conflicts with A9 */ + }; ++ pinctrl_usb_default: usb_default { ++ atmel,pins = ++ ; ++ }; + }; + }; + }; +@@ -288,6 +293,8 @@ + &pioE 3 GPIO_ACTIVE_LOW + &pioE 4 GPIO_ACTIVE_LOW + >; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usb_default>; + status = "okay"; + }; + +-- +2.27.0 + diff --git a/queue-4.9/arm-dts-at91-sama5d4_xplained-add-pincontrol-for-usb.patch b/queue-4.9/arm-dts-at91-sama5d4_xplained-add-pincontrol-for-usb.patch new file mode 100644 index 00000000000..be83a5a2964 --- /dev/null +++ b/queue-4.9/arm-dts-at91-sama5d4_xplained-add-pincontrol-for-usb.patch @@ -0,0 +1,51 @@ +From d09b57abd4ddcf70eb7d7bd025b822723de7c323 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Nov 2020 14:00:18 +0200 +Subject: ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host + +From: Cristian Birsan + +[ Upstream commit be4dd2d448816a27c1446f8f37fce375daf64148 ] + +The pincontrol node is needed for USB Host since Linux v5.7-rc1. Without +it the driver probes but VBus is not powered because of wrong pincontrol +configuration. + +Fixes: 38153a017896f ("ARM: at91/dt: sama5d4: add dts for sama5d4 xplained board") +Signed-off-by: Cristian Birsan +Signed-off-by: Alexandre Belloni +Acked-by: Ludovic Desroches +Link: https://lore.kernel.org/r/20201118120019.1257580-3-cristian.birsan@microchip.com +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/at91-sama5d4_xplained.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts +index 44d1171c7fc04..4ce8656293837 100644 +--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts ++++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts +@@ -152,6 +152,11 @@ + atmel,pins = + ; + }; ++ pinctrl_usb_default: usb_default { ++ atmel,pins = ++ ; ++ }; + pinctrl_key_gpio: key_gpio_0 { + atmel,pins = + ; +@@ -177,6 +182,8 @@ + &pioE 11 GPIO_ACTIVE_HIGH + &pioE 14 GPIO_ACTIVE_HIGH + >; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usb_default>; + status = "okay"; + }; + +-- +2.27.0 + diff --git a/queue-4.9/arm-p2v-fix-handling-of-lpae-translation-in-be-mode.patch b/queue-4.9/arm-p2v-fix-handling-of-lpae-translation-in-be-mode.patch new file mode 100644 index 00000000000..62946d54ecf --- /dev/null +++ b/queue-4.9/arm-p2v-fix-handling-of-lpae-translation-in-be-mode.patch @@ -0,0 +1,55 @@ +From d2d813db2391433bab8d0ddceeebea110eb68632 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 21 Sep 2020 00:10:16 +0200 +Subject: ARM: p2v: fix handling of LPAE translation in BE mode + +From: Ard Biesheuvel + +[ Upstream commit 4e79f0211b473f8e1eab8211a9fd50cc41a3a061 ] + +When running in BE mode on LPAE hardware with a PA-to-VA translation +that exceeds 4 GB, we patch bits 39:32 of the offset into the wrong +byte of the opcode. So fix that, by rotating the offset in r0 to the +right by 8 bits, which will put the 8-bit immediate in bits 31:24. + +Note that this will also move bit #22 in its correct place when +applying the rotation to the constant #0x400000. + +Fixes: d9a790df8e984 ("ARM: 7883/1: fix mov to mvn conversion in case of 64 bit phys_addr_t and BE") +Acked-by: Nicolas Pitre +Reviewed-by: Linus Walleij +Signed-off-by: Ard Biesheuvel +Signed-off-by: Sasha Levin +--- + arch/arm/kernel/head.S | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S +index 04286fd9e09ce..2e336acd68b0a 100644 +--- a/arch/arm/kernel/head.S ++++ b/arch/arm/kernel/head.S +@@ -673,12 +673,8 @@ ARM_BE8(rev16 ip, ip) + ldrcc r7, [r4], #4 @ use branch for delay slot + bcc 1b + bx lr +-#else +-#ifdef CONFIG_CPU_ENDIAN_BE8 +- moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction + #else + moveq r0, #0x400000 @ set bit 22, mov to mvn instruction +-#endif + b 2f + 1: ldr ip, [r7, r3] + #ifdef CONFIG_CPU_ENDIAN_BE8 +@@ -687,7 +683,7 @@ ARM_BE8(rev16 ip, ip) + tst ip, #0x000f0000 @ check the rotation field + orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 + biceq ip, ip, #0x00004000 @ clear bit 22 +- orreq ip, ip, r0 @ mask in offset bits 7-0 ++ orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0 + #else + bic ip, ip, #0x000000ff + tst ip, #0xf00 @ check the rotation field +-- +2.27.0 + diff --git a/queue-4.9/arm64-dts-exynos-correct-psci-compatible-used-on-exy.patch b/queue-4.9/arm64-dts-exynos-correct-psci-compatible-used-on-exy.patch new file mode 100644 index 00000000000..3e323e829a8 --- /dev/null +++ b/queue-4.9/arm64-dts-exynos-correct-psci-compatible-used-on-exy.patch @@ -0,0 +1,50 @@ +From 24e047270d24b50e2edb5bc30348d3badbe75a9a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Nov 2020 14:39:26 +0100 +Subject: arm64: dts: exynos: Correct psci compatible used on Exynos7 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Paweł Chmiel + +[ Upstream commit e1e47fbca668507a81bb388fcae044b89d112ecc ] + +It's not possible to reboot or poweroff Exynos7420 using PSCI. Instead +we need to use syscon reboot/poweroff drivers, like it's done for other +Exynos SoCs. This was confirmed by checking vendor source and testing it +on Samsung Galaxy S6 device based on this SoC. + +To be able to use custom restart/poweroff handlers instead of PSCI +functions, we need to correct psci compatible. This also requires us to +provide function ids for CPU_ON and CPU_OFF. + +Fixes: fb026cb65247 ("arm64: dts: Add reboot node for exynos7") +Fixes: b9024cbc937d ("arm64: dts: Add initial device tree support for exynos7") +Signed-off-by: Paweł Chmiel +Link: https://lore.kernel.org/r/20201107133926.37187-2-pawel.mikolaj.chmiel@gmail.com +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/exynos/exynos7.dtsi | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi +index 6328a66ed97e4..4c7c40ce50662 100644 +--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi ++++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi +@@ -65,8 +65,10 @@ + }; + + psci { +- compatible = "arm,psci-0.2"; ++ compatible = "arm,psci"; + method = "smc"; ++ cpu_off = <0x84000002>; ++ cpu_on = <0xC4000003>; + }; + + soc: soc { +-- +2.27.0 + diff --git a/queue-4.9/asoc-jz4740-i2s-add-missed-checks-for-clk_get.patch b/queue-4.9/asoc-jz4740-i2s-add-missed-checks-for-clk_get.patch new file mode 100644 index 00000000000..1749f56fe61 --- /dev/null +++ b/queue-4.9/asoc-jz4740-i2s-add-missed-checks-for-clk_get.patch @@ -0,0 +1,44 @@ +From eb1086ce8dfc0f3830d654070f69d20eca41ccd8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Dec 2020 22:42:27 +0800 +Subject: ASoC: jz4740-i2s: add missed checks for clk_get() + +From: Chuhong Yuan + +[ Upstream commit 1c1fb2653a0c2e3f310c07eacd8fc3a10e08c97a ] + +jz4740_i2s_set_sysclk() does not check the return values of clk_get(), +while the file dereferences the pointers in clk_put(). +Add the missed checks to fix it. + +Fixes: 11bd3dd1b7c2 ("ASoC: Add JZ4740 ASoC support") +Signed-off-by: Chuhong Yuan +Link: https://lore.kernel.org/r/20201203144227.418194-1-hslester96@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/jz4740/jz4740-i2s.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c +index 0dc1ab48fcebe..6440729facaf0 100644 +--- a/sound/soc/jz4740/jz4740-i2s.c ++++ b/sound/soc/jz4740/jz4740-i2s.c +@@ -315,10 +315,14 @@ static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, + switch (clk_id) { + case JZ4740_I2S_CLKSRC_EXT: + parent = clk_get(NULL, "ext"); ++ if (IS_ERR(parent)) ++ return PTR_ERR(parent); + clk_set_parent(i2s->clk_i2s, parent); + break; + case JZ4740_I2S_CLKSRC_PLL: + parent = clk_get(NULL, "pll half"); ++ if (IS_ERR(parent)) ++ return PTR_ERR(parent); + clk_set_parent(i2s->clk_i2s, parent); + ret = clk_set_rate(i2s->clk_i2s, freq); + break; +-- +2.27.0 + diff --git a/queue-4.9/asoc-pcm-drain-support-reactivation.patch b/queue-4.9/asoc-pcm-drain-support-reactivation.patch new file mode 100644 index 00000000000..0f34094397d --- /dev/null +++ b/queue-4.9/asoc-pcm-drain-support-reactivation.patch @@ -0,0 +1,51 @@ +From 2c04e0528da3025ef420f6372d24d0988523f22b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Oct 2020 11:01:29 +0100 +Subject: ASoC: pcm: DRAIN support reactivation + +From: Cezary Rojewski + +[ Upstream commit 4c22b80f61540ea99d9b4af0127315338755f05b ] + +soc-pcm's dpcm_fe_dai_do_trigger() supported DRAIN commnad up to kernel +v5.4 where explicit switch(cmd) has been introduced which takes into +account all SNDRV_PCM_TRIGGER_xxx but SNDRV_PCM_TRIGGER_DRAIN. Update +switch statement to reactive support for it. + +As DRAIN is somewhat unique by lacking negative/stop counterpart, bring +behaviour of dpcm_fe_dai_do_trigger() for said command back to its +pre-v5.4 state by adding it to START/RESUME/PAUSE_RELEASE group. + +Fixes: acbf27746ecf ("ASoC: pcm: update FE/BE trigger order based on the command") +Signed-off-by: Cezary Rojewski +Reviewed-by: Ranjani Sridharan +Link: https://lore.kernel.org/r/20201026100129.8216-1-cezary.rojewski@intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/soc-pcm.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c +index b67d105b76e46..6c31a909845cd 100644 +--- a/sound/soc/soc-pcm.c ++++ b/sound/soc/soc-pcm.c +@@ -2186,6 +2186,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ case SNDRV_PCM_TRIGGER_DRAIN: + ret = dpcm_dai_trigger_fe_be(substream, cmd, true); + break; + case SNDRV_PCM_TRIGGER_STOP: +@@ -2203,6 +2204,7 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ case SNDRV_PCM_TRIGGER_DRAIN: + ret = dpcm_dai_trigger_fe_be(substream, cmd, false); + break; + case SNDRV_PCM_TRIGGER_STOP: +-- +2.27.0 + diff --git a/queue-4.9/asoc-wm_adsp-remove-ctl-from-list-on-error-in-wm_ads.patch b/queue-4.9/asoc-wm_adsp-remove-ctl-from-list-on-error-in-wm_ads.patch new file mode 100644 index 00000000000..bbc7ed4fae9 --- /dev/null +++ b/queue-4.9/asoc-wm_adsp-remove-ctl-from-list-on-error-in-wm_ads.patch @@ -0,0 +1,50 @@ +From fd8ca0e326004feb57bc468ccf9d49f874b3aac4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Dec 2020 09:54:09 +0300 +Subject: ASoC: wm_adsp: remove "ctl" from list on error in + wm_adsp_create_control() + +From: Dan Carpenter + +[ Upstream commit 85a7555575a0e48f9b73db310d0d762a08a46d63 ] + +The error handling frees "ctl" but it's still on the "dsp->ctl_list" +list so that could result in a use after free. Remove it from the list +before returning. + +Fixes: 2323736dca72 ("ASoC: wm_adsp: Add basic support for rev 1 firmware file format") +Signed-off-by: Dan Carpenter +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/X9B0keV/02wrx9Xs@mwanda +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm_adsp.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c +index 28eb55bc46634..00dd37f10daff 100644 +--- a/sound/soc/codecs/wm_adsp.c ++++ b/sound/soc/codecs/wm_adsp.c +@@ -1156,7 +1156,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, + ctl_work = kzalloc(sizeof(*ctl_work), GFP_KERNEL); + if (!ctl_work) { + ret = -ENOMEM; +- goto err_ctl_cache; ++ goto err_list_del; + } + + ctl_work->dsp = dsp; +@@ -1166,7 +1166,8 @@ static int wm_adsp_create_control(struct wm_adsp *dsp, + + return 0; + +-err_ctl_cache: ++err_list_del: ++ list_del(&ctl->list); + kfree(ctl->cache); + err_ctl_name: + kfree(ctl->name); +-- +2.27.0 + diff --git a/queue-4.9/bluetooth-fix-null-pointer-dereference-in-hci_event_.patch b/queue-4.9/bluetooth-fix-null-pointer-dereference-in-hci_event_.patch new file mode 100644 index 00000000000..07d536c04b6 --- /dev/null +++ b/queue-4.9/bluetooth-fix-null-pointer-dereference-in-hci_event_.patch @@ -0,0 +1,49 @@ +From 09433368d03685d649f79f9edaa5239f127afde0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 30 Sep 2020 19:48:13 +0530 +Subject: Bluetooth: Fix null pointer dereference in hci_event_packet() + +From: Anmol Karn + +[ Upstream commit 6dfccd13db2ff2b709ef60a50163925d477549aa ] + +AMP_MGR is getting derefernced in hci_phy_link_complete_evt(), when called +from hci_event_packet() and there is a possibility, that hcon->amp_mgr may +not be found when accessing after initialization of hcon. + +- net/bluetooth/hci_event.c:4945 +The bug seems to get triggered in this line: + +bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon; + +Fix it by adding a NULL check for the hcon->amp_mgr before checking the ev-status. + +Fixes: d5e911928bd8 ("Bluetooth: AMP: Process Physical Link Complete evt") +Reported-and-tested-by: syzbot+0bef568258653cff272f@syzkaller.appspotmail.com +Link: https://syzkaller.appspot.com/bug?extid=0bef568258653cff272f +Signed-off-by: Anmol Karn +Signed-off-by: Marcel Holtmann +Signed-off-by: Sasha Levin +--- + net/bluetooth/hci_event.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c +index d4c1c34cfa945..d01bf6a111cee 100644 +--- a/net/bluetooth/hci_event.c ++++ b/net/bluetooth/hci_event.c +@@ -4350,6 +4350,11 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev, + return; + } + ++ if (!hcon->amp_mgr) { ++ hci_dev_unlock(hdev); ++ return; ++ } ++ + if (ev->status) { + hci_conn_del(hcon); + hci_dev_unlock(hdev); +-- +2.27.0 + diff --git a/queue-4.9/cfg80211-initialize-rekey_data.patch b/queue-4.9/cfg80211-initialize-rekey_data.patch new file mode 100644 index 00000000000..6acd95f6fd2 --- /dev/null +++ b/queue-4.9/cfg80211-initialize-rekey_data.patch @@ -0,0 +1,36 @@ +From 4a57ee7cfadc06520bed943723b4e47909325f7b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 29 Nov 2020 17:30:44 +0200 +Subject: cfg80211: initialize rekey_data + +From: Sara Sharon + +[ Upstream commit f495acd8851d7b345e5f0e521b2645b1e1f928a0 ] + +In case we have old supplicant, the akm field is uninitialized. + +Signed-off-by: Sara Sharon +Signed-off-by: Luca Coelho +Link: https://lore.kernel.org/r/iwlwifi.20201129172929.930f0ab7ebee.Ic546e384efab3f4a89f318eafddc3eb7d556aecb@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 5bd89f536720d..ab8bca39afa3f 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -10428,7 +10428,7 @@ static int nl80211_set_rekey_data(struct sk_buff *skb, struct genl_info *info) + struct net_device *dev = info->user_ptr[1]; + struct wireless_dev *wdev = dev->ieee80211_ptr; + struct nlattr *tb[NUM_NL80211_REKEY_DATA]; +- struct cfg80211_gtk_rekey_data rekey_data; ++ struct cfg80211_gtk_rekey_data rekey_data = {}; + int err; + + if (!info->attrs[NL80211_ATTR_REKEY_DATA]) +-- +2.27.0 + diff --git a/queue-4.9/checkpatch-fix-unescaped-left-brace.patch b/queue-4.9/checkpatch-fix-unescaped-left-brace.patch new file mode 100644 index 00000000000..c9813a9eed0 --- /dev/null +++ b/queue-4.9/checkpatch-fix-unescaped-left-brace.patch @@ -0,0 +1,42 @@ +From bac073f4bbba816ef1273cce557e58929585c853 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Dec 2020 20:45:02 -0800 +Subject: checkpatch: fix unescaped left brace + +From: Dwaipayan Ray + +[ Upstream commit 03f4935135b9efeb780b970ba023c201f81cf4e6 ] + +There is an unescaped left brace in a regex in OPEN_BRACE check. This +throws a runtime error when checkpatch is run with --fix flag and the +OPEN_BRACE check is executed. + +Fix it by escaping the left brace. + +Link: https://lkml.kernel.org/r/20201115202928.81955-1-dwaipayanray1@gmail.com +Fixes: 8d1824780f2f ("checkpatch: add --fix option for a couple OPEN_BRACE misuses") +Signed-off-by: Dwaipayan Ray +Acked-by: Joe Perches +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + scripts/checkpatch.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl +index 9432387dc1789..c3b23244e64ff 100755 +--- a/scripts/checkpatch.pl ++++ b/scripts/checkpatch.pl +@@ -3818,7 +3818,7 @@ sub process { + $fix) { + fix_delete_line($fixlinenr, $rawline); + my $fixed_line = $rawline; +- $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; ++ $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*)\{(.*)$/; + my $line1 = $1; + my $line2 = $2; + fix_insert_line($fixlinenr, ltrim($line1)); +-- +2.27.0 + diff --git a/queue-4.9/clk-s2mps11-fix-a-resource-leak-in-error-handling-pa.patch b/queue-4.9/clk-s2mps11-fix-a-resource-leak-in-error-handling-pa.patch new file mode 100644 index 00000000000..8a486afb344 --- /dev/null +++ b/queue-4.9/clk-s2mps11-fix-a-resource-leak-in-error-handling-pa.patch @@ -0,0 +1,41 @@ +From 72260bd4999b1a400ace77f186ded8429ce02bbc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 12 Dec 2020 13:28:18 +0100 +Subject: clk: s2mps11: Fix a resource leak in error handling paths in the + probe function + +From: Christophe JAILLET + +[ Upstream commit d2d94fc567624f96187e8b52083795620f93e69f ] + +Some resource should be released in the error handling path of the probe +function, as already done in the remove function. + +The remove function was fixed in commit bf416bd45738 ("clk: s2mps11: Add +missing of_node_put and of_clk_del_provider") + +Fixes: 7cc560dea415 ("clk: s2mps11: Add support for s2mps11") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/20201212122818.86195-1-christophe.jaillet@wanadoo.fr +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/clk-s2mps11.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c +index f5d74e8db4327..1803af6230b27 100644 +--- a/drivers/clk/clk-s2mps11.c ++++ b/drivers/clk/clk-s2mps11.c +@@ -211,6 +211,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) + return ret; + + err_reg: ++ of_node_put(s2mps11_clks[0].clk_np); + while (--i >= 0) + clkdev_drop(s2mps11_clks[i].lookup); + +-- +2.27.0 + diff --git a/queue-4.9/clk-tegra-fix-duplicated-se-clock-entry.patch b/queue-4.9/clk-tegra-fix-duplicated-se-clock-entry.patch new file mode 100644 index 00000000000..e2118864438 --- /dev/null +++ b/queue-4.9/clk-tegra-fix-duplicated-se-clock-entry.patch @@ -0,0 +1,55 @@ +From 6a014749998bdabefd52c97be153695b9db001ff Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Oct 2020 01:42:12 +0300 +Subject: clk: tegra: Fix duplicated SE clock entry + +From: Dmitry Osipenko + +[ Upstream commit 5bf5861d6ea6c3f4b38fc8fda2062b2dc44ac63d ] + +The periph_clks[] array contains duplicated entry for Security Engine +clock which was meant to be defined for T210, but it wasn't added +properly. This patch corrects the T210 SE entry and fixes the following +error message on T114/T124: "Tegra clk 127: register failed with -17". + +Fixes: dc37fec48314 ("clk: tegra: periph: Add new periph clks and muxes for Tegra210") +Tested-by Nicolas Chauvet +Reported-by Nicolas Chauvet +Signed-off-by: Dmitry Osipenko +Link: https://lore.kernel.org/r/20201025224212.7790-1-digetx@gmail.com +Acked-by: Thierry Reding +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/tegra/clk-id.h | 1 + + drivers/clk/tegra/clk-tegra-periph.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/clk/tegra/clk-id.h b/drivers/clk/tegra/clk-id.h +index 5738635c52741..9f8397c696e6c 100644 +--- a/drivers/clk/tegra/clk-id.h ++++ b/drivers/clk/tegra/clk-id.h +@@ -233,6 +233,7 @@ enum clk_id { + tegra_clk_sdmmc4_8, + tegra_clk_sdmmc4_9, + tegra_clk_se, ++ tegra_clk_se_10, + tegra_clk_soc_therm, + tegra_clk_soc_therm_8, + tegra_clk_sor0, +diff --git a/drivers/clk/tegra/clk-tegra-periph.c b/drivers/clk/tegra/clk-tegra-periph.c +index d9c1f229c644b..bf88f90e6c438 100644 +--- a/drivers/clk/tegra/clk-tegra-periph.c ++++ b/drivers/clk/tegra/clk-tegra-periph.c +@@ -648,7 +648,7 @@ static struct tegra_periph_init_data periph_clks[] = { + INT8("host1x", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_8), + INT8("host1x", mux_pllc4_out1_pllc_pllc4_out2_pllp_clkm_plla_pllc4_out0, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_9), + INT8("se", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), +- INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), ++ INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se_10), + INT8("2d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_2D, 21, 0, tegra_clk_gr2d_8), + INT8("3d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_3D, 24, 0, tegra_clk_gr3d_8), + INT8("vic03", mux_pllm_pllc_pllp_plla_pllc2_c3_clkm, CLK_SOURCE_VIC03, 178, 0, tegra_clk_vic03), +-- +2.27.0 + diff --git a/queue-4.9/clk-ti-fix-memleak-in-ti_fapll_synth_setup.patch b/queue-4.9/clk-ti-fix-memleak-in-ti_fapll_synth_setup.patch new file mode 100644 index 00000000000..e572d9dff4a --- /dev/null +++ b/queue-4.9/clk-ti-fix-memleak-in-ti_fapll_synth_setup.patch @@ -0,0 +1,60 @@ +From 9b81df7b2af19faeece5b3c0ed230371385e4c63 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Nov 2020 21:16:23 +0800 +Subject: clk: ti: Fix memleak in ti_fapll_synth_setup + +From: Zhang Qilong + +[ Upstream commit 8c6239f6e95f583bb763d0228e02d4dd0fb3d492 ] + +If clk_register fails, we should goto free branch +before function returns to prevent memleak. + +Fixes: 163152cbbe321 ("clk: ti: Add support for FAPLL on dm816x") +Reported-by: Hulk Robot +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201113131623.2098222-1-zhangqilong3@huawei.com +Acked-by: Tony Lindgren +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/ti/fapll.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c +index 66a0d0ed8b550..02ff499e36536 100644 +--- a/drivers/clk/ti/fapll.c ++++ b/drivers/clk/ti/fapll.c +@@ -497,6 +497,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, + { + struct clk_init_data *init; + struct fapll_synth *synth; ++ struct clk *clk = ERR_PTR(-ENOMEM); + + init = kzalloc(sizeof(*init), GFP_KERNEL); + if (!init) +@@ -519,13 +520,19 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, + synth->hw.init = init; + synth->clk_pll = pll_clk; + +- return clk_register(NULL, &synth->hw); ++ clk = clk_register(NULL, &synth->hw); ++ if (IS_ERR(clk)) { ++ pr_err("failed to register clock\n"); ++ goto free; ++ } ++ ++ return clk; + + free: + kfree(synth); + kfree(init); + +- return ERR_PTR(-ENOMEM); ++ return clk; + } + + static void __init ti_fapll_setup(struct device_node *node) +-- +2.27.0 + diff --git a/queue-4.9/clocksource-drivers-arm_arch_timer-correct-fault-pro.patch b/queue-4.9/clocksource-drivers-arm_arch_timer-correct-fault-pro.patch new file mode 100644 index 00000000000..944efd41e80 --- /dev/null +++ b/queue-4.9/clocksource-drivers-arm_arch_timer-correct-fault-pro.patch @@ -0,0 +1,70 @@ +From d533c0938504bcd0479285432f22625eb55c3a36 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 4 Dec 2020 15:31:26 +0800 +Subject: clocksource/drivers/arm_arch_timer: Correct fault programming of + CNTKCTL_EL1.EVNTI + +From: Keqian Zhu + +[ Upstream commit 8b7770b877d187bfdae1eaf587bd2b792479a31c ] + +ARM virtual counter supports event stream, it can only trigger an event +when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, +so the actual period of event stream is 2^(cntkctl_evnti + 1). For example, +when the trigger bit is 0, then virtual counter trigger an event for every +two cycles. + +While we're at it, rework the way we compute the trigger bit position +by making it more obvious that when bits [n:n-1] are both set (with n +being the most significant bit), we pick bit (n + 1). + +Fixes: 037f637767a8 ("drivers: clocksource: add support for ARM architected timer event stream") +Suggested-by: Marc Zyngier +Signed-off-by: Keqian Zhu +Acked-by: Marc Zyngier +Signed-off-by: Daniel Lezcano +Link: https://lore.kernel.org/r/20201204073126.6920-3-zhukeqian1@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/clocksource/arm_arch_timer.c | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c +index a2503db7e533e..5d7f83d27093f 100644 +--- a/drivers/clocksource/arm_arch_timer.c ++++ b/drivers/clocksource/arm_arch_timer.c +@@ -426,15 +426,24 @@ static void arch_timer_evtstrm_enable(int divider) + + static void arch_timer_configure_evtstream(void) + { +- int evt_stream_div, pos; ++ int evt_stream_div, lsb; ++ ++ /* ++ * As the event stream can at most be generated at half the frequency ++ * of the counter, use half the frequency when computing the divider. ++ */ ++ evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ / 2; ++ ++ /* ++ * Find the closest power of two to the divisor. If the adjacent bit ++ * of lsb (last set bit, starts from 0) is set, then we use (lsb + 1). ++ */ ++ lsb = fls(evt_stream_div) - 1; ++ if (lsb > 0 && (evt_stream_div & BIT(lsb - 1))) ++ lsb++; + +- /* Find the closest power of two to the divisor */ +- evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ; +- pos = fls(evt_stream_div); +- if (pos > 1 && !(evt_stream_div & (1 << (pos - 2)))) +- pos--; + /* enable event stream */ +- arch_timer_evtstrm_enable(min(pos, 15)); ++ arch_timer_evtstrm_enable(max(0, min(lsb, 15))); + } + + static void arch_counter_set_user_access(void) +-- +2.27.0 + diff --git a/queue-4.9/clocksource-drivers-cadence_ttc-fix-memory-leak-in-t.patch b/queue-4.9/clocksource-drivers-cadence_ttc-fix-memory-leak-in-t.patch new file mode 100644 index 00000000000..65a2f5a9b6d --- /dev/null +++ b/queue-4.9/clocksource-drivers-cadence_ttc-fix-memory-leak-in-t.patch @@ -0,0 +1,74 @@ +From fa33c65e94d847e83a4698e48d2bc0ea3571c576 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Nov 2020 21:51:23 +0800 +Subject: clocksource/drivers/cadence_ttc: Fix memory leak in + ttc_setup_clockevent() + +From: Yu Kuai + +[ Upstream commit eee422c46e6840a81c9db18a497b74387a557b29 ] + +If clk_notifier_register() failed, ttc_setup_clockevent() will return +without freeing 'ttcce', which will leak memory. + +Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error") +Reported-by: Hulk Robot +Signed-off-by: Yu Kuai +Signed-off-by: Daniel Lezcano +Link: https://lore.kernel.org/r/20201116135123.2164033-1-yukuai3@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/clocksource/cadence_ttc_timer.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c +index fbfbdec13b081..7cddc54be96cc 100644 +--- a/drivers/clocksource/cadence_ttc_timer.c ++++ b/drivers/clocksource/cadence_ttc_timer.c +@@ -418,10 +418,8 @@ static int __init ttc_setup_clockevent(struct clk *clk, + ttcce->ttc.clk = clk; + + err = clk_prepare_enable(ttcce->ttc.clk); +- if (err) { +- kfree(ttcce); +- return err; +- } ++ if (err) ++ goto out_kfree; + + ttcce->ttc.clk_rate_change_nb.notifier_call = + ttc_rate_change_clockevent_cb; +@@ -431,7 +429,7 @@ static int __init ttc_setup_clockevent(struct clk *clk, + &ttcce->ttc.clk_rate_change_nb); + if (err) { + pr_warn("Unable to register clock notifier.\n"); +- return err; ++ goto out_kfree; + } + + ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk); +@@ -460,15 +458,17 @@ static int __init ttc_setup_clockevent(struct clk *clk, + + err = request_irq(irq, ttc_clock_event_interrupt, + IRQF_TIMER, ttcce->ce.name, ttcce); +- if (err) { +- kfree(ttcce); +- return err; +- } ++ if (err) ++ goto out_kfree; + + clockevents_config_and_register(&ttcce->ce, + ttcce->ttc.freq / PRESCALE, 1, 0xfffe); + + return 0; ++ ++out_kfree: ++ kfree(ttcce); ++ return err; + } + + /** +-- +2.27.0 + diff --git a/queue-4.9/cpufreq-highbank-add-missing-module_device_table.patch b/queue-4.9/cpufreq-highbank-add-missing-module_device_table.patch new file mode 100644 index 00000000000..76f1aa0112a --- /dev/null +++ b/queue-4.9/cpufreq-highbank-add-missing-module_device_table.patch @@ -0,0 +1,45 @@ +From 2538c726ad24e11a2b94e065122d3701785d589b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 16:11:32 +0100 +Subject: cpufreq: highbank: Add missing MODULE_DEVICE_TABLE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit 9433777a6e0aae27468d3434b75cd51bb88ff711 ] + +This patch adds missing MODULE_DEVICE_TABLE definition which generates +correct modalias for automatic loading of this cpufreq driver when it is +compiled as an external module. + +Signed-off-by: Pali Rohár +Fixes: 6754f556103be ("cpufreq / highbank: add support for highbank cpufreq") +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/highbank-cpufreq.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c +index 1608f7105c9f8..ad743f2f31e78 100644 +--- a/drivers/cpufreq/highbank-cpufreq.c ++++ b/drivers/cpufreq/highbank-cpufreq.c +@@ -104,6 +104,13 @@ out_put_node: + } + module_init(hb_cpufreq_driver_init); + ++static const struct of_device_id __maybe_unused hb_cpufreq_of_match[] = { ++ { .compatible = "calxeda,highbank" }, ++ { .compatible = "calxeda,ecx-2000" }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(of, hb_cpufreq_of_match); ++ + MODULE_AUTHOR("Mark Langsdorf "); + MODULE_DESCRIPTION("Calxeda Highbank cpufreq driver"); + MODULE_LICENSE("GPL"); +-- +2.27.0 + diff --git a/queue-4.9/cpufreq-loongson1-add-missing-module_alias.patch b/queue-4.9/cpufreq-loongson1-add-missing-module_alias.patch new file mode 100644 index 00000000000..51369d12da5 --- /dev/null +++ b/queue-4.9/cpufreq-loongson1-add-missing-module_alias.patch @@ -0,0 +1,38 @@ +From e69cf29873e815e41cd4148107957f061aaec452 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 16:11:37 +0100 +Subject: cpufreq: loongson1: Add missing MODULE_ALIAS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit b9acab091842ca8b288882798bb809f7abf5408a ] + +This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq +driver when it is compiled as an external module. + +Signed-off-by: Pali Rohár +Fixes: a0a22cf14472f ("cpufreq: Loongson1: Add cpufreq driver for Loongson1B") +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/loongson1-cpufreq.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/cpufreq/loongson1-cpufreq.c b/drivers/cpufreq/loongson1-cpufreq.c +index be89416e2358f..9d902f67f8716 100644 +--- a/drivers/cpufreq/loongson1-cpufreq.c ++++ b/drivers/cpufreq/loongson1-cpufreq.c +@@ -217,6 +217,7 @@ static struct platform_driver ls1x_cpufreq_platdrv = { + + module_platform_driver(ls1x_cpufreq_platdrv); + ++MODULE_ALIAS("platform:ls1x-cpufreq"); + MODULE_AUTHOR("Kelvin Cheung "); + MODULE_DESCRIPTION("Loongson1 CPUFreq driver"); + MODULE_LICENSE("GPL"); +-- +2.27.0 + diff --git a/queue-4.9/cpufreq-scpi-add-missing-module_alias.patch b/queue-4.9/cpufreq-scpi-add-missing-module_alias.patch new file mode 100644 index 00000000000..b52b7098253 --- /dev/null +++ b/queue-4.9/cpufreq-scpi-add-missing-module_alias.patch @@ -0,0 +1,38 @@ +From 8d9080d5ab7e59c5807de9966a5c8d78e1fc6573 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 16:11:38 +0100 +Subject: cpufreq: scpi: Add missing MODULE_ALIAS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit c0382d049d2def37b81e907a8b22661a4a4a6eb5 ] + +This patch adds missing MODULE_ALIAS for automatic loading of this cpufreq +driver when it is compiled as an external module. + +Signed-off-by: Pali Rohár +Fixes: 8def31034d033 ("cpufreq: arm_big_little: add SCPI interface driver") +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/scpi-cpufreq.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c +index ea7a4e1b68c26..1a45fbb00d877 100644 +--- a/drivers/cpufreq/scpi-cpufreq.c ++++ b/drivers/cpufreq/scpi-cpufreq.c +@@ -111,6 +111,7 @@ static struct platform_driver scpi_cpufreq_platdrv = { + }; + module_platform_driver(scpi_cpufreq_platdrv); + ++MODULE_ALIAS("platform:scpi-cpufreq"); + MODULE_AUTHOR("Sudeep Holla "); + MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver"); + MODULE_LICENSE("GPL v2"); +-- +2.27.0 + diff --git a/queue-4.9/cpufreq-st-add-missing-module_device_table.patch b/queue-4.9/cpufreq-st-add-missing-module_device_table.patch new file mode 100644 index 00000000000..959385bac30 --- /dev/null +++ b/queue-4.9/cpufreq-st-add-missing-module_device_table.patch @@ -0,0 +1,45 @@ +From 816035f1f5c3201be21643ef29735b524f415397 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 16:11:35 +0100 +Subject: cpufreq: st: Add missing MODULE_DEVICE_TABLE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +[ Upstream commit 183747ab52654eb406fc6b5bfb40806b75d31811 ] + +This patch adds missing MODULE_DEVICE_TABLE definition which generates +correct modalias for automatic loading of this cpufreq driver when it is +compiled as an external module. + +Signed-off-by: Pali Rohár +Fixes: ab0ea257fc58d ("cpufreq: st: Provide runtime initialised driver for ST's platforms") +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/sti-cpufreq.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c +index 2cb3346e82d35..c7f0b2df15cdd 100644 +--- a/drivers/cpufreq/sti-cpufreq.c ++++ b/drivers/cpufreq/sti-cpufreq.c +@@ -294,6 +294,13 @@ register_cpufreq_dt: + } + module_init(sti_cpufreq_init); + ++static const struct of_device_id __maybe_unused sti_cpufreq_of_match[] = { ++ { .compatible = "st,stih407" }, ++ { .compatible = "st,stih410" }, ++ { }, ++}; ++MODULE_DEVICE_TABLE(of, sti_cpufreq_of_match); ++ + MODULE_DESCRIPTION("STMicroelectronics CPUFreq/OPP driver"); + MODULE_AUTHOR("Ajitpal Singh "); + MODULE_AUTHOR("Lee Jones "); +-- +2.27.0 + diff --git a/queue-4.9/crypto-omap-aes-fix-pm-disable-depth-imbalance-in-om.patch b/queue-4.9/crypto-omap-aes-fix-pm-disable-depth-imbalance-in-om.patch new file mode 100644 index 00000000000..c15c9ee9d81 --- /dev/null +++ b/queue-4.9/crypto-omap-aes-fix-pm-disable-depth-imbalance-in-om.patch @@ -0,0 +1,45 @@ +From 698ca2e265baa2835a7734257a8abd233a69fc8e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Nov 2020 21:17:28 +0800 +Subject: crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe + +From: Zhang Qilong + +[ Upstream commit ff8107200367f4abe0e5bce66a245e8d0f2d229e ] + +The pm_runtime_enable will increase power disable depth. +Thus a pairing decrement is needed on the error handling +path to keep it balanced according to context. + +Fixes: f7b2b5dd6a62a ("crypto: omap-aes - add error check for pm_runtime_get_sync") +Signed-off-by: Zhang Qilong +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/omap-aes.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c +index fe32dd95ae4ff..a2d5ba0a0d5a0 100644 +--- a/drivers/crypto/omap-aes.c ++++ b/drivers/crypto/omap-aes.c +@@ -1172,7 +1172,7 @@ static int omap_aes_probe(struct platform_device *pdev) + if (err < 0) { + dev_err(dev, "%s: failed to get_sync(%d)\n", + __func__, err); +- goto err_res; ++ goto err_pm_disable; + } + + omap_aes_dma_stop(dd); +@@ -1257,6 +1257,7 @@ err_engine: + omap_aes_dma_cleanup(dd); + err_irq: + tasklet_kill(&dd->done_task); ++err_pm_disable: + pm_runtime_disable(dev); + err_res: + dd = NULL; +-- +2.27.0 + diff --git a/queue-4.9/crypto-talitos-fix-return-type-of-current_desc_hdr.patch b/queue-4.9/crypto-talitos-fix-return-type-of-current_desc_hdr.patch new file mode 100644 index 00000000000..26a6cc4feae --- /dev/null +++ b/queue-4.9/crypto-talitos-fix-return-type-of-current_desc_hdr.patch @@ -0,0 +1,55 @@ +From cc18164c2884bcea3755f16915b149458144ed25 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Oct 2020 09:34:56 +0000 +Subject: crypto: talitos - Fix return type of current_desc_hdr() + +From: Christophe Leroy + +[ Upstream commit 0237616173fd363a54bd272aa3bd376faa1d7caa ] + +current_desc_hdr() returns a u32 but in fact this is a __be32, +leading to a lot of sparse warnings. + +Change the return type to __be32 and ensure it is handled as +sure by the caller. + +Fixes: 3e721aeb3df3 ("crypto: talitos - handle descriptor not found in error path") +Signed-off-by: Christophe Leroy +Signed-off-by: Herbert Xu +Signed-off-by: Sasha Levin +--- + drivers/crypto/talitos.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c +index 059c2d4ad18fb..f4a6be76468d5 100644 +--- a/drivers/crypto/talitos.c ++++ b/drivers/crypto/talitos.c +@@ -447,7 +447,7 @@ DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE) + /* + * locate current (offending) descriptor + */ +-static u32 current_desc_hdr(struct device *dev, int ch) ++static __be32 current_desc_hdr(struct device *dev, int ch) + { + struct talitos_private *priv = dev_get_drvdata(dev); + int tail, iter; +@@ -478,13 +478,13 @@ static u32 current_desc_hdr(struct device *dev, int ch) + /* + * user diagnostics; report root cause of error based on execution unit status + */ +-static void report_eu_error(struct device *dev, int ch, u32 desc_hdr) ++static void report_eu_error(struct device *dev, int ch, __be32 desc_hdr) + { + struct talitos_private *priv = dev_get_drvdata(dev); + int i; + + if (!desc_hdr) +- desc_hdr = in_be32(priv->chan[ch].reg + TALITOS_DESCBUF); ++ desc_hdr = cpu_to_be32(in_be32(priv->chan[ch].reg + TALITOS_DESCBUF)); + + switch (desc_hdr & DESC_HDR_SEL0_MASK) { + case DESC_HDR_SEL0_AFEU: +-- +2.27.0 + diff --git a/queue-4.9/cw1200-fix-missing-destroy_workqueue-on-error-in-cw1.patch b/queue-4.9/cw1200-fix-missing-destroy_workqueue-on-error-in-cw1.patch new file mode 100644 index 00000000000..a0dff71418e --- /dev/null +++ b/queue-4.9/cw1200-fix-missing-destroy_workqueue-on-error-in-cw1.patch @@ -0,0 +1,46 @@ +From 68efd64e802780649db38ca385607ccd644d020e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Nov 2020 15:08:42 +0800 +Subject: cw1200: fix missing destroy_workqueue() on error in + cw1200_init_common + +From: Qinglang Miao + +[ Upstream commit 7ec8a926188eb8e7a3cbaca43ec44f2d7146d71b ] + +Add the missing destroy_workqueue() before return from +cw1200_init_common in the error handling case. + +Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") +Reported-by: Hulk Robot +Signed-off-by: Qinglang Miao +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20201119070842.1011-1-miaoqinglang@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/st/cw1200/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/wireless/st/cw1200/main.c b/drivers/net/wireless/st/cw1200/main.c +index 84624c812a15f..f4338bce78f4a 100644 +--- a/drivers/net/wireless/st/cw1200/main.c ++++ b/drivers/net/wireless/st/cw1200/main.c +@@ -385,6 +385,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr, + CW1200_LINK_ID_MAX, + cw1200_skb_dtor, + priv)) { ++ destroy_workqueue(priv->workqueue); + ieee80211_free_hw(hw); + return NULL; + } +@@ -396,6 +397,7 @@ static struct ieee80211_hw *cw1200_init_common(const u8 *macaddr, + for (; i > 0; i--) + cw1200_queue_deinit(&priv->tx_queue[i - 1]); + cw1200_queue_stats_deinit(&priv->tx_queue_stats); ++ destroy_workqueue(priv->workqueue); + ieee80211_free_hw(hw); + return NULL; + } +-- +2.27.0 + diff --git a/queue-4.9/dm-ioctl-fix-error-return-code-in-target_message.patch b/queue-4.9/dm-ioctl-fix-error-return-code-in-target_message.patch new file mode 100644 index 00000000000..bb2de948fc3 --- /dev/null +++ b/queue-4.9/dm-ioctl-fix-error-return-code-in-target_message.patch @@ -0,0 +1,36 @@ +From 5d36a41f63181fb529b96ec1c962da097c2ac1fc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 28 Nov 2020 18:19:59 +0800 +Subject: dm ioctl: fix error return code in target_message + +From: Qinglang Miao + +[ Upstream commit 4d7659bfbe277a43399a4a2d90fca141e70f29e1 ] + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. + +Fixes: 2ca4c92f58f9 ("dm ioctl: prevent empty message") +Reported-by: Hulk Robot +Signed-off-by: Qinglang Miao +Signed-off-by: Mike Snitzer +Signed-off-by: Sasha Levin +--- + drivers/md/dm-ioctl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c +index 6964b252952a4..836a2808c0c71 100644 +--- a/drivers/md/dm-ioctl.c ++++ b/drivers/md/dm-ioctl.c +@@ -1549,6 +1549,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size) + + if (!argc) { + DMWARN("Empty message received."); ++ r = -EINVAL; + goto out_argv; + } + +-- +2.27.0 + diff --git a/queue-4.9/drivers-soc-ti-knav_qmss_queue-fix-error-return-code.patch b/queue-4.9/drivers-soc-ti-knav_qmss_queue-fix-error-return-code.patch new file mode 100644 index 00000000000..605d037c79d --- /dev/null +++ b/queue-4.9/drivers-soc-ti-knav_qmss_queue-fix-error-return-code.patch @@ -0,0 +1,41 @@ +From 69f55c17eae0af493cd493a8a079072e1e9cc527 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 21 Nov 2020 19:22:38 -0800 +Subject: drivers: soc: ti: knav_qmss_queue: Fix error return code in + knav_queue_probe + +From: Zhihao Cheng + +[ Upstream commit 4cba398f37f868f515ff12868418dc28574853a1 ] + +Fix to return the error code from of_get_child_by_name() instaed of 0 +in knav_queue_probe(). + +Fixes: 41f93af900a20d1a0a ("soc: ti: add Keystone Navigator QMSS driver") +Reported-by: Hulk Robot +Signed-off-by: Zhihao Cheng +Signed-off-by: Santosh Shilimkar +Signed-off-by: Sasha Levin +--- + drivers/soc/ti/knav_qmss_queue.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c +index fec97882ac880..5248649b0b41e 100644 +--- a/drivers/soc/ti/knav_qmss_queue.c ++++ b/drivers/soc/ti/knav_qmss_queue.c +@@ -1785,9 +1785,10 @@ static int knav_queue_probe(struct platform_device *pdev) + if (ret) + goto err; + +- regions = of_get_child_by_name(node, "descriptor-regions"); ++ regions = of_get_child_by_name(node, "descriptor-regions"); + if (!regions) { + dev_err(dev, "descriptor-regions not specified\n"); ++ ret = -ENODEV; + goto err; + } + ret = knav_queue_setup_regions(kdev, regions); +-- +2.27.0 + diff --git a/queue-4.9/drm-gma500-fix-double-free-of-gma_connector.patch b/queue-4.9/drm-gma500-fix-double-free-of-gma_connector.patch new file mode 100644 index 00000000000..55d248fb160 --- /dev/null +++ b/queue-4.9/drm-gma500-fix-double-free-of-gma_connector.patch @@ -0,0 +1,45 @@ +From 41c14d93786435ba6f91c4b83c562d98a018adfb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 3 Oct 2020 12:39:28 -0700 +Subject: drm/gma500: fix double free of gma_connector + +From: Tom Rix + +[ Upstream commit 4e19d51ca5b28a1d435a844c7b2a8e1b1b6fa237 ] + +clang static analysis reports this problem: + +cdv_intel_dp.c:2101:2: warning: Attempt to free released memory + kfree(gma_connector); + ^~~~~~~~~~~~~~~~~~~~ + +In cdv_intel_dp_init() when the call to cdv_intel_edp_panel_vdd_off() +fails, the handler calls cdv_intel_dp_destroy(connector) which does +the first free of gma_connector. So adjust the goto label and skip +the second free. + +Fixes: d112a8163f83 ("gma500/cdv: Add eDP support") +Signed-off-by: Tom Rix +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20201003193928.18869-1-trix@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c +index 7ec4e3fbafd8c..ec6ea202cf5de 100644 +--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c ++++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c +@@ -2126,7 +2126,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev + DRM_INFO("failed to retrieve link info, disabling eDP\n"); + cdv_intel_dp_encoder_destroy(encoder); + cdv_intel_dp_destroy(connector); +- goto err_priv; ++ goto err_connector; + } else { + DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n", + intel_dp->dpcd[0], intel_dp->dpcd[1], +-- +2.27.0 + diff --git a/queue-4.9/drm-omap-dmm_tiler-fix-return-error-code-in-omap_dmm.patch b/queue-4.9/drm-omap-dmm_tiler-fix-return-error-code-in-omap_dmm.patch new file mode 100644 index 00000000000..ae98be716e9 --- /dev/null +++ b/queue-4.9/drm-omap-dmm_tiler-fix-return-error-code-in-omap_dmm.patch @@ -0,0 +1,36 @@ +From ff6b26806f8ec3d8b10116f043800d380f09b0bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Nov 2020 14:10:45 +0800 +Subject: drm/omap: dmm_tiler: fix return error code in omap_dmm_probe() + +From: Yang Yingliang + +[ Upstream commit 723ae803218da993143387bf966042eccefac077 ] + +Return -ENOMEM when allocating refill memory failed. + +Fixes: 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform") +Reported-by: Hulk Robot +Signed-off-by: Yang Yingliang +Signed-off-by: Thomas Zimmermann +Link: https://patchwork.freedesktop.org/patch/msgid/20201117061045.3452287-1-yangyingliang@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +index 6a0b25e0823fa..6b64a1e07c017 100644 +--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c ++++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +@@ -747,6 +747,7 @@ static int omap_dmm_probe(struct platform_device *dev) + &omap_dmm->refill_pa, GFP_KERNEL); + if (!omap_dmm->refill_va) { + dev_err(&dev->dev, "could not allocate refill memory\n"); ++ ret = -ENOMEM; + goto fail; + } + +-- +2.27.0 + diff --git a/queue-4.9/extcon-max77693-fix-modalias-string.patch b/queue-4.9/extcon-max77693-fix-modalias-string.patch new file mode 100644 index 00000000000..f1de43069a0 --- /dev/null +++ b/queue-4.9/extcon-max77693-fix-modalias-string.patch @@ -0,0 +1,34 @@ +From 8c0e265cd0da0839ea1cae59735da4b07c268a78 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 8 Dec 2020 14:36:27 +0100 +Subject: extcon: max77693: Fix modalias string + +From: Marek Szyprowski + +[ Upstream commit e1efdb604f5c9903a5d92ef42244009d3c04880f ] + +The platform device driver name is "max77693-muic", so advertise it +properly in the modalias string. This fixes automated module loading when +this driver is compiled as a module. + +Fixes: db1b9037424b ("extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device") +Signed-off-by: Marek Szyprowski +Signed-off-by: Chanwoo Choi +Signed-off-by: Sasha Levin +--- + drivers/extcon/extcon-max77693.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c +index 68dbcb814b2ff..4cf72487381e3 100644 +--- a/drivers/extcon/extcon-max77693.c ++++ b/drivers/extcon/extcon-max77693.c +@@ -1272,4 +1272,4 @@ module_platform_driver(max77693_muic_driver); + MODULE_DESCRIPTION("Maxim MAX77693 Extcon driver"); + MODULE_AUTHOR("Chanwoo Choi "); + MODULE_LICENSE("GPL"); +-MODULE_ALIAS("platform:extcon-max77693"); ++MODULE_ALIAS("platform:max77693-muic"); +-- +2.27.0 + diff --git a/queue-4.9/hid-i2c-hid-add-vero-k147-to-descriptor-override.patch-15974 b/queue-4.9/hid-i2c-hid-add-vero-k147-to-descriptor-override.patch-15974 new file mode 100644 index 00000000000..8b6f2a8751e --- /dev/null +++ b/queue-4.9/hid-i2c-hid-add-vero-k147-to-descriptor-override.patch-15974 @@ -0,0 +1,43 @@ +From b26876a40b3b172e6d07df5b196b34a7e8fa8600 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Nov 2020 18:51:58 +0100 +Subject: HID: i2c-hid: add Vero K147 to descriptor override + +From: Julian Sax + +commit c870d50ce387d84b6438211a7044c60afbd5d60a upstream. + +This device uses the SIPODEV SP1064 touchpad, which does not +supply descriptors, so it has to be added to the override list. + +Cc: stable@vger.kernel.org +Signed-off-by: Julian Sax +Reviewed-by: Hans de Goede +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +index 58a753ef27175..5808eed6d6ba6 100644 +--- a/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c ++++ b/drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +@@ -405,6 +405,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { + }, + .driver_data = (void *)&sipodev_desc + }, ++ { ++ .ident = "Vero K147", ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VERO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "K147"), ++ }, ++ .driver_data = (void *)&sipodev_desc ++ }, + { } /* Terminate list */ + }; + +-- +2.27.0 + diff --git a/queue-4.9/hsi-omap_ssi-don-t-jump-to-free-id-in-ssi_add_contro.patch b/queue-4.9/hsi-omap_ssi-don-t-jump-to-free-id-in-ssi_add_contro.patch new file mode 100644 index 00000000000..51447264c7f --- /dev/null +++ b/queue-4.9/hsi-omap_ssi-don-t-jump-to-free-id-in-ssi_add_contro.patch @@ -0,0 +1,36 @@ +From 36ec9d1c3f1d92885d16274f288c4c6868ceb243 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Oct 2020 10:56:43 +0800 +Subject: HSI: omap_ssi: Don't jump to free ID in ssi_add_controller() + +From: Jing Xiangfeng + +[ Upstream commit 41fff6e19bc8d6d8bca79ea388427c426e72e097 ] + +In current code, it jumps to ida_simple_remove() when ida_simple_get() +failes to allocate an ID. Just return to fix it. + +Fixes: 0fae198988b8 ("HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module") +Signed-off-by: Jing Xiangfeng +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +--- + drivers/hsi/controllers/omap_ssi_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c +index 9a29b34ed2c82..22cd7169011d1 100644 +--- a/drivers/hsi/controllers/omap_ssi_core.c ++++ b/drivers/hsi/controllers/omap_ssi_core.c +@@ -391,7 +391,7 @@ static int ssi_add_controller(struct hsi_controller *ssi, + + err = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL); + if (err < 0) +- goto out_err; ++ return err; + ssi->id = err; + + ssi->owner = THIS_MODULE; +-- +2.27.0 + diff --git a/queue-4.9/input-ads7846-fix-integer-overflow-on-rt-calculation.patch b/queue-4.9/input-ads7846-fix-integer-overflow-on-rt-calculation.patch new file mode 100644 index 00000000000..a077b37e0b1 --- /dev/null +++ b/queue-4.9/input-ads7846-fix-integer-overflow-on-rt-calculation.patch @@ -0,0 +1,52 @@ +From d20cf4928c78ea69af5b36044017fe0e4ad020bc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Nov 2020 15:33:24 -0800 +Subject: Input: ads7846 - fix integer overflow on Rt calculation + +From: Oleksij Rempel + +[ Upstream commit 820830ec918f6c3dcd77a54a1c6198ab57407916 ] + +In some rare cases the 32 bit Rt value will overflow if z2 and x is max, +z1 is minimal value and x_plate_ohms is relatively high (for example 800 +ohm). This would happen on some screen age with low pressure. + +There are two possible fixes: +- make Rt 64bit +- reorder calculation to avoid overflow + +The second variant seems to be preferable, since 64 bit calculation on +32 bit system is a bit more expensive. + +Fixes: ffa458c1bd9b6f653008d450f337602f3d52a646 ("spi: ads7846 driver") +Co-developed-by: David Jander +Signed-off-by: David Jander +Signed-off-by: Oleksij Rempel +Link: https://lore.kernel.org/r/20201113112240.1360-1-o.rempel@pengutronix.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/ads7846.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c +index 1ce3ecbe37f89..9fa7ae12df80a 100644 +--- a/drivers/input/touchscreen/ads7846.c ++++ b/drivers/input/touchscreen/ads7846.c +@@ -785,10 +785,11 @@ static void ads7846_report_state(struct ads7846 *ts) + /* compute touch pressure resistance using equation #2 */ + Rt = z2; + Rt -= z1; +- Rt *= x; + Rt *= ts->x_plate_ohms; ++ Rt = DIV_ROUND_CLOSEST(Rt, 16); ++ Rt *= x; + Rt /= z1; +- Rt = (Rt + 2047) >> 12; ++ Rt = DIV_ROUND_CLOSEST(Rt, 256); + } else { + Rt = 0; + } +-- +2.27.0 + diff --git a/queue-4.9/input-ads7846-fix-unaligned-access-on-7845.patch b/queue-4.9/input-ads7846-fix-unaligned-access-on-7845.patch new file mode 100644 index 00000000000..60e379e5e4f --- /dev/null +++ b/queue-4.9/input-ads7846-fix-unaligned-access-on-7845.patch @@ -0,0 +1,43 @@ +From 6f316bc88f43d2ce81c343fe861526838cab3ebf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Nov 2020 17:17:11 -0800 +Subject: Input: ads7846 - fix unaligned access on 7845 + +From: Dmitry Torokhov + +[ Upstream commit 03e2c9c782f721b661a0e42b1b58f394b5298544 ] + +req->sample[1] is not naturally aligned at word boundary, and therefore we +should use get_unaligned_be16() when accessing it. + +Fixes: 3eac5c7e44f3 ("Input: ads7846 - extend the driver for ads7845 controller support") +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/ads7846.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c +index 9fa7ae12df80a..b77a2178fdec4 100644 +--- a/drivers/input/touchscreen/ads7846.c ++++ b/drivers/input/touchscreen/ads7846.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + /* + * This code has been heavily tested on a Nokia 770, and lightly +@@ -410,7 +411,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command) + + if (status == 0) { + /* BE12 value, then padding */ +- status = be16_to_cpu(*((u16 *)&req->sample[1])); ++ status = get_unaligned_be16(&req->sample[1]); + status = status >> 3; + status &= 0x0fff; + } +-- +2.27.0 + diff --git a/queue-4.9/input-cros_ec_keyb-send-scancodes-in-addition-to-key.patch b/queue-4.9/input-cros_ec_keyb-send-scancodes-in-addition-to-key.patch new file mode 100644 index 00000000000..ac8a821cfa9 --- /dev/null +++ b/queue-4.9/input-cros_ec_keyb-send-scancodes-in-addition-to-key.patch @@ -0,0 +1,37 @@ +From abd4841f8461221cab80726db89ad8262410eb70 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Dec 2020 17:59:53 -0800 +Subject: Input: cros_ec_keyb - send 'scancodes' in addition to key events + +From: Dmitry Torokhov + +[ Upstream commit 80db2a087f425b63f0163bc95217abd01c637cb5 ] + +To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE +and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in +addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN +capability, so it is only matter of actually sending the events. + +Link: https://lore.kernel.org/r/X87aOaSptPTvZ3nZ@google.com +Acked-by: Rajat Jain +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/keyboard/cros_ec_keyb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c +index 25943e9bc8bff..328792e26a9f6 100644 +--- a/drivers/input/keyboard/cros_ec_keyb.c ++++ b/drivers/input/keyboard/cros_ec_keyb.c +@@ -140,6 +140,7 @@ static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev, + "changed: [r%d c%d]: byte %02x\n", + row, col, new_state); + ++ input_event(idev, EV_MSC, MSC_SCAN, pos); + input_report_key(idev, keycodes[pos], + new_state); + } +-- +2.27.0 + diff --git a/queue-4.9/input-goodix-add-upside-down-quirk-for-teclast-x98-p.patch b/queue-4.9/input-goodix-add-upside-down-quirk-for-teclast-x98-p.patch new file mode 100644 index 00000000000..26d70bdcef5 --- /dev/null +++ b/queue-4.9/input-goodix-add-upside-down-quirk-for-teclast-x98-p.patch @@ -0,0 +1,47 @@ +From a0fc8eb28286e232219c967de228d6d0b249edf6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Dec 2020 16:17:32 -0800 +Subject: Input: goodix - add upside-down quirk for Teclast X98 Pro tablet + +From: Simon Beginn + +[ Upstream commit cffdd6d90482316e18d686060a4397902ea04bd2 ] + +The touchscreen on the Teclast x98 Pro is also mounted upside-down in +relation to the display orientation. + +Signed-off-by: Simon Beginn +Signed-off-by: Bastien Nocera +Link: https://lore.kernel.org/r/20201117004253.27A5A27EFD@localhost +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/goodix.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c +index 6a02e7301297d..ba0ab9963f3cd 100644 +--- a/drivers/input/touchscreen/goodix.c ++++ b/drivers/input/touchscreen/goodix.c +@@ -98,6 +98,18 @@ static const struct dmi_system_id rotated_screen[] = { + DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"), + }, + }, ++ { ++ .ident = "Teclast X98 Pro", ++ .matches = { ++ /* ++ * Only match BIOS date, because the manufacturers ++ * BIOS does not report the board name at all ++ * (sometimes)... ++ */ ++ DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"), ++ DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"), ++ }, ++ }, + { + .ident = "WinBook TW100", + .matches = { +-- +2.27.0 + diff --git a/queue-4.9/irqchip-alpine-msi-fix-freeing-of-interrupts-on-allo.patch b/queue-4.9/irqchip-alpine-msi-fix-freeing-of-interrupts-on-allo.patch new file mode 100644 index 00000000000..5c2af060a4e --- /dev/null +++ b/queue-4.9/irqchip-alpine-msi-fix-freeing-of-interrupts-on-allo.patch @@ -0,0 +1,43 @@ +From 44992460502d86b11eb7872e72d2162cc2e04d40 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 29 Nov 2020 13:55:25 +0000 +Subject: irqchip/alpine-msi: Fix freeing of interrupts on allocation error + path + +From: Marc Zyngier + +[ Upstream commit 3841245e8498a789c65dedd7ffa8fb2fee2c0684 ] + +The alpine-msi driver has an interesting allocation error handling, +where it frees the same interrupts repeatedly. Hilarity follows. + +This code is probably never executed, but let's fix it nonetheless. + +Fixes: e6b78f2c3e14 ("irqchip: Add the Alpine MSIX interrupt controller") +Signed-off-by: Marc Zyngier +Reviewed-by: Antoine Tenart +Cc: Tsahee Zidenberg +Cc: Antoine Tenart +Link: https://lore.kernel.org/r/20201129135525.396671-1-maz@kernel.org +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-alpine-msi.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c +index 63d980995d17d..ac431697ebe1c 100644 +--- a/drivers/irqchip/irq-alpine-msi.c ++++ b/drivers/irqchip/irq-alpine-msi.c +@@ -165,8 +165,7 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain, + return 0; + + err_sgi: +- while (--i >= 0) +- irq_domain_free_irqs_parent(domain, virq, i); ++ irq_domain_free_irqs_parent(domain, virq, i - 1); + alpine_msix_free_sgi(priv, sgi, nr_irqs); + return err; + } +-- +2.27.0 + diff --git a/queue-4.9/lockd-don-t-use-interval-based-rebinding-over-tcp.patch b/queue-4.9/lockd-don-t-use-interval-based-rebinding-over-tcp.patch new file mode 100644 index 00000000000..fa96b50acc0 --- /dev/null +++ b/queue-4.9/lockd-don-t-use-interval-based-rebinding-over-tcp.patch @@ -0,0 +1,99 @@ +From 5afd2b18b5a5817544d091be60657303db657242 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Oct 2020 20:16:27 +0000 +Subject: lockd: don't use interval-based rebinding over TCP + +From: Calum Mackay + +[ Upstream commit 9b82d88d5976e5f2b8015d58913654856576ace5 ] + +NLM uses an interval-based rebinding, i.e. it clears the transport's +binding under certain conditions if more than 60 seconds have elapsed +since the connection was last bound. + +This rebinding is not necessary for an autobind RPC client over a +connection-oriented protocol like TCP. + +It can also cause problems: it is possible for nlm_bind_host() to clear +XPRT_BOUND whilst a connection worker is in the middle of trying to +reconnect, after it had already been checked in xprt_connect(). + +When the connection worker notices that XPRT_BOUND has been cleared +under it, in xs_tcp_finish_connecting(), that results in: + + xs_tcp_setup_socket: connect returned unhandled error -107 + +Worse, it's possible that the two can get into lockstep, resulting in +the same behaviour repeated indefinitely, with the above error every +300 seconds, without ever recovering, and the connection never being +established. This has been seen in practice, with a large number of NLM +client tasks, following a server restart. + +The existing callers of nlm_bind_host & nlm_rebind_host should not need +to force the rebind, for TCP, so restrict the interval-based rebinding +to UDP only. + +For TCP, we will still rebind when needed, e.g. on timeout, and connection +error (including closure), since connection-related errors on an existing +connection, ECONNREFUSED when trying to connect, and rpc_check_timeout(), +already unconditionally clear XPRT_BOUND. + +To avoid having to add the fix, and explanation, to both nlm_bind_host() +and nlm_rebind_host(), remove the duplicate code from the former, and +have it call the latter. + +Drop the dprintk, which adds no value over a trace. + +Signed-off-by: Calum Mackay +Fixes: 35f5a422ce1a ("SUNRPC: new interface to force an RPC rebind") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/lockd/host.c | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/fs/lockd/host.c b/fs/lockd/host.c +index c7eb47f2fb6c3..603fa652b965d 100644 +--- a/fs/lockd/host.c ++++ b/fs/lockd/host.c +@@ -430,12 +430,7 @@ nlm_bind_host(struct nlm_host *host) + * RPC rebind is required + */ + if ((clnt = host->h_rpcclnt) != NULL) { +- if (time_after_eq(jiffies, host->h_nextrebind)) { +- rpc_force_rebind(clnt); +- host->h_nextrebind = jiffies + NLM_HOST_REBIND; +- dprintk("lockd: next rebind in %lu jiffies\n", +- host->h_nextrebind - jiffies); +- } ++ nlm_rebind_host(host); + } else { + unsigned long increment = nlmsvc_timeout; + struct rpc_timeout timeparms = { +@@ -483,13 +478,20 @@ nlm_bind_host(struct nlm_host *host) + return clnt; + } + +-/* +- * Force a portmap lookup of the remote lockd port ++/** ++ * nlm_rebind_host - If needed, force a portmap lookup of the peer's lockd port ++ * @host: NLM host handle for peer ++ * ++ * This is not needed when using a connection-oriented protocol, such as TCP. ++ * The existing autobind mechanism is sufficient to force a rebind when ++ * required, e.g. on connection state transitions. + */ + void + nlm_rebind_host(struct nlm_host *host) + { +- dprintk("lockd: rebind host %s\n", host->h_name); ++ if (host->h_proto != IPPROTO_UDP) ++ return; ++ + if (host->h_rpcclnt && time_after_eq(jiffies, host->h_nextrebind)) { + rpc_force_rebind(host->h_rpcclnt); + host->h_nextrebind = jiffies + NLM_HOST_REBIND; +-- +2.27.0 + diff --git a/queue-4.9/media-saa7146-fix-array-overflow-in-vidioc_s_audio.patch b/queue-4.9/media-saa7146-fix-array-overflow-in-vidioc_s_audio.patch new file mode 100644 index 00000000000..a8aebff68d6 --- /dev/null +++ b/queue-4.9/media-saa7146-fix-array-overflow-in-vidioc_s_audio.patch @@ -0,0 +1,56 @@ +From 17c43f92665c21de1c605806654dc15321a170ea Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Nov 2020 08:23:40 +0100 +Subject: media: saa7146: fix array overflow in vidioc_s_audio() + +From: Dan Carpenter + +[ Upstream commit 8e4d86e241cf035d6d3467cd346e7ce490681937 ] + +The "a->index" value comes from the user via the ioctl. The problem is +that the shift can wrap resulting in setting "mxb->cur_audinput" to an +invalid value, which later results in an array overflow. + +Fixes: 6680427791c9 ("[media] mxb: fix audio handling") +Signed-off-by: Dan Carpenter +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Sasha Levin +--- + drivers/media/pci/saa7146/mxb.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c +index 504d788076392..3e8753c9e1e47 100644 +--- a/drivers/media/pci/saa7146/mxb.c ++++ b/drivers/media/pci/saa7146/mxb.c +@@ -652,16 +652,17 @@ static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio * + struct mxb *mxb = (struct mxb *)dev->ext_priv; + + DEB_D("VIDIOC_S_AUDIO %d\n", a->index); +- if (mxb_inputs[mxb->cur_input].audioset & (1 << a->index)) { +- if (mxb->cur_audinput != a->index) { +- mxb->cur_audinput = a->index; +- tea6420_route(mxb, a->index); +- if (mxb->cur_audinput == 0) +- mxb_update_audmode(mxb); +- } +- return 0; ++ if (a->index >= 32 || ++ !(mxb_inputs[mxb->cur_input].audioset & (1 << a->index))) ++ return -EINVAL; ++ ++ if (mxb->cur_audinput != a->index) { ++ mxb->cur_audinput = a->index; ++ tea6420_route(mxb, a->index); ++ if (mxb->cur_audinput == 0) ++ mxb_update_audmode(mxb); + } +- return -EINVAL; ++ return 0; + } + + #ifdef CONFIG_VIDEO_ADV_DEBUG +-- +2.27.0 + diff --git a/queue-4.9/media-siano-fix-memory-leak-of-debugfs-members-in-sm.patch b/queue-4.9/media-siano-fix-memory-leak-of-debugfs-members-in-sm.patch new file mode 100644 index 00000000000..f9b15fa7f37 --- /dev/null +++ b/queue-4.9/media-siano-fix-memory-leak-of-debugfs-members-in-sm.patch @@ -0,0 +1,47 @@ +From 09c60ddb6ec6a9767f04adbc69190a5d34157e6c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Sep 2020 14:56:57 +0200 +Subject: media: siano: fix memory leak of debugfs members in smsdvb_hotplug + +From: Keita Suzuki + +[ Upstream commit abf287eeff4c6da6aa804bbd429dfd9d0dfb6ea7 ] + +When dvb_create_media_graph fails, the debugfs kept inside client should +be released. However, the current implementation does not release them. + +Fix this by adding a new goto label to call smsdvb_debugfs_release. + +Fixes: 0d3ab8410dcb ("[media] dvb core: must check dvb_create_media_graph()") +Signed-off-by: Keita Suzuki +Signed-off-by: Sean Young +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Sasha Levin +--- + drivers/media/common/siano/smsdvb-main.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c +index 9148e14c9d077..9d5eb8b6aede9 100644 +--- a/drivers/media/common/siano/smsdvb-main.c ++++ b/drivers/media/common/siano/smsdvb-main.c +@@ -1180,12 +1180,15 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, + rc = dvb_create_media_graph(&client->adapter, true); + if (rc < 0) { + pr_err("dvb_create_media_graph failed %d\n", rc); +- goto client_error; ++ goto media_graph_error; + } + + pr_info("DVB interface registered.\n"); + return 0; + ++media_graph_error: ++ smsdvb_debugfs_release(client); ++ + client_error: + dvb_unregister_frontend(&client->frontend); + +-- +2.27.0 + diff --git a/queue-4.9/media-solo6x10-fix-missing-snd_card_free-in-error-ha.patch b/queue-4.9/media-solo6x10-fix-missing-snd_card_free-in-error-ha.patch new file mode 100644 index 00000000000..876559455c0 --- /dev/null +++ b/queue-4.9/media-solo6x10-fix-missing-snd_card_free-in-error-ha.patch @@ -0,0 +1,38 @@ +From 8f2523164ecac1dbe3a7c4212be4262199dad076 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Nov 2020 04:22:01 +0100 +Subject: media: solo6x10: fix missing snd_card_free in error handling case + +From: Qinglang Miao + +[ Upstream commit dcdff74fa6bc00c32079d0bebd620764c26f2d89 ] + +Fix to goto snd_error in error handling case when fails +to do snd_ctl_add, as done elsewhere in this function. + +Fixes: 28cae868cd24 ("[media] solo6x10: move out of staging into drivers/media/pci.") +Reported-by: Hulk Robot +Signed-off-by: Qinglang Miao +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Sasha Levin +--- + drivers/media/pci/solo6x10/solo6x10-g723.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/media/pci/solo6x10/solo6x10-g723.c b/drivers/media/pci/solo6x10/solo6x10-g723.c +index 6a35107aca255..0fe69e71331db 100644 +--- a/drivers/media/pci/solo6x10/solo6x10-g723.c ++++ b/drivers/media/pci/solo6x10/solo6x10-g723.c +@@ -385,7 +385,7 @@ int solo_g723_init(struct solo_dev *solo_dev) + + ret = snd_ctl_add(card, snd_ctl_new1(&kctl, solo_dev)); + if (ret < 0) +- return ret; ++ goto snd_error; + + ret = solo_snd_pcm_init(solo_dev); + if (ret < 0) +-- +2.27.0 + diff --git a/queue-4.9/memstick-fix-a-double-free-bug-in-memstick_check.patch b/queue-4.9/memstick-fix-a-double-free-bug-in-memstick_check.patch new file mode 100644 index 00000000000..6b5b717260c --- /dev/null +++ b/queue-4.9/memstick-fix-a-double-free-bug-in-memstick_check.patch @@ -0,0 +1,37 @@ +From 50b3300230fbeb647add55324be127529649e0ec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 20 Nov 2020 15:48:46 +0800 +Subject: memstick: fix a double-free bug in memstick_check + +From: Qinglang Miao + +[ Upstream commit e3e9ced5c93803d5b2ea1942c4bf0192622531d6 ] + +kfree(host->card) has been called in put_device so that +another kfree would raise cause a double-free bug. + +Fixes: 0193383a5833 ("memstick: core: fix device_register() error handling") +Reported-by: Hulk Robot +Signed-off-by: Qinglang Miao +Link: https://lore.kernel.org/r/20201120074846.31322-1-miaoqinglang@huawei.com +Signed-off-by: Ulf Hansson +Signed-off-by: Sasha Levin +--- + drivers/memstick/core/memstick.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c +index 1041eb7a61672..2cae85a7ca6de 100644 +--- a/drivers/memstick/core/memstick.c ++++ b/drivers/memstick/core/memstick.c +@@ -469,7 +469,6 @@ static void memstick_check(struct work_struct *work) + host->card = card; + if (device_register(&card->dev)) { + put_device(&card->dev); +- kfree(host->card); + host->card = NULL; + } + } else +-- +2.27.0 + diff --git a/queue-4.9/memstick-r592-fix-error-return-in-r592_probe.patch b/queue-4.9/memstick-r592-fix-error-return-in-r592_probe.patch new file mode 100644 index 00000000000..63408a19c8a --- /dev/null +++ b/queue-4.9/memstick-r592-fix-error-return-in-r592_probe.patch @@ -0,0 +1,57 @@ +From 2ef3ec532ac58fd2a9eb1f2f6e940d2ed40df703 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Nov 2020 09:47:18 +0800 +Subject: memstick: r592: Fix error return in r592_probe() + +From: Jing Xiangfeng + +[ Upstream commit db29d3d1c2451e673e29c7257471e3ce9d50383a ] + +Fix to return a error code from the error handling case instead of 0. + +Fixes: 926341250102 ("memstick: add driver for Ricoh R5C592 card reader") +Signed-off-by: Jing Xiangfeng +Link: https://lore.kernel.org/r/20201125014718.153563-1-jingxiangfeng@huawei.com +Signed-off-by: Ulf Hansson +Signed-off-by: Sasha Levin +--- + drivers/memstick/host/r592.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c +index d5cfb503b9d69..2539984c1db1c 100644 +--- a/drivers/memstick/host/r592.c ++++ b/drivers/memstick/host/r592.c +@@ -762,8 +762,10 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) + goto error3; + + dev->mmio = pci_ioremap_bar(pdev, 0); +- if (!dev->mmio) ++ if (!dev->mmio) { ++ error = -ENOMEM; + goto error4; ++ } + + dev->irq = pdev->irq; + spin_lock_init(&dev->irq_lock); +@@ -790,12 +792,14 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id) + &dev->dummy_dma_page_physical_address, GFP_KERNEL); + r592_stop_dma(dev , 0); + +- if (request_irq(dev->irq, &r592_irq, IRQF_SHARED, +- DRV_NAME, dev)) ++ error = request_irq(dev->irq, &r592_irq, IRQF_SHARED, ++ DRV_NAME, dev); ++ if (error) + goto error6; + + r592_update_card_detect(dev); +- if (memstick_add_host(host)) ++ error = memstick_add_host(host); ++ if (error) + goto error7; + + message("driver successfully loaded"); +-- +2.27.0 + diff --git a/queue-4.9/mips-bcm47xx-fix-kconfig-dependency-bug-for-bcm47xx_.patch b/queue-4.9/mips-bcm47xx-fix-kconfig-dependency-bug-for-bcm47xx_.patch new file mode 100644 index 00000000000..8319c409ab3 --- /dev/null +++ b/queue-4.9/mips-bcm47xx-fix-kconfig-dependency-bug-for-bcm47xx_.patch @@ -0,0 +1,48 @@ +From a256aabe872947c269b70b7f195f4da1ae88a86c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 00:34:01 +0300 +Subject: MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA + +From: Necip Fazil Yildiran + +[ Upstream commit 3a5fe2fb9635c43359c9729352f45044f3c8df6b ] + +When BCM47XX_BCMA is enabled and BCMA_DRIVER_PCI is disabled, it results +in the following Kbuild warning: + +WARNING: unmet direct dependencies detected for BCMA_DRIVER_PCI_HOSTMODE + Depends on [n]: MIPS [=y] && BCMA_DRIVER_PCI [=n] && PCI_DRIVERS_LEGACY [=y] && BCMA [=y]=y + Selected by [y]: + - BCM47XX_BCMA [=y] && BCM47XX [=y] && PCI [=y] + +The reason is that BCM47XX_BCMA selects BCMA_DRIVER_PCI_HOSTMODE without +depending on or selecting BCMA_DRIVER_PCI while BCMA_DRIVER_PCI_HOSTMODE +depends on BCMA_DRIVER_PCI. This can also fail building the kernel. + +Honor the kconfig dependency to remove unmet direct dependency warnings +and avoid any potential build failures. + +Fixes: c1d1c5d4213e ("bcm47xx: add support for bcma bus") +Link: https://bugzilla.kernel.org/show_bug.cgi?id=209879 +Signed-off-by: Necip Fazil Yildiran +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/bcm47xx/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/bcm47xx/Kconfig b/arch/mips/bcm47xx/Kconfig +index e970fd9cf7693..7ca7384fd5c9d 100644 +--- a/arch/mips/bcm47xx/Kconfig ++++ b/arch/mips/bcm47xx/Kconfig +@@ -26,6 +26,7 @@ config BCM47XX_BCMA + select BCMA + select BCMA_HOST_SOC + select BCMA_DRIVER_MIPS ++ select BCMA_DRIVER_PCI if PCI + select BCMA_DRIVER_PCI_HOSTMODE if PCI + select BCMA_DRIVER_GPIO + default y +-- +2.27.0 + diff --git a/queue-4.9/mips-cdmm-fix-use-after-free-in-mips_cdmm_bus_discov.patch b/queue-4.9/mips-cdmm-fix-use-after-free-in-mips_cdmm_bus_discov.patch new file mode 100644 index 00000000000..e669542ec76 --- /dev/null +++ b/queue-4.9/mips-cdmm-fix-use-after-free-in-mips_cdmm_bus_discov.patch @@ -0,0 +1,41 @@ +From 93bbaa04614303ce0915b63cad1372003a2a20fe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 20 Nov 2020 15:48:47 +0800 +Subject: mips: cdmm: fix use-after-free in mips_cdmm_bus_discover + +From: Qinglang Miao + +[ Upstream commit f0e82242b16826077a2775eacfe201d803bb7a22 ] + +kfree(dev) has been called inside put_device so anther +kfree would cause a use-after-free bug/ + +Fixes: 8286ae03308c ("MIPS: Add CDMM bus support") +Reported-by: Hulk Robot +Signed-off-by: Qinglang Miao +Acked-by: Serge Semin +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + drivers/bus/mips_cdmm.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c +index 1b14256376d24..7c1da45be166e 100644 +--- a/drivers/bus/mips_cdmm.c ++++ b/drivers/bus/mips_cdmm.c +@@ -544,10 +544,8 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus) + dev_set_name(&dev->dev, "cdmm%u-%u", cpu, id); + ++id; + ret = device_register(&dev->dev); +- if (ret) { ++ if (ret) + put_device(&dev->dev); +- kfree(dev); +- } + } + } + +-- +2.27.0 + diff --git a/queue-4.9/net-allwinner-fix-some-resources-leak-in-the-error-h.patch b/queue-4.9/net-allwinner-fix-some-resources-leak-in-the-error-h.patch new file mode 100644 index 00000000000..086b75c6076 --- /dev/null +++ b/queue-4.9/net-allwinner-fix-some-resources-leak-in-the-error-h.patch @@ -0,0 +1,65 @@ +From f549e6a3cdd9b54d780e03fb726ff84b85491dc0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Dec 2020 21:21:17 +0100 +Subject: net: allwinner: Fix some resources leak in the error handling path of + the probe and in the remove function + +From: Christophe JAILLET + +[ Upstream commit 322e53d1e2529ae9d501f5e0f20604a79b873aef ] + +'irq_of_parse_and_map()' should be balanced by a corresponding +'irq_dispose_mapping()' call. Otherwise, there is some resources leaks. + +Add such a call in the error handling path of the probe function and in the +remove function. + +Fixes: 492205050d77 ("net: Add EMAC ethernet driver found on Allwinner A10 SoC's") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/20201214202117.146293-1-christophe.jaillet@wanadoo.fr +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/allwinner/sun4i-emac.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c +index 672a8212c8d96..3dc101f7d6bd8 100644 +--- a/drivers/net/ethernet/allwinner/sun4i-emac.c ++++ b/drivers/net/ethernet/allwinner/sun4i-emac.c +@@ -827,13 +827,13 @@ static int emac_probe(struct platform_device *pdev) + db->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(db->clk)) { + ret = PTR_ERR(db->clk); +- goto out_iounmap; ++ goto out_dispose_mapping; + } + + ret = clk_prepare_enable(db->clk); + if (ret) { + dev_err(&pdev->dev, "Error couldn't enable clock (%d)\n", ret); +- goto out_iounmap; ++ goto out_dispose_mapping; + } + + ret = sunxi_sram_claim(&pdev->dev); +@@ -890,6 +890,8 @@ out_release_sram: + sunxi_sram_release(&pdev->dev); + out_clk_disable_unprepare: + clk_disable_unprepare(db->clk); ++out_dispose_mapping: ++ irq_dispose_mapping(ndev->irq); + out_iounmap: + iounmap(db->membase); + out: +@@ -908,6 +910,7 @@ static int emac_remove(struct platform_device *pdev) + unregister_netdev(ndev); + sunxi_sram_release(&pdev->dev); + clk_disable_unprepare(db->clk); ++ irq_dispose_mapping(ndev->irq); + iounmap(db->membase); + free_netdev(ndev); + +-- +2.27.0 + diff --git a/queue-4.9/net-bcmgenet-fix-a-resource-leak-in-an-error-handlin.patch b/queue-4.9/net-bcmgenet-fix-a-resource-leak-in-an-error-handlin.patch new file mode 100644 index 00000000000..4c1100294aa --- /dev/null +++ b/queue-4.9/net-bcmgenet-fix-a-resource-leak-in-an-error-handlin.patch @@ -0,0 +1,42 @@ +From 7be464786ac233b832f8a66292c4fe32ee829107 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 12 Dec 2020 19:20:05 +0100 +Subject: net: bcmgenet: Fix a resource leak in an error handling path in the + probe functin + +From: Christophe JAILLET + +[ Upstream commit 4375ada01963d1ebf733d60d1bb6e5db401e1ac6 ] + +If the 'register_netdev()' call fails, we must undo a previous +'bcmgenet_mii_init()' call. + +Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file") +Signed-off-by: Christophe JAILLET +Acked-by: Florian Fainelli +Link: https://lore.kernel.org/r/20201212182005.120437-1-christophe.jaillet@wanadoo.fr +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +index 5d4189c94718c..2921ae13db283 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -3433,8 +3433,10 @@ static int bcmgenet_probe(struct platform_device *pdev) + clk_disable_unprepare(priv->clk); + + err = register_netdev(dev); +- if (err) ++ if (err) { ++ bcmgenet_mii_exit(dev); + goto err; ++ } + + return err; + +-- +2.27.0 + diff --git a/queue-4.9/net-evaluate-net.ipv4.conf.all.proxy_arp_pvlan.patch b/queue-4.9/net-evaluate-net.ipv4.conf.all.proxy_arp_pvlan.patch new file mode 100644 index 00000000000..491fc17d0d8 --- /dev/null +++ b/queue-4.9/net-evaluate-net.ipv4.conf.all.proxy_arp_pvlan.patch @@ -0,0 +1,38 @@ +From 07d1ca76a13c0b3824639e5a4f6b979f242d592d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Nov 2020 20:35:14 +0100 +Subject: net: evaluate net.ipv4.conf.all.proxy_arp_pvlan + +From: Vincent Bernat + +[ Upstream commit 1af5318c00a8acc33a90537af49b3f23f72a2c4b ] + +Introduced in 65324144b50b, the "proxy_arp_vlan" sysctl is a +per-interface sysctl to tune proxy ARP support for private VLANs. +While the "all" variant is exposed, it was a noop and never evaluated. +We use the usual "or" logic for this kind of sysctls. + +Fixes: 65324144b50b ("net: RFC3069, private VLAN proxy arp support") +Signed-off-by: Vincent Bernat +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + include/linux/inetdevice.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h +index 0e6cd645f67f3..65e88c62db7b2 100644 +--- a/include/linux/inetdevice.h ++++ b/include/linux/inetdevice.h +@@ -100,7 +100,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) + + #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) + #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) +-#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) ++#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP_PVLAN) + #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) + #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) + #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ +-- +2.27.0 + diff --git a/queue-4.9/net-evaluate-net.ipvx.conf.all.ignore_routes_with_li.patch b/queue-4.9/net-evaluate-net.ipvx.conf.all.ignore_routes_with_li.patch new file mode 100644 index 00000000000..6d1e85b0aec --- /dev/null +++ b/queue-4.9/net-evaluate-net.ipvx.conf.all.ignore_routes_with_li.patch @@ -0,0 +1,111 @@ +From 2cd91e6be9525287832639ee59d173624bf4c60b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Nov 2020 20:35:13 +0100 +Subject: net: evaluate net.ipvX.conf.all.ignore_routes_with_linkdown + +From: Vincent Bernat + +[ Upstream commit c0c5a60f0f1311bcf08bbe735122096d6326fb5b ] + +Introduced in 0eeb075fad73, the "ignore_routes_with_linkdown" sysctl +ignores a route whose interface is down. It is provided as a +per-interface sysctl. However, while a "all" variant is exposed, it +was a noop since it was never evaluated. We use the usual "or" logic +for this kind of sysctls. + +Tested with: + + ip link add type veth # veth0 + veth1 + ip link add type veth # veth1 + veth2 + ip link set up dev veth0 + ip link set up dev veth1 # link-status paired with veth0 + ip link set up dev veth2 + ip link set up dev veth3 # link-status paired with veth2 + + # First available path + ip -4 addr add 203.0.113.${uts#H}/24 dev veth0 + ip -6 addr add 2001:db8:1::${uts#H}/64 dev veth0 + + # Second available path + ip -4 addr add 192.0.2.${uts#H}/24 dev veth2 + ip -6 addr add 2001:db8:2::${uts#H}/64 dev veth2 + + # More specific route through first path + ip -4 route add 198.51.100.0/25 via 203.0.113.254 # via veth0 + ip -6 route add 2001:db8:3::/56 via 2001:db8:1::ff # via veth0 + + # Less specific route through second path + ip -4 route add 198.51.100.0/24 via 192.0.2.254 # via veth2 + ip -6 route add 2001:db8:3::/48 via 2001:db8:2::ff # via veth2 + + # H1: enable on "all" + # H2: enable on "veth0" + for v in ipv4 ipv6; do + case $uts in + H1) + sysctl -qw net.${v}.conf.all.ignore_routes_with_linkdown=1 + ;; + H2) + sysctl -qw net.${v}.conf.veth0.ignore_routes_with_linkdown=1 + ;; + esac + done + + set -xe + # When veth0 is up, best route is through veth0 + ip -o route get 198.51.100.1 | grep -Fw veth0 + ip -o route get 2001:db8:3::1 | grep -Fw veth0 + + # When veth0 is down, best route should be through veth2 on H1/H2, + # but on veth0 on H2 + ip link set down dev veth1 # down veth0 + ip route show + [ $uts != H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth0 + [ $uts != H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth0 + [ $uts = H3 ] || ip -o route get 198.51.100.1 | grep -Fw veth2 + [ $uts = H3 ] || ip -o route get 2001:db8:3::1 | grep -Fw veth2 + +Without this patch, the two last lines would fail on H1 (the one using +the "all" sysctl). With the patch, everything succeeds as expected. + +Also document the sysctl in `ip-sysctl.rst`. + +Fixes: 0eeb075fad73 ("net: ipv4 sysctl option to ignore routes when nexthop link is down") +Signed-off-by: Vincent Bernat +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + Documentation/networking/ip-sysctl.txt | 3 +++ + include/linux/inetdevice.h | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt +index a374412610ba3..1526fc785a084 100644 +--- a/Documentation/networking/ip-sysctl.txt ++++ b/Documentation/networking/ip-sysctl.txt +@@ -1237,6 +1237,9 @@ igmpv3_unsolicited_report_interval - INTEGER + IGMPv3 report retransmit will take place. + Default: 1000 (1 seconds) + ++ignore_routes_with_linkdown - BOOLEAN ++ Ignore routes whose link is down when performing a FIB lookup. ++ + promote_secondaries - BOOLEAN + When a primary IP address is removed from this interface + promote a corresponding secondary IP address instead of +diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h +index ee971f335a8b6..0e6cd645f67f3 100644 +--- a/include/linux/inetdevice.h ++++ b/include/linux/inetdevice.h +@@ -121,7 +121,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) + IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS))) + + #define IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev) \ +- IN_DEV_CONF_GET((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) ++ IN_DEV_ORCONF((in_dev), IGNORE_ROUTES_WITH_LINKDOWN) + + #define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) + #define IN_DEV_ARP_ACCEPT(in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT) +-- +2.27.0 + diff --git a/queue-4.9/net-korina-fix-return-value.patch b/queue-4.9/net-korina-fix-return-value.patch new file mode 100644 index 00000000000..01d7a48dd19 --- /dev/null +++ b/queue-4.9/net-korina-fix-return-value.patch @@ -0,0 +1,43 @@ +From 411b7f82f47af3588fe33a077e3fcac8be05ec59 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Dec 2020 23:09:52 +0100 +Subject: net: korina: fix return value +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Vincent Stehlé + +[ Upstream commit 7eb000bdbe7c7da811ef51942b356f6e819b13ba ] + +The ndo_start_xmit() method must not attempt to free the skb to transmit +when returning NETDEV_TX_BUSY. Therefore, make sure the +korina_send_packet() function returns NETDEV_TX_OK when it frees a packet. + +Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC") +Suggested-by: Jakub Kicinski +Signed-off-by: Vincent Stehlé +Acked-by: Florian Fainelli +Link: https://lore.kernel.org/r/20201214220952.19935-1-vincent.stehle@laposte.net +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/korina.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c +index cd8895838a04c..4cf1fc89df3c6 100644 +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -216,7 +216,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) + dev_kfree_skb_any(skb); + spin_unlock_irqrestore(&lp->lock, flags); + +- return NETDEV_TX_BUSY; ++ return NETDEV_TX_OK; + } + } + +-- +2.27.0 + diff --git a/queue-4.9/nfc-s3fwrn5-release-the-nfc-firmware.patch b/queue-4.9/nfc-s3fwrn5-release-the-nfc-firmware.patch new file mode 100644 index 00000000000..2608b54a7dc --- /dev/null +++ b/queue-4.9/nfc-s3fwrn5-release-the-nfc-firmware.patch @@ -0,0 +1,41 @@ +From 6ddb85784130dfc55b35d208f815279826398ef2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 13 Dec 2020 18:58:50 +0900 +Subject: nfc: s3fwrn5: Release the nfc firmware + +From: Bongsu Jeon + +[ Upstream commit a4485baefa1efa596702ebffd5a9c760d42b14b5 ] + +add the code to release the nfc firmware when the firmware image size is +wrong. + +Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") +Signed-off-by: Bongsu Jeon +Reviewed-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20201213095850.28169-1-bongsu.jeon@samsung.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/nfc/s3fwrn5/firmware.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c +index 5f97da1947e39..e6ca1f9a7f63e 100644 +--- a/drivers/nfc/s3fwrn5/firmware.c ++++ b/drivers/nfc/s3fwrn5/firmware.c +@@ -304,8 +304,10 @@ static int s3fwrn5_fw_request_firmware(struct s3fwrn5_fw_info *fw_info) + if (ret < 0) + return ret; + +- if (fw->fw->size < S3FWRN5_FW_IMAGE_HEADER_SIZE) ++ if (fw->fw->size < S3FWRN5_FW_IMAGE_HEADER_SIZE) { ++ release_firmware(fw->fw); + return -EINVAL; ++ } + + memcpy(fw->date, fw->fw->data + 0x00, 12); + fw->date[12] = '\0'; +-- +2.27.0 + diff --git a/queue-4.9/nfs-switch-nfsiod-to-be-an-unbound-workqueue.patch b/queue-4.9/nfs-switch-nfsiod-to-be-an-unbound-workqueue.patch new file mode 100644 index 00000000000..73f55c60147 --- /dev/null +++ b/queue-4.9/nfs-switch-nfsiod-to-be-an-unbound-workqueue.patch @@ -0,0 +1,52 @@ +From 5cca90080694325ec7cbf27d0dc9a5a5dfbcbc61 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Nov 2020 11:24:33 +1100 +Subject: NFS: switch nfsiod to be an UNBOUND workqueue. + +From: NeilBrown + +[ Upstream commit bf701b765eaa82dd164d65edc5747ec7288bb5c3 ] + +nfsiod is currently a concurrency-managed workqueue (CMWQ). +This means that workitems scheduled to nfsiod on a given CPU are queued +behind all other work items queued on any CMWQ on the same CPU. This +can introduce unexpected latency. + +Occaionally nfsiod can even cause excessive latency. If the work item +to complete a CLOSE request calls the final iput() on an inode, the +address_space of that inode will be dismantled. This takes time +proportional to the number of in-memory pages, which on a large host +working on large files (e.g.. 5TB), can be a large number of pages +resulting in a noticable number of seconds. + +We can avoid these latency problems by switching nfsiod to WQ_UNBOUND. +This causes each concurrent work item to gets a dedicated thread which +can be scheduled to an idle CPU. + +There is precedent for this as several other filesystems use WQ_UNBOUND +workqueue for handling various async events. + +Signed-off-by: NeilBrown +Fixes: ada609ee2ac2 ("workqueue: use WQ_MEM_RECLAIM instead of WQ_RESCUER") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c +index 851274b25d394..6c0035761d170 100644 +--- a/fs/nfs/inode.c ++++ b/fs/nfs/inode.c +@@ -1995,7 +1995,7 @@ static int nfsiod_start(void) + { + struct workqueue_struct *wq; + dprintk("RPC: creating workqueue nfsiod\n"); +- wq = alloc_workqueue("nfsiod", WQ_MEM_RECLAIM, 0); ++ wq = alloc_workqueue("nfsiod", WQ_MEM_RECLAIM | WQ_UNBOUND, 0); + if (wq == NULL) + return -ENOMEM; + nfsiod_workqueue = wq; +-- +2.27.0 + diff --git a/queue-4.9/nfs_common-need-lock-during-iterate-through-the-list.patch b/queue-4.9/nfs_common-need-lock-during-iterate-through-the-list.patch new file mode 100644 index 00000000000..aac07ad5cc6 --- /dev/null +++ b/queue-4.9/nfs_common-need-lock-during-iterate-through-the-list.patch @@ -0,0 +1,79 @@ +From 4da89ecbd3bd6d0354069fac4c2ee587000ceb0b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Dec 2020 07:06:35 -0500 +Subject: nfs_common: need lock during iterate through the list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Cheng Lin + +[ Upstream commit 4a9d81caf841cd2c0ae36abec9c2963bf21d0284 ] + +If the elem is deleted during be iterated on it, the iteration +process will fall into an endless loop. + +kernel: NMI watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [nfsd:17137] + +PID: 17137  TASK: ffff8818d93c0000  CPU: 4   COMMAND: "nfsd" +    [exception RIP: __state_in_grace+76] +    RIP: ffffffffc00e817c  RSP: ffff8818d3aefc98  RFLAGS: 00000246 +    RAX: ffff881dc0c38298  RBX: ffffffff81b03580  RCX: ffff881dc02c9f50 +    RDX: ffff881e3fce8500  RSI: 0000000000000001  RDI: ffffffff81b03580 +    RBP: ffff8818d3aefca0   R8: 0000000000000020   R9: ffff8818d3aefd40 +    R10: ffff88017fc03800  R11: ffff8818e83933c0  R12: ffff8818d3aefd40 +    R13: 0000000000000000  R14: ffff8818e8391068  R15: ffff8818fa6e4000 +    CS: 0010  SS: 0018 + #0 [ffff8818d3aefc98] opens_in_grace at ffffffffc00e81e3 [grace] + #1 [ffff8818d3aefca8] nfs4_preprocess_stateid_op at ffffffffc02a3e6c [nfsd] + #2 [ffff8818d3aefd18] nfsd4_write at ffffffffc028ed5b [nfsd] + #3 [ffff8818d3aefd80] nfsd4_proc_compound at ffffffffc0290a0d [nfsd] + #4 [ffff8818d3aefdd0] nfsd_dispatch at ffffffffc027b800 [nfsd] + #5 [ffff8818d3aefe08] svc_process_common at ffffffffc02017f3 [sunrpc] + #6 [ffff8818d3aefe70] svc_process at ffffffffc0201ce3 [sunrpc] + #7 [ffff8818d3aefe98] nfsd at ffffffffc027b117 [nfsd] + #8 [ffff8818d3aefec8] kthread at ffffffff810b88c1 + #9 [ffff8818d3aeff50] ret_from_fork at ffffffff816d1607 + +The troublemake elem: +crash> lock_manager ffff881dc0c38298 +struct lock_manager { +  list = { +    next = 0xffff881dc0c38298, +    prev = 0xffff881dc0c38298 +  }, +  block_opens = false +} + +Fixes: c87fb4a378f9 ("lockd: NLM grace period shouldn't block NFSv4 opens") +Signed-off-by: Cheng Lin  +Signed-off-by: Yi Wang  +Signed-off-by: Chuck Lever +Signed-off-by: Sasha Levin +--- + fs/nfs_common/grace.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c +index 77d136ac89099..c21fca0dcba74 100644 +--- a/fs/nfs_common/grace.c ++++ b/fs/nfs_common/grace.c +@@ -75,10 +75,14 @@ __state_in_grace(struct net *net, bool open) + if (!open) + return !list_empty(grace_list); + ++ spin_lock(&grace_lock); + list_for_each_entry(lm, grace_list, list) { +- if (lm->block_opens) ++ if (lm->block_opens) { ++ spin_unlock(&grace_lock); + return true; ++ } + } ++ spin_unlock(&grace_lock); + return false; + } + +-- +2.27.0 + diff --git a/queue-4.9/nfsd-fix-message-level-for-normal-termination.patch b/queue-4.9/nfsd-fix-message-level-for-normal-termination.patch new file mode 100644 index 00000000000..3f9aba40933 --- /dev/null +++ b/queue-4.9/nfsd-fix-message-level-for-normal-termination.patch @@ -0,0 +1,41 @@ +From 45342a5f667bc2954463e7ab57600dc05728e864 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 27 Nov 2020 15:26:59 +0900 +Subject: nfsd: Fix message level for normal termination + +From: kazuo ito + +[ Upstream commit 4420440c57892779f265108f46f83832a88ca795 ] + +The warning message from nfsd terminating normally +can confuse system adminstrators or monitoring software. + +Though it's not exactly fair to pin-point a commit where it +originated, the current form in the current place started +to appear in: + +Fixes: e096bbc6488d ("knfsd: remove special handling for SIGHUP") +Signed-off-by: kazuo ito +Signed-off-by: Chuck Lever +Signed-off-by: Sasha Levin +--- + fs/nfsd/nfssvc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c +index 60291d10f8e4a..6bb3f3a98d7de 100644 +--- a/fs/nfsd/nfssvc.c ++++ b/fs/nfsd/nfssvc.c +@@ -393,8 +393,7 @@ static void nfsd_last_thread(struct svc_serv *serv, struct net *net) + return; + + nfsd_shutdown_net(net); +- printk(KERN_WARNING "nfsd: last server has exited, flushing export " +- "cache\n"); ++ pr_info("nfsd: last server has exited, flushing export cache\n"); + nfsd_export_flush(net); + } + +-- +2.27.0 + diff --git a/queue-4.9/nfsv4.2-condition-readdir-s-mask-for-security-label-.patch b/queue-4.9/nfsv4.2-condition-readdir-s-mask-for-security-label-.patch new file mode 100644 index 00000000000..de472c4b88a --- /dev/null +++ b/queue-4.9/nfsv4.2-condition-readdir-s-mask-for-security-label-.patch @@ -0,0 +1,74 @@ +From 2225d975864e97c194520eb96a1f8ac57b76e86f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Nov 2020 16:03:38 -0500 +Subject: NFSv4.2: condition READDIR's mask for security label based on LSM + state + +From: Olga Kornievskaia + +[ Upstream commit 05ad917561fca39a03338cb21fe9622f998b0f9c ] + +Currently, the client will always ask for security_labels if the server +returns that it supports that feature regardless of any LSM modules +(such as Selinux) enforcing security policy. This adds performance +penalty to the READDIR operation. + +Client adjusts superblock's support of the security_label based on +the server's support but also current client's configuration of the +LSM modules. Thus, prior to using the default bitmask in READDIR, +this patch checks the server's capabilities and then instructs +READDIR to remove FATTR4_WORD2_SECURITY_LABEL from the bitmask. + +v5: fixing silly mistakes of the rushed v4 +v4: simplifying logic +v3: changing label's initialization per Ondrej's comment +v2: dropping selinux hook and using the sb cap. + +Suggested-by: Ondrej Mosnacek +Suggested-by: Scott Mayhew +Signed-off-by: Olga Kornievskaia +Fixes: 2b0143b5c986 ("VFS: normal filesystems (and lustre): d_inode() annotations") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/nfs4proc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index 4e2f18c26535d..2abdb2070c879 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -4334,12 +4334,12 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, + u64 cookie, struct page **pages, unsigned int count, int plus) + { + struct inode *dir = d_inode(dentry); ++ struct nfs_server *server = NFS_SERVER(dir); + struct nfs4_readdir_arg args = { + .fh = NFS_FH(dir), + .pages = pages, + .pgbase = 0, + .count = count, +- .bitmask = NFS_SERVER(d_inode(dentry))->attr_bitmask, + .plus = plus, + }; + struct nfs4_readdir_res res; +@@ -4354,9 +4354,15 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, + dprintk("%s: dentry = %pd2, cookie = %Lu\n", __func__, + dentry, + (unsigned long long)cookie); ++ if (!(server->caps & NFS_CAP_SECURITY_LABEL)) ++ args.bitmask = server->attr_bitmask_nl; ++ else ++ args.bitmask = server->attr_bitmask; ++ + nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); + res.pgbase = args.pgbase; +- status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); ++ status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, ++ &res.seq_res, 0); + if (status >= 0) { + memcpy(NFS_I(dir)->cookieverf, res.verifier.data, NFS4_VERIFIER_SIZE); + status += args.pgbase; +-- +2.27.0 + diff --git a/queue-4.9/orinoco-move-context-allocation-after-processing-the.patch b/queue-4.9/orinoco-move-context-allocation-after-processing-the.patch new file mode 100644 index 00000000000..74f00606489 --- /dev/null +++ b/queue-4.9/orinoco-move-context-allocation-after-processing-the.patch @@ -0,0 +1,60 @@ +From bd436a32de6d0e460dad910036b20835c23d1e6e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Nov 2020 22:22:43 +0100 +Subject: orinoco: Move context allocation after processing the skb + +From: Sebastian Andrzej Siewior + +[ Upstream commit a31eb615646a63370aa1da1053c45439c7653d83 ] + +ezusb_xmit() allocates a context which is leaked if +orinoco_process_xmit_skb() returns an error. + +Move ezusb_alloc_ctx() after the invocation of +orinoco_process_xmit_skb() because the context is not needed so early. +ezusb_access_ltv() will cleanup the context in case of an error. + +Fixes: bac6fafd4d6a0 ("orinoco: refactor xmit path") +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20201113212252.2243570-2-bigeasy@linutronix.de +Signed-off-by: Sasha Levin +--- + .../net/wireless/intersil/orinoco/orinoco_usb.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +index 4e91c74fcfad9..de928938c7a1c 100644 +--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c ++++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +@@ -1224,13 +1224,6 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev) + if (skb->len < ETH_HLEN) + goto drop; + +- ctx = ezusb_alloc_ctx(upriv, EZUSB_RID_TX, 0); +- if (!ctx) +- goto busy; +- +- memset(ctx->buf, 0, BULK_BUF_SIZE); +- buf = ctx->buf->data; +- + tx_control = 0; + + err = orinoco_process_xmit_skb(skb, dev, priv, &tx_control, +@@ -1238,6 +1231,13 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev) + if (err) + goto drop; + ++ ctx = ezusb_alloc_ctx(upriv, EZUSB_RID_TX, 0); ++ if (!ctx) ++ goto drop; ++ ++ memset(ctx->buf, 0, BULK_BUF_SIZE); ++ buf = ctx->buf->data; ++ + { + __le16 *tx_cntl = (__le16 *)buf; + *tx_cntl = cpu_to_le16(tx_control); +-- +2.27.0 + diff --git a/queue-4.9/perf-record-fix-memory-leak-when-using-user-regs-to-.patch b/queue-4.9/perf-record-fix-memory-leak-when-using-user-regs-to-.patch new file mode 100644 index 00000000000..ae15ccacdbe --- /dev/null +++ b/queue-4.9/perf-record-fix-memory-leak-when-using-user-regs-to-.patch @@ -0,0 +1,45 @@ +From e54d6092e1fb130752b5614a1eb37651a04cf3bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 3 Jul 2020 17:33:44 +0800 +Subject: =?UTF-8?q?perf=20record:=20Fix=20memory=20leak=20when=20using=20'?= + =?UTF-8?q?--user-regs=3D=3F'=20to=20list=20registers?= + +From: Zheng Zengkai + +[ Upstream commit 2eb5dd418034ecea2f7031e3d33f2991a878b148 ] + +When using 'perf record's option '-I' or '--user-regs=' along with +argument '?' to list available register names, memory of variable 'os' +allocated by strdup() needs to be released before __parse_regs() +returns, otherwise memory leak will occur. + +Fixes: bcc84ec65ad1 ("perf record: Add ability to name registers to record") +Signed-off-by: Zheng Zengkai +Acked-by: Jiri Olsa +Cc: Alexander Shishkin +Cc: Li Bin +Cc: Mark Rutland +Cc: Namhyung Kim +Link: https://lore.kernel.org/r/20200703093344.189450-1-zhengzengkai@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/parse-regs-options.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/perf/util/parse-regs-options.c b/tools/perf/util/parse-regs-options.c +index 646ecf736aadb..be2ab1091c2bb 100644 +--- a/tools/perf/util/parse-regs-options.c ++++ b/tools/perf/util/parse-regs-options.c +@@ -40,7 +40,7 @@ parse_regs(const struct option *opt, const char *str, int unset) + } + fputc('\n', stderr); + /* just printing available regs */ +- return -1; ++ goto error; + } + for (r = sample_reg_masks; r->name; r++) { + if (!strcasecmp(s, r->name)) +-- +2.27.0 + diff --git a/queue-4.9/pinctrl-falcon-add-missing-put_device-call-in-pinctr.patch b/queue-4.9/pinctrl-falcon-add-missing-put_device-call-in-pinctr.patch new file mode 100644 index 00000000000..1baa994de2e --- /dev/null +++ b/queue-4.9/pinctrl-falcon-add-missing-put_device-call-in-pinctr.patch @@ -0,0 +1,64 @@ +From 072c9b69ccbb4c74cb5a57d6fab8668e893ece66 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Nov 2020 09:12:19 +0800 +Subject: pinctrl: falcon: add missing put_device() call in + pinctrl_falcon_probe() + +From: Yu Kuai + +[ Upstream commit 89cce2b3f247a434ee174ab6803698041df98014 ] + +if of_find_device_by_node() succeed, pinctrl_falcon_probe() doesn't have +a corresponding put_device(). Thus add put_device() to fix the exception +handling for this function implementation. + +Fixes: e316cb2b16bb ("OF: pinctrl: MIPS: lantiq: adds support for FALCON SoC") +Signed-off-by: Yu Kuai +Link: https://lore.kernel.org/r/20201119011219.2248232-1-yukuai3@huawei.com +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-falcon.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/pinctrl/pinctrl-falcon.c b/drivers/pinctrl/pinctrl-falcon.c +index 0b0fc2eb48e0b..adcdb0585d398 100644 +--- a/drivers/pinctrl/pinctrl-falcon.c ++++ b/drivers/pinctrl/pinctrl-falcon.c +@@ -438,24 +438,28 @@ static int pinctrl_falcon_probe(struct platform_device *pdev) + + /* load and remap the pad resources of the different banks */ + for_each_compatible_node(np, NULL, "lantiq,pad-falcon") { +- struct platform_device *ppdev = of_find_device_by_node(np); + const __be32 *bank = of_get_property(np, "lantiq,bank", NULL); + struct resource res; ++ struct platform_device *ppdev; + u32 avail; + int pins; + + if (!of_device_is_available(np)) + continue; + +- if (!ppdev) { +- dev_err(&pdev->dev, "failed to find pad pdev\n"); +- continue; +- } + if (!bank || *bank >= PORTS) + continue; + if (of_address_to_resource(np, 0, &res)) + continue; ++ ++ ppdev = of_find_device_by_node(np); ++ if (!ppdev) { ++ dev_err(&pdev->dev, "failed to find pad pdev\n"); ++ continue; ++ } ++ + falcon_info.clk[*bank] = clk_get(&ppdev->dev, NULL); ++ put_device(&ppdev->dev); + if (IS_ERR(falcon_info.clk[*bank])) { + dev_err(&ppdev->dev, "failed to get clock\n"); + return PTR_ERR(falcon_info.clk[*bank]); +-- +2.27.0 + diff --git a/queue-4.9/powerpc-feature-fix-cpu_ftrs_always-by-removing-cpu_.patch b/queue-4.9/powerpc-feature-fix-cpu_ftrs_always-by-removing-cpu_.patch new file mode 100644 index 00000000000..3f7dee18a6d --- /dev/null +++ b/queue-4.9/powerpc-feature-fix-cpu_ftrs_always-by-removing-cpu_.patch @@ -0,0 +1,68 @@ +From 729a28d9ccf92f593b45e628b8ff70c1d0fe9161 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 18:07:12 +0000 +Subject: powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32 + +From: Christophe Leroy + +[ Upstream commit 78665179e569c7e1fe102fb6c21d0f5b6951f084 ] + +On 8xx, we get the following features: + +[ 0.000000] cpu_features = 0x0000000000000100 +[ 0.000000] possible = 0x0000000000000120 +[ 0.000000] always = 0x0000000000000000 + +This is not correct. As CONFIG_PPC_8xx is mutually exclusive with all +other configurations, the three lines should be equal. + +The problem is due to CPU_FTRS_GENERIC_32 which is taken when +CONFIG_BOOK3S_32 is NOT selected. This CPU_FTRS_GENERIC_32 is +pointless because there is no generic configuration supporting +all 32 bits but book3s/32. + +Remove this pointless generic features definition to unbreak the +calculation of 'possible' features and 'always' features. + +Fixes: 76bc080ef5a3 ("[POWERPC] Make default cputable entries reflect selected CPU family") +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/76a85f30bf981d1aeaae00df99321235494da254.1604426550.git.christophe.leroy@csgroup.eu +Signed-off-by: Sasha Levin +--- + arch/powerpc/include/asm/cputable.h | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h +index cf51aea47510c..090edefe125da 100644 +--- a/arch/powerpc/include/asm/cputable.h ++++ b/arch/powerpc/include/asm/cputable.h +@@ -419,7 +419,6 @@ enum { + CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ + CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ + CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) +-#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) + + /* 64-bit CPUs */ + #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ +@@ -510,8 +509,6 @@ enum { + CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | + CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | + CPU_FTRS_CLASSIC32 | +-#else +- CPU_FTRS_GENERIC_32 | + #endif + #ifdef CONFIG_8xx + CPU_FTRS_8XX | +@@ -562,8 +559,6 @@ enum { + CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & + CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & + CPU_FTRS_CLASSIC32 & +-#else +- CPU_FTRS_GENERIC_32 & + #endif + #ifdef CONFIG_8xx + CPU_FTRS_8XX & +-- +2.27.0 + diff --git a/queue-4.9/powerpc-ps3-use-dma_mapping_error.patch b/queue-4.9/powerpc-ps3-use-dma_mapping_error.patch new file mode 100644 index 00000000000..4b8d83b8a61 --- /dev/null +++ b/queue-4.9/powerpc-ps3-use-dma_mapping_error.patch @@ -0,0 +1,41 @@ +From 643cb45a9bc10f03d182b6a1731bd550df9701ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 13 Dec 2020 19:26:22 +0100 +Subject: powerpc/ps3: use dma_mapping_error() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Vincent Stehlé + +[ Upstream commit d0edaa28a1f7830997131cbce87b6c52472825d1 ] + +The DMA address returned by dma_map_single() should be checked with +dma_mapping_error(). Fix the ps3stor_setup() function accordingly. + +Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core") +Signed-off-by: Vincent Stehlé +Reviewed-by: Geert Uytterhoeven +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201213182622.23047-1-vincent.stehle@laposte.net +Signed-off-by: Sasha Levin +--- + drivers/ps3/ps3stor_lib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c +index 8c3f5adf1bc65..2d76183756626 100644 +--- a/drivers/ps3/ps3stor_lib.c ++++ b/drivers/ps3/ps3stor_lib.c +@@ -201,7 +201,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler) + dev->bounce_lpar = ps3_mm_phys_to_lpar(__pa(dev->bounce_buf)); + dev->bounce_dma = dma_map_single(&dev->sbd.core, dev->bounce_buf, + dev->bounce_size, DMA_BIDIRECTIONAL); +- if (!dev->bounce_dma) { ++ if (dma_mapping_error(&dev->sbd.core, dev->bounce_dma)) { + dev_err(&dev->sbd.core, "%s:%u: map DMA region failed\n", + __func__, __LINE__); + error = -ENODEV; +-- +2.27.0 + diff --git a/queue-4.9/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch b/queue-4.9/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch new file mode 100644 index 00000000000..b431f6bfc72 --- /dev/null +++ b/queue-4.9/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch @@ -0,0 +1,73 @@ +From 70dc4fa9071a0d239d6828bbfedd8ad67f10c52f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 7 Dec 2020 15:51:49 -0600 +Subject: powerpc/pseries/hibernation: drop pseries_suspend_begin() from + suspend ops + +From: Nathan Lynch + +[ Upstream commit 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc ] + +There are three ways pseries_suspend_begin() can be reached: + +1. When "mem" is written to /sys/power/state: + +kobj_attr_store() +-> state_store() + -> pm_suspend() + -> suspend_devices_and_enter() + -> pseries_suspend_begin() + +This never works because there is no way to supply a valid stream id +using this interface, and H_VASI_STATE is called with a stream id of +zero. So this call path is useless at best. + +2. When a stream id is written to /sys/devices/system/power/hibernate. +pseries_suspend_begin() is polled directly from store_hibernate() +until the stream is in the "Suspending" state (i.e. the platform is +ready for the OS to suspend execution): + +dev_attr_store() +-> store_hibernate() + -> pseries_suspend_begin() + +3. When a stream id is written to /sys/devices/system/power/hibernate +(continued). After #2, pseries_suspend_begin() is called once again +from the pm core: + +dev_attr_store() +-> store_hibernate() + -> pm_suspend() + -> suspend_devices_and_enter() + -> pseries_suspend_begin() + +This is redundant because the VASI suspend state is already known to +be Suspending. + +The begin() callback of platform_suspend_ops is optional, so we can +simply remove that assignment with no loss of function. + +Fixes: 32d8ad4e621d ("powerpc/pseries: Partition hibernation support") +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-18-nathanl@linux.ibm.com +Signed-off-by: Sasha Levin +--- + arch/powerpc/platforms/pseries/suspend.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index e76aefae2aa2b..0a0e0c8256f67 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -224,7 +224,6 @@ static struct bus_type suspend_subsys = { + + static const struct platform_suspend_ops pseries_suspend_ops = { + .valid = suspend_valid_only_mem, +- .begin = pseries_suspend_begin, + .prepare_late = pseries_prepare_late, + .enter = pseries_suspend_enter, + }; +-- +2.27.0 + diff --git a/queue-4.9/qlcnic-fix-error-code-in-probe.patch b/queue-4.9/qlcnic-fix-error-code-in-probe.patch new file mode 100644 index 00000000000..f22a6d74768 --- /dev/null +++ b/queue-4.9/qlcnic-fix-error-code-in-probe.patch @@ -0,0 +1,36 @@ +From b9f4456b5034ea404bf41c6d4f826ebd7c73ecfe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Dec 2020 11:38:04 +0300 +Subject: qlcnic: Fix error code in probe + +From: Dan Carpenter + +[ Upstream commit 0d52848632a357948028eab67ff9b7cc0c12a0fb ] + +Return -EINVAL if we can't find the correct device. Currently it +returns success. + +Fixes: 13159183ec7a ("qlcnic: 83xx base driver") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/X9nHbMqEyI/xPfGd@mwanda +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +index ebf5ead16939a..0928da21efd04 100644 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +@@ -2507,6 +2507,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + qlcnic_sriov_vf_register_map(ahw); + break; + default: ++ err = -EINVAL; + goto err_out_free_hw_res; + } + +-- +2.27.0 + diff --git a/queue-4.9/rdma-cxgb4-validate-the-number-of-cqes.patch b/queue-4.9/rdma-cxgb4-validate-the-number-of-cqes.patch new file mode 100644 index 00000000000..65a58412238 --- /dev/null +++ b/queue-4.9/rdma-cxgb4-validate-the-number-of-cqes.patch @@ -0,0 +1,38 @@ +From 9f43ba4aad20b2f53352083143bb22aee0b190b0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 8 Nov 2020 15:20:07 +0200 +Subject: RDMA/cxgb4: Validate the number of CQEs + +From: Kamal Heib + +[ Upstream commit 6d8285e604e0221b67bd5db736921b7ddce37d00 ] + +Before create CQ, make sure that the requested number of CQEs is in the +supported range. + +Fixes: cfdda9d76436 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC") +Link: https://lore.kernel.org/r/20201108132007.67537-1-kamalheib1@gmail.com +Signed-off-by: Kamal Heib +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/cxgb4/cq.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c +index a856371bbe58c..501f496f4e1a1 100644 +--- a/drivers/infiniband/hw/cxgb4/cq.c ++++ b/drivers/infiniband/hw/cxgb4/cq.c +@@ -893,6 +893,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, + + rhp = to_c4iw_dev(ibdev); + ++ if (entries < 1 || entries > ibdev->attrs.max_cqe) ++ return -EINVAL; ++ + if (vector >= rhp->rdev.lldi.nciq) + return ERR_PTR(-EINVAL); + +-- +2.27.0 + diff --git a/queue-4.9/rdma-mthca-work-around-wenum-conversion-warning.patch b/queue-4.9/rdma-mthca-work-around-wenum-conversion-warning.patch new file mode 100644 index 00000000000..4a7aa512faa --- /dev/null +++ b/queue-4.9/rdma-mthca-work-around-wenum-conversion-warning.patch @@ -0,0 +1,61 @@ +From 9be9a232920f2ec6eac4e6952bc6b2ed988175f4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Oct 2020 22:12:30 +0100 +Subject: RDMa/mthca: Work around -Wenum-conversion warning + +From: Arnd Bergmann + +[ Upstream commit fbb7dc5db6dee553b5a07c27e86364a5223e244c ] + +gcc points out a suspicious mixing of enum types in a function that +converts from MTHCA_OPCODE_* values to IB_WC_* values: + +drivers/infiniband/hw/mthca/mthca_cq.c: In function 'mthca_poll_one': +drivers/infiniband/hw/mthca/mthca_cq.c:607:21: warning: implicit conversion from 'enum ' to 'enum ib_wc_opcode' [-Wenum-conversion] + 607 | entry->opcode = MTHCA_OPCODE_INVALID; + +Nothing seems to ever check for MTHCA_OPCODE_INVALID again, no idea if +this is meaningful, but it seems harmless as it deals with an invalid +input. + +Remove MTHCA_OPCODE_INVALID and set the ib_wc_opcode to 0xFF, which is +still bogus, but at least doesn't make compiler warnings. + +Fixes: 2a4443a69934 ("[PATCH] IB/mthca: fill in opcode field for send completions") +Link: https://lore.kernel.org/r/20201026211311.3887003-1-arnd@kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/mthca/mthca_cq.c | 2 +- + drivers/infiniband/hw/mthca/mthca_dev.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c +index a5694dec3f2ee..098653b8157ed 100644 +--- a/drivers/infiniband/hw/mthca/mthca_cq.c ++++ b/drivers/infiniband/hw/mthca/mthca_cq.c +@@ -609,7 +609,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev, + entry->byte_len = MTHCA_ATOMIC_BYTE_LEN; + break; + default: +- entry->opcode = MTHCA_OPCODE_INVALID; ++ entry->opcode = 0xFF; + break; + } + } else { +diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h +index 4393a022867ba..e1fc67e73bf87 100644 +--- a/drivers/infiniband/hw/mthca/mthca_dev.h ++++ b/drivers/infiniband/hw/mthca/mthca_dev.h +@@ -105,7 +105,6 @@ enum { + MTHCA_OPCODE_ATOMIC_CS = 0x11, + MTHCA_OPCODE_ATOMIC_FA = 0x12, + MTHCA_OPCODE_BIND_MW = 0x18, +- MTHCA_OPCODE_INVALID = 0xff + }; + + enum { +-- +2.27.0 + diff --git a/queue-4.9/rdma-rxe-compute-psn-windows-correctly.patch b/queue-4.9/rdma-rxe-compute-psn-windows-correctly.patch new file mode 100644 index 00000000000..d59be6f7ee3 --- /dev/null +++ b/queue-4.9/rdma-rxe-compute-psn-windows-correctly.patch @@ -0,0 +1,43 @@ +From 1874a051852a7e04ee1465d5851da4bc70504232 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Oct 2020 12:07:42 -0500 +Subject: RDMA/rxe: Compute PSN windows correctly + +From: Bob Pearson + +[ Upstream commit bb3ab2979fd69db23328691cb10067861df89037 ] + +The code which limited the number of unacknowledged PSNs was incorrect. +The PSNs are limited to 24 bits and wrap back to zero from 0x00ffffff. +The test was computing a 32 bit value which wraps at 32 bits so that +qp->req.psn can appear smaller than the limit when it is actually larger. + +Replace '>' test with psn_compare which is used for other PSN comparisons +and correctly handles the 24 bit size. + +Fixes: 8700e3e7c485 ("Soft RoCE driver") +Link: https://lore.kernel.org/r/20201013170741.3590-1-rpearson@hpe.com +Signed-off-by: Bob Pearson +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/sw/rxe/rxe_req.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c +index 5a2d7b0050f4c..463c4b3e73661 100644 +--- a/drivers/infiniband/sw/rxe/rxe_req.c ++++ b/drivers/infiniband/sw/rxe/rxe_req.c +@@ -661,7 +661,8 @@ next_wqe: + } + + if (unlikely(qp_type(qp) == IB_QPT_RC && +- qp->req.psn > (qp->comp.psn + RXE_MAX_UNACKED_PSNS))) { ++ psn_compare(qp->req.psn, (qp->comp.psn + ++ RXE_MAX_UNACKED_PSNS)) > 0)) { + qp->req.wait_psn = 1; + goto exit; + } +-- +2.27.0 + diff --git a/queue-4.9/scsi-fnic-fix-error-return-code-in-fnic_probe.patch b/queue-4.9/scsi-fnic-fix-error-return-code-in-fnic_probe.patch new file mode 100644 index 00000000000..3ffb5b7b175 --- /dev/null +++ b/queue-4.9/scsi-fnic-fix-error-return-code-in-fnic_probe.patch @@ -0,0 +1,38 @@ +From 22905eba0c972f48607447287d847d1c2cb20e5d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 4 Dec 2020 15:47:39 +0800 +Subject: scsi: fnic: Fix error return code in fnic_probe() + +From: Zhang Changzhong + +[ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ] + +Return a negative error code from the error handling case instead of 0 as +done elsewhere in this function. + +Link: https://lore.kernel.org/r/1607068060-31203-1-git-send-email-zhangchangzhong@huawei.com +Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA") +Reported-by: Hulk Robot +Reviewed-by: Karan Tilak Kumar +Signed-off-by: Zhang Changzhong +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/fnic/fnic_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c +index 58ce9020d69c5..389c13e1c9788 100644 +--- a/drivers/scsi/fnic/fnic_main.c ++++ b/drivers/scsi/fnic/fnic_main.c +@@ -735,6 +735,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + for (i = 0; i < FNIC_IO_LOCKS; i++) + spin_lock_init(&fnic->io_req_lock[i]); + ++ err = -ENOMEM; + fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache); + if (!fnic->io_req_pool) + goto err_out_free_resources; +-- +2.27.0 + diff --git a/queue-4.9/scsi-pm80xx-fix-error-return-in-pm8001_pci_probe.patch b/queue-4.9/scsi-pm80xx-fix-error-return-in-pm8001_pci_probe.patch new file mode 100644 index 00000000000..2e777631052 --- /dev/null +++ b/queue-4.9/scsi-pm80xx-fix-error-return-in-pm8001_pci_probe.patch @@ -0,0 +1,41 @@ +From 21d86d34df37c14651778508d8d6a03ae08c8958 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 5 Dec 2020 19:55:51 +0800 +Subject: scsi: pm80xx: Fix error return in pm8001_pci_probe() + +From: Zhang Qilong + +[ Upstream commit 97031ccffa4f62728602bfea8439dd045cd3aeb2 ] + +The driver did not return an error in the case where +pm8001_configure_phy_settings() failed. + +Use rc to store the return value of pm8001_configure_phy_settings(). + +Link: https://lore.kernel.org/r/20201205115551.2079471-1-zhangqilong3@huawei.com +Fixes: 279094079a44 ("[SCSI] pm80xx: Phy settings support for motherboard controller.") +Acked-by: Jack Wang +Signed-off-by: Zhang Qilong +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/pm8001/pm8001_init.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c +index 9fc675f57e336..f54115d74f519 100644 +--- a/drivers/scsi/pm8001/pm8001_init.c ++++ b/drivers/scsi/pm8001/pm8001_init.c +@@ -1061,7 +1061,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev, + + pm8001_init_sas_add(pm8001_ha); + /* phy setting support for motherboard controller */ +- if (pm8001_configure_phy_settings(pm8001_ha)) ++ rc = pm8001_configure_phy_settings(pm8001_ha); ++ if (rc) + goto err_out_shost; + + pm8001_post_sas_ha_init(shost, chip); +-- +2.27.0 + diff --git a/queue-4.9/seq_buf-avoid-type-mismatch-for-seq_buf_init.patch b/queue-4.9/seq_buf-avoid-type-mismatch-for-seq_buf_init.patch new file mode 100644 index 00000000000..7d06284adec --- /dev/null +++ b/queue-4.9/seq_buf-avoid-type-mismatch-for-seq_buf_init.patch @@ -0,0 +1,68 @@ +From 8c06641d76b4597fb1f118aaa2d087b5cdaebbd1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Oct 2020 17:10:58 +0100 +Subject: seq_buf: Avoid type mismatch for seq_buf_init + +From: Arnd Bergmann + +[ Upstream commit d9a9280a0d0ae51dc1d4142138b99242b7ec8ac6 ] + +Building with W=2 prints a number of warnings for one function that +has a pointer type mismatch: + +linux/seq_buf.h: In function 'seq_buf_init': +linux/seq_buf.h:35:12: warning: pointer targets in assignment from 'unsigned char *' to 'char *' differ in signedness [-Wpointer-sign] + +Change the type in the function prototype according to the type in +the structure. + +Link: https://lkml.kernel.org/r/20201026161108.3707783-1-arnd@kernel.org + +Fixes: 9a7777935c34 ("tracing: Convert seq_buf fields to be like seq_file fields") +Reviewed-by: Cezary Rojewski +Signed-off-by: Arnd Bergmann +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Sasha Levin +--- + include/linux/seq_buf.h | 2 +- + include/linux/trace_seq.h | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h +index fb7eb9ccb1cd4..d4c3c9bab5826 100644 +--- a/include/linux/seq_buf.h ++++ b/include/linux/seq_buf.h +@@ -29,7 +29,7 @@ static inline void seq_buf_clear(struct seq_buf *s) + } + + static inline void +-seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size) ++seq_buf_init(struct seq_buf *s, char *buf, unsigned int size) + { + s->buffer = buf; + s->size = size; +diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h +index cfaf5a1d4bad7..f5be2716b01c6 100644 +--- a/include/linux/trace_seq.h ++++ b/include/linux/trace_seq.h +@@ -11,7 +11,7 @@ + */ + + struct trace_seq { +- unsigned char buffer[PAGE_SIZE]; ++ char buffer[PAGE_SIZE]; + struct seq_buf seq; + int full; + }; +@@ -50,7 +50,7 @@ static inline int trace_seq_used(struct trace_seq *s) + * that is about to be written to and then return the result + * of that write. + */ +-static inline unsigned char * ++static inline char * + trace_seq_buffer_ptr(struct trace_seq *s) + { + return s->buffer + seq_buf_used(&s->seq); +-- +2.27.0 + diff --git a/queue-4.9/series b/queue-4.9/series index 6df9c9e15bd..547786c969d 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -47,3 +47,85 @@ serial_core-check-for-port-state-when-tty-is-in-error-state.patch media-msi2500-assign-spi-bus-number-dynamically.patch md-fix-a-warning-caused-by-a-race-between-concurrent-md_ioctl-s.patch bluetooth-fix-slab-out-of-bounds-read-in-hci_le_direct_adv_report_evt.patch +hid-i2c-hid-add-vero-k147-to-descriptor-override.patch-15974 +drm-gma500-fix-double-free-of-gma_connector.patch +rdma-rxe-compute-psn-windows-correctly.patch +arm-p2v-fix-handling-of-lpae-translation-in-be-mode.patch +crypto-talitos-fix-return-type-of-current_desc_hdr.patch +spi-img-spfi-fix-reference-leak-in-img_spfi_resume.patch +asoc-pcm-drain-support-reactivation.patch +arm64-dts-exynos-correct-psci-compatible-used-on-exy.patch +bluetooth-fix-null-pointer-dereference-in-hci_event_.patch +spi-spi-ti-qspi-fix-reference-leak-in-ti_qspi_setup.patch +spi-tegra20-slink-fix-reference-leak-in-slink-ops-of.patch +spi-tegra20-sflash-fix-reference-leak-in-tegra_sflas.patch +spi-tegra114-fix-reference-leak-in-tegra-spi-ops.patch +net-evaluate-net.ipvx.conf.all.ignore_routes_with_li.patch +net-evaluate-net.ipv4.conf.all.proxy_arp_pvlan.patch +rdma-mthca-work-around-wenum-conversion-warning.patch +mips-bcm47xx-fix-kconfig-dependency-bug-for-bcm47xx_.patch +staging-greybus-codecs-fix-reference-counter-leak-in.patch +media-solo6x10-fix-missing-snd_card_free-in-error-ha.patch +drm-omap-dmm_tiler-fix-return-error-code-in-omap_dmm.patch +input-ads7846-fix-integer-overflow-on-rt-calculation.patch +input-ads7846-fix-unaligned-access-on-7845.patch +powerpc-feature-fix-cpu_ftrs_always-by-removing-cpu_.patch +crypto-omap-aes-fix-pm-disable-depth-imbalance-in-om.patch +soc-ti-knav_qmss-fix-reference-leak-in-knav_queue_pr.patch +soc-ti-fix-reference-imbalance-in-knav_dma_probe.patch +drivers-soc-ti-knav_qmss_queue-fix-error-return-code.patch +rdma-cxgb4-validate-the-number-of-cqes.patch +memstick-fix-a-double-free-bug-in-memstick_check.patch +arm-dts-at91-sama5d4_xplained-add-pincontrol-for-usb.patch +arm-dts-at91-sama5d3_xplained-add-pincontrol-for-usb.patch +orinoco-move-context-allocation-after-processing-the.patch +cw1200-fix-missing-destroy_workqueue-on-error-in-cw1.patch +media-siano-fix-memory-leak-of-debugfs-members-in-sm.patch +mips-cdmm-fix-use-after-free-in-mips_cdmm_bus_discov.patch +hsi-omap_ssi-don-t-jump-to-free-id-in-ssi_add_contro.patch +arm-dts-at91-at91sam9rl-fix-adc-triggers.patch +nfsv4.2-condition-readdir-s-mask-for-security-label-.patch +sunrpc-xprt_load_transport-needs-to-support-the-neti.patch +lockd-don-t-use-interval-based-rebinding-over-tcp.patch +nfs-switch-nfsiod-to-be-an-unbound-workqueue.patch +vfio-pci-use-io_remap_pfn_range-for-pci-io-memory.patch +media-saa7146-fix-array-overflow-in-vidioc_s_audio.patch +clocksource-drivers-cadence_ttc-fix-memory-leak-in-t.patch +pinctrl-falcon-add-missing-put_device-call-in-pinctr.patch +memstick-r592-fix-error-return-in-r592_probe.patch +asoc-jz4740-i2s-add-missed-checks-for-clk_get.patch +dm-ioctl-fix-error-return-code-in-target_message.patch +clocksource-drivers-arm_arch_timer-correct-fault-pro.patch +cpufreq-highbank-add-missing-module_device_table.patch +cpufreq-st-add-missing-module_device_table.patch +cpufreq-loongson1-add-missing-module_alias.patch +cpufreq-scpi-add-missing-module_alias.patch +scsi-pm80xx-fix-error-return-in-pm8001_pci_probe.patch +seq_buf-avoid-type-mismatch-for-seq_buf_init.patch +scsi-fnic-fix-error-return-code-in-fnic_probe.patch +powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch +usb-ehci-omap-fix-pm-disable-depth-umbalance-in-ehci.patch +usb-oxu210hp-hcd-fix-memory-leak-in-oxu_create.patch +speakup-fix-uninitialized-flush_lock.patch +nfsd-fix-message-level-for-normal-termination.patch +nfs_common-need-lock-during-iterate-through-the-list.patch +x86-kprobes-restore-btf-if-the-single-stepping-is-ca.patch +clk-tegra-fix-duplicated-se-clock-entry.patch +extcon-max77693-fix-modalias-string.patch +asoc-wm_adsp-remove-ctl-from-list-on-error-in-wm_ads.patch +irqchip-alpine-msi-fix-freeing-of-interrupts-on-allo.patch +um-chan_xterm-fix-fd-leak.patch +nfc-s3fwrn5-release-the-nfc-firmware.patch +powerpc-ps3-use-dma_mapping_error.patch +checkpatch-fix-unescaped-left-brace.patch +net-bcmgenet-fix-a-resource-leak-in-an-error-handlin.patch +net-allwinner-fix-some-resources-leak-in-the-error-h.patch +net-korina-fix-return-value.patch +watchdog-qcom-avoid-context-switch-in-restart-handle.patch +clk-ti-fix-memleak-in-ti_fapll_synth_setup.patch +perf-record-fix-memory-leak-when-using-user-regs-to-.patch +qlcnic-fix-error-code-in-probe.patch +clk-s2mps11-fix-a-resource-leak-in-error-handling-pa.patch +cfg80211-initialize-rekey_data.patch +input-cros_ec_keyb-send-scancodes-in-addition-to-key.patch +input-goodix-add-upside-down-quirk-for-teclast-x98-p.patch diff --git a/queue-4.9/soc-ti-fix-reference-imbalance-in-knav_dma_probe.patch b/queue-4.9/soc-ti-fix-reference-imbalance-in-knav_dma_probe.patch new file mode 100644 index 00000000000..26ec931e71b --- /dev/null +++ b/queue-4.9/soc-ti-fix-reference-imbalance-in-knav_dma_probe.patch @@ -0,0 +1,72 @@ +From 933186b4c35b1c4ea559c90f66bf20bd8c0328d3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 21 Nov 2020 19:22:37 -0800 +Subject: soc: ti: Fix reference imbalance in knav_dma_probe + +From: Zhang Qilong + +[ Upstream commit b4fa73358c306d747a2200aec6f7acb97e5750e6 ] + +The patch fix two reference leak. + + 1) pm_runtime_get_sync will increment pm usage counter even it + failed. Forgetting to call put operation will result in + reference leak. + + 2) The pm_runtime_enable will increase power disable depth. Thus + a pairing decrement is needed on the error handling path to + keep it balanced. + +We fix it by: 1) adding call pm_runtime_put_noidle or +pm_runtime_put_sync in error handling. 2) adding pm_runtime_disable +in error handling, to keep usage counter and disable depth balanced. + +Fixes: 88139ed030583 ("soc: ti: add Keystone Navigator DMA support") +Signed-off-by: Zhang Qilong +Signed-off-by: Santosh Shilimkar +Signed-off-by: Sasha Levin +--- + drivers/soc/ti/knav_dma.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c +index 1a7b5caa127b5..b86bea4537325 100644 +--- a/drivers/soc/ti/knav_dma.c ++++ b/drivers/soc/ti/knav_dma.c +@@ -752,8 +752,9 @@ static int knav_dma_probe(struct platform_device *pdev) + pm_runtime_enable(kdev->dev); + ret = pm_runtime_get_sync(kdev->dev); + if (ret < 0) { ++ pm_runtime_put_noidle(kdev->dev); + dev_err(kdev->dev, "unable to enable pktdma, err %d\n", ret); +- return ret; ++ goto err_pm_disable; + } + + /* Initialise all packet dmas */ +@@ -767,13 +768,21 @@ static int knav_dma_probe(struct platform_device *pdev) + + if (list_empty(&kdev->list)) { + dev_err(dev, "no valid dma instance\n"); +- return -ENODEV; ++ ret = -ENODEV; ++ goto err_put_sync; + } + + debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL, + &knav_dma_debug_ops); + + return ret; ++ ++err_put_sync: ++ pm_runtime_put_sync(kdev->dev); ++err_pm_disable: ++ pm_runtime_disable(kdev->dev); ++ ++ return ret; + } + + static int knav_dma_remove(struct platform_device *pdev) +-- +2.27.0 + diff --git a/queue-4.9/soc-ti-knav_qmss-fix-reference-leak-in-knav_queue_pr.patch b/queue-4.9/soc-ti-knav_qmss-fix-reference-leak-in-knav_queue_pr.patch new file mode 100644 index 00000000000..c6d70a54a70 --- /dev/null +++ b/queue-4.9/soc-ti-knav_qmss-fix-reference-leak-in-knav_queue_pr.patch @@ -0,0 +1,36 @@ +From b80c0e92eda57a01e3f422840b73b0e54b568c71 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 21 Nov 2020 19:22:00 -0800 +Subject: soc: ti: knav_qmss: fix reference leak in knav_queue_probe + +From: Zhang Qilong + +[ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in knav_queue_probe, so we should fix it. + +Fixes: 41f93af900a20 ("soc: ti: add Keystone Navigator QMSS driver") +Signed-off-by: Zhang Qilong +Signed-off-by: Santosh Shilimkar +Signed-off-by: Sasha Levin +--- + drivers/soc/ti/knav_qmss_queue.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c +index b73e3534f67b2..fec97882ac880 100644 +--- a/drivers/soc/ti/knav_qmss_queue.c ++++ b/drivers/soc/ti/knav_qmss_queue.c +@@ -1717,6 +1717,7 @@ static int knav_queue_probe(struct platform_device *pdev) + pm_runtime_enable(&pdev->dev); + ret = pm_runtime_get_sync(&pdev->dev); + if (ret < 0) { ++ pm_runtime_put_noidle(&pdev->dev); + dev_err(dev, "Failed to enable QMSS\n"); + return ret; + } +-- +2.27.0 + diff --git a/queue-4.9/speakup-fix-uninitialized-flush_lock.patch b/queue-4.9/speakup-fix-uninitialized-flush_lock.patch new file mode 100644 index 00000000000..01930c2e818 --- /dev/null +++ b/queue-4.9/speakup-fix-uninitialized-flush_lock.patch @@ -0,0 +1,39 @@ +From 1a812c7f20e6cbb3db1a17152779b6ed5e455d29 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 17 Nov 2020 09:22:29 +0800 +Subject: speakup: fix uninitialized flush_lock + +From: Yang Yingliang + +[ Upstream commit d1b928ee1cfa965a3327bbaa59bfa005d97fa0fe ] + +The flush_lock is uninitialized, use DEFINE_SPINLOCK +to define and initialize flush_lock. + +Fixes: c6e3fd22cd53 ("Staging: add speakup to the staging directory") +Reported-by: Hulk Robot +Reviewed-by: Samuel Thibault +Signed-off-by: Yang Yingliang +Link: https://lore.kernel.org/r/20201117012229.3395186-1-yangyingliang@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/staging/speakup/speakup_dectlk.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c +index 764656759fbf4..1079b11fff4bc 100644 +--- a/drivers/staging/speakup/speakup_dectlk.c ++++ b/drivers/staging/speakup/speakup_dectlk.c +@@ -47,7 +47,7 @@ static unsigned char get_index(void); + static int in_escape; + static int is_flushing; + +-static spinlock_t flush_lock; ++static DEFINE_SPINLOCK(flush_lock); + static DECLARE_WAIT_QUEUE_HEAD(flush); + + static struct var_t vars[] = { +-- +2.27.0 + diff --git a/queue-4.9/spi-img-spfi-fix-reference-leak-in-img_spfi_resume.patch b/queue-4.9/spi-img-spfi-fix-reference-leak-in-img_spfi_resume.patch new file mode 100644 index 00000000000..ef29b87c0bd --- /dev/null +++ b/queue-4.9/spi-img-spfi-fix-reference-leak-in-img_spfi_resume.patch @@ -0,0 +1,41 @@ +From 68d70df9542118507d16adff96142f8ca081a887 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 2 Nov 2020 22:56:51 +0800 +Subject: spi: img-spfi: fix reference leak in img_spfi_resume + +From: Zhang Qilong + +[ Upstream commit ee5558a9084584015c8754ffd029ce14a5827fa8 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in img_spfi_resume, so we should fix it. + +Fixes: deba25800a12b ("spi: Add driver for IMG SPFI controller") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201102145651.3875-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-img-spfi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c +index 2e65b70c78792..2a340234c85c1 100644 +--- a/drivers/spi/spi-img-spfi.c ++++ b/drivers/spi/spi-img-spfi.c +@@ -771,8 +771,10 @@ static int img_spfi_resume(struct device *dev) + int ret; + + ret = pm_runtime_get_sync(dev); +- if (ret) ++ if (ret) { ++ pm_runtime_put_noidle(dev); + return ret; ++ } + spfi_reset(spfi); + pm_runtime_put(dev); + +-- +2.27.0 + diff --git a/queue-4.9/spi-spi-ti-qspi-fix-reference-leak-in-ti_qspi_setup.patch b/queue-4.9/spi-spi-ti-qspi-fix-reference-leak-in-ti_qspi_setup.patch new file mode 100644 index 00000000000..44822200049 --- /dev/null +++ b/queue-4.9/spi-spi-ti-qspi-fix-reference-leak-in-ti_qspi_setup.patch @@ -0,0 +1,37 @@ +From 0310f67f3d57ef282ab1d2cd7338c5e7540d88b0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 22:09:47 +0800 +Subject: spi: spi-ti-qspi: fix reference leak in ti_qspi_setup + +From: Zhang Qilong + +[ Upstream commit 45c0cba753641e5d7c3207f04241bd0e7a021698 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in ti_qspi_setup, so we should fix it. + +Fixes: 505a14954e2d7 ("spi/qspi: Add qspi flash controller") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201103140947.3815-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-ti-qspi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c +index 4cb72a8e46460..b0a5486936c01 100644 +--- a/drivers/spi/spi-ti-qspi.c ++++ b/drivers/spi/spi-ti-qspi.c +@@ -175,6 +175,7 @@ static int ti_qspi_setup(struct spi_device *spi) + + ret = pm_runtime_get_sync(qspi->dev); + if (ret < 0) { ++ pm_runtime_put_noidle(qspi->dev); + dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); + return ret; + } +-- +2.27.0 + diff --git a/queue-4.9/spi-tegra114-fix-reference-leak-in-tegra-spi-ops.patch b/queue-4.9/spi-tegra114-fix-reference-leak-in-tegra-spi-ops.patch new file mode 100644 index 00000000000..f40359bef2d --- /dev/null +++ b/queue-4.9/spi-tegra114-fix-reference-leak-in-tegra-spi-ops.patch @@ -0,0 +1,46 @@ +From 9588b4d94a3e23f40c0d61f27386df4ded134d5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 22:13:06 +0800 +Subject: spi: tegra114: fix reference leak in tegra spi ops + +From: Zhang Qilong + +[ Upstream commit a042184c7fb99961ea083d4ec192614bec671969 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in two callers(tegra_spi_setup and +tegra_spi_resume), so we should fix it. + +Fixes: f333a331adfac ("spi/tegra114: add spi driver") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201103141306.5607-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-tegra114.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c +index e37712bed0b2d..d1ca8f619b828 100644 +--- a/drivers/spi/spi-tegra114.c ++++ b/drivers/spi/spi-tegra114.c +@@ -801,6 +801,7 @@ static int tegra_spi_setup(struct spi_device *spi) + + ret = pm_runtime_get_sync(tspi->dev); + if (ret < 0) { ++ pm_runtime_put_noidle(tspi->dev); + dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); + return ret; + } +@@ -1214,6 +1215,7 @@ static int tegra_spi_resume(struct device *dev) + + ret = pm_runtime_get_sync(dev); + if (ret < 0) { ++ pm_runtime_put_noidle(dev); + dev_err(dev, "pm runtime failed, e = %d\n", ret); + return ret; + } +-- +2.27.0 + diff --git a/queue-4.9/spi-tegra20-sflash-fix-reference-leak-in-tegra_sflas.patch b/queue-4.9/spi-tegra20-sflash-fix-reference-leak-in-tegra_sflas.patch new file mode 100644 index 00000000000..0caa67a98a4 --- /dev/null +++ b/queue-4.9/spi-tegra20-sflash-fix-reference-leak-in-tegra_sflas.patch @@ -0,0 +1,37 @@ +From 43d351b2171c6f71b887007bfb3b81ec371af2bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 22:13:23 +0800 +Subject: spi: tegra20-sflash: fix reference leak in tegra_sflash_resume + +From: Zhang Qilong + +[ Upstream commit 3482e797ab688da6703fe18d8bad52f94199f4f2 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in tegra_sflash_resume, so we should fix it. + +Fixes: 8528547bcc336 ("spi: tegra: add spi driver for sflash controller") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201103141323.5841-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-tegra20-sflash.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c +index b6558bb6f9dfc..4b9541e1726a5 100644 +--- a/drivers/spi/spi-tegra20-sflash.c ++++ b/drivers/spi/spi-tegra20-sflash.c +@@ -564,6 +564,7 @@ static int tegra_sflash_resume(struct device *dev) + + ret = pm_runtime_get_sync(dev); + if (ret < 0) { ++ pm_runtime_put_noidle(dev); + dev_err(dev, "pm runtime failed, e = %d\n", ret); + return ret; + } +-- +2.27.0 + diff --git a/queue-4.9/spi-tegra20-slink-fix-reference-leak-in-slink-ops-of.patch b/queue-4.9/spi-tegra20-slink-fix-reference-leak-in-slink-ops-of.patch new file mode 100644 index 00000000000..2bba4f1c24d --- /dev/null +++ b/queue-4.9/spi-tegra20-slink-fix-reference-leak-in-slink-ops-of.patch @@ -0,0 +1,46 @@ +From 859d23d4088ed2ad771ab3fe56a14b6d6e9f1a00 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Nov 2020 22:13:45 +0800 +Subject: spi: tegra20-slink: fix reference leak in slink ops of tegra20 + +From: Zhang Qilong + +[ Upstream commit 763eab7074f6e71babd85d796156f05a675f9510 ] + +pm_runtime_get_sync will increment pm usage counter even it +failed. Forgetting to pm_runtime_put_noidle will result in +reference leak in two callers(tegra_slink_setup and +tegra_slink_resume), so we should fix it. + +Fixes: dc4dc36056392 ("spi: tegra: add spi driver for SLINK controller") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201103141345.6188-1-zhangqilong3@huawei.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-tegra20-slink.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c +index cf2a329fd8958..9f14560686b68 100644 +--- a/drivers/spi/spi-tegra20-slink.c ++++ b/drivers/spi/spi-tegra20-slink.c +@@ -761,6 +761,7 @@ static int tegra_slink_setup(struct spi_device *spi) + + ret = pm_runtime_get_sync(tspi->dev); + if (ret < 0) { ++ pm_runtime_put_noidle(tspi->dev); + dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); + return ret; + } +@@ -1197,6 +1198,7 @@ static int tegra_slink_resume(struct device *dev) + + ret = pm_runtime_get_sync(dev); + if (ret < 0) { ++ pm_runtime_put_noidle(dev); + dev_err(dev, "pm runtime failed, e = %d\n", ret); + return ret; + } +-- +2.27.0 + diff --git a/queue-4.9/staging-greybus-codecs-fix-reference-counter-leak-in.patch b/queue-4.9/staging-greybus-codecs-fix-reference-counter-leak-in.patch new file mode 100644 index 00000000000..7de980020c1 --- /dev/null +++ b/queue-4.9/staging-greybus-codecs-fix-reference-counter-leak-in.patch @@ -0,0 +1,47 @@ +From 8db2059d4b5db20bbd10d0c6e72d8465b63a1081 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Nov 2020 21:13:46 +0800 +Subject: staging: greybus: codecs: Fix reference counter leak in error + handling + +From: Zhang Qilong + +[ Upstream commit 3952659a6108f77a0d062d8e8487bdbdaf52a66c ] + +gb_pm_runtime_get_sync has increased the usage counter of the device here. +Forgetting to call gb_pm_runtime_put_noidle will result in usage counter +leak in the error branch of (gbcodec_hw_params and gbcodec_prepare). We +fixed it by adding it. + +Fixes: c388ae7696992 ("greybus: audio: Update pm runtime support in dai_ops callback") +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201109131347.1725288-2-zhangqilong3@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/staging/greybus/audio_codec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c +index 8a0744b58a329..4c2d6c2d4fb41 100644 +--- a/drivers/staging/greybus/audio_codec.c ++++ b/drivers/staging/greybus/audio_codec.c +@@ -491,6 +491,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream, + if (ret) { + dev_err_ratelimited(dai->dev, "%d: Error during set_config\n", + ret); ++ gb_pm_runtime_put_noidle(bundle); + mutex_unlock(&codec->lock); + return ret; + } +@@ -562,6 +563,7 @@ static int gbcodec_prepare(struct snd_pcm_substream *substream, + break; + } + if (ret) { ++ gb_pm_runtime_put_noidle(bundle); + mutex_unlock(&codec->lock); + dev_err_ratelimited(dai->dev, "set_data_size failed:%d\n", + ret); +-- +2.27.0 + diff --git a/queue-4.9/sunrpc-xprt_load_transport-needs-to-support-the-neti.patch b/queue-4.9/sunrpc-xprt_load_transport-needs-to-support-the-neti.patch new file mode 100644 index 00000000000..aa025563c4e --- /dev/null +++ b/queue-4.9/sunrpc-xprt_load_transport-needs-to-support-the-neti.patch @@ -0,0 +1,185 @@ +From 3648f43ac7a408a8323dba3b6f8fb0dd10c3c425 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Nov 2020 16:33:38 -0500 +Subject: SUNRPC: xprt_load_transport() needs to support the netid "rdma6" + +From: Trond Myklebust + +[ Upstream commit d5aa6b22e2258f05317313ecc02efbb988ed6d38 ] + +According to RFC5666, the correct netid for an IPv6 addressed RDMA +transport is "rdma6", which we've supported as a mount option since +Linux-4.7. The problem is when we try to load the module "xprtrdma6", +that will fail, since there is no modulealias of that name. + +Fixes: 181342c5ebe8 ("xprtrdma: Add rdma6 option to support NFS/RDMA IPv6") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + include/linux/sunrpc/xprt.h | 1 + + net/sunrpc/xprt.c | 65 +++++++++++++++++++++++++-------- + net/sunrpc/xprtrdma/module.c | 1 + + net/sunrpc/xprtrdma/transport.c | 1 + + net/sunrpc/xprtsock.c | 4 ++ + 5 files changed, 56 insertions(+), 16 deletions(-) + +diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h +index a5da60b24d83e..15bab51a3aef1 100644 +--- a/include/linux/sunrpc/xprt.h ++++ b/include/linux/sunrpc/xprt.h +@@ -310,6 +310,7 @@ struct xprt_class { + struct rpc_xprt * (*setup)(struct xprt_create *); + struct module *owner; + char name[32]; ++ const char * netid[]; + }; + + /* +diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c +index 1a8df242d26a1..9491fc81d50ad 100644 +--- a/net/sunrpc/xprt.c ++++ b/net/sunrpc/xprt.c +@@ -143,31 +143,64 @@ out: + } + EXPORT_SYMBOL_GPL(xprt_unregister_transport); + ++static void ++xprt_class_release(const struct xprt_class *t) ++{ ++ module_put(t->owner); ++} ++ ++static const struct xprt_class * ++xprt_class_find_by_netid_locked(const char *netid) ++{ ++ const struct xprt_class *t; ++ unsigned int i; ++ ++ list_for_each_entry(t, &xprt_list, list) { ++ for (i = 0; t->netid[i][0] != '\0'; i++) { ++ if (strcmp(t->netid[i], netid) != 0) ++ continue; ++ if (!try_module_get(t->owner)) ++ continue; ++ return t; ++ } ++ } ++ return NULL; ++} ++ ++static const struct xprt_class * ++xprt_class_find_by_netid(const char *netid) ++{ ++ const struct xprt_class *t; ++ ++ spin_lock(&xprt_list_lock); ++ t = xprt_class_find_by_netid_locked(netid); ++ if (!t) { ++ spin_unlock(&xprt_list_lock); ++ request_module("rpc%s", netid); ++ spin_lock(&xprt_list_lock); ++ t = xprt_class_find_by_netid_locked(netid); ++ } ++ spin_unlock(&xprt_list_lock); ++ return t; ++} ++ + /** + * xprt_load_transport - load a transport implementation +- * @transport_name: transport to load ++ * @netid: transport to load + * + * Returns: + * 0: transport successfully loaded + * -ENOENT: transport module not available + */ +-int xprt_load_transport(const char *transport_name) ++int xprt_load_transport(const char *netid) + { +- struct xprt_class *t; +- int result; ++ const struct xprt_class *t; + +- result = 0; +- spin_lock(&xprt_list_lock); +- list_for_each_entry(t, &xprt_list, list) { +- if (strcmp(t->name, transport_name) == 0) { +- spin_unlock(&xprt_list_lock); +- goto out; +- } +- } +- spin_unlock(&xprt_list_lock); +- result = request_module("xprt%s", transport_name); +-out: +- return result; ++ t = xprt_class_find_by_netid(netid); ++ if (!t) ++ return -ENOENT; ++ xprt_class_release(t); ++ return 0; + } + EXPORT_SYMBOL_GPL(xprt_load_transport); + +diff --git a/net/sunrpc/xprtrdma/module.c b/net/sunrpc/xprtrdma/module.c +index 560712bd9fa2c..dd227de31a589 100644 +--- a/net/sunrpc/xprtrdma/module.c ++++ b/net/sunrpc/xprtrdma/module.c +@@ -19,6 +19,7 @@ MODULE_DESCRIPTION("RPC/RDMA Transport"); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_ALIAS("svcrdma"); + MODULE_ALIAS("xprtrdma"); ++MODULE_ALIAS("rpcrdma6"); + + static void __exit rpc_rdma_cleanup(void) + { +diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c +index fa324fe739466..3ea3bb64b6d5c 100644 +--- a/net/sunrpc/xprtrdma/transport.c ++++ b/net/sunrpc/xprtrdma/transport.c +@@ -777,6 +777,7 @@ static struct xprt_class xprt_rdma = { + .owner = THIS_MODULE, + .ident = XPRT_TRANSPORT_RDMA, + .setup = xprt_setup_rdma, ++ .netid = { "rdma", "rdma6", "" }, + }; + + void xprt_rdma_cleanup(void) +diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c +index f3f05148922a1..bf20ea2606389 100644 +--- a/net/sunrpc/xprtsock.c ++++ b/net/sunrpc/xprtsock.c +@@ -3147,6 +3147,7 @@ static struct xprt_class xs_local_transport = { + .owner = THIS_MODULE, + .ident = XPRT_TRANSPORT_LOCAL, + .setup = xs_setup_local, ++ .netid = { "" }, + }; + + static struct xprt_class xs_udp_transport = { +@@ -3155,6 +3156,7 @@ static struct xprt_class xs_udp_transport = { + .owner = THIS_MODULE, + .ident = XPRT_TRANSPORT_UDP, + .setup = xs_setup_udp, ++ .netid = { "udp", "udp6", "" }, + }; + + static struct xprt_class xs_tcp_transport = { +@@ -3163,6 +3165,7 @@ static struct xprt_class xs_tcp_transport = { + .owner = THIS_MODULE, + .ident = XPRT_TRANSPORT_TCP, + .setup = xs_setup_tcp, ++ .netid = { "tcp", "tcp6", "" }, + }; + + static struct xprt_class xs_bc_tcp_transport = { +@@ -3171,6 +3174,7 @@ static struct xprt_class xs_bc_tcp_transport = { + .owner = THIS_MODULE, + .ident = XPRT_TRANSPORT_BC_TCP, + .setup = xs_setup_bc_tcp, ++ .netid = { "" }, + }; + + /** +-- +2.27.0 + diff --git a/queue-4.9/um-chan_xterm-fix-fd-leak.patch b/queue-4.9/um-chan_xterm-fix-fd-leak.patch new file mode 100644 index 00000000000..4c2a98881d8 --- /dev/null +++ b/queue-4.9/um-chan_xterm-fix-fd-leak.patch @@ -0,0 +1,66 @@ +From 7cf4ac4a253bf6c141753e66a5a65376b8e487fa Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 7 Dec 2020 17:19:40 +0000 +Subject: um: chan_xterm: Fix fd leak + +From: Anton Ivanov + +[ Upstream commit 9431f7c199ab0d02da1482d62255e0b4621cb1b5 ] + +xterm serial channel was leaking a fd used in setting up the +port helper + +This bug is prehistoric - it predates switching to git. The "fixes" +header here is really just to mark all the versions we would like this to +apply to which is "Anything from the Cretaceous period onwards". + +No dinosaurs were harmed in fixing this bug. + +Fixes: b40997b872cd ("um: drivers/xterm.c: fix a file descriptor leak") +Signed-off-by: Anton Ivanov +Signed-off-by: Richard Weinberger +Signed-off-by: Sasha Levin +--- + arch/um/drivers/xterm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c +index 20e30be44795b..e3b422ebce09f 100644 +--- a/arch/um/drivers/xterm.c ++++ b/arch/um/drivers/xterm.c +@@ -18,6 +18,7 @@ + struct xterm_chan { + int pid; + int helper_pid; ++ int chan_fd; + char *title; + int device; + int raw; +@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts) + return NULL; + *data = ((struct xterm_chan) { .pid = -1, + .helper_pid = -1, ++ .chan_fd = -1, + .device = device, + .title = opts->xterm_title, + .raw = opts->raw } ); +@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d, + goto out_kill; + } + ++ data->chan_fd = fd; + new = xterm_fd(fd, &data->helper_pid); + if (new < 0) { + err = new; +@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d) + os_kill_process(data->helper_pid, 0); + data->helper_pid = -1; + ++ if (data->chan_fd != -1) ++ os_close_file(data->chan_fd); + os_close_file(fd); + } + +-- +2.27.0 + diff --git a/queue-4.9/usb-ehci-omap-fix-pm-disable-depth-umbalance-in-ehci.patch b/queue-4.9/usb-ehci-omap-fix-pm-disable-depth-umbalance-in-ehci.patch new file mode 100644 index 00000000000..c736bdbbe68 --- /dev/null +++ b/queue-4.9/usb-ehci-omap-fix-pm-disable-depth-umbalance-in-ehci.patch @@ -0,0 +1,39 @@ +From 8f28b78a1a97297f7cff4e12a134c096ab7e57b8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Nov 2020 22:57:19 +0800 +Subject: usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe + +From: Zhang Qilong + +[ Upstream commit d6ff32478d7e95d6ca199b5c852710d6964d5811 ] + +The pm_runtime_enable will decrement the power disable depth. Imbalance +depth will resulted in enabling runtime PM of device fails later. Thus +a pairing decrement must be needed on the error handling path to keep it +balanced. + +Fixes: 6c984b066d84b ("ARM: OMAP: USBHOST: Replace usbhs core driver APIs by Runtime pm APIs") +Acked-by: Alan Stern +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201123145719.1455849-1-zhangqilong3@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/ehci-omap.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c +index 94ea9fff13e6d..9227a9ddac609 100644 +--- a/drivers/usb/host/ehci-omap.c ++++ b/drivers/usb/host/ehci-omap.c +@@ -237,6 +237,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) + + err_pm_runtime: + pm_runtime_put_sync(dev); ++ pm_runtime_disable(dev); + + err_phy: + for (i = 0; i < omap->nports; i++) { +-- +2.27.0 + diff --git a/queue-4.9/usb-oxu210hp-hcd-fix-memory-leak-in-oxu_create.patch b/queue-4.9/usb-oxu210hp-hcd-fix-memory-leak-in-oxu_create.patch new file mode 100644 index 00000000000..9e5e1887404 --- /dev/null +++ b/queue-4.9/usb-oxu210hp-hcd-fix-memory-leak-in-oxu_create.patch @@ -0,0 +1,42 @@ +From 9ab6303b13ed7c0083887d3a92560c1a429a1910 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Nov 2020 22:58:09 +0800 +Subject: usb: oxu210hp-hcd: Fix memory leak in oxu_create + +From: Zhang Qilong + +[ Upstream commit e5548b05631ec3e6bfdaef1cad28c799545b791b ] + +usb_create_hcd will alloc memory for hcd, and we should +call usb_put_hcd to free it when adding fails to prevent +memory leak. + +Fixes: b92a78e582b1a ("usb host: Oxford OXU210HP HCD driver") +Reported-by: Hulk Robot +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20201123145809.1456541-1-zhangqilong3@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/oxu210hp-hcd.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c +index 4e4d601af35c1..2f48da0c0bb39 100644 +--- a/drivers/usb/host/oxu210hp-hcd.c ++++ b/drivers/usb/host/oxu210hp-hcd.c +@@ -3734,8 +3734,10 @@ static struct usb_hcd *oxu_create(struct platform_device *pdev, + oxu->is_otg = otg; + + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); +- if (ret < 0) ++ if (ret < 0) { ++ usb_put_hcd(hcd); + return ERR_PTR(ret); ++ } + + device_wakeup_enable(hcd->self.controller); + return hcd; +-- +2.27.0 + diff --git a/queue-4.9/vfio-pci-use-io_remap_pfn_range-for-pci-io-memory.patch b/queue-4.9/vfio-pci-use-io_remap_pfn_range-for-pci-io-memory.patch new file mode 100644 index 00000000000..3f57be96b0a --- /dev/null +++ b/queue-4.9/vfio-pci-use-io_remap_pfn_range-for-pci-io-memory.patch @@ -0,0 +1,46 @@ +From 3ae246d8d54999c76003abcbeeb37e551b554cde Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 5 Nov 2020 12:34:58 -0400 +Subject: vfio-pci: Use io_remap_pfn_range() for PCI IO memory + +From: Jason Gunthorpe + +[ Upstream commit 7b06a56d468b756ad6bb43ac21b11e474ebc54a0 ] + +commit f8f6ae5d077a ("mm: always have io_remap_pfn_range() set +pgprot_decrypted()") allows drivers using mmap to put PCI memory mapped +BAR space into userspace to work correctly on AMD SME systems that default +to all memory encrypted. + +Since vfio_pci_mmap_fault() is working with PCI memory mapped BAR space it +should be calling io_remap_pfn_range() otherwise it will not work on SME +systems. + +Fixes: 11c4cd07ba11 ("vfio-pci: Fault mmaps to enable vma tracking") +Signed-off-by: Jason Gunthorpe +Acked-by: Peter Xu +Tested-by: Tom Lendacky +Signed-off-by: Alex Williamson +Signed-off-by: Sasha Levin +--- + drivers/vfio/pci/vfio_pci.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c +index 237d5aceb302d..f9a3da02c631b 100644 +--- a/drivers/vfio/pci/vfio_pci.c ++++ b/drivers/vfio/pci/vfio_pci.c +@@ -1403,8 +1403,8 @@ static int vfio_pci_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) + + mutex_unlock(&vdev->vma_lock); + +- if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, +- vma->vm_end - vma->vm_start, vma->vm_page_prot)) ++ if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, ++ vma->vm_end - vma->vm_start, vma->vm_page_prot)) + ret = VM_FAULT_SIGBUS; + + up_out: +-- +2.27.0 + diff --git a/queue-4.9/watchdog-qcom-avoid-context-switch-in-restart-handle.patch b/queue-4.9/watchdog-qcom-avoid-context-switch-in-restart-handle.patch new file mode 100644 index 00000000000..8aba577a94e --- /dev/null +++ b/queue-4.9/watchdog-qcom-avoid-context-switch-in-restart-handle.patch @@ -0,0 +1,69 @@ +From 79f5aa544334dfdc27c7b4b79c8b042c219d0dd4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 7 Dec 2020 11:30:05 +0530 +Subject: watchdog: qcom: Avoid context switch in restart handler + +From: Manivannan Sadhasivam + +[ Upstream commit 7948fab26bcc468aa2a76462f441291b5fb0d5c7 ] + +The use of msleep() in the restart handler will cause scheduler to +induce a context switch which is not desirable. This generates below +warning on SDX55 when WDT is the only available restart source: + +[ 39.800188] reboot: Restarting system +[ 39.804115] ------------[ cut here ]------------ +[ 39.807855] WARNING: CPU: 0 PID: 678 at kernel/rcu/tree_plugin.h:297 rcu_note_context_switch+0x190/0x764 +[ 39.812538] Modules linked in: +[ 39.821954] CPU: 0 PID: 678 Comm: reboot Not tainted 5.10.0-rc1-00063-g33a9990d1d66-dirty #47 +[ 39.824854] Hardware name: Generic DT based system +[ 39.833470] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) +[ 39.838154] [] (show_stack) from [] (dump_stack+0x8c/0xa0) +[ 39.846049] [] (dump_stack) from [] (__warn+0xd8/0xf0) +[ 39.853058] [] (__warn) from [] (warn_slowpath_fmt+0x64/0xc8) +[ 39.859925] [] (warn_slowpath_fmt) from [] (rcu_note_context_switch+0x190/0x764) +[ 39.867503] [] (rcu_note_context_switch) from [] (__schedule+0x84/0x640) +[ 39.876685] [] (__schedule) from [] (schedule+0x58/0x10c) +[ 39.885095] [] (schedule) from [] (schedule_timeout+0x1e8/0x3d4) +[ 39.892135] [] (schedule_timeout) from [] (msleep+0x2c/0x38) +[ 39.899947] [] (msleep) from [] (qcom_wdt_restart+0xc4/0xcc) +[ 39.907319] [] (qcom_wdt_restart) from [] (watchdog_restart_notifier+0x18/0x28) +[ 39.914715] [] (watchdog_restart_notifier) from [] (atomic_notifier_call_chain+0x60/0x84) +[ 39.923487] [] (atomic_notifier_call_chain) from [] (machine_restart+0x78/0x7c) +[ 39.933551] [] (machine_restart) from [] (__do_sys_reboot+0xdc/0x1e0) +[ 39.942397] [] (__do_sys_reboot) from [] (ret_fast_syscall+0x0/0x54) +[ 39.950721] Exception stack(0xc3e0bfa8 to 0xc3e0bff0) +[ 39.958855] bfa0: 0001221c bed2fe24 fee1dead 28121969 01234567 00000000 +[ 39.963832] bfc0: 0001221c bed2fe24 00000003 00000058 000225e0 00000000 00000000 00000000 +[ 39.971985] bfe0: b6e62560 bed2fc84 00010fd8 b6e62580 +[ 39.980124] ---[ end trace 3f578288bad866e4 ]--- + +Hence, replace msleep() with mdelay() to fix this issue. + +Fixes: 05e487d905ab ("watchdog: qcom: register a restart notifier") +Signed-off-by: Manivannan Sadhasivam +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20201207060005.21293-1-manivannan.sadhasivam@linaro.org +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Sasha Levin +--- + drivers/watchdog/qcom-wdt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c +index 4f47b5e909566..8b88824a88dc2 100644 +--- a/drivers/watchdog/qcom-wdt.c ++++ b/drivers/watchdog/qcom-wdt.c +@@ -121,7 +121,7 @@ static int qcom_wdt_restart(struct watchdog_device *wdd, unsigned long action, + */ + wmb(); + +- msleep(150); ++ mdelay(150); + return 0; + } + +-- +2.27.0 + diff --git a/queue-4.9/x86-kprobes-restore-btf-if-the-single-stepping-is-ca.patch b/queue-4.9/x86-kprobes-restore-btf-if-the-single-stepping-is-ca.patch new file mode 100644 index 00000000000..30a6d39d837 --- /dev/null +++ b/queue-4.9/x86-kprobes-restore-btf-if-the-single-stepping-is-ca.patch @@ -0,0 +1,46 @@ +From 168a18a53c82c723ea13d3df39955c5f8fde7b0f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Oct 2020 23:31:10 +0900 +Subject: x86/kprobes: Restore BTF if the single-stepping is cancelled + +From: Masami Hiramatsu + +[ Upstream commit 78ff2733ff352175eb7f4418a34654346e1b6cd2 ] + +Fix to restore BTF if single-stepping causes a page fault and +it is cancelled. + +Usually the BTF flag was restored when the single stepping is done +(in resume_execution()). However, if a page fault happens on the +single stepping instruction, the fault handler is invoked and +the single stepping is cancelled. Thus, the BTF flag is not +restored. + +Fixes: 1ecc798c6764 ("x86: debugctlmsr kprobes") +Signed-off-by: Masami Hiramatsu +Signed-off-by: Peter Zijlstra (Intel) +Link: https://lkml.kernel.org/r/160389546985.106936.12727996109376240993.stgit@devnote2 +Signed-off-by: Sasha Levin +--- + arch/x86/kernel/kprobes/core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c +index 86aec286e4f22..3da08881a0104 100644 +--- a/arch/x86/kernel/kprobes/core.c ++++ b/arch/x86/kernel/kprobes/core.c +@@ -1018,6 +1018,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr) + * So clear it by resetting the current kprobe: + */ + regs->flags &= ~X86_EFLAGS_TF; ++ /* ++ * Since the single step (trap) has been cancelled, ++ * we need to restore BTF here. ++ */ ++ restore_btf(); + + /* + * If the TF flag was set before the kprobe hit, +-- +2.27.0 + -- 2.47.3