From 7aa391dc4b8c33d88fdb2ee962bf1ebc7e17f985 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 28 Jun 2020 17:42:41 +0200 Subject: [PATCH] 4.14-stable patches added patches: alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch usb-add-usb_quirk_delay_init-for-logitech-c922.patch usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch usb-ehci-reopen-solution-for-synopsys-hc-bug.patch usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch usb-ohci-sm501-add-missed-iounmap-in-remove.patch --- ...audio-add-quirk-for-denon-dcd-1500re.patch | 39 ++++++++++++ queue-4.14/series | 7 +++ ...b_quirk_delay_init-for-logitech-c922.patch | 41 ++++++++++++ ...registration-to-the-udc-class-driver.patch | 62 +++++++++++++++++++ ...-reopen-solution-for-synopsys-hc-bug.patch | 58 +++++++++++++++++ ...fix-error-check-in-exynos_ehci_probe.patch | 40 ++++++++++++ ...id-runtime-suspend-when-removing-hcd.patch | 46 ++++++++++++++ ...i-sm501-add-missed-iounmap-in-remove.patch | 34 ++++++++++ 8 files changed, 327 insertions(+) create mode 100644 queue-4.14/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch create mode 100644 queue-4.14/usb-add-usb_quirk_delay_init-for-logitech-c922.patch create mode 100644 queue-4.14/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch create mode 100644 queue-4.14/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch create mode 100644 queue-4.14/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch create mode 100644 queue-4.14/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch create mode 100644 queue-4.14/usb-ohci-sm501-add-missed-iounmap-in-remove.patch diff --git a/queue-4.14/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch b/queue-4.14/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch new file mode 100644 index 00000000000..54d17ea19c9 --- /dev/null +++ b/queue-4.14/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch @@ -0,0 +1,39 @@ +From c9808bbfed3cfc911ecb60fe8e80c0c27876c657 Mon Sep 17 00:00:00 2001 +From: "Yick W. Tse" +Date: Sat, 13 Jun 2020 11:40:06 +0000 +Subject: ALSA: usb-audio: add quirk for Denon DCD-1500RE + +From: Yick W. Tse + +commit c9808bbfed3cfc911ecb60fe8e80c0c27876c657 upstream. + +fix error "clock source 41 is not valid, cannot use" + +[] New USB device found, idVendor=154e, idProduct=1002, bcdDevice= 1.00 +[] New USB device strings: Mfr=1, Product=2, SerialNumber=0 +[] Product: DCD-1500RE +[] Manufacturer: D & M Holdings Inc. +[] +[] clock source 41 is not valid, cannot use +[] usbcore: registered new interface driver snd-usb-audio + +Signed-off-by: Yick W. Tse +Cc: +Link: https://lore.kernel.org/r/1373857985.210365.1592048406997@mail.yahoo.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1164,6 +1164,7 @@ bool snd_usb_get_sample_rate_quirk(struc + static bool is_itf_usb_dsd_2alts_dac(unsigned int id) + { + switch (id) { ++ case USB_ID(0x154e, 0x1002): /* Denon DCD-1500RE */ + case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ + case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ + case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ diff --git a/queue-4.14/series b/queue-4.14/series index 4877531e60e..b4747410e80 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -20,3 +20,10 @@ ip6_gre-fix-use-after-free-in-ip6gre_tunnel_lookup.patch net-fix-the-arp-error-in-some-cases.patch net-do-not-clear-the-sock-tx-queue-in-sk_set_socket.patch net-core-reduce-recursion-limit-value.patch +usb-ohci-sm501-add-missed-iounmap-in-remove.patch +usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch +usb-add-usb_quirk_delay_init-for-logitech-c922.patch +usb-ehci-reopen-solution-for-synopsys-hc-bug.patch +usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch +usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch +alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch diff --git a/queue-4.14/usb-add-usb_quirk_delay_init-for-logitech-c922.patch b/queue-4.14/usb-add-usb_quirk_delay_init-for-logitech-c922.patch new file mode 100644 index 00000000000..ecdd71311e7 --- /dev/null +++ b/queue-4.14/usb-add-usb_quirk_delay_init-for-logitech-c922.patch @@ -0,0 +1,41 @@ +From 5d8021923e8a8cc37a421a64e27c7221f0fee33c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tomasz=20Meresi=C5=84ski?= +Date: Wed, 3 Jun 2020 22:33:46 +0200 +Subject: usb: add USB_QUIRK_DELAY_INIT for Logitech C922 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tomasz Meresiński + +commit 5d8021923e8a8cc37a421a64e27c7221f0fee33c upstream. + +The Logitech C922, just like other Logitech webcams, +needs the USB_QUIRK_DELAY_INIT or it will randomly +not respond after device connection + +Signed-off-by: Tomasz Meresiński +Cc: stable +Link: https://lore.kernel.org/r/20200603203347.7792-1-tomasz@meresinski.eu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/quirks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -73,11 +73,12 @@ static const struct usb_device_id usb_qu + /* Logitech HD Webcam C270 */ + { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, + +- /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ ++ /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */ + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, + { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT }, ++ { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT }, + + /* Logitech ConferenceCam CC3000e */ + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, diff --git a/queue-4.14/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch b/queue-4.14/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch new file mode 100644 index 00000000000..3ca28c0cae9 --- /dev/null +++ b/queue-4.14/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch @@ -0,0 +1,62 @@ +From 207324a321a866401b098cadf19e4a2dd6584622 Mon Sep 17 00:00:00 2001 +From: Minas Harutyunyan +Date: Tue, 9 Jun 2020 12:28:11 +0400 +Subject: usb: dwc2: Postponed gadget registration to the udc class driver + +From: Minas Harutyunyan + +commit 207324a321a866401b098cadf19e4a2dd6584622 upstream. + +During dwc2 driver probe, after gadget registration to the udc class +driver, if exist any builtin function driver it immediately bound to +dwc2 and after init host side (dwc2_hcd_init()) stucked in host mode. +Patch postpone gadget registration after host side initialization done. + +Fixes: 117777b2c3bb9 ("usb: dwc2: Move gadget probe function into platform code") +Reported-by: kbuild test robot +Tested-by: Marek Vasut +Cc: stable +Signed-off-by: Minas Harutyunyan +Link: https://lore.kernel.org/r/f21cb38fecc72a230b86155d94c7e60c9cb66f58.1591690938.git.hminas@synopsys.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc2/gadget.c | 6 ------ + drivers/usb/dwc2/platform.c | 11 +++++++++++ + 2 files changed, 11 insertions(+), 6 deletions(-) + +--- a/drivers/usb/dwc2/gadget.c ++++ b/drivers/usb/dwc2/gadget.c +@@ -4723,12 +4723,6 @@ int dwc2_gadget_init(struct dwc2_hsotg * + epnum, 0); + } + +- ret = usb_add_gadget_udc(dev, &hsotg->gadget); +- if (ret) { +- dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, +- hsotg->ctrl_req); +- return ret; +- } + dwc2_hsotg_dump(hsotg); + + return 0; +--- a/drivers/usb/dwc2/platform.c ++++ b/drivers/usb/dwc2/platform.c +@@ -452,6 +452,17 @@ static int dwc2_driver_probe(struct plat + if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) + dwc2_lowlevel_hw_disable(hsotg); + ++#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ ++ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) ++ /* Postponed adding a new gadget to the udc class driver list */ ++ if (hsotg->gadget_enabled) { ++ retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget); ++ if (retval) { ++ dwc2_hsotg_remove(hsotg); ++ goto error; ++ } ++ } ++#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ + return 0; + + error: diff --git a/queue-4.14/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch b/queue-4.14/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch new file mode 100644 index 00000000000..420a706f4d2 --- /dev/null +++ b/queue-4.14/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch @@ -0,0 +1,58 @@ +From 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 Mon Sep 17 00:00:00 2001 +From: Longfang Liu +Date: Mon, 8 Jun 2020 11:46:59 +0800 +Subject: USB: ehci: reopen solution for Synopsys HC bug +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Longfang Liu + +commit 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 upstream. + +A Synopsys USB2.0 core used in Huawei Kunpeng920 SoC has a bug which +might cause the host controller not issuing ping. + +Bug description: +After indicating an Interrupt on Async Advance, the software uses the +doorbell mechanism to delete the Next Link queue head of the last +executed queue head. At this time, the host controller still references +the removed queue head(the queue head is NULL). NULL reference causes +the host controller to lose the USB device. + +Solution: +After deleting the Next Link queue head, when has_synopsys_hc_bug set +to 1,the software can write one of the valid queue head addresses to +the ASYNCLISTADDR register to allow the host controller to get +the valid queue head. in order to solve that problem, this patch set +the flag for Huawei Kunpeng920 + +There are detailed instructions and solutions in this patch: +commit 2f7ac6c19997 ("USB: ehci: add workaround for Synopsys HC bug") + +Signed-off-by: Longfang Liu +Cc: stable +Acked-by: Alan Stern +Link: https://lore.kernel.org/r/1591588019-44284-1-git-send-email-liulongfang@huawei.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-pci.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -229,6 +229,13 @@ static int ehci_pci_setup(struct usb_hcd + ehci_info(ehci, "applying MosChip frame-index workaround\n"); + ehci->frame_index_bug = 1; + break; ++ case PCI_VENDOR_ID_HUAWEI: ++ /* Synopsys HC bug */ ++ if (pdev->device == 0xa239) { ++ ehci_info(ehci, "applying Synopsys HC workaround\n"); ++ ehci->has_synopsys_hc_bug = 1; ++ } ++ break; + } + + /* optional debug port, normally in the first BAR */ diff --git a/queue-4.14/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch b/queue-4.14/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch new file mode 100644 index 00000000000..1fe0a2938d7 --- /dev/null +++ b/queue-4.14/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch @@ -0,0 +1,40 @@ +From 44ed240d62736ad29943ec01e41e194b96f7c5e9 Mon Sep 17 00:00:00 2001 +From: Tang Bin +Date: Tue, 2 Jun 2020 19:47:08 +0800 +Subject: usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() + +From: Tang Bin + +commit 44ed240d62736ad29943ec01e41e194b96f7c5e9 upstream. + +If the function platform_get_irq() failed, the negative value +returned will not be detected here. So fix error handling in +exynos_ehci_probe(). And when get irq failed, the function +platform_get_irq() logs an error message, so remove redundant +message here. + +Fixes: 1bcc5aa87f04 ("USB: Add initial S5P EHCI driver") +Cc: stable +Signed-off-by: Zhang Shengju +Signed-off-by: Tang Bin +Link: https://lore.kernel.org/r/20200602114708.28620-1-tangbin@cmss.chinamobile.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-exynos.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/ehci-exynos.c ++++ b/drivers/usb/host/ehci-exynos.c +@@ -199,9 +199,8 @@ skip_phy: + hcd->rsrc_len = resource_size(res); + + irq = platform_get_irq(pdev, 0); +- if (!irq) { +- dev_err(&pdev->dev, "Failed to get IRQ\n"); +- err = -ENODEV; ++ if (irq < 0) { ++ err = irq; + goto fail_io; + } + diff --git a/queue-4.14/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch b/queue-4.14/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch new file mode 100644 index 00000000000..368de70d904 --- /dev/null +++ b/queue-4.14/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch @@ -0,0 +1,46 @@ +From a24d5072e87457a14023ee1dd3fc8b1e76f899ef Mon Sep 17 00:00:00 2001 +From: Macpaul Lin +Date: Wed, 24 Jun 2020 16:59:47 +0300 +Subject: usb: host: xhci-mtk: avoid runtime suspend when removing hcd + +From: Macpaul Lin + +commit a24d5072e87457a14023ee1dd3fc8b1e76f899ef upstream. + +When runtime suspend was enabled, runtime suspend might happen +when xhci is removing hcd. This might cause kernel panic when hcd +has been freed but runtime pm suspend related handle need to +reference it. + +Signed-off-by: Macpaul Lin +Reviewed-by: Chunfeng Yun +Cc: stable@vger.kernel.org +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20200624135949.22611-4-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-mtk.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/xhci-mtk.c ++++ b/drivers/usb/host/xhci-mtk.c +@@ -726,6 +726,9 @@ static int xhci_mtk_remove(struct platfo + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct usb_hcd *shared_hcd = xhci->shared_hcd; + ++ pm_runtime_put_noidle(&dev->dev); ++ pm_runtime_disable(&dev->dev); ++ + usb_remove_hcd(shared_hcd); + xhci->shared_hcd = NULL; + xhci_mtk_phy_power_off(mtk); +@@ -738,8 +741,6 @@ static int xhci_mtk_remove(struct platfo + xhci_mtk_sch_exit(mtk); + xhci_mtk_clks_disable(mtk); + xhci_mtk_ldos_disable(mtk); +- pm_runtime_put_sync(&dev->dev); +- pm_runtime_disable(&dev->dev); + + return 0; + } diff --git a/queue-4.14/usb-ohci-sm501-add-missed-iounmap-in-remove.patch b/queue-4.14/usb-ohci-sm501-add-missed-iounmap-in-remove.patch new file mode 100644 index 00000000000..31ebccc3849 --- /dev/null +++ b/queue-4.14/usb-ohci-sm501-add-missed-iounmap-in-remove.patch @@ -0,0 +1,34 @@ +From 07c112fb09c86c0231f6ff0061a000ffe91c8eb9 Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Wed, 10 Jun 2020 10:48:44 +0800 +Subject: USB: ohci-sm501: Add missed iounmap() in remove + +From: Chuhong Yuan + +commit 07c112fb09c86c0231f6ff0061a000ffe91c8eb9 upstream. + +This driver misses calling iounmap() in remove to undo the ioremap() +called in probe. +Add the missed call to fix it. + +Fixes: f54aab6ebcec ("usb: ohci-sm501 driver") +Cc: stable +Signed-off-by: Chuhong Yuan +Acked-by: Alan Stern +Link: https://lore.kernel.org/r/20200610024844.3628408-1-hslester96@gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ohci-sm501.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/host/ohci-sm501.c ++++ b/drivers/usb/host/ohci-sm501.c +@@ -195,6 +195,7 @@ static int ohci_hcd_sm501_drv_remove(str + struct resource *mem; + + usb_remove_hcd(hcd); ++ iounmap(hcd->regs); + release_mem_region(hcd->rsrc_start, hcd->rsrc_len); + usb_put_hcd(hcd); + dma_release_declared_memory(&pdev->dev); -- 2.47.3