Skip to content

Commit 950a9f5

Browse files
committed
Merge tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB driver fixes from Greg KH: "Here are a number of USB driver fixes and new device ids for 6.1-rc6. Included in here are: - new usb-serial device ids - dwc3 driver fixes for reported problems - cdns3 driver fixes - new USB device quirks - typec driver fixes - extcon USB typec driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add u-blox LARA-L6 modem USB: serial: option: add u-blox LARA-R6 00B modem USB: serial: option: remove old LARA-R6 PID USB: serial: option: add Fibocom FM160 0x0111 composition usb: add NO_LPM quirk for Realforce 87U Keyboard usb: cdns3: host: fix endless superspeed hub port reset usb: chipidea: fix deadlock in ci_otg_del_timer usb: dwc3: Do not get extcon device when usb-role-switch is used usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler usb: typec: mux: Enter safe mode only when pins need to be reconfigured extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered Revert "usb: dwc3: disable USB core PHY management" usb: dwc3: gadget: Return -ESHUTDOWN on ep disable USB: bcma: Make GPIO explicitly optional USB: serial: option: add Sierra Wireless EM9191
2 parents 12fe29e + 59a5118 commit 950a9f5

File tree

11 files changed

+90
-51
lines changed

11 files changed

+90
-51
lines changed

drivers/extcon/extcon-usbc-tusb320.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,13 @@ static irqreturn_t tusb320_irq_handler(int irq, void *dev_id)
327327
return IRQ_NONE;
328328

329329
tusb320_extcon_irq_handler(priv, reg);
330-
tusb320_typec_irq_handler(priv, reg);
330+
331+
/*
332+
* Type-C support is optional. Only call the Type-C handler if a
333+
* port had been registered previously.
334+
*/
335+
if (priv->port)
336+
tusb320_typec_irq_handler(priv, reg);
331337

332338
regmap_write(priv->regmap, TUSB320_REG9, reg);
333339

drivers/usb/cdns3/host.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,37 @@
2424
#define CFG_RXDET_P3_EN BIT(15)
2525
#define LPM_2_STB_SWITCH_EN BIT(25)
2626

27-
static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd);
27+
static void xhci_cdns3_plat_start(struct usb_hcd *hcd)
28+
{
29+
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
30+
u32 value;
31+
32+
/* set usbcmd.EU3S */
33+
value = readl(&xhci->op_regs->command);
34+
value |= CMD_PM_INDEX;
35+
writel(value, &xhci->op_regs->command);
36+
37+
if (hcd->regs) {
38+
value = readl(hcd->regs + XECP_AUX_CTRL_REG1);
39+
value |= CFG_RXDET_P3_EN;
40+
writel(value, hcd->regs + XECP_AUX_CTRL_REG1);
41+
42+
value = readl(hcd->regs + XECP_PORT_CAP_REG);
43+
value |= LPM_2_STB_SWITCH_EN;
44+
writel(value, hcd->regs + XECP_PORT_CAP_REG);
45+
}
46+
}
47+
48+
static int xhci_cdns3_resume_quirk(struct usb_hcd *hcd)
49+
{
50+
xhci_cdns3_plat_start(hcd);
51+
return 0;
52+
}
2853

2954
static const struct xhci_plat_priv xhci_plat_cdns3_xhci = {
3055
.quirks = XHCI_SKIP_PHY_INIT | XHCI_AVOID_BEI,
31-
.suspend_quirk = xhci_cdns3_suspend_quirk,
56+
.plat_start = xhci_cdns3_plat_start,
57+
.resume_quirk = xhci_cdns3_resume_quirk,
3258
};
3359

3460
static int __cdns_host_init(struct cdns *cdns)
@@ -90,32 +116,6 @@ static int __cdns_host_init(struct cdns *cdns)
90116
return ret;
91117
}
92118

93-
static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd)
94-
{
95-
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
96-
u32 value;
97-
98-
if (pm_runtime_status_suspended(hcd->self.controller))
99-
return 0;
100-
101-
/* set usbcmd.EU3S */
102-
value = readl(&xhci->op_regs->command);
103-
value |= CMD_PM_INDEX;
104-
writel(value, &xhci->op_regs->command);
105-
106-
if (hcd->regs) {
107-
value = readl(hcd->regs + XECP_AUX_CTRL_REG1);
108-
value |= CFG_RXDET_P3_EN;
109-
writel(value, hcd->regs + XECP_AUX_CTRL_REG1);
110-
111-
value = readl(hcd->regs + XECP_PORT_CAP_REG);
112-
value |= LPM_2_STB_SWITCH_EN;
113-
writel(value, hcd->regs + XECP_PORT_CAP_REG);
114-
}
115-
116-
return 0;
117-
}
118-
119119
static void cdns_host_exit(struct cdns *cdns)
120120
{
121121
kfree(cdns->xhci_plat_data);

drivers/usb/chipidea/otg_fsm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ static void ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t)
256256
ci->enabled_otg_timer_bits &= ~(1 << t);
257257
if (ci->next_otg_timer == t) {
258258
if (ci->enabled_otg_timer_bits == 0) {
259+
spin_unlock_irqrestore(&ci->lock, flags);
259260
/* No enabled timers after delete it */
260261
hrtimer_cancel(&ci->otg_fsm_hrtimer);
262+
spin_lock_irqsave(&ci->lock, flags);
261263
ci->next_otg_timer = NUM_OTG_FSM_TIMERS;
262264
} else {
263265
/* Find the next timer */

drivers/usb/core/quirks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ static const struct usb_device_id usb_quirk_list[] = {
362362
{ USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM },
363363
{ USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },
364364

365+
/* Realforce 87U Keyboard */
366+
{ USB_DEVICE(0x0853, 0x011b), .driver_info = USB_QUIRK_NO_LPM },
367+
365368
/* M-Systems Flash Disk Pioneers */
366369
{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
367370

drivers/usb/dwc3/core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,16 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
17101710
if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
17111711
return extcon_get_extcon_dev(name);
17121712

1713+
/*
1714+
* Check explicitly if "usb-role-switch" is used since
1715+
* extcon_find_edev_by_node() can not be used to check the absence of
1716+
* an extcon device. In the absence of an device it will always return
1717+
* EPROBE_DEFER.
1718+
*/
1719+
if (IS_ENABLED(CONFIG_USB_ROLE_SWITCH) &&
1720+
device_property_read_bool(dev, "usb-role-switch"))
1721+
return NULL;
1722+
17131723
/*
17141724
* Try to get an extcon device from the USB PHY controller's "port"
17151725
* node. Check if it has the "port" node first, to avoid printing the

drivers/usb/dwc3/gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
10291029
dep->endpoint.desc = NULL;
10301030
}
10311031

1032-
dwc3_remove_requests(dwc, dep, -ECONNRESET);
1032+
dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
10331033

10341034
dep->stream_capable = false;
10351035
dep->type = 0;

drivers/usb/dwc3/host.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@
1111
#include <linux/of.h>
1212
#include <linux/platform_device.h>
1313

14-
#include "../host/xhci-plat.h"
1514
#include "core.h"
1615

17-
static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
18-
.quirks = XHCI_SKIP_PHY_INIT,
19-
};
20-
2116
static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc,
2217
int irq, char *name)
2318
{
@@ -97,11 +92,6 @@ int dwc3_host_init(struct dwc3 *dwc)
9792
goto err;
9893
}
9994

100-
ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
101-
sizeof(dwc3_xhci_plat_priv));
102-
if (ret)
103-
goto err;
104-
10595
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
10696

10797
if (dwc->usb3_lpm_capable)

drivers/usb/host/bcma-hcd.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static void bcma_hci_platform_power_gpio(struct bcma_device *dev, bool val)
285285
{
286286
struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);
287287

288-
if (IS_ERR_OR_NULL(usb_dev->gpio_desc))
288+
if (!usb_dev->gpio_desc)
289289
return;
290290

291291
gpiod_set_value(usb_dev->gpio_desc, val);
@@ -406,9 +406,11 @@ static int bcma_hcd_probe(struct bcma_device *core)
406406
return -ENOMEM;
407407
usb_dev->core = core;
408408

409-
if (core->dev.of_node)
410-
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
411-
GPIOD_OUT_HIGH);
409+
usb_dev->gpio_desc = devm_gpiod_get_optional(&core->dev, "vcc",
410+
GPIOD_OUT_HIGH);
411+
if (IS_ERR(usb_dev->gpio_desc))
412+
return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
413+
"error obtaining VCC GPIO");
412414

413415
switch (core->id.id) {
414416
case BCMA_CORE_USB20_HOST:

drivers/usb/serial/option.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ static void option_instat_callback(struct urb *urb);
162162
#define NOVATELWIRELESS_PRODUCT_G2 0xA010
163163
#define NOVATELWIRELESS_PRODUCT_MC551 0xB001
164164

165+
#define UBLOX_VENDOR_ID 0x1546
166+
165167
/* AMOI PRODUCTS */
166168
#define AMOI_VENDOR_ID 0x1614
167169
#define AMOI_PRODUCT_H01 0x0800
@@ -240,7 +242,6 @@ static void option_instat_callback(struct urb *urb);
240242
#define QUECTEL_PRODUCT_UC15 0x9090
241243
/* These u-blox products use Qualcomm's vendor ID */
242244
#define UBLOX_PRODUCT_R410M 0x90b2
243-
#define UBLOX_PRODUCT_R6XX 0x90fa
244245
/* These Yuga products use Qualcomm's vendor ID */
245246
#define YUGA_PRODUCT_CLM920_NC5 0x9625
246247

@@ -581,6 +582,9 @@ static void option_instat_callback(struct urb *urb);
581582
#define OPPO_VENDOR_ID 0x22d9
582583
#define OPPO_PRODUCT_R11 0x276c
583584

585+
/* Sierra Wireless products */
586+
#define SIERRA_VENDOR_ID 0x1199
587+
#define SIERRA_PRODUCT_EM9191 0x90d3
584588

585589
/* Device flags */
586590

@@ -1124,8 +1128,16 @@ static const struct usb_device_id option_ids[] = {
11241128
/* u-blox products using Qualcomm vendor ID */
11251129
{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
11261130
.driver_info = RSVD(1) | RSVD(3) },
1127-
{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX),
1131+
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x908b), /* u-blox LARA-R6 00B */
1132+
.driver_info = RSVD(4) },
1133+
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x90fa),
11281134
.driver_info = RSVD(3) },
1135+
/* u-blox products */
1136+
{ USB_DEVICE(UBLOX_VENDOR_ID, 0x1341) }, /* u-blox LARA-L6 */
1137+
{ USB_DEVICE(UBLOX_VENDOR_ID, 0x1342), /* u-blox LARA-L6 (RMNET) */
1138+
.driver_info = RSVD(4) },
1139+
{ USB_DEVICE(UBLOX_VENDOR_ID, 0x1343), /* u-blox LARA-L6 (ECM) */
1140+
.driver_info = RSVD(4) },
11291141
/* Quectel products using Quectel vendor ID */
11301142
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff),
11311143
.driver_info = NUMEP2 },
@@ -2167,6 +2179,7 @@ static const struct usb_device_id option_ids[] = {
21672179
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */
21682180
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
21692181
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
2182+
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
21702183
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
21712184
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
21722185
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
@@ -2176,6 +2189,8 @@ static const struct usb_device_id option_ids[] = {
21762189
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
21772190
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
21782191
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
2192+
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) },
2193+
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
21792194
{ } /* Terminating entry */
21802195
};
21812196
MODULE_DEVICE_TABLE(usb, option_ids);

drivers/usb/typec/mux/intel_pmc_mux.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,24 @@ pmc_usb_mux_usb4(struct pmc_usb_port *port, struct typec_mux_state *state)
369369
return pmc_usb_command(port, (void *)&req, sizeof(req));
370370
}
371371

372-
static int pmc_usb_mux_safe_state(struct pmc_usb_port *port)
372+
static int pmc_usb_mux_safe_state(struct pmc_usb_port *port,
373+
struct typec_mux_state *state)
373374
{
374375
u8 msg;
375376

376377
if (IOM_PORT_ACTIVITY_IS(port->iom_status, SAFE_MODE))
377378
return 0;
378379

380+
if ((IOM_PORT_ACTIVITY_IS(port->iom_status, DP) ||
381+
IOM_PORT_ACTIVITY_IS(port->iom_status, DP_MFD)) &&
382+
state->alt && state->alt->svid == USB_TYPEC_DP_SID)
383+
return 0;
384+
385+
if ((IOM_PORT_ACTIVITY_IS(port->iom_status, TBT) ||
386+
IOM_PORT_ACTIVITY_IS(port->iom_status, ALT_MODE_TBT_USB)) &&
387+
state->alt && state->alt->svid == USB_TYPEC_TBT_SID)
388+
return 0;
389+
379390
msg = PMC_USB_SAFE_MODE;
380391
msg |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT;
381392

@@ -443,7 +454,7 @@ pmc_usb_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state)
443454
return 0;
444455

445456
if (state->mode == TYPEC_STATE_SAFE)
446-
return pmc_usb_mux_safe_state(port);
457+
return pmc_usb_mux_safe_state(port, state);
447458
if (state->mode == TYPEC_STATE_USB)
448459
return pmc_usb_connect(port, port->role);
449460

0 commit comments

Comments
 (0)