From 5fa420b11148fa56882c2fcbc96609cb733fff79 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 26 Jul 2021 10:38:21 +0200 Subject: [PATCH] 5.13-stable patches added patches: usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch usb-dwc2-skip-clock-gating-on-samsung-socs.patch usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch usb-max-3421-prevent-corruption-of-freed-memory.patch usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch usb-serial-cp210x-fix-comments-for-ge-cs1000.patch usb-serial-option-add-support-for-u-blox-lara-r6-family.patch usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch --- queue-5.13/series | 13 ++ ...dget-fix-goutnak-flow-for-slave-mode.patch | 70 ++++++++++ ...ding-zero-length-packet-in-ddma-mode.patch | 47 +++++++ ...c2-skip-clock-gating-on-samsung-socs.patch | 97 +++++++++++++ ...m_runtime_enable-in-tegra_xudc_probe.patch | 32 +++++ ...1-prevent-corruption-of-freed-memory.patch | 132 ++++++++++++++++++ ...fluous-irqs-happen-after-usb_pkt_pop.patch | 51 +++++++ ...d-id-for-cel-em3588-usb-zigbee-stick.patch | 29 ++++ ...al-cp210x-fix-comments-for-ge-cs1000.patch | 34 +++++ ...dd-support-for-u-blox-lara-r6-family.patch | 49 +++++++ ...obing-of-consumer-of-connector-nodes.patch | 42 ++++++ ...switch-before-interrupt-registration.patch | 63 +++++++++ ...obing-of-consumer-of-connector-nodes.patch | 43 ++++++ ...d-lacie-rugged-usb3-fw-to-ignore_uas.patch | 42 ++++++ 14 files changed, 744 insertions(+) create mode 100644 queue-5.13/usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch create mode 100644 queue-5.13/usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch create mode 100644 queue-5.13/usb-dwc2-skip-clock-gating-on-samsung-socs.patch create mode 100644 queue-5.13/usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch create mode 100644 queue-5.13/usb-max-3421-prevent-corruption-of-freed-memory.patch create mode 100644 queue-5.13/usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch create mode 100644 queue-5.13/usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch create mode 100644 queue-5.13/usb-serial-cp210x-fix-comments-for-ge-cs1000.patch create mode 100644 queue-5.13/usb-serial-option-add-support-for-u-blox-lara-r6-family.patch create mode 100644 queue-5.13/usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch create mode 100644 queue-5.13/usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch create mode 100644 queue-5.13/usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch create mode 100644 queue-5.13/usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch diff --git a/queue-5.13/series b/queue-5.13/series index 8ee08804b3f..832a4633fd4 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -161,3 +161,16 @@ kvm-ppc-book3s-fix-h_rtas-rets-buffer-overflow.patch kvm-ppc-book3s-hv-nested-sanitise-h_enter_nested-tm-state.patch usb-hub-disable-usb-3-device-initiated-lpm-if-exit-latency-is-too-high.patch usb-hub-fix-link-power-management-max-exit-latency-mel-calculations.patch +usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch +usb-max-3421-prevent-corruption-of-freed-memory.patch +usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch +usb-serial-option-add-support-for-u-blox-lara-r6-family.patch +usb-serial-cp210x-fix-comments-for-ge-cs1000.patch +usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch +usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch +usb-dwc2-skip-clock-gating-on-samsung-socs.patch +usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch +usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch +usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch +usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch +usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch diff --git a/queue-5.13/usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch b/queue-5.13/usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch new file mode 100644 index 00000000000..f505e11c050 --- /dev/null +++ b/queue-5.13/usb-dwc2-gadget-fix-goutnak-flow-for-slave-mode.patch @@ -0,0 +1,70 @@ +From fecb3a171db425e5068b27231f8efe154bf72637 Mon Sep 17 00:00:00 2001 +From: Minas Harutyunyan +Date: Tue, 13 Jul 2021 09:32:55 +0400 +Subject: usb: dwc2: gadget: Fix GOUTNAK flow for Slave mode. + +From: Minas Harutyunyan + +commit fecb3a171db425e5068b27231f8efe154bf72637 upstream. + +Because of dwc2_hsotg_ep_stop_xfr() function uses poll +mode, first need to mask GINTSTS_GOUTNAKEFF interrupt. +In Slave mode GINTSTS_GOUTNAKEFF interrupt will be +aserted only after pop OUT NAK status packet from RxFIFO. + +In dwc2_hsotg_ep_sethalt() function before setting +DCTL_SGOUTNAK need to unmask GOUTNAKEFF interrupt. + +Tested by USBCV CH9 and MSC tests set in Slave, BDMA and DDMA. +All tests are passed. + +Fixes: a4f827714539a ("usb: dwc2: gadget: Disable enabled HW endpoint in dwc2_hsotg_ep_disable") +Fixes: 6070636c4918c ("usb: dwc2: Fix Stalling a Non-Isochronous OUT EP") +Cc: stable +Signed-off-by: Minas Harutyunyan +Link: https://lore.kernel.org/r/e17fad802bbcaf879e1ed6745030993abb93baf8.1626152924.git.Minas.Harutyunyan@synopsys.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc2/gadget.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +--- a/drivers/usb/dwc2/gadget.c ++++ b/drivers/usb/dwc2/gadget.c +@@ -3900,9 +3900,27 @@ static void dwc2_hsotg_ep_stop_xfr(struc + __func__); + } + } else { ++ /* Mask GINTSTS_GOUTNAKEFF interrupt */ ++ dwc2_hsotg_disable_gsint(hsotg, GINTSTS_GOUTNAKEFF); ++ + if (!(dwc2_readl(hsotg, GINTSTS) & GINTSTS_GOUTNAKEFF)) + dwc2_set_bit(hsotg, DCTL, DCTL_SGOUTNAK); + ++ if (!using_dma(hsotg)) { ++ /* Wait for GINTSTS_RXFLVL interrupt */ ++ if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS, ++ GINTSTS_RXFLVL, 100)) { ++ dev_warn(hsotg->dev, "%s: timeout GINTSTS.RXFLVL\n", ++ __func__); ++ } else { ++ /* ++ * Pop GLOBAL OUT NAK status packet from RxFIFO ++ * to assert GOUTNAKEFF interrupt ++ */ ++ dwc2_readl(hsotg, GRXSTSP); ++ } ++ } ++ + /* Wait for global nak to take effect */ + if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS, + GINTSTS_GOUTNAKEFF, 100)) +@@ -4348,6 +4366,9 @@ static int dwc2_hsotg_ep_sethalt(struct + epctl = dwc2_readl(hs, epreg); + + if (value) { ++ /* Unmask GOUTNAKEFF interrupt */ ++ dwc2_hsotg_en_gsint(hs, GINTSTS_GOUTNAKEFF); ++ + if (!(dwc2_readl(hs, GINTSTS) & GINTSTS_GOUTNAKEFF)) + dwc2_set_bit(hs, DCTL, DCTL_SGOUTNAK); + // STALL bit will be set in GOUTNAKEFF interrupt handler diff --git a/queue-5.13/usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch b/queue-5.13/usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch new file mode 100644 index 00000000000..1b322b8db01 --- /dev/null +++ b/queue-5.13/usb-dwc2-gadget-fix-sending-zero-length-packet-in-ddma-mode.patch @@ -0,0 +1,47 @@ +From d53dc38857f6dbefabd9eecfcbf67b6eac9a1ef4 Mon Sep 17 00:00:00 2001 +From: Minas Harutyunyan +Date: Tue, 20 Jul 2021 05:41:24 -0700 +Subject: usb: dwc2: gadget: Fix sending zero length packet in DDMA mode. + +From: Minas Harutyunyan + +commit d53dc38857f6dbefabd9eecfcbf67b6eac9a1ef4 upstream. + +Sending zero length packet in DDMA mode perform by DMA descriptor +by setting SP (short packet) flag. + +For DDMA in function dwc2_hsotg_complete_in() does not need to send +zlp. + +Tested by USBCV MSC tests. + +Fixes: f71b5e2533de ("usb: dwc2: gadget: fix zero length packet transfers") +Cc: stable +Signed-off-by: Minas Harutyunyan +Link: https://lore.kernel.org/r/967bad78c55dd2db1c19714eee3d0a17cf99d74a.1626777738.git.Minas.Harutyunyan@synopsys.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc2/gadget.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/dwc2/gadget.c ++++ b/drivers/usb/dwc2/gadget.c +@@ -2749,12 +2749,14 @@ static void dwc2_hsotg_complete_in(struc + return; + } + +- /* Zlp for all endpoints, for ep0 only in DATA IN stage */ ++ /* Zlp for all endpoints in non DDMA, for ep0 only in DATA IN stage */ + if (hs_ep->send_zlp) { +- dwc2_hsotg_program_zlp(hsotg, hs_ep); + hs_ep->send_zlp = 0; +- /* transfer will be completed on next complete interrupt */ +- return; ++ if (!using_desc_dma(hsotg)) { ++ dwc2_hsotg_program_zlp(hsotg, hs_ep); ++ /* transfer will be completed on next complete interrupt */ ++ return; ++ } + } + + if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_DATA_IN) { diff --git a/queue-5.13/usb-dwc2-skip-clock-gating-on-samsung-socs.patch b/queue-5.13/usb-dwc2-skip-clock-gating-on-samsung-socs.patch new file mode 100644 index 00000000000..9d0f3bd9bb4 --- /dev/null +++ b/queue-5.13/usb-dwc2-skip-clock-gating-on-samsung-socs.patch @@ -0,0 +1,97 @@ +From c4a0f7a6ab5417eb6105b0e1d7e6e67f6ef7d4e5 Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Fri, 16 Jul 2021 07:01:27 +0200 +Subject: usb: dwc2: Skip clock gating on Samsung SoCs + +From: Marek Szyprowski + +commit c4a0f7a6ab5417eb6105b0e1d7e6e67f6ef7d4e5 upstream. + +Commit 0112b7ce68ea ("usb: dwc2: Update dwc2_handle_usb_suspend_intr +function.") changed the way the driver handles power down modes in a such +way that it uses clock gating when no other power down mode is available. + +This however doesn't work well on the DWC2 implementation used on the +Samsung SoCs. When a clock gating is enabled, system hangs. It looks that +the proper clock gating requires some additional glue code in the shared +USB2 PHY and/or Samsung glue code for the DWC2. To restore driver +operation on the Samsung SoCs simply skip enabling clock gating mode +until one finds what is really needed to make it working reliably. + +Fixes: 0112b7ce68ea ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.") +Cc: stable +Acked-by: Krzysztof Kozlowski +Signed-off-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20210716050127.4406-1-m.szyprowski@samsung.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc2/core.h | 4 ++++ + drivers/usb/dwc2/core_intr.c | 3 ++- + drivers/usb/dwc2/hcd.c | 6 ++++-- + drivers/usb/dwc2/params.c | 1 + + 4 files changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/usb/dwc2/core.h ++++ b/drivers/usb/dwc2/core.h +@@ -383,6 +383,9 @@ enum dwc2_ep0_state { + * 0 - No (default) + * 1 - Partial power down + * 2 - Hibernation ++ * @no_clock_gating: Specifies whether to avoid clock gating feature. ++ * 0 - No (use clock gating) ++ * 1 - Yes (avoid it) + * @lpm: Enable LPM support. + * 0 - No + * 1 - Yes +@@ -480,6 +483,7 @@ struct dwc2_core_params { + #define DWC2_POWER_DOWN_PARAM_NONE 0 + #define DWC2_POWER_DOWN_PARAM_PARTIAL 1 + #define DWC2_POWER_DOWN_PARAM_HIBERNATION 2 ++ bool no_clock_gating; + + bool lpm; + bool lpm_clock_gating; +--- a/drivers/usb/dwc2/core_intr.c ++++ b/drivers/usb/dwc2/core_intr.c +@@ -556,7 +556,8 @@ static void dwc2_handle_usb_suspend_intr + * If neither hibernation nor partial power down are supported, + * clock gating is used to save power. + */ +- dwc2_gadget_enter_clock_gating(hsotg); ++ if (!hsotg->params.no_clock_gating) ++ dwc2_gadget_enter_clock_gating(hsotg); + } + + /* +--- a/drivers/usb/dwc2/hcd.c ++++ b/drivers/usb/dwc2/hcd.c +@@ -3338,7 +3338,8 @@ int dwc2_port_suspend(struct dwc2_hsotg + * If not hibernation nor partial power down are supported, + * clock gating is used to save power. + */ +- dwc2_host_enter_clock_gating(hsotg); ++ if (!hsotg->params.no_clock_gating) ++ dwc2_host_enter_clock_gating(hsotg); + break; + } + +@@ -4402,7 +4403,8 @@ static int _dwc2_hcd_suspend(struct usb_ + * If not hibernation nor partial power down are supported, + * clock gating is used to save power. + */ +- dwc2_host_enter_clock_gating(hsotg); ++ if (!hsotg->params.no_clock_gating) ++ dwc2_host_enter_clock_gating(hsotg); + + /* After entering suspend, hardware is not accessible */ + clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); +--- a/drivers/usb/dwc2/params.c ++++ b/drivers/usb/dwc2/params.c +@@ -76,6 +76,7 @@ static void dwc2_set_s3c6400_params(stru + struct dwc2_core_params *p = &hsotg->params; + + p->power_down = DWC2_POWER_DOWN_PARAM_NONE; ++ p->no_clock_gating = true; + p->phy_utmi_width = 8; + } + diff --git a/queue-5.13/usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch b/queue-5.13/usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch new file mode 100644 index 00000000000..dc5b59fe2ef --- /dev/null +++ b/queue-5.13/usb-gadget-fix-unbalanced-pm_runtime_enable-in-tegra_xudc_probe.patch @@ -0,0 +1,32 @@ +From 5b01248156bd75303e66985c351dee648c149979 Mon Sep 17 00:00:00 2001 +From: Zhang Qilong +Date: Fri, 18 Jun 2021 22:14:41 +0800 +Subject: usb: gadget: Fix Unbalanced pm_runtime_enable in tegra_xudc_probe + +From: Zhang Qilong + +commit 5b01248156bd75303e66985c351dee648c149979 upstream. + +Add missing pm_runtime_disable() when probe error out. It could +avoid pm_runtime implementation complains when removing and probing +again the driver. + +Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") +Cc: stable +Signed-off-by: Zhang Qilong +Link: https://lore.kernel.org/r/20210618141441.107817-1-zhangqilong3@huawei.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/udc/tegra-xudc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/gadget/udc/tegra-xudc.c ++++ b/drivers/usb/gadget/udc/tegra-xudc.c +@@ -3861,6 +3861,7 @@ static int tegra_xudc_probe(struct platf + return 0; + + free_eps: ++ pm_runtime_disable(&pdev->dev); + tegra_xudc_free_eps(xudc); + free_event_ring: + tegra_xudc_free_event_ring(xudc); diff --git a/queue-5.13/usb-max-3421-prevent-corruption-of-freed-memory.patch b/queue-5.13/usb-max-3421-prevent-corruption-of-freed-memory.patch new file mode 100644 index 00000000000..b3016d77ed6 --- /dev/null +++ b/queue-5.13/usb-max-3421-prevent-corruption-of-freed-memory.patch @@ -0,0 +1,132 @@ +From b5fdf5c6e6bee35837e160c00ac89327bdad031b Mon Sep 17 00:00:00 2001 +From: Mark Tomlinson +Date: Fri, 25 Jun 2021 15:14:56 +1200 +Subject: usb: max-3421: Prevent corruption of freed memory + +From: Mark Tomlinson + +commit b5fdf5c6e6bee35837e160c00ac89327bdad031b upstream. + +The MAX-3421 USB driver remembers the state of the USB toggles for a +device/endpoint. To save SPI writes, this was only done when a new +device/endpoint was being used. Unfortunately, if the old device was +removed, this would cause writes to freed memory. + +To fix this, a simpler scheme is used. The toggles are read from +hardware when a URB is completed, and the toggles are always written to +hardware when any URB transaction is started. This will cause a few more +SPI transactions, but no causes kernel panics. + +Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.") +Cc: stable +Signed-off-by: Mark Tomlinson +Link: https://lore.kernel.org/r/20210625031456.8632-1-mark.tomlinson@alliedtelesis.co.nz +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/max3421-hcd.c | 44 +++++++++++++---------------------------- + 1 file changed, 14 insertions(+), 30 deletions(-) + +--- a/drivers/usb/host/max3421-hcd.c ++++ b/drivers/usb/host/max3421-hcd.c +@@ -153,8 +153,6 @@ struct max3421_hcd { + */ + struct urb *curr_urb; + enum scheduling_pass sched_pass; +- struct usb_device *loaded_dev; /* dev that's loaded into the chip */ +- int loaded_epnum; /* epnum whose toggles are loaded */ + int urb_done; /* > 0 -> no errors, < 0: errno */ + size_t curr_len; + u8 hien; +@@ -492,39 +490,17 @@ max3421_set_speed(struct usb_hcd *hcd, s + * Caller must NOT hold HCD spinlock. + */ + static void +-max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum, +- int force_toggles) ++max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum) + { +- struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); +- int old_epnum, same_ep, rcvtog, sndtog; +- struct usb_device *old_dev; ++ int rcvtog, sndtog; + u8 hctl; + +- old_dev = max3421_hcd->loaded_dev; +- old_epnum = max3421_hcd->loaded_epnum; +- +- same_ep = (dev == old_dev && epnum == old_epnum); +- if (same_ep && !force_toggles) +- return; +- +- if (old_dev && !same_ep) { +- /* save the old end-points toggles: */ +- u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); +- +- rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1; +- sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1; +- +- /* no locking: HCD (i.e., we) own toggles, don't we? */ +- usb_settoggle(old_dev, old_epnum, 0, rcvtog); +- usb_settoggle(old_dev, old_epnum, 1, sndtog); +- } + /* setup new endpoint's toggle bits: */ + rcvtog = usb_gettoggle(dev, epnum, 0); + sndtog = usb_gettoggle(dev, epnum, 1); + hctl = (BIT(rcvtog + MAX3421_HCTL_RCVTOG0_BIT) | + BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT)); + +- max3421_hcd->loaded_epnum = epnum; + spi_wr8(hcd, MAX3421_REG_HCTL, hctl); + + /* +@@ -532,7 +508,6 @@ max3421_set_address(struct usb_hcd *hcd, + * address-assignment so it's best to just always load the + * address whenever the end-point changed/was forced. + */ +- max3421_hcd->loaded_dev = dev; + spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum); + } + +@@ -667,7 +642,7 @@ max3421_select_and_start_urb(struct usb_ + struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); + struct urb *urb, *curr_urb = NULL; + struct max3421_ep *max3421_ep; +- int epnum, force_toggles = 0; ++ int epnum; + struct usb_host_endpoint *ep; + struct list_head *pos; + unsigned long flags; +@@ -777,7 +752,6 @@ done: + usb_settoggle(urb->dev, epnum, 0, 1); + usb_settoggle(urb->dev, epnum, 1, 1); + max3421_ep->pkt_state = PKT_STATE_SETUP; +- force_toggles = 1; + } else + max3421_ep->pkt_state = PKT_STATE_TRANSFER; + } +@@ -785,7 +759,7 @@ done: + spin_unlock_irqrestore(&max3421_hcd->lock, flags); + + max3421_ep->last_active = max3421_hcd->frame_number; +- max3421_set_address(hcd, urb->dev, epnum, force_toggles); ++ max3421_set_address(hcd, urb->dev, epnum); + max3421_set_speed(hcd, urb->dev); + max3421_next_transfer(hcd, 0); + return 1; +@@ -1380,6 +1354,16 @@ max3421_urb_done(struct usb_hcd *hcd) + status = 0; + urb = max3421_hcd->curr_urb; + if (urb) { ++ /* save the old end-points toggles: */ ++ u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); ++ int rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1; ++ int sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1; ++ int epnum = usb_endpoint_num(&urb->ep->desc); ++ ++ /* no locking: HCD (i.e., we) own toggles, don't we? */ ++ usb_settoggle(urb->dev, epnum, 0, rcvtog); ++ usb_settoggle(urb->dev, epnum, 1, sndtog); ++ + max3421_hcd->curr_urb = NULL; + spin_lock_irqsave(&max3421_hcd->lock, flags); + usb_hcd_unlink_urb_from_ep(hcd, urb); diff --git a/queue-5.13/usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch b/queue-5.13/usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch new file mode 100644 index 00000000000..e0b9274ba50 --- /dev/null +++ b/queue-5.13/usb-renesas_usbhs-fix-superfluous-irqs-happen-after-usb_pkt_pop.patch @@ -0,0 +1,51 @@ +From 5719df243e118fb343725e8b2afb1637e1af1373 Mon Sep 17 00:00:00 2001 +From: Yoshihiro Shimoda +Date: Thu, 24 Jun 2021 21:20:39 +0900 +Subject: usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() + +From: Yoshihiro Shimoda + +commit 5719df243e118fb343725e8b2afb1637e1af1373 upstream. + +This driver has a potential issue which this driver is possible to +cause superfluous irqs after usb_pkt_pop() is called. So, after +the commit 3af32605289e ("usb: renesas_usbhs: fix error return +code of usbhsf_pkt_handler()") had been applied, we could observe +the following error happened when we used g_audio. + + renesas_usbhs e6590000.usb: irq_ready run_error 1 : -22 + +To fix the issue, disable the tx or rx interrupt in usb_pkt_pop(). + +Fixes: 2743e7f90dc0 ("usb: renesas_usbhs: fix the usb_pkt_pop()") +Cc: # v4.4+ +Signed-off-by: Yoshihiro Shimoda +Link: https://lore.kernel.org/r/20210624122039.596528-1-yoshihiro.shimoda.uh@renesas.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/fifo.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/renesas_usbhs/fifo.c ++++ b/drivers/usb/renesas_usbhs/fifo.c +@@ -101,6 +101,8 @@ static struct dma_chan *usbhsf_dma_chan_ + #define usbhsf_dma_map(p) __usbhsf_dma_map_ctrl(p, 1) + #define usbhsf_dma_unmap(p) __usbhsf_dma_map_ctrl(p, 0) + static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map); ++static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable); ++static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable); + struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) + { + struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); +@@ -123,6 +125,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct u + if (chan) { + dmaengine_terminate_all(chan); + usbhsf_dma_unmap(pkt); ++ } else { ++ if (usbhs_pipe_is_dir_in(pipe)) ++ usbhsf_rx_irq_ctrl(pipe, 0); ++ else ++ usbhsf_tx_irq_ctrl(pipe, 0); + } + + usbhs_pipe_clear_without_sequence(pipe, 0, 0); diff --git a/queue-5.13/usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch b/queue-5.13/usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch new file mode 100644 index 00000000000..002dd93f47e --- /dev/null +++ b/queue-5.13/usb-serial-cp210x-add-id-for-cel-em3588-usb-zigbee-stick.patch @@ -0,0 +1,29 @@ +From d6a206e60124a9759dd7f6dfb86b0e1d3b1df82e Mon Sep 17 00:00:00 2001 +From: John Keeping +Date: Wed, 21 Jul 2021 17:17:45 +0100 +Subject: USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick + +From: John Keeping + +commit d6a206e60124a9759dd7f6dfb86b0e1d3b1df82e upstream. + +Add the USB serial device ID for the CEL ZigBee EM3588 radio stick. + +Signed-off-by: John Keeping +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -155,6 +155,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ + { USB_DEVICE(0x10C4, 0x89FB) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ ++ { USB_DEVICE(0x10C4, 0x8A5B) }, /* CEL EM3588 ZigBee USB Stick */ + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ + { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ diff --git a/queue-5.13/usb-serial-cp210x-fix-comments-for-ge-cs1000.patch b/queue-5.13/usb-serial-cp210x-fix-comments-for-ge-cs1000.patch new file mode 100644 index 00000000000..de28fbcf7ab --- /dev/null +++ b/queue-5.13/usb-serial-cp210x-fix-comments-for-ge-cs1000.patch @@ -0,0 +1,34 @@ +From e9db418d4b828dd049caaf5ed65dc86f93bb1a0c Mon Sep 17 00:00:00 2001 +From: Ian Ray +Date: Mon, 19 Jul 2021 18:43:49 +0200 +Subject: USB: serial: cp210x: fix comments for GE CS1000 + +From: Ian Ray + +commit e9db418d4b828dd049caaf5ed65dc86f93bb1a0c upstream. + +Fix comments for GE CS1000 CP210x USB ID assignments. + +Fixes: 42213a0190b5 ("USB: serial: cp210x: add some more GE USB IDs") +Signed-off-by: Ian Ray +Signed-off-by: Sebastian Reichel +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -202,8 +202,8 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ + { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ + { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ +- { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 Display serial interface */ +- { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 M.2 Key E serial interface */ ++ { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 M.2 Key E serial interface */ ++ { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 Display serial interface */ + { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */ + { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ diff --git a/queue-5.13/usb-serial-option-add-support-for-u-blox-lara-r6-family.patch b/queue-5.13/usb-serial-option-add-support-for-u-blox-lara-r6-family.patch new file mode 100644 index 00000000000..c1f24bf664a --- /dev/null +++ b/queue-5.13/usb-serial-option-add-support-for-u-blox-lara-r6-family.patch @@ -0,0 +1,49 @@ +From 94b619a07655805a1622484967754f5848640456 Mon Sep 17 00:00:00 2001 +From: Marco De Marco +Date: Mon, 5 Jul 2021 19:44:21 +0000 +Subject: USB: serial: option: add support for u-blox LARA-R6 family + +From: Marco De Marco + +commit 94b619a07655805a1622484967754f5848640456 upstream. + +The patch is meant to support LARA-R6 Cat 1 module family. + +Module USB ID: +Vendor ID: 0x05c6 +Product ID: 0x90fA + +Interface layout: +If 0: Diagnostic +If 1: AT parser +If 2: AT parser +If 3: QMI wwan (not available in all versions) + +Signed-off-by: Marco De Marco +Link: https://lore.kernel.org/r/49260184.kfMIbaSn9k@mars +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -238,6 +238,7 @@ static void option_instat_callback(struc + #define QUECTEL_PRODUCT_UC15 0x9090 + /* These u-blox products use Qualcomm's vendor ID */ + #define UBLOX_PRODUCT_R410M 0x90b2 ++#define UBLOX_PRODUCT_R6XX 0x90fa + /* These Yuga products use Qualcomm's vendor ID */ + #define YUGA_PRODUCT_CLM920_NC5 0x9625 + +@@ -1101,6 +1102,8 @@ static const struct usb_device_id option + /* u-blox products using Qualcomm vendor ID */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), + .driver_info = RSVD(1) | RSVD(3) }, ++ { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX), ++ .driver_info = RSVD(3) }, + /* Quectel products using Quectel vendor ID */ + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), + .driver_info = NUMEP2 }, diff --git a/queue-5.13/usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch b/queue-5.13/usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch new file mode 100644 index 00000000000..f4e9374bfb6 --- /dev/null +++ b/queue-5.13/usb-typec-stusb160x-don-t-block-probing-of-consumer-of-connector-nodes.patch @@ -0,0 +1,42 @@ +From 6b63376722d9e1b915a2948e9b30f4ba2712e3f5 Mon Sep 17 00:00:00 2001 +From: Amelie Delaunay +Date: Fri, 16 Jul 2021 14:07:18 +0200 +Subject: usb: typec: stusb160x: Don't block probing of consumer of "connector" nodes + +From: Amelie Delaunay + +commit 6b63376722d9e1b915a2948e9b30f4ba2712e3f5 upstream. + +Similar as with tcpm this patch lets fw_devlink know not to wait on the +fwnode to be populated as a struct device. + +Without this patch, USB functionality can be broken on some previously +supported boards. + +Fixes: 28ec344bb891 ("usb: typec: tcpm: Don't block probing of consumers of "connector" nodes") +Cc: stable +Signed-off-by: Amelie Delaunay +Link: https://lore.kernel.org/r/20210716120718.20398-3-amelie.delaunay@foss.st.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/stusb160x.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/usb/typec/stusb160x.c ++++ b/drivers/usb/typec/stusb160x.c +@@ -686,6 +686,15 @@ static int stusb160x_probe(struct i2c_cl + return -ENODEV; + + /* ++ * This fwnode has a "compatible" property, but is never populated as a ++ * struct device. Instead we simply parse it to read the properties. ++ * This it breaks fw_devlink=on. To maintain backward compatibility ++ * with existing DT files, we work around this by deleting any ++ * fwnode_links to/from this fwnode. ++ */ ++ fw_devlink_purge_absent_suppliers(fwnode); ++ ++ /* + * When both VDD and VSYS power supplies are present, the low power + * supply VSYS is selected when VSYS voltage is above 3.1 V. + * Otherwise VDD is selected. diff --git a/queue-5.13/usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch b/queue-5.13/usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch new file mode 100644 index 00000000000..79d65ab19b0 --- /dev/null +++ b/queue-5.13/usb-typec-stusb160x-register-role-switch-before-interrupt-registration.patch @@ -0,0 +1,63 @@ +From 86762ad4abcc549deb7a155c8e5e961b9755bcf0 Mon Sep 17 00:00:00 2001 +From: Amelie Delaunay +Date: Fri, 16 Jul 2021 14:07:17 +0200 +Subject: usb: typec: stusb160x: register role switch before interrupt registration + +From: Amelie Delaunay + +commit 86762ad4abcc549deb7a155c8e5e961b9755bcf0 upstream. + +During interrupt registration, attach state is checked. If attached, +then the Type-C state is updated with typec_set_xxx functions and role +switch is set with usb_role_switch_set_role(). + +If the usb_role_switch parameter is error or null, the function simply +returns 0. + +So, to update usb_role_switch role if a device is attached before the +irq is registered, usb_role_switch must be registered before irq +registration. + +Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family") +Cc: stable +Signed-off-by: Amelie Delaunay +Link: https://lore.kernel.org/r/20210716120718.20398-2-amelie.delaunay@foss.st.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/stusb160x.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/usb/typec/stusb160x.c ++++ b/drivers/usb/typec/stusb160x.c +@@ -739,10 +739,6 @@ static int stusb160x_probe(struct i2c_cl + typec_set_pwr_opmode(chip->port, chip->pwr_opmode); + + if (client->irq) { +- ret = stusb160x_irq_init(chip, client->irq); +- if (ret) +- goto port_unregister; +- + chip->role_sw = fwnode_usb_role_switch_get(fwnode); + if (IS_ERR(chip->role_sw)) { + ret = PTR_ERR(chip->role_sw); +@@ -752,6 +748,10 @@ static int stusb160x_probe(struct i2c_cl + ret); + goto port_unregister; + } ++ ++ ret = stusb160x_irq_init(chip, client->irq); ++ if (ret) ++ goto role_sw_put; + } else { + /* + * If Source or Dual power role, need to enable VDD supply +@@ -775,6 +775,9 @@ static int stusb160x_probe(struct i2c_cl + + return 0; + ++role_sw_put: ++ if (chip->role_sw) ++ usb_role_switch_put(chip->role_sw); + port_unregister: + typec_unregister_port(chip->port); + all_reg_disable: diff --git a/queue-5.13/usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch b/queue-5.13/usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch new file mode 100644 index 00000000000..46fa0f44cae --- /dev/null +++ b/queue-5.13/usb-typec-tipd-don-t-block-probing-of-consumer-of-connector-nodes.patch @@ -0,0 +1,43 @@ +From 57560ee95cb7f91cf0bc31d4ae8276e0dcfe17aa Mon Sep 17 00:00:00 2001 +From: Martin Kepplinger +Date: Wed, 14 Jul 2021 08:18:07 +0200 +Subject: usb: typec: tipd: Don't block probing of consumer of "connector" nodes + +From: Martin Kepplinger + +commit 57560ee95cb7f91cf0bc31d4ae8276e0dcfe17aa upstream. + +Similar as with tcpm this patch lets fw_devlink know not to wait on the +fwnode to be populated as a struct device. + +Without this patch, USB functionality can be broken on some previously +supported boards. + +Fixes: 28ec344bb891 ("usb: typec: tcpm: Don't block probing of consumers of "connector" nodes") +Cc: stable +Acked-by: Heikki Krogerus +Signed-off-by: Martin Kepplinger +Link: https://lore.kernel.org/r/20210714061807.5737-1-martin.kepplinger@puri.sm +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/tipd/core.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/usb/typec/tipd/core.c ++++ b/drivers/usb/typec/tipd/core.c +@@ -629,6 +629,15 @@ static int tps6598x_probe(struct i2c_cli + if (!fwnode) + return -ENODEV; + ++ /* ++ * This fwnode has a "compatible" property, but is never populated as a ++ * struct device. Instead we simply parse it to read the properties. ++ * This breaks fw_devlink=on. To maintain backward compatibility ++ * with existing DT files, we work around this by deleting any ++ * fwnode_links to/from this fwnode. ++ */ ++ fw_devlink_purge_absent_suppliers(fwnode); ++ + tps->role_sw = fwnode_usb_role_switch_get(fwnode); + if (IS_ERR(tps->role_sw)) { + ret = PTR_ERR(tps->role_sw); diff --git a/queue-5.13/usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch b/queue-5.13/usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch new file mode 100644 index 00000000000..56722481ceb --- /dev/null +++ b/queue-5.13/usb-usb-storage-add-lacie-rugged-usb3-fw-to-ignore_uas.patch @@ -0,0 +1,42 @@ +From 6abf2fe6b4bf6e5256b80c5817908151d2d33e9f Mon Sep 17 00:00:00 2001 +From: Julian Sikorski +Date: Tue, 20 Jul 2021 19:19:10 +0200 +Subject: USB: usb-storage: Add LaCie Rugged USB3-FW to IGNORE_UAS + +From: Julian Sikorski + +commit 6abf2fe6b4bf6e5256b80c5817908151d2d33e9f upstream. + +LaCie Rugged USB3-FW appears to be incompatible with UAS. It generates +errors like: +[ 1151.582598] sd 14:0:0:0: tag#16 uas_eh_abort_handler 0 uas-tag 1 inflight: IN +[ 1151.582602] sd 14:0:0:0: tag#16 CDB: Report supported operation codes a3 0c 01 12 00 00 00 00 02 00 00 00 +[ 1151.588594] scsi host14: uas_eh_device_reset_handler start +[ 1151.710482] usb 2-4: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd +[ 1151.741398] scsi host14: uas_eh_device_reset_handler success +[ 1181.785534] scsi host14: uas_eh_device_reset_handler start + +Signed-off-by: Julian Sikorski +Cc: stable +Link: https://lore.kernel.org/r/20210720171910.36497-1-belegdol+github@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/storage/unusual_uas.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -45,6 +45,13 @@ UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x99 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME), + ++/* Reported-by: Julian Sikorski */ ++UNUSUAL_DEV(0x059f, 0x1061, 0x0000, 0x9999, ++ "LaCie", ++ "Rugged USB3-FW", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_IGNORE_UAS), ++ + /* + * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI + * commands in UAS mode. Observed with the 1.28 firmware; are there others? -- 2.47.3