From: Greg Kroah-Hartman Date: Mon, 18 May 2020 14:44:27 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.224~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1609242985cf94173c24335026c9d22951b72e7e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: arm-dts-r8a73a4-add-missing-cmt1-interrupts.patch arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch clk-unlink-clock-if-failed-to-prepare-or-enable.patch kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch makefile-disallow-data-races-on-gcc-10-as-well.patch revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch --- diff --git a/queue-4.9/arm-dts-r8a73a4-add-missing-cmt1-interrupts.patch b/queue-4.9/arm-dts-r8a73a4-add-missing-cmt1-interrupts.patch new file mode 100644 index 00000000000..d7672c1a5d4 --- /dev/null +++ b/queue-4.9/arm-dts-r8a73a4-add-missing-cmt1-interrupts.patch @@ -0,0 +1,40 @@ +From 0f739fdfe9e5ce668bd6d3210f310df282321837 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 8 Apr 2020 11:09:26 +0200 +Subject: ARM: dts: r8a73a4: Add missing CMT1 interrupts + +From: Geert Uytterhoeven + +commit 0f739fdfe9e5ce668bd6d3210f310df282321837 upstream. + +The R-Mobile APE6 Compare Match Timer 1 generates 8 interrupts, one for +each channel, but currently only 1 is described. +Fix this by adding the missing interrupts. + +Fixes: f7b65230019b9dac ("ARM: shmobile: r8a73a4: Add CMT1 node") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20200408090926.25201-1-geert+renesas@glider.be +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/r8a73a4.dtsi | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/r8a73a4.dtsi ++++ b/arch/arm/boot/dts/r8a73a4.dtsi +@@ -135,7 +135,14 @@ + cmt1: timer@e6130000 { + compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2"; + reg = <0 0xe6130000 0 0x1004>; +- interrupts = ; ++ interrupts = , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; + clocks = <&mstp3_clks R8A73A4_CLK_CMT1>; + clock-names = "fck"; + power-domains = <&pd_c5>; diff --git a/queue-4.9/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch b/queue-4.9/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch new file mode 100644 index 00000000000..a7b714d84cd --- /dev/null +++ b/queue-4.9/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch @@ -0,0 +1,38 @@ +From e47cb97f153193d4b41ca8d48127da14513d54c7 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Fri, 8 May 2020 11:59:18 +0200 +Subject: ARM: dts: r8a7740: Add missing extal2 to CPG node + +From: Geert Uytterhoeven + +commit e47cb97f153193d4b41ca8d48127da14513d54c7 upstream. + +The Clock Pulse Generator (CPG) device node lacks the extal2 clock. +This may lead to a failure registering the "r" clock, or to a wrong +parent for the "usb24s" clock, depending on MD_CK2 pin configuration and +boot loader CPG_USBCKCR register configuration. + +This went unnoticed, as this does not affect the single upstream board +configuration, which relies on the first clock input only. + +Fixes: d9ffd583bf345e2e ("ARM: shmobile: r8a7740: add SoC clocks to DTS") +Signed-off-by: Geert Uytterhoeven +Reviewed-by: Ulrich Hecht +Link: https://lore.kernel.org/r/20200508095918.6061-1-geert+renesas@glider.be +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/r8a7740.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/r8a7740.dtsi ++++ b/arch/arm/boot/dts/r8a7740.dtsi +@@ -467,7 +467,7 @@ + cpg_clocks: cpg_clocks@e6150000 { + compatible = "renesas,r8a7740-cpg-clocks"; + reg = <0xe6150000 0x10000>; +- clocks = <&extal1_clk>, <&extalr_clk>; ++ clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>; + #clock-cells = <1>; + clock-output-names = "system", "pllc0", "pllc1", + "pllc2", "r", diff --git a/queue-4.9/clk-unlink-clock-if-failed-to-prepare-or-enable.patch b/queue-4.9/clk-unlink-clock-if-failed-to-prepare-or-enable.patch new file mode 100644 index 00000000000..ff76e24abb3 --- /dev/null +++ b/queue-4.9/clk-unlink-clock-if-failed-to-prepare-or-enable.patch @@ -0,0 +1,42 @@ +From 018d4671b9bbd4a5c55cf6eab3e1dbc70a50b66e Mon Sep 17 00:00:00 2001 +From: Marc Zyngier +Date: Tue, 5 May 2020 15:09:53 +0100 +Subject: clk: Unlink clock if failed to prepare or enable + +From: Marc Zyngier + +commit 018d4671b9bbd4a5c55cf6eab3e1dbc70a50b66e upstream. + +On failing to prepare or enable a clock, remove the core structure +from the list it has been inserted as it is about to be freed. + +This otherwise leads to random crashes when subsequent clocks get +registered, during which parsing of the clock tree becomes adventurous. + +Observed with QEMU's RPi-3 emulation. + +Fixes: 12ead77432f2 ("clk: Don't try to enable critical clocks if prepare failed") +Signed-off-by: Marc Zyngier +Cc: Guenter Roeck +Cc: Stephen Boyd +Cc: Michael Turquette +Link: https://lkml.kernel.org/r/20200505140953.409430-1-maz@kernel.org +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/clk.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -2746,6 +2746,9 @@ void clk_unregister(struct clk *clk) + __func__, clk->core->name); + kref_put(&clk->core->ref, __clk_release); + unlock: ++ if (ret) ++ hlist_del_init(&core->child_node); ++ + clk_prepare_unlock(); + } + EXPORT_SYMBOL_GPL(clk_unregister); diff --git a/queue-4.9/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch b/queue-4.9/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch new file mode 100644 index 00000000000..e65a93e0dd2 --- /dev/null +++ b/queue-4.9/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch @@ -0,0 +1,37 @@ +From c4e0e4ab4cf3ec2b3f0b628ead108d677644ebd9 Mon Sep 17 00:00:00 2001 +From: Jim Mattson +Date: Mon, 11 May 2020 15:56:16 -0700 +Subject: KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce + +From: Jim Mattson + +commit c4e0e4ab4cf3ec2b3f0b628ead108d677644ebd9 upstream. + +Bank_num is a one-based count of banks, not a zero-based index. It +overflows the allocated space only when strictly greater than +KVM_MAX_MCE_BANKS. + +Fixes: a9e38c3e01ad ("KVM: x86: Catch potential overrun in MCE setup") +Signed-off-by: Jue Wang +Signed-off-by: Jim Mattson +Reviewed-by: Peter Shier +Message-Id: <20200511225616.19557-1-jmattson@google.com> +Reviewed-by: Vitaly Kuznetsov +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -3128,7 +3128,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce( + unsigned bank_num = mcg_cap & 0xff, bank; + + r = -EINVAL; +- if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS) ++ if (!bank_num || bank_num > KVM_MAX_MCE_BANKS) + goto out; + if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000)) + goto out; diff --git a/queue-4.9/makefile-disallow-data-races-on-gcc-10-as-well.patch b/queue-4.9/makefile-disallow-data-races-on-gcc-10-as-well.patch new file mode 100644 index 00000000000..c722ca095aa --- /dev/null +++ b/queue-4.9/makefile-disallow-data-races-on-gcc-10-as-well.patch @@ -0,0 +1,34 @@ +From b1112139a103b4b1101d0d2d72931f2d33d8c978 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Tue, 17 Mar 2020 00:07:18 +0000 +Subject: Makefile: disallow data races on gcc-10 as well + +From: Sergei Trofimovich + +commit b1112139a103b4b1101d0d2d72931f2d33d8c978 upstream. + +gcc-10 will rename --param=allow-store-data-races=0 +to -fno-allow-store-data-races. + +The flag change happened at https://gcc.gnu.org/PR92046. + +Signed-off-by: Sergei Trofimovich +Acked-by: Jiri Kosina +Signed-off-by: Masahiro Yamada +Cc: Thomas Backlund +Signed-off-by: Greg Kroah-Hartman + +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/Makefile ++++ b/Makefile +@@ -665,6 +665,7 @@ endif + + # Tell gcc to never replace conditional load with a non-conditional one + KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) ++KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races) + + # check for 'asm goto' + ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) diff --git a/queue-4.9/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch b/queue-4.9/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch new file mode 100644 index 00000000000..446d9eab142 --- /dev/null +++ b/queue-4.9/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch @@ -0,0 +1,36 @@ +From f41224efcf8aafe80ea47ac870c5e32f3209ffc8 Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Sun, 3 May 2020 23:24:46 +0800 +Subject: Revert "ALSA: hda/realtek: Fix pop noise on ALC225" + +From: Kai-Heng Feng + +commit f41224efcf8aafe80ea47ac870c5e32f3209ffc8 upstream. + +This reverts commit 3b36b13d5e69d6f51ff1c55d1b404a74646c9757. + +Enable power save node breaks some systems with ACL225. Revert the patch +and use a platform specific quirk for the original issue isntead. + +Fixes: 3b36b13d5e69 ("ALSA: hda/realtek: Fix pop noise on ALC225") +BugLink: https://bugs.launchpad.net/bugs/1875916 +Signed-off-by: Kai-Heng Feng +Link: https://lore.kernel.org/r/20200503152449.22761-1-kai.heng.feng@canonical.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4212,8 +4212,6 @@ static void alc_determine_headset_type(s + is_ctia = (val & 0x1c02) == 0x1c02; + break; + case 0x10ec0225: +- codec->power_save_node = 1; +- /* fall through */ + case 0x10ec0295: + case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); diff --git a/queue-4.9/series b/queue-4.9/series index 0521fab63a3..de953207450 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -79,3 +79,13 @@ usb-xhci-fix-null-pointer-dereference-when-enqueuing-trbs-from-urb-sg-list.patch arm-dts-imx27-phytec-phycard-s-rdk-fix-the-i2c1-pinctrl-entries.patch x86-fix-early-boot-crash-on-gcc-10-third-try.patch exec-move-would_dump-into-flush_old_exec.patch +usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch +usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch +usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch +usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch +revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch +clk-unlink-clock-if-failed-to-prepare-or-enable.patch +arm-dts-r8a73a4-add-missing-cmt1-interrupts.patch +arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch +kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch +makefile-disallow-data-races-on-gcc-10-as-well.patch diff --git a/queue-4.9/usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch b/queue-4.9/usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch new file mode 100644 index 00000000000..75433d66c38 --- /dev/null +++ b/queue-4.9/usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch @@ -0,0 +1,35 @@ +From 19b94c1f9c9a16d41a8de3ccbdb8536cf1aecdbf Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Sun, 3 May 2020 12:47:07 +0200 +Subject: usb: gadget: audio: Fix a missing error return value in audio_bind() + +From: Christophe JAILLET + +commit 19b94c1f9c9a16d41a8de3ccbdb8536cf1aecdbf upstream. + +If 'usb_otg_descriptor_alloc()' fails, we must return an error code, not 0. + +Fixes: 56023ce0fd70 ("usb: gadget: audio: allocate and init otg descriptor by otg capabilities") +Reviewed-by: Peter Chen +Signed-off-by: Christophe JAILLET +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/legacy/audio.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/legacy/audio.c ++++ b/drivers/usb/gadget/legacy/audio.c +@@ -249,8 +249,10 @@ static int audio_bind(struct usb_composi + struct usb_descriptor_header *usb_desc; + + usb_desc = usb_otg_descriptor_alloc(cdev->gadget); +- if (!usb_desc) ++ if (!usb_desc) { ++ status = -ENOMEM; + goto fail; ++ } + usb_otg_descriptor_init(cdev->gadget, usb_desc); + otg_desc[0] = usb_desc; + otg_desc[1] = NULL; diff --git a/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch b/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch new file mode 100644 index 00000000000..c054338a7e4 --- /dev/null +++ b/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch @@ -0,0 +1,36 @@ +From e8f7f9e3499a6d96f7f63a4818dc7d0f45a7783b Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Thu, 7 May 2020 05:13:32 +0000 +Subject: usb: gadget: legacy: fix error return code in cdc_bind() + +From: Wei Yongjun + +commit e8f7f9e3499a6d96f7f63a4818dc7d0f45a7783b upstream. + +If 'usb_otg_descriptor_alloc()' fails, we must return a +negative error code -ENOMEM, not 0. + +Fixes: ab6796ae9833 ("usb: gadget: cdc2: allocate and init otg descriptor by otg capabilities") +Reported-by: Hulk Robot +Signed-off-by: Wei Yongjun +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/legacy/cdc2.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/legacy/cdc2.c ++++ b/drivers/usb/gadget/legacy/cdc2.c +@@ -183,8 +183,10 @@ static int cdc_bind(struct usb_composite + struct usb_descriptor_header *usb_desc; + + usb_desc = usb_otg_descriptor_alloc(gadget); +- if (!usb_desc) ++ if (!usb_desc) { ++ status = -ENOMEM; + goto fail1; ++ } + usb_otg_descriptor_init(gadget, usb_desc); + otg_desc[0] = usb_desc; + otg_desc[1] = NULL; diff --git a/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch b/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch new file mode 100644 index 00000000000..484045d662d --- /dev/null +++ b/queue-4.9/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch @@ -0,0 +1,36 @@ +From e27d4b30b71c66986196d8a1eb93cba9f602904a Mon Sep 17 00:00:00 2001 +From: Wei Yongjun +Date: Thu, 7 May 2020 05:13:23 +0000 +Subject: usb: gadget: legacy: fix error return code in gncm_bind() + +From: Wei Yongjun + +commit e27d4b30b71c66986196d8a1eb93cba9f602904a upstream. + +If 'usb_otg_descriptor_alloc()' fails, we must return a +negative error code -ENOMEM, not 0. + +Fixes: 1156e91dd7cc ("usb: gadget: ncm: allocate and init otg descriptor by otg capabilities") +Reported-by: Hulk Robot +Signed-off-by: Wei Yongjun +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/legacy/ncm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/legacy/ncm.c ++++ b/drivers/usb/gadget/legacy/ncm.c +@@ -162,8 +162,10 @@ static int gncm_bind(struct usb_composit + struct usb_descriptor_header *usb_desc; + + usb_desc = usb_otg_descriptor_alloc(gadget); +- if (!usb_desc) ++ if (!usb_desc) { ++ status = -ENOMEM; + goto fail; ++ } + usb_otg_descriptor_init(gadget, usb_desc); + otg_desc[0] = usb_desc; + otg_desc[1] = NULL; diff --git a/queue-4.9/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch b/queue-4.9/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch new file mode 100644 index 00000000000..c7a2b910f34 --- /dev/null +++ b/queue-4.9/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch @@ -0,0 +1,33 @@ +From ccaef7e6e354fb65758eaddd3eae8065a8b3e295 Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Mon, 27 Apr 2020 20:04:23 +0200 +Subject: usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()' + +From: Christophe JAILLET + +commit ccaef7e6e354fb65758eaddd3eae8065a8b3e295 upstream. + +'dev' is allocated in 'net2272_probe_init()'. It must be freed in the error +handling path, as already done in the remove function (i.e. +'net2272_plat_remove()') + +Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers") +Signed-off-by: Christophe JAILLET +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/udc/net2272.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/udc/net2272.c ++++ b/drivers/usb/gadget/udc/net2272.c +@@ -2666,6 +2666,8 @@ net2272_plat_probe(struct platform_devic + err_req: + release_mem_region(base, len); + err: ++ kfree(dev); ++ + return ret; + } +