From d338d99ec820beac9b2cea7e720c55efd3a8b8ed Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 18 May 2020 16:44:13 +0200 Subject: [PATCH] 4.4-stable patches added patches: 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 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 --- ...a7740-add-missing-extal2-to-cpg-node.patch | 38 +++++++++++++++++++ ...rror-in-kvm_vcpu_ioctl_x86_setup_mce.patch | 37 ++++++++++++++++++ ...isallow-data-races-on-gcc-10-as-well.patch | 34 +++++++++++++++++ ...-hda-realtek-fix-pop-noise-on-alc225.patch | 36 ++++++++++++++++++ queue-4.4/series | 8 ++++ ...ing-error-return-value-in-audio_bind.patch | 35 +++++++++++++++++ ...cy-fix-error-return-code-in-cdc_bind.patch | 36 ++++++++++++++++++ ...y-fix-error-return-code-in-gncm_bind.patch | 36 ++++++++++++++++++ ...-handling-path-in-net2272_plat_probe.patch | 33 ++++++++++++++++ 9 files changed, 293 insertions(+) create mode 100644 queue-4.4/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch create mode 100644 queue-4.4/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch create mode 100644 queue-4.4/makefile-disallow-data-races-on-gcc-10-as-well.patch create mode 100644 queue-4.4/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch create mode 100644 queue-4.4/usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch create mode 100644 queue-4.4/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch create mode 100644 queue-4.4/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch create mode 100644 queue-4.4/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch diff --git a/queue-4.4/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch b/queue-4.4/arm-dts-r8a7740-add-missing-extal2-to-cpg-node.patch new file mode 100644 index 00000000000..72c66783f6a --- /dev/null +++ b/queue-4.4/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 +@@ -461,7 +461,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.4/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch b/queue-4.4/kvm-x86-fix-off-by-one-error-in-kvm_vcpu_ioctl_x86_setup_mce.patch new file mode 100644 index 00000000000..ae2725e3ef7 --- /dev/null +++ b/queue-4.4/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 +@@ -2941,7 +2941,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.4/makefile-disallow-data-races-on-gcc-10-as-well.patch b/queue-4.4/makefile-disallow-data-races-on-gcc-10-as-well.patch new file mode 100644 index 00000000000..74c5de84b99 --- /dev/null +++ b/queue-4.4/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 +@@ -650,6 +650,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.4/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch b/queue-4.4/revert-alsa-hda-realtek-fix-pop-noise-on-alc225.patch new file mode 100644 index 00000000000..e9415186ca2 --- /dev/null +++ b/queue-4.4/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 +@@ -6341,8 +6341,6 @@ static int patch_alc269(struct hda_codec + alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/ + break; + case 0x10ec0225: +- codec->power_save_node = 1; +- /* fall through */ + case 0x10ec0295: + case 0x10ec0299: + spec->codec_variant = ALC269_TYPE_ALC225; diff --git a/queue-4.4/series b/queue-4.4/series index 6e40ef26fad..09bb047fbf1 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -76,3 +76,11 @@ usb-gadget-fix-illegal-array-access-in-binding-with-udc.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 +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.4/usb-gadget-audio-fix-a-missing-error-return-value-in-audio_bind.patch b/queue-4.4/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.4/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.4/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch b/queue-4.4/usb-gadget-legacy-fix-error-return-code-in-cdc_bind.patch new file mode 100644 index 00000000000..c054338a7e4 --- /dev/null +++ b/queue-4.4/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.4/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch b/queue-4.4/usb-gadget-legacy-fix-error-return-code-in-gncm_bind.patch new file mode 100644 index 00000000000..484045d662d --- /dev/null +++ b/queue-4.4/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.4/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch b/queue-4.4/usb-gadget-net2272-fix-a-memory-leak-in-an-error-handling-path-in-net2272_plat_probe.patch new file mode 100644 index 00000000000..d51f1878265 --- /dev/null +++ b/queue-4.4/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 +@@ -2670,6 +2670,8 @@ net2272_plat_probe(struct platform_devic + err_req: + release_mem_region(base, len); + err: ++ kfree(dev); ++ + return ret; + } + -- 2.47.3