From dc38b99401bbbed6fcad2b6407b0e18ba50ca400 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 28 Jun 2020 17:42:54 +0200 Subject: [PATCH] 4.19-stable patches added patches: alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch alsa-usb-audio-fix-oob-access-of-mixer-element-list.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 usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch xhci-poll-for-u0-after-disabling-usb2-lpm.patch --- ...audio-add-quirk-for-denon-dcd-1500re.patch | 39 ++++++ ...d-quirk-for-samsung-usbc-headset-akg.patch | 41 ++++++ ...fix-oob-access-of-mixer-element-list.patch | 117 ++++++++++++++++++ queue-4.19/series | 11 ++ ...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 +++++ ...oid-screaming-irq-causing-boot-hangs.patch | 85 +++++++++++++ ...poll-for-u0-after-disabling-usb2-lpm.patch | 59 +++++++++ 12 files changed, 633 insertions(+) create mode 100644 queue-4.19/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch create mode 100644 queue-4.19/alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch create mode 100644 queue-4.19/alsa-usb-audio-fix-oob-access-of-mixer-element-list.patch create mode 100644 queue-4.19/usb-add-usb_quirk_delay_init-for-logitech-c922.patch create mode 100644 queue-4.19/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch create mode 100644 queue-4.19/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch create mode 100644 queue-4.19/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch create mode 100644 queue-4.19/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch create mode 100644 queue-4.19/usb-ohci-sm501-add-missed-iounmap-in-remove.patch create mode 100644 queue-4.19/usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch create mode 100644 queue-4.19/xhci-poll-for-u0-after-disabling-usb2-lpm.patch diff --git a/queue-4.19/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch b/queue-4.19/alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch new file mode 100644 index 00000000000..c9b64510e7e --- /dev/null +++ b/queue-4.19/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 +@@ -1203,6 +1203,7 @@ bool snd_usb_get_sample_rate_quirk(struc + static bool is_itf_usb_dsd_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.19/alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch b/queue-4.19/alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch new file mode 100644 index 00000000000..f6d08b24c3f --- /dev/null +++ b/queue-4.19/alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch @@ -0,0 +1,41 @@ +From a32a1fc99807244d920d274adc46ba04b538cc8a Mon Sep 17 00:00:00 2001 +From: Macpaul Lin +Date: Tue, 23 Jun 2020 19:03:23 +0800 +Subject: ALSA: usb-audio: add quirk for Samsung USBC Headset (AKG) + +From: Macpaul Lin + +commit a32a1fc99807244d920d274adc46ba04b538cc8a upstream. + +We've found Samsung USBC Headset (AKG) (VID: 0x04e8, PID: 0xa051) +need a tiny delay after each class compliant request. +Otherwise the device might not be able to be recognized each times. + +Signed-off-by: Chihhao Chen +Signed-off-by: Macpaul Lin +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/1592910203-24035-1-git-send-email-macpaul.lin@mediatek.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1345,6 +1345,14 @@ void snd_usb_ctl_msg_quirk(struct usb_de + chip->usb_id == USB_ID(0x0951, 0x16ad)) && + (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) + usleep_range(1000, 2000); ++ ++ /* ++ * Samsung USBC Headset (AKG) need a tiny delay after each ++ * class compliant request. (Model number: AAM625R or AAM627R) ++ */ ++ if (chip->usb_id == USB_ID(0x04e8, 0xa051) && ++ (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) ++ usleep_range(5000, 6000); + } + + /* diff --git a/queue-4.19/alsa-usb-audio-fix-oob-access-of-mixer-element-list.patch b/queue-4.19/alsa-usb-audio-fix-oob-access-of-mixer-element-list.patch new file mode 100644 index 00000000000..71726a50cea --- /dev/null +++ b/queue-4.19/alsa-usb-audio-fix-oob-access-of-mixer-element-list.patch @@ -0,0 +1,117 @@ +From 220345e98f1cdc768eeb6e3364a0fa7ab9647fe7 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 24 Jun 2020 14:23:40 +0200 +Subject: ALSA: usb-audio: Fix OOB access of mixer element list + +From: Takashi Iwai + +commit 220345e98f1cdc768eeb6e3364a0fa7ab9647fe7 upstream. + +The USB-audio mixer code holds a linked list of usb_mixer_elem_list, +and several operations are performed for each mixer element. A few of +them (snd_usb_mixer_notify_id() and snd_usb_mixer_interrupt_v2()) +assume each mixer element being a usb_mixer_elem_info object that is a +subclass of usb_mixer_elem_list, cast via container_of() and access it +members. This may result in an out-of-bound access when a +non-standard list element has been added, as spotted by syzkaller +recently. + +This patch adds a new field, is_std_info, in usb_mixer_elem_list to +indicate that the element is the usb_mixer_elem_info type or not, and +skip the access to such an element if needed. + +Reported-by: syzbot+fb14314433463ad51625@syzkaller.appspotmail.com +Reported-by: syzbot+2405ca3401e943c538b5@syzkaller.appspotmail.com +Cc: +Link: https://lore.kernel.org/r/20200624122340.9615-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/mixer.c | 15 +++++++++++---- + sound/usb/mixer.h | 9 +++++++-- + sound/usb/mixer_quirks.c | 3 ++- + 3 files changed, 20 insertions(+), 7 deletions(-) + +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -591,8 +591,9 @@ static int check_matrix_bitmap(unsigned + * if failed, give up and free the control instance. + */ + +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list, +- struct snd_kcontrol *kctl) ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list, ++ struct snd_kcontrol *kctl, ++ bool is_std_info) + { + struct usb_mixer_interface *mixer = list->mixer; + int err; +@@ -606,6 +607,7 @@ int snd_usb_mixer_add_control(struct usb + return err; + } + list->kctl = kctl; ++ list->is_std_info = is_std_info; + list->next_id_elem = mixer->id_elems[list->id]; + mixer->id_elems[list->id] = list; + return 0; +@@ -3232,8 +3234,11 @@ void snd_usb_mixer_notify_id(struct usb_ + unitid = delegate_notify(mixer, unitid, NULL, NULL); + + for_each_mixer_elem(list, mixer, unitid) { +- struct usb_mixer_elem_info *info = +- mixer_elem_list_to_info(list); ++ struct usb_mixer_elem_info *info; ++ ++ if (!list->is_std_info) ++ continue; ++ info = mixer_elem_list_to_info(list); + /* invalidate cache, so the value is read from the device */ + info->cached = 0; + snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE, +@@ -3313,6 +3318,8 @@ static void snd_usb_mixer_interrupt_v2(s + + if (!list->kctl) + continue; ++ if (!list->is_std_info) ++ continue; + + info = mixer_elem_list_to_info(list); + if (count > 1 && info->control != control) +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -59,6 +59,7 @@ struct usb_mixer_elem_list { + struct usb_mixer_elem_list *next_id_elem; /* list of controls with same id */ + struct snd_kcontrol *kctl; + unsigned int id; ++ bool is_std_info; + usb_mixer_elem_dump_func_t dump; + usb_mixer_elem_resume_func_t resume; + }; +@@ -96,8 +97,12 @@ void snd_usb_mixer_notify_id(struct usb_ + int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, + int request, int validx, int value_set); + +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list, +- struct snd_kcontrol *kctl); ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list, ++ struct snd_kcontrol *kctl, ++ bool is_std_info); ++ ++#define snd_usb_mixer_add_control(list, kctl) \ ++ snd_usb_mixer_add_list(list, kctl, true) + + void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list, + struct usb_mixer_interface *mixer, +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -168,7 +168,8 @@ static int add_single_ctl_with_resume(st + return -ENOMEM; + } + kctl->private_free = snd_usb_mixer_elem_free; +- return snd_usb_mixer_add_control(list, kctl); ++ /* don't use snd_usb_mixer_add_control() here, this is a special list element */ ++ return snd_usb_mixer_add_list(list, kctl, false); + } + + /* diff --git a/queue-4.19/series b/queue-4.19/series index 3fffbe63515..eb46a5081d2 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -38,3 +38,14 @@ sch_cake-don-t-call-diffserv-parsing-code-when-it-is-not-needed.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 +xhci-poll-for-u0-after-disabling-usb2-lpm.patch +usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch +usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch +alsa-usb-audio-add-quirk-for-denon-dcd-1500re.patch +alsa-usb-audio-add-quirk-for-samsung-usbc-headset-akg.patch +alsa-usb-audio-fix-oob-access-of-mixer-element-list.patch diff --git a/queue-4.19/usb-add-usb_quirk_delay_init-for-logitech-c922.patch b/queue-4.19/usb-add-usb_quirk_delay_init-for-logitech-c922.patch new file mode 100644 index 00000000000..b1db9374e6a --- /dev/null +++ b/queue-4.19/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 +@@ -218,11 +218,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.19/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch b/queue-4.19/usb-dwc2-postponed-gadget-registration-to-the-udc-class-driver.patch new file mode 100644 index 00000000000..d5d66a89a51 --- /dev/null +++ b/queue-4.19/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 +@@ -4759,12 +4759,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 +@@ -492,6 +492,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.19/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch b/queue-4.19/usb-ehci-reopen-solution-for-synopsys-hc-bug.patch new file mode 100644 index 00000000000..c8862cd0632 --- /dev/null +++ b/queue-4.19/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 +@@ -216,6 +216,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.19/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch b/queue-4.19/usb-host-ehci-exynos-fix-error-check-in-exynos_ehci_probe.patch new file mode 100644 index 00000000000..7c9e499e0f7 --- /dev/null +++ b/queue-4.19/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 +@@ -188,9 +188,8 @@ static int exynos_ehci_probe(struct plat + 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.19/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch b/queue-4.19/usb-host-xhci-mtk-avoid-runtime-suspend-when-removing-hcd.patch new file mode 100644 index 00000000000..d37e6c6416e --- /dev/null +++ b/queue-4.19/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 +@@ -592,6 +592,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; + device_init_wakeup(&dev->dev, false); +@@ -602,8 +605,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.19/usb-ohci-sm501-add-missed-iounmap-in-remove.patch b/queue-4.19/usb-ohci-sm501-add-missed-iounmap-in-remove.patch new file mode 100644 index 00000000000..b961d55c52a --- /dev/null +++ b/queue-4.19/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 +@@ -196,6 +196,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); diff --git a/queue-4.19/usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch b/queue-4.19/usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch new file mode 100644 index 00000000000..c50dfb69aeb --- /dev/null +++ b/queue-4.19/usb-typec-tcpci_rt1711h-avoid-screaming-irq-causing-boot-hangs.patch @@ -0,0 +1,85 @@ +From 302c570bf36e997d55ad0d60628a2feec76954a4 Mon Sep 17 00:00:00 2001 +From: Li Jun +Date: Thu, 4 Jun 2020 19:21:18 +0800 +Subject: usb: typec: tcpci_rt1711h: avoid screaming irq causing boot hangs + +From: Li Jun + +commit 302c570bf36e997d55ad0d60628a2feec76954a4 upstream. + +John reported screaming irq caused by rt1711h when system boot[1], +this is because irq request is done before tcpci_register_port(), +so the chip->tcpci has not been setup, irq handler is entered but +can't do anything, this patch is to address this by moving the irq +request after tcpci_register_port(). + +[1] https://lore.kernel.org/linux-usb/20200530040157.31038-1-john.stultz@linaro.org + +Fixes: ce08eaeb6388 ("staging: typec: rt1711h typec chip driver") +Cc: stable # v4.18+ +Cc: John Stultz +Reported-and-tested-by: John Stultz +Reviewed-by: Guenter Roeck +Reviewed-by: Heikki Krogerus +Signed-off-by: Li Jun +Link: https://lore.kernel.org/r/20200604112118.38062-1-jun.li@nxp.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/typec/tcpci_rt1711h.c | 31 ++++++++++--------------------- + 1 file changed, 10 insertions(+), 21 deletions(-) + +--- a/drivers/usb/typec/tcpci_rt1711h.c ++++ b/drivers/usb/typec/tcpci_rt1711h.c +@@ -179,26 +179,6 @@ out: + return tcpci_irq(chip->tcpci); + } + +-static int rt1711h_init_alert(struct rt1711h_chip *chip, +- struct i2c_client *client) +-{ +- int ret; +- +- /* Disable chip interrupts before requesting irq */ +- ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0); +- if (ret < 0) +- return ret; +- +- ret = devm_request_threaded_irq(chip->dev, client->irq, NULL, +- rt1711h_irq, +- IRQF_ONESHOT | IRQF_TRIGGER_LOW, +- dev_name(chip->dev), chip); +- if (ret < 0) +- return ret; +- enable_irq_wake(client->irq); +- return 0; +-} +- + static int rt1711h_sw_reset(struct rt1711h_chip *chip) + { + int ret; +@@ -260,7 +240,8 @@ static int rt1711h_probe(struct i2c_clie + if (ret < 0) + return ret; + +- ret = rt1711h_init_alert(chip, client); ++ /* Disable chip interrupts before requesting irq */ ++ ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0); + if (ret < 0) + return ret; + +@@ -271,6 +252,14 @@ static int rt1711h_probe(struct i2c_clie + if (IS_ERR_OR_NULL(chip->tcpci)) + return PTR_ERR(chip->tcpci); + ++ ret = devm_request_threaded_irq(chip->dev, client->irq, NULL, ++ rt1711h_irq, ++ IRQF_ONESHOT | IRQF_TRIGGER_LOW, ++ dev_name(chip->dev), chip); ++ if (ret < 0) ++ return ret; ++ enable_irq_wake(client->irq); ++ + return 0; + } + diff --git a/queue-4.19/xhci-poll-for-u0-after-disabling-usb2-lpm.patch b/queue-4.19/xhci-poll-for-u0-after-disabling-usb2-lpm.patch new file mode 100644 index 00000000000..b35d4a3c369 --- /dev/null +++ b/queue-4.19/xhci-poll-for-u0-after-disabling-usb2-lpm.patch @@ -0,0 +1,59 @@ +From b3d71abd135e6919ca0b6cab463738472653ddfb Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Wed, 24 Jun 2020 16:59:49 +0300 +Subject: xhci: Poll for U0 after disabling USB2 LPM + +From: Kai-Heng Feng + +commit b3d71abd135e6919ca0b6cab463738472653ddfb upstream. + +USB2 devices with LPM enabled may interrupt the system suspend: +[ 932.510475] usb 1-7: usb suspend, wakeup 0 +[ 932.510549] hub 1-0:1.0: hub_suspend +[ 932.510581] usb usb1: bus suspend, wakeup 0 +[ 932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended +[ 932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended +.. +[ 932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03 +.. +[ 932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16 +[ 932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16 +[ 932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16 + +During system suspend, USB core will let HC suspends the device if it +doesn't have remote wakeup enabled and doesn't have any children. +However, from the log above we can see that the usb 1-7 doesn't get bus +suspended due to not in U0. After a while the port finished U2 -> U0 +transition, interrupts the suspend process. + +The observation is that after disabling LPM, port doesn't transit to U0 +immediately and can linger in U2. xHCI spec 4.23.5.2 states that the +maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for +the affected device is advertised as 400us, which is still not enough +based on my testing result. + +So let's use the maximum permitted latency, 10000, to poll for U0 +status to solve the issue. + +Cc: stable@vger.kernel.org +Signed-off-by: Kai-Heng Feng +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -4385,6 +4385,9 @@ static int xhci_set_usb2_hardware_lpm(st + mutex_lock(hcd->bandwidth_mutex); + xhci_change_max_exit_latency(xhci, udev, 0); + mutex_unlock(hcd->bandwidth_mutex); ++ readl_poll_timeout(ports[port_num]->addr, pm_val, ++ (pm_val & PORT_PLS_MASK) == XDEV_U0, ++ 100, 10000); + return 0; + } + } -- 2.47.3