Skip to content

Commit 88f66f1

Browse files
committed
Merge tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a set of USB driver fixes for 6.5-rc4. Include in here are: - new USB serial device ids - dwc3 driver fixes for reported issues - typec driver fixes for reported problems - gadget driver fixes - reverts of some problematic USB changes that went into -rc1 All of these have been in linux-next with no reported problems" * tag 'usb-6.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (24 commits) usb: misc: ehset: fix wrong if condition usb: dwc3: pci: skip BYT GPIO lookup table for hardwired phy usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config usb: gadget: call usb_gadget_check_config() to verify UDC capability usb: typec: Use sysfs_emit_at when concatenating the string usb: typec: Iterate pds array when showing the pd list usb: typec: Set port->pd before adding device for typec_port usb: typec: qcom: fix return value check in qcom_pmic_typec_probe() Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()" Revert "usb: xhci: tegra: Fix error check" USB: gadget: Fix the memory leak in raw_gadget driver usb: gadget: core: remove unbalanced mutex_unlock in usb_gadget_activate Revert "usb: dwc3: core: Enable AutoRetry feature in the controller" Revert "xhci: add quirk for host controllers that don't update endpoint DCS" USB: quirks: add quirk for Focusrite Scarlett usb: xhci-mtk: set the dma max_seg_size MAINTAINERS: drop invalid usb/cdns3 Reviewer e-mail usb: dwc3: don't reset device side if dwc3 was configured as host-only usb: typec: ucsi: move typec_set_mode(TYPEC_STATE_SAFE) to ucsi_unregister_partner() usb: ohci-at91: Fix the unhandle interrupt when resume ...
2 parents e6d34ce + 7f23276 commit 88f66f1

File tree

21 files changed

+103
-114
lines changed

21 files changed

+103
-114
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4463,7 +4463,6 @@ CADENCE USB3 DRD IP DRIVER
44634463
M: Peter Chen <[email protected]>
44644464
M: Pawel Laszczak <[email protected]>
44654465
R: Roger Quadros <[email protected]>
4466-
R: Aswath Govindraju <[email protected]>
44674466
44684467
S: Maintained
44694468
T: git git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git

drivers/usb/cdns3/cdns3-gadget.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3015,12 +3015,14 @@ static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)
30153015
static int cdns3_gadget_check_config(struct usb_gadget *gadget)
30163016
{
30173017
struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
3018+
struct cdns3_endpoint *priv_ep;
30183019
struct usb_ep *ep;
30193020
int n_in = 0;
30203021
int total;
30213022

30223023
list_for_each_entry(ep, &gadget->ep_list, ep_list) {
3023-
if (ep->claimed && (ep->address & USB_DIR_IN))
3024+
priv_ep = ep_to_cdns3_ep(ep);
3025+
if ((priv_ep->flags & EP_CLAIMED) && (ep->address & USB_DIR_IN))
30243026
n_in++;
30253027
}
30263028

drivers/usb/core/quirks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@ static const struct usb_device_id usb_quirk_list[] = {
436436
/* novation SoundControl XL */
437437
{ USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
438438

439+
/* Focusrite Scarlett Solo USB */
440+
{ USB_DEVICE(0x1235, 0x8211), .driver_info =
441+
USB_QUIRK_DISCONNECT_SUSPEND },
442+
439443
/* Huawei 4G LTE module */
440444
{ USB_DEVICE(0x12d1, 0x15bb), .driver_info =
441445
USB_QUIRK_DISCONNECT_SUSPEND },

drivers/usb/dwc3/core.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ int dwc3_core_soft_reset(struct dwc3 *dwc)
277277
/*
278278
* We're resetting only the device side because, if we're in host mode,
279279
* XHCI driver will reset the host block. If dwc3 was configured for
280-
* host-only mode, then we can return early.
280+
* host-only mode or current role is host, then we can return early.
281281
*/
282-
if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
282+
if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
283283
return 0;
284284

285285
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
@@ -1209,22 +1209,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
12091209
dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
12101210
}
12111211

1212-
if (dwc->dr_mode == USB_DR_MODE_HOST ||
1213-
dwc->dr_mode == USB_DR_MODE_OTG) {
1214-
reg = dwc3_readl(dwc->regs, DWC3_GUCTL);
1215-
1216-
/*
1217-
* Enable Auto retry Feature to make the controller operating in
1218-
* Host mode on seeing transaction errors(CRC errors or internal
1219-
* overrun scenerios) on IN transfers to reply to the device
1220-
* with a non-terminating retry ACK (i.e, an ACK transcation
1221-
* packet with Retry=1 & Nump != 0)
1222-
*/
1223-
reg |= DWC3_GUCTL_HSTINAUTORETRY;
1224-
1225-
dwc3_writel(dwc->regs, DWC3_GUCTL, reg);
1226-
}
1227-
12281212
/*
12291213
* Must config both number of packets and max burst settings to enable
12301214
* RX and/or TX threshold.

drivers/usb/dwc3/core.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@
256256
#define DWC3_GCTL_GBLHIBERNATIONEN BIT(1)
257257
#define DWC3_GCTL_DSBLCLKGTNG BIT(0)
258258

259-
/* Global User Control Register */
260-
#define DWC3_GUCTL_HSTINAUTORETRY BIT(14)
261-
262259
/* Global User Control 1 Register */
263260
#define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT BIT(31)
264261
#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28)

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,12 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc,
233233

234234
/*
235235
* A lot of BYT devices lack ACPI resource entries for
236-
* the GPIOs, add a fallback mapping to the reference
236+
* the GPIOs. If the ACPI entry for the GPIO controller
237+
* is present add a fallback mapping to the reference
237238
* design GPIOs which all boards seem to use.
238239
*/
239-
gpiod_add_lookup_table(&platform_bytcr_gpios);
240+
if (acpi_dev_present("INT33FC", NULL, -1))
241+
gpiod_add_lookup_table(&platform_bytcr_gpios);
240242

241243
/*
242244
* These GPIOs will turn on the USB2 PHY. Note that we have to

drivers/usb/gadget/composite.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,10 @@ int usb_add_config(struct usb_composite_dev *cdev,
11251125
goto done;
11261126

11271127
status = bind(config);
1128+
1129+
if (status == 0)
1130+
status = usb_gadget_check_config(cdev->gadget);
1131+
11281132
if (status < 0) {
11291133
while (!list_empty(&config->functions)) {
11301134
struct usb_function *f;

drivers/usb/gadget/legacy/raw_gadget.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@ static int gadget_bind(struct usb_gadget *gadget,
310310
dev->eps_num = i;
311311
spin_unlock_irqrestore(&dev->lock, flags);
312312

313-
/* Matches kref_put() in gadget_unbind(). */
314-
kref_get(&dev->count);
315-
316313
ret = raw_queue_event(dev, USB_RAW_EVENT_CONNECT, 0, NULL);
317-
if (ret < 0)
314+
if (ret < 0) {
318315
dev_err(&gadget->dev, "failed to queue event\n");
316+
set_gadget_data(gadget, NULL);
317+
return ret;
318+
}
319319

320+
/* Matches kref_put() in gadget_unbind(). */
321+
kref_get(&dev->count);
320322
return ret;
321323
}
322324

drivers/usb/gadget/udc/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,6 @@ int usb_gadget_activate(struct usb_gadget *gadget)
878878
*/
879879
if (gadget->connected)
880880
ret = usb_gadget_connect_locked(gadget);
881-
mutex_unlock(&gadget->udc->connect_lock);
882881

883882
unlock:
884883
mutex_unlock(&gadget->udc->connect_lock);

drivers/usb/gadget/udc/tegra-xudc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3718,15 +3718,15 @@ static int tegra_xudc_powerdomain_init(struct tegra_xudc *xudc)
37183718
int err;
37193719

37203720
xudc->genpd_dev_device = dev_pm_domain_attach_by_name(dev, "dev");
3721-
if (IS_ERR_OR_NULL(xudc->genpd_dev_device)) {
3722-
err = PTR_ERR(xudc->genpd_dev_device) ? : -ENODATA;
3721+
if (IS_ERR(xudc->genpd_dev_device)) {
3722+
err = PTR_ERR(xudc->genpd_dev_device);
37233723
dev_err(dev, "failed to get device power domain: %d\n", err);
37243724
return err;
37253725
}
37263726

37273727
xudc->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "ss");
3728-
if (IS_ERR_OR_NULL(xudc->genpd_dev_ss)) {
3729-
err = PTR_ERR(xudc->genpd_dev_ss) ? : -ENODATA;
3728+
if (IS_ERR(xudc->genpd_dev_ss)) {
3729+
err = PTR_ERR(xudc->genpd_dev_ss);
37303730
dev_err(dev, "failed to get SuperSpeed power domain: %d\n", err);
37313731
return err;
37323732
}

drivers/usb/host/ohci-at91.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,13 @@ ohci_hcd_at91_drv_resume(struct device *dev)
672672
else
673673
at91_start_clock(ohci_at91);
674674

675-
ohci_resume(hcd, false);
675+
/*
676+
* According to the comment in ohci_hcd_at91_drv_suspend()
677+
* we need to do a reset if the 48Mhz clock was stopped,
678+
* that is, if ohci_at91->wakeup is clear. Tell ohci_resume()
679+
* to reset in this case by setting its "hibernated" flag.
680+
*/
681+
ohci_resume(hcd, !ohci_at91->wakeup);
676682

677683
return 0;
678684
}

drivers/usb/host/xhci-mtk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
586586
}
587587

588588
device_init_wakeup(dev, true);
589+
dma_set_max_seg_size(dev, UINT_MAX);
589590

590591
xhci = hcd_to_xhci(hcd);
591592
xhci->main_hcd = hcd;

drivers/usb/host/xhci-pci.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
479479
pdev->device == 0x3432)
480480
xhci->quirks |= XHCI_BROKEN_STREAMS;
481481

482-
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
482+
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483)
483483
xhci->quirks |= XHCI_LPM_SUPPORT;
484-
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
485-
}
486484

487485
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
488486
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,8 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
626626
struct xhci_ring *ep_ring;
627627
struct xhci_command *cmd;
628628
struct xhci_segment *new_seg;
629-
struct xhci_segment *halted_seg = NULL;
630629
union xhci_trb *new_deq;
631630
int new_cycle;
632-
union xhci_trb *halted_trb;
633-
int index = 0;
634631
dma_addr_t addr;
635632
u64 hw_dequeue;
636633
bool cycle_found = false;
@@ -668,27 +665,7 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
668665
hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
669666
new_seg = ep_ring->deq_seg;
670667
new_deq = ep_ring->dequeue;
671-
672-
/*
673-
* Quirk: xHC write-back of the DCS field in the hardware dequeue
674-
* pointer is wrong - use the cycle state of the TRB pointed to by
675-
* the dequeue pointer.
676-
*/
677-
if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS &&
678-
!(ep->ep_state & EP_HAS_STREAMS))
679-
halted_seg = trb_in_td(xhci, td->start_seg,
680-
td->first_trb, td->last_trb,
681-
hw_dequeue & ~0xf, false);
682-
if (halted_seg) {
683-
index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) /
684-
sizeof(*halted_trb);
685-
halted_trb = &halted_seg->trbs[index];
686-
new_cycle = halted_trb->generic.field[3] & 0x1;
687-
xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n",
688-
(u8)(hw_dequeue & 0x1), index, new_cycle);
689-
} else {
690-
new_cycle = hw_dequeue & 0x1;
691-
}
668+
new_cycle = hw_dequeue & 0x1;
692669

693670
/*
694671
* We want to find the pointer, segment and cycle state of the new trb

drivers/usb/host/xhci-tegra.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,15 +1145,15 @@ static int tegra_xusb_powerdomain_init(struct device *dev,
11451145
int err;
11461146

11471147
tegra->genpd_dev_host = dev_pm_domain_attach_by_name(dev, "xusb_host");
1148-
if (IS_ERR_OR_NULL(tegra->genpd_dev_host)) {
1149-
err = PTR_ERR(tegra->genpd_dev_host) ? : -ENODATA;
1148+
if (IS_ERR(tegra->genpd_dev_host)) {
1149+
err = PTR_ERR(tegra->genpd_dev_host);
11501150
dev_err(dev, "failed to get host pm-domain: %d\n", err);
11511151
return err;
11521152
}
11531153

11541154
tegra->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "xusb_ss");
1155-
if (IS_ERR_OR_NULL(tegra->genpd_dev_ss)) {
1156-
err = PTR_ERR(tegra->genpd_dev_ss) ? : -ENODATA;
1155+
if (IS_ERR(tegra->genpd_dev_ss)) {
1156+
err = PTR_ERR(tegra->genpd_dev_ss);
11571157
dev_err(dev, "failed to get superspeed pm-domain: %d\n", err);
11581158
return err;
11591159
}

drivers/usb/misc/ehset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int ehset_probe(struct usb_interface *intf,
7777
switch (test_pid) {
7878
case TEST_SE0_NAK_PID:
7979
ret = ehset_prepare_port_for_testing(hub_udev, portnum);
80-
if (!ret)
80+
if (ret < 0)
8181
break;
8282
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
8383
USB_RT_PORT, USB_PORT_FEAT_TEST,
@@ -86,7 +86,7 @@ static int ehset_probe(struct usb_interface *intf,
8686
break;
8787
case TEST_J_PID:
8888
ret = ehset_prepare_port_for_testing(hub_udev, portnum);
89-
if (!ret)
89+
if (ret < 0)
9090
break;
9191
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
9292
USB_RT_PORT, USB_PORT_FEAT_TEST,
@@ -95,7 +95,7 @@ static int ehset_probe(struct usb_interface *intf,
9595
break;
9696
case TEST_K_PID:
9797
ret = ehset_prepare_port_for_testing(hub_udev, portnum);
98-
if (!ret)
98+
if (ret < 0)
9999
break;
100100
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
101101
USB_RT_PORT, USB_PORT_FEAT_TEST,
@@ -104,7 +104,7 @@ static int ehset_probe(struct usb_interface *intf,
104104
break;
105105
case TEST_PACKET_PID:
106106
ret = ehset_prepare_port_for_testing(hub_udev, portnum);
107-
if (!ret)
107+
if (ret < 0)
108108
break;
109109
ret = usb_control_msg_send(hub_udev, 0, USB_REQ_SET_FEATURE,
110110
USB_RT_PORT, USB_PORT_FEAT_TEST,

drivers/usb/serial/option.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ static void option_instat_callback(struct urb *urb);
251251
#define QUECTEL_PRODUCT_EM061K_LTA 0x0123
252252
#define QUECTEL_PRODUCT_EM061K_LMS 0x0124
253253
#define QUECTEL_PRODUCT_EC25 0x0125
254+
#define QUECTEL_PRODUCT_EM060K_128 0x0128
254255
#define QUECTEL_PRODUCT_EG91 0x0191
255256
#define QUECTEL_PRODUCT_EG95 0x0195
256257
#define QUECTEL_PRODUCT_BG96 0x0296
@@ -268,6 +269,7 @@ static void option_instat_callback(struct urb *urb);
268269
#define QUECTEL_PRODUCT_RM520N 0x0801
269270
#define QUECTEL_PRODUCT_EC200U 0x0901
270271
#define QUECTEL_PRODUCT_EC200S_CN 0x6002
272+
#define QUECTEL_PRODUCT_EC200A 0x6005
271273
#define QUECTEL_PRODUCT_EM061K_LWW 0x6008
272274
#define QUECTEL_PRODUCT_EM061K_LCN 0x6009
273275
#define QUECTEL_PRODUCT_EC200T 0x6026
@@ -1197,6 +1199,9 @@ static const struct usb_device_id option_ids[] = {
11971199
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
11981200
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
11991201
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
1202+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x30) },
1203+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0x00, 0x40) },
1204+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x40) },
12001205
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x30) },
12011206
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0x00, 0x40) },
12021207
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x40) },
@@ -1225,6 +1230,7 @@ static const struct usb_device_id option_ids[] = {
12251230
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) },
12261231
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0900, 0xff, 0, 0), /* RM500U-CN */
12271232
.driver_info = ZLP },
1233+
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200A, 0xff, 0, 0) },
12281234
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) },
12291235
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
12301236
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },

0 commit comments

Comments
 (0)