Skip to content

Commit 28318f5

Browse files
committed
Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a number of small USB driver fixes for 5.11-rc3. Include in here are: - USB gadget driver fixes for reported issues - new usb-serial driver ids - dma from stack bugfixes - typec bugfixes - dwc3 bugfixes - xhci driver bugfixes - other small misc usb driver bugfixes All of these have been in linux-next with no reported issues" * tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits) usb: dwc3: gadget: Clear wait flag on dequeue usb: typec: Send uevent for num_altmodes update usb: typec: Fix copy paste error for NVIDIA alt-mode description usb: gadget: enable super speed plus kcov, usb: hide in_serving_softirq checks in __usb_hcd_giveback_urb usb: uas: Add PNY USB Portable SSD to unusual_uas usb: gadget: configfs: Preserve function ordering after bind failure usb: gadget: select CONFIG_CRC32 usb: gadget: core: change the comment for usb_gadget_connect usb: gadget: configfs: Fix use-after-free issue with udc_name usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup usb: usbip: vhci_hcd: protect shift size USB: usblp: fix DMA to stack USB: serial: iuu_phoenix: fix DMA from stack USB: serial: option: add LongSung M5710 module support USB: serial: option: add Quectel EM160R-GL USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug usb: gadget: f_uac2: reset wMaxPacketSize usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one ...
2 parents 4ad9a28 + a5c7682 commit 28318f5

File tree

33 files changed

+267
-225
lines changed

33 files changed

+267
-225
lines changed

Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ maintainers:
1111

1212
properties:
1313
compatible:
14-
items:
14+
oneOf:
1515
- const: ti,j721e-usb
16+
- const: ti,am64-usb
17+
- items:
18+
- const: ti,j721e-usb
19+
- const: ti,am64-usb
1620

1721
reg:
1822
description: module registers

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3883,7 +3883,7 @@ F: drivers/mtd/nand/raw/cadence-nand-controller.c
38833883
CADENCE USB3 DRD IP DRIVER
38843884
M: Peter Chen <[email protected]>
38853885
M: Pawel Laszczak <[email protected]>
3886-
M: Roger Quadros <rogerq@ti.com>
3886+
R: Roger Quadros <rogerq@kernel.org>
38873887
R: Aswath Govindraju <[email protected]>
38883888
38893889
S: Maintained

drivers/usb/chipidea/ci_hdrc_imx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
139139
misc_pdev = of_find_device_by_node(args.np);
140140
of_node_put(args.np);
141141

142-
if (!misc_pdev || !platform_get_drvdata(misc_pdev))
142+
if (!misc_pdev)
143143
return ERR_PTR(-EPROBE_DEFER);
144144

145+
if (!platform_get_drvdata(misc_pdev)) {
146+
put_device(&misc_pdev->dev);
147+
return ERR_PTR(-EPROBE_DEFER);
148+
}
145149
data->dev = &misc_pdev->dev;
146150

147151
/*

drivers/usb/class/cdc-acm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,10 @@ static const struct usb_device_id acm_ids[] = {
18951895
{ USB_DEVICE(0x04d8, 0xfd08),
18961896
.driver_info = IGNORE_DEVICE,
18971897
},
1898+
1899+
{ USB_DEVICE(0x04d8, 0xf58b),
1900+
.driver_info = IGNORE_DEVICE,
1901+
},
18981902
#endif
18991903

19001904
/*Samsung phone in firmware update mode */

drivers/usb/class/cdc-wdm.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,23 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
465465
if (!desc->resp_count || !--desc->resp_count)
466466
goto out;
467467

468+
if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
469+
rv = -ENODEV;
470+
goto out;
471+
}
472+
if (test_bit(WDM_RESETTING, &desc->flags)) {
473+
rv = -EIO;
474+
goto out;
475+
}
476+
468477
set_bit(WDM_RESPONDING, &desc->flags);
469478
spin_unlock_irq(&desc->iuspin);
470479
rv = usb_submit_urb(desc->response, GFP_KERNEL);
471480
spin_lock_irq(&desc->iuspin);
472481
if (rv) {
473-
dev_err(&desc->intf->dev,
474-
"usb_submit_urb failed with result %d\n", rv);
482+
if (!test_bit(WDM_DISCONNECTING, &desc->flags))
483+
dev_err(&desc->intf->dev,
484+
"usb_submit_urb failed with result %d\n", rv);
475485

476486
/* make sure the next notification trigger a submit */
477487
clear_bit(WDM_RESPONDING, &desc->flags);
@@ -1027,9 +1037,9 @@ static void wdm_disconnect(struct usb_interface *intf)
10271037
wake_up_all(&desc->wait);
10281038
mutex_lock(&desc->rlock);
10291039
mutex_lock(&desc->wlock);
1030-
kill_urbs(desc);
10311040
cancel_work_sync(&desc->rxwork);
10321041
cancel_work_sync(&desc->service_outs_intr);
1042+
kill_urbs(desc);
10331043
mutex_unlock(&desc->wlock);
10341044
mutex_unlock(&desc->rlock);
10351045

drivers/usb/class/usblp.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,25 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i
274274
#define usblp_reset(usblp)\
275275
usblp_ctrl_msg(usblp, USBLP_REQ_RESET, USB_TYPE_CLASS, USB_DIR_OUT, USB_RECIP_OTHER, 0, NULL, 0)
276276

277-
#define usblp_hp_channel_change_request(usblp, channel, buffer) \
278-
usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, channel, buffer, 1)
277+
static int usblp_hp_channel_change_request(struct usblp *usblp, int channel, u8 *new_channel)
278+
{
279+
u8 *buf;
280+
int ret;
281+
282+
buf = kzalloc(1, GFP_KERNEL);
283+
if (!buf)
284+
return -ENOMEM;
285+
286+
ret = usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST,
287+
USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE,
288+
channel, buf, 1);
289+
if (ret == 0)
290+
*new_channel = buf[0];
291+
292+
kfree(buf);
293+
294+
return ret;
295+
}
279296

280297
/*
281298
* See the description for usblp_select_alts() below for the usage

drivers/usb/core/hcd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,14 +1649,12 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
16491649
urb->status = status;
16501650
/*
16511651
* This function can be called in task context inside another remote
1652-
* coverage collection section, but KCOV doesn't support that kind of
1652+
* coverage collection section, but kcov doesn't support that kind of
16531653
* recursion yet. Only collect coverage in softirq context for now.
16541654
*/
1655-
if (in_serving_softirq())
1656-
kcov_remote_start_usb((u64)urb->dev->bus->busnum);
1655+
kcov_remote_start_usb_softirq((u64)urb->dev->bus->busnum);
16571656
urb->complete(urb);
1658-
if (in_serving_softirq())
1659-
kcov_remote_stop();
1657+
kcov_remote_stop_softirq();
16601658

16611659
usb_anchor_resume_wakeups(anchor);
16621660
atomic_dec(&urb->use_count);

drivers/usb/dwc3/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@
285285

286286
/* Global USB2 PHY Vendor Control Register */
287287
#define DWC3_GUSB2PHYACC_NEWREGREQ BIT(25)
288+
#define DWC3_GUSB2PHYACC_DONE BIT(24)
288289
#define DWC3_GUSB2PHYACC_BUSY BIT(23)
289290
#define DWC3_GUSB2PHYACC_WRITE BIT(22)
290291
#define DWC3_GUSB2PHYACC_ADDR(n) (n << 16)

drivers/usb/dwc3/dwc3-meson-g12a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
754754

755755
ret = priv->drvdata->setup_regmaps(priv, base);
756756
if (ret)
757-
return ret;
757+
goto err_disable_clks;
758758

759759
if (priv->vbus) {
760760
ret = regulator_enable(priv->vbus);

drivers/usb/dwc3/gadget.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
17631763
list_for_each_entry_safe(r, t, &dep->started_list, list)
17641764
dwc3_gadget_move_cancelled_request(r);
17651765

1766+
dep->flags &= ~DWC3_EP_WAIT_TRANSFER_COMPLETE;
1767+
17661768
goto out;
17671769
}
17681770
}
@@ -2083,6 +2085,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
20832085

20842086
static void dwc3_gadget_disable_irq(struct dwc3 *dwc);
20852087
static void __dwc3_gadget_stop(struct dwc3 *dwc);
2088+
static int __dwc3_gadget_start(struct dwc3 *dwc);
20862089

20872090
static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
20882091
{
@@ -2145,6 +2148,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
21452148
dwc->ev_buf->lpos = (dwc->ev_buf->lpos + count) %
21462149
dwc->ev_buf->length;
21472150
}
2151+
} else {
2152+
__dwc3_gadget_start(dwc);
21482153
}
21492154

21502155
ret = dwc3_gadget_run_stop(dwc, is_on, false);
@@ -2319,10 +2324,6 @@ static int dwc3_gadget_start(struct usb_gadget *g,
23192324
}
23202325

23212326
dwc->gadget_driver = driver;
2322-
2323-
if (pm_runtime_active(dwc->dev))
2324-
__dwc3_gadget_start(dwc);
2325-
23262327
spin_unlock_irqrestore(&dwc->lock, flags);
23272328

23282329
return 0;
@@ -2348,13 +2349,6 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
23482349
unsigned long flags;
23492350

23502351
spin_lock_irqsave(&dwc->lock, flags);
2351-
2352-
if (pm_runtime_suspended(dwc->dev))
2353-
goto out;
2354-
2355-
__dwc3_gadget_stop(dwc);
2356-
2357-
out:
23582352
dwc->gadget_driver = NULL;
23592353
spin_unlock_irqrestore(&dwc->lock, flags);
23602354

0 commit comments

Comments
 (0)