History

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 ...

Linus Torvalds committed 5 years ago

Commit 28318f52 parents 4ad9a28 a5c768233 files · +267 −225Browse files

Unified · Split

33 files
  1. Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml +5 −1
  2. MAINTAINERS +1 −1
  3. drivers/usb/chipidea/ci_hdrc_imx.c +5 −1
  4. drivers/usb/class/cdc-acm.c +4 −0
  5. drivers/usb/class/cdc-wdm.c +13 −3
  6. drivers/usb/class/usblp.c +19 −2
  7. drivers/usb/core/hcd.c +3 −5
  8. drivers/usb/dwc3/core.h +1 −0
  9. drivers/usb/dwc3/dwc3-meson-g12a.c +1 −1
  10. drivers/usb/dwc3/gadget.c +5 −11
  11. drivers/usb/dwc3/ulpi.c +21 −17
  12. drivers/usb/gadget/Kconfig +2 −0
  13. drivers/usb/gadget/composite.c +8 −2
  14. drivers/usb/gadget/configfs.c +13 −6
  15. drivers/usb/gadget/function/f_printer.c +1 −0
  16. drivers/usb/gadget/function/f_uac2.c +55 −14
  17. drivers/usb/gadget/function/u_ether.c +5 −4
  18. drivers/usb/gadget/legacy/acm_ms.c +3 −1
  19. drivers/usb/gadget/udc/Kconfig +1 −1
  20. drivers/usb/gadget/udc/Makefile +0 −1
  21. drivers/usb/gadget/udc/core.c +1 −2
  22. drivers/usb/gadget/udc/dummy_hcd.c +23 −12
  23. drivers/usb/gadget/udc/fsl_mxc_udc.c +0 −122
  24. drivers/usb/host/xhci.c +12 −12
  25. drivers/usb/misc/yurex.c +3 −0
  26. drivers/usb/serial/iuu_phoenix.c +15 −5
  27. drivers/usb/serial/option.c +3 −0
  28. drivers/usb/storage/unusual_uas.h +7 −0
  29. drivers/usb/typec/altmodes/Kconfig +1 −1
  30. drivers/usb/typec/class.c +2 −0
  31. drivers/usb/typec/mux/intel_pmc_mux.c +11 −0
  32. drivers/usb/usbip/vhci_hcd.c +2 −0
  33. include/linux/kcov.h +21 −0
Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml+5−1
@@ -11,8 +11,12 @@ maintainers: · 10 unmodified lines
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+1−1
@@ -3883,7 +3883,7 @@ F: drivers/mtd/nand/raw/cadence-nand-controller.c · 3882 unmodified lines
38833883 CADENCE USB3 DRD IP DRIVER
38843884 M: Peter Chen <peter.chen@nxp.com>
38853885 M: Pawel Laszczak <pawell@cadence.com>
3886−M: Roger Quadros <rogerq@ti.com>
3886+R: Roger Quadros <rogerq@kernel.org>
38873887 R: Aswath Govindraju <a-govindraju@ti.com>
38883888 L: linux-usb@vger.kernel.org
38893889 S: Maintained
drivers/usb/chipidea/ci_hdrc_imx.c+5−1
@@ -139,9 +139,13 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) · 138 unmodified lines
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+4−0
@@ -1895,6 +1895,10 @@ static const struct usb_device_id acm_ids[] = { · 1894 unmodified lines
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+13−3
@@ -465,13 +465,23 @@ static int service_outstanding_interrupt(struct wdm_device *desc) · 464 unmodified lines
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) · 549 unmodified lines
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+19−2
@@ -274,8 +274,25 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, i · 273 unmodified lines
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+3−5
@@ -1649,14 +1649,12 @@ static void __usb_hcd_giveback_urb(struct urb *urb) · 1648 unmodified lines
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+1−0
@@ -285,6 +285,7 @@ · 284 unmodified lines
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+1−1
@@ -754,7 +754,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) · 753 unmodified lines
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+5−11
@@ -1763,6 +1763,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, · 1762 unmodified lines
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) · 314 unmodified lines
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) · 56 unmodified lines
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, · 168 unmodified lines
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) · 19 unmodified lines
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
drivers/usb/dwc3/ulpi.c+21−17
@@ -7,6 +7,8 @@ · 6 unmodified lines
77 * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
88 */
99
10+#include <linux/delay.h>
11+#include <linux/time64.h>
1012 #include <linux/ulpi/regs.h>
1113
1214 #include "core.h"
@@ -17,14 +19,28 @@ · 4 unmodified lines
1719 DWC3_GUSB2PHYACC_ADDR(ULPI_ACCESS_EXTENDED) | \
1820 DWC3_GUSB2PHYACC_EXTEND_ADDR(a) : DWC3_GUSB2PHYACC_ADDR(a))
1921
20−static int dwc3_ulpi_busyloop(struct dwc3 *dwc)
22+#define DWC3_ULPI_BASE_DELAY DIV_ROUND_UP(NSEC_PER_SEC, 60000000L)
23+
24+static int dwc3_ulpi_busyloop(struct dwc3 *dwc, u8 addr, bool read)
2125 {
22− unsigned int count = 1000;
26+ unsigned long ns = 5L * DWC3_ULPI_BASE_DELAY;
27+ unsigned int count = 10000;
2328 u32 reg;
2429
30+ if (addr >= ULPI_EXT_VENDOR_SPECIFIC)
31+ ns += DWC3_ULPI_BASE_DELAY;
32+
33+ if (read)
34+ ns += DWC3_ULPI_BASE_DELAY;
35+
36+ reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
37+ if (reg & DWC3_GUSB2PHYCFG_SUSPHY)
38+ usleep_range(1000, 1200);
39+
2540 while (count--) {
41+ ndelay(ns);
2642 reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYACC(0));
27− if (!(reg & DWC3_GUSB2PHYACC_BUSY))
43+ if (reg & DWC3_GUSB2PHYACC_DONE)
2844 return 0;
2945 cpu_relax();
3046 }
@@ -38,16 +54,10 @@ static int dwc3_ulpi_read(struct device *dev, u8 addr) · 7 unmodified lines
3854 u32 reg;
3955 int ret;
4056
41− reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
42− if (reg & DWC3_GUSB2PHYCFG_SUSPHY) {
43− reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
44− dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
45− }
46−
4757 reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr);
4858 dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg);
4959
50− ret = dwc3_ulpi_busyloop(dwc);
60+ ret = dwc3_ulpi_busyloop(dwc, addr, true);
5161 if (ret)
5262 return ret;
5363
@@ -61,17 +71,11 @@ static int dwc3_ulpi_write(struct device *dev, u8 addr, u8 val) · 7 unmodified lines
6171 struct dwc3 *dwc = dev_get_drvdata(dev);
6272 u32 reg;
6373
64− reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
65− if (reg & DWC3_GUSB2PHYCFG_SUSPHY) {
66− reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
67− dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
68− }
69−
7074 reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr);
7175 reg |= DWC3_GUSB2PHYACC_WRITE | val;
7276 dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg);
7377
74− return dwc3_ulpi_busyloop(dwc);
78+ return dwc3_ulpi_busyloop(dwc, addr, false);
7579 }
7680
7781 static const struct ulpi_ops dwc3_ulpi_ops = {
drivers/usb/gadget/Kconfig+2−0
@@ -265,6 +265,7 @@ config USB_CONFIGFS_NCM · 264 unmodified lines
265265 depends on NET
266266 select USB_U_ETHER
267267 select USB_F_NCM
268+ select CRC32
268269 help
269270 NCM is an advanced protocol for Ethernet encapsulation, allows
270271 grouping of several ethernet frames into one USB transfer and
@@ -314,6 +315,7 @@ config USB_CONFIGFS_EEM · 43 unmodified lines
314315 depends on NET
315316 select USB_U_ETHER
316317 select USB_F_EEM
318+ select CRC32
317319 help
318320 CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
319321 and therefore can be supported by more hardware. Technically ECM and
drivers/usb/gadget/composite.c+8−2
@@ -392,8 +392,11 @@ int usb_function_deactivate(struct usb_function *function) · 391 unmodified lines
392392
393393 spin_lock_irqsave(&cdev->lock, flags);
394394
395− if (cdev->deactivations == 0)
395+ if (cdev->deactivations == 0) {
396+ spin_unlock_irqrestore(&cdev->lock, flags);
396397 status = usb_gadget_deactivate(cdev->gadget);
398+ spin_lock_irqsave(&cdev->lock, flags);
399+ }
397400 if (status == 0)
398401 cdev->deactivations++;
399402
@@ -424,8 +427,11 @@ int usb_function_activate(struct usb_function *function) · 24 unmodified lines
424427 status = -EINVAL;
425428 else {
426429 cdev->deactivations--;
427− if (cdev->deactivations == 0)
430+ if (cdev->deactivations == 0) {
431+ spin_unlock_irqrestore(&cdev->lock, flags);
428432 status = usb_gadget_activate(cdev->gadget);
433+ spin_lock_irqsave(&cdev->lock, flags);
434+ }
429435 }
430436
431437 spin_unlock_irqrestore(&cdev->lock, flags);
drivers/usb/gadget/configfs.c+13−6
@@ -221,9 +221,16 @@ static ssize_t gadget_dev_desc_bcdUSB_store(struct config_item *item, · 220 unmodified lines
221221
222222 static ssize_t gadget_dev_desc_UDC_show(struct config_item *item, char *page)
223223 {
224− char *udc_name = to_gadget_info(item)->composite.gadget_driver.udc_name;
224+ struct gadget_info *gi = to_gadget_info(item);
225+ char *udc_name;
226+ int ret;
227+
228+ mutex_lock(&gi->lock);
229+ udc_name = gi->composite.gadget_driver.udc_name;
230+ ret = sprintf(page, "%s\n", udc_name ?: "");
231+ mutex_unlock(&gi->lock);
225232
226− return sprintf(page, "%s\n", udc_name ?: "");
233+ return ret;
227234 }
228235
229236 static int unregister_gadget(struct gadget_info *gi)
@@ -1248,9 +1255,9 @@ static void purge_configs_funcs(struct gadget_info *gi) · 1018 unmodified lines
12481255
12491256 cfg = container_of(c, struct config_usb_cfg, c);
12501257
1251− list_for_each_entry_safe(f, tmp, &c->functions, list) {
1258+ list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) {
12521259
1253− list_move_tail(&f->list, &cfg->func_list);
1260+ list_move(&f->list, &cfg->func_list);
12541261 if (f->unbind) {
12551262 dev_dbg(&gi->cdev.gadget->dev,
12561263 "unbind function '%s'/%p\n",
@@ -1536,7 +1543,7 @@ static const struct usb_gadget_driver configfs_driver_template = { · 279 unmodified lines
15361543 .suspend = configfs_composite_suspend,
15371544 .resume = configfs_composite_resume,
15381545
1539− .max_speed = USB_SPEED_SUPER,
1546+ .max_speed = USB_SPEED_SUPER_PLUS,
15401547 .driver = {
15411548 .owner = THIS_MODULE,
15421549 .name = "configfs-gadget",
@@ -1576,7 +1583,7 @@ static struct config_group *gadgets_make( · 33 unmodified lines
15761583 gi->composite.unbind = configfs_do_nothing;
15771584 gi->composite.suspend = NULL;
15781585 gi->composite.resume = NULL;
1579− gi->composite.max_speed = USB_SPEED_SUPER;
1586+ gi->composite.max_speed = USB_SPEED_SUPER_PLUS;
15801587
15811588 spin_lock_init(&gi->spinlock);
15821589 mutex_init(&gi->lock);
drivers/usb/gadget/function/f_printer.c+1−0
@@ -1162,6 +1162,7 @@ fail_tx_reqs: · 1161 unmodified lines
11621162 printer_req_free(dev->in_ep, req);
11631163 }
11641164
1165+ usb_free_all_descriptors(f);
11651166 return ret;
11661167
11671168 }
drivers/usb/gadget/function/f_uac2.c+55−14
@@ -271,7 +271,7 @@ static struct usb_endpoint_descriptor fs_epout_desc = { · 270 unmodified lines
271271
272272 .bEndpointAddress = USB_DIR_OUT,
273273 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
274− .wMaxPacketSize = cpu_to_le16(1023),
274+ /* .wMaxPacketSize = DYNAMIC */
275275 .bInterval = 1,
276276 };
277277
@@ -280,7 +280,7 @@ static struct usb_endpoint_descriptor hs_epout_desc = { · 2 unmodified lines
280280 .bDescriptorType = USB_DT_ENDPOINT,
281281
282282 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
283− .wMaxPacketSize = cpu_to_le16(1024),
283+ /* .wMaxPacketSize = DYNAMIC */
284284 .bInterval = 4,
285285 };
286286
@@ -348,7 +348,7 @@ static struct usb_endpoint_descriptor fs_epin_desc = { · 61 unmodified lines
348348
349349 .bEndpointAddress = USB_DIR_IN,
350350 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
351− .wMaxPacketSize = cpu_to_le16(1023),
351+ /* .wMaxPacketSize = DYNAMIC */
352352 .bInterval = 1,
353353 };
354354
@@ -357,7 +357,7 @@ static struct usb_endpoint_descriptor hs_epin_desc = { · 2 unmodified lines
357357 .bDescriptorType = USB_DT_ENDPOINT,
358358
359359 .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
360− .wMaxPacketSize = cpu_to_le16(1024),
360+ /* .wMaxPacketSize = DYNAMIC */
361361 .bInterval = 4,
362362 };
363363
@@ -444,12 +444,28 @@ struct cntrl_range_lay3 { · 80 unmodified lines
444444 __le32 dRES;
445445 } __packed;
446446
447−static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
447+static int set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
448448 struct usb_endpoint_descriptor *ep_desc,
449− unsigned int factor, bool is_playback)
449+ enum usb_device_speed speed, bool is_playback)
450450 {
451451 int chmask, srate, ssize;
452− u16 max_packet_size;
452+ u16 max_size_bw, max_size_ep;
453+ unsigned int factor;
454+
455+ switch (speed) {
456+ case USB_SPEED_FULL:
457+ max_size_ep = 1023;
458+ factor = 1000;
459+ break;
460+
461+ case USB_SPEED_HIGH:
462+ max_size_ep = 1024;
463+ factor = 8000;
464+ break;
465+
466+ default:
467+ return -EINVAL;
468+ }
453469
454470 if (is_playback) {
455471 chmask = uac2_opts->p_chmask;
@@ -461,10 +477,12 @@ static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, · 5 unmodified lines
461477 ssize = uac2_opts->c_ssize;
462478 }
463479
464− max_packet_size = num_channels(chmask) * ssize *
480+ max_size_bw = num_channels(chmask) * ssize *
465481 DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1)));
466− ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_packet_size,
467− le16_to_cpu(ep_desc->wMaxPacketSize)));
482+ ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_size_bw,
483+ max_size_ep));
484+
485+ return 0;
468486 }
469487
470488 /* Use macro to overcome line length limitation */
@@ -670,10 +688,33 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) · 199 unmodified lines
670688 }
671689
672690 /* Calculate wMaxPacketSize according to audio bandwidth */
673− set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true);
674− set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false);
675− set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true);
676− set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false);
691+ ret = set_ep_max_packet_size(uac2_opts, &fs_epin_desc, USB_SPEED_FULL,
692+ true);
693+ if (ret < 0) {
694+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
695+ return ret;
696+ }
697+
698+ ret = set_ep_max_packet_size(uac2_opts, &fs_epout_desc, USB_SPEED_FULL,
699+ false);
700+ if (ret < 0) {
701+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
702+ return ret;
703+ }
704+
705+ ret = set_ep_max_packet_size(uac2_opts, &hs_epin_desc, USB_SPEED_HIGH,
706+ true);
707+ if (ret < 0) {
708+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
709+ return ret;
710+ }
711+
712+ ret = set_ep_max_packet_size(uac2_opts, &hs_epout_desc, USB_SPEED_HIGH,
713+ false);
714+ if (ret < 0) {
715+ dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
716+ return ret;
717+ }
677718
678719 if (EPOUT_EN(uac2_opts)) {
679720 agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
drivers/usb/gadget/function/u_ether.c+5−4
@@ -45,9 +45,10 @@ · 44 unmodified lines
4545 #define UETH__VERSION "29-May-2008"
4646
4747 /* Experiments show that both Linux and Windows hosts allow up to 16k
48− * frame sizes. Set the max size to 15k+52 to prevent allocating 32k
48+ * frame sizes. Set the max MTU size to 15k+52 to prevent allocating 32k
4949 * blocks and still have efficient handling. */
50−#define GETHER_MAX_ETH_FRAME_LEN 15412
50+#define GETHER_MAX_MTU_SIZE 15412
51+#define GETHER_MAX_ETH_FRAME_LEN (GETHER_MAX_MTU_SIZE + ETH_HLEN)
5152
5253 struct eth_dev {
5354 /* lock is held while accessing port_usb
@@ -786,7 +787,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, · 732 unmodified lines
786787
787788 /* MTU range: 14 - 15412 */
788789 net->min_mtu = ETH_HLEN;
789− net->max_mtu = GETHER_MAX_ETH_FRAME_LEN;
790+ net->max_mtu = GETHER_MAX_MTU_SIZE;
790791
791792 dev->gadget = g;
792793 SET_NETDEV_DEV(net, &g->dev);
@@ -848,7 +849,7 @@ struct net_device *gether_setup_name_default(const char *netname) · 55 unmodified lines
848849
849850 /* MTU range: 14 - 15412 */
850851 net->min_mtu = ETH_HLEN;
851− net->max_mtu = GETHER_MAX_ETH_FRAME_LEN;
852+ net->max_mtu = GETHER_MAX_MTU_SIZE;
852853
853854 return net;
854855 }
drivers/usb/gadget/legacy/acm_ms.c+3−1
@@ -200,8 +200,10 @@ static int acm_ms_bind(struct usb_composite_dev *cdev) · 199 unmodified lines
200200 struct usb_descriptor_header *usb_desc;
201201
202202 usb_desc = usb_otg_descriptor_alloc(gadget);
203− if (!usb_desc)
203+ if (!usb_desc) {
204+ status = -ENOMEM;
204205 goto fail_string_ids;
206+ }
205207 usb_otg_descriptor_init(gadget, usb_desc);
206208 otg_desc[0] = usb_desc;
207209 otg_desc[1] = NULL;
drivers/usb/gadget/udc/Kconfig+1−1
@@ -90,7 +90,7 @@ config USB_BCM63XX_UDC · 89 unmodified lines
9090
9191 config USB_FSL_USB2
9292 tristate "Freescale Highspeed USB DR Peripheral Controller"
93− depends on FSL_SOC || ARCH_MXC
93+ depends on FSL_SOC
9494 help
9595 Some of Freescale PowerPC and i.MX processors have a High Speed
9696 Dual-Role(DR) USB controller, which supports device mode.
drivers/usb/gadget/udc/Makefile+0−1
@@ -23,7 +23,6 @@ obj-$(CONFIG_USB_ATMEL_USBA) += atmel_usba_udc.o · 22 unmodified lines
2323 obj-$(CONFIG_USB_BCM63XX_UDC) += bcm63xx_udc.o
2424 obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
2525 fsl_usb2_udc-y := fsl_udc_core.o
26−fsl_usb2_udc-$(CONFIG_ARCH_MXC) += fsl_mxc_udc.o
2726 obj-$(CONFIG_USB_TEGRA_XUDC) += tegra-xudc.o
2827 obj-$(CONFIG_USB_M66592) += m66592-udc.o
2928 obj-$(CONFIG_USB_R8A66597) += r8a66597-udc.o
drivers/usb/gadget/udc/core.c+1−2
@@ -659,8 +659,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_vbus_disconnect); · 658 unmodified lines
659659 *
660660 * Enables the D+ (or potentially D-) pullup. The host will start
661661 * enumerating this gadget when the pullup is active and a VBUS session
662− * is active (the link is powered). This pullup is always enabled unless
663− * usb_gadget_disconnect() has been used to disable it.
662+ * is active (the link is powered).
664663 *
665664 * Returns zero on success, else negative errno.
666665 */
drivers/usb/gadget/udc/dummy_hcd.c+23−12
@@ -2118,9 +2118,21 @@ static int dummy_hub_control( · 2117 unmodified lines
21182118 dum_hcd->port_status &= ~USB_PORT_STAT_POWER;
21192119 set_link_state(dum_hcd);
21202120 break;
2121− default:
2121+ case USB_PORT_FEAT_ENABLE:
2122+ case USB_PORT_FEAT_C_ENABLE:
2123+ case USB_PORT_FEAT_C_SUSPEND:
2124+ /* Not allowed for USB-3 */
2125+ if (hcd->speed == HCD_USB3)
2126+ goto error;
2127+ fallthrough;
2128+ case USB_PORT_FEAT_C_CONNECTION:
2129+ case USB_PORT_FEAT_C_RESET:
21222130 dum_hcd->port_status &= ~(1 << wValue);
21232131 set_link_state(dum_hcd);
2132+ break;
2133+ default:
2134+ /* Disallow INDICATOR and C_OVER_CURRENT */
2135+ goto error;
21242136 }
21252137 break;
21262138 case GetHubDescriptor:
@@ -2281,18 +2293,17 @@ static int dummy_hub_control( · 154 unmodified lines
22812293 */
22822294 dum_hcd->re_timeout = jiffies + msecs_to_jiffies(50);
22832295 fallthrough;
2296+ case USB_PORT_FEAT_C_CONNECTION:
2297+ case USB_PORT_FEAT_C_RESET:
2298+ case USB_PORT_FEAT_C_ENABLE:
2299+ case USB_PORT_FEAT_C_SUSPEND:
2300+ /* Not allowed for USB-3, and ignored for USB-2 */
2301+ if (hcd->speed == HCD_USB3)
2302+ goto error;
2303+ break;
22842304 default:
2285− if (hcd->speed == HCD_USB3) {
2286− if ((dum_hcd->port_status &
2287− USB_SS_PORT_STAT_POWER) != 0) {
2288− dum_hcd->port_status |= (1 << wValue);
2289− }
2290− } else
2291− if ((dum_hcd->port_status &
2292− USB_PORT_STAT_POWER) != 0) {
2293− dum_hcd->port_status |= (1 << wValue);
2294− }
2295− set_link_state(dum_hcd);
2305+ /* Disallow TEST, INDICATOR, and C_OVER_CURRENT */
2306+ goto error;
22962307 }
22972308 break;
22982309 case GetPortErrorCount:
drivers/usb/gadget/udc/fsl_mxc_udc.c+0−122
@@ -1,122 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0+
2−/*
3− * Copyright (C) 2009
4− * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5− *
6− * Description:
7− * Helper routines for i.MX3x SoCs from Freescale, needed by the fsl_usb2_udc.c
8− * driver to function correctly on these systems.
9− */
10−#include <linux/clk.h>
11−#include <linux/delay.h>
12−#include <linux/err.h>
13−#include <linux/fsl_devices.h>
14−#include <linux/mod_devicetable.h>
15−#include <linux/platform_device.h>
16−#include <linux/io.h>
17−
18−#include "fsl_usb2_udc.h"
19−
20−static struct clk *mxc_ahb_clk;
21−static struct clk *mxc_per_clk;
22−static struct clk *mxc_ipg_clk;
23−
24−/* workaround ENGcm09152 for i.MX35 */
25−#define MX35_USBPHYCTRL_OFFSET 0x600
26−#define USBPHYCTRL_OTGBASE_OFFSET 0x8
27−#define USBPHYCTRL_EVDO (1 << 23)
28−
29−int fsl_udc_clk_init(struct platform_device *pdev)
30−{
31− struct fsl_usb2_platform_data *pdata;
32− unsigned long freq;
33− int ret;
34−
35− pdata = dev_get_platdata(&pdev->dev);
36−
37− mxc_ipg_clk = devm_clk_get(&pdev->dev, "ipg");
38− if (IS_ERR(mxc_ipg_clk)) {
39− dev_err(&pdev->dev, "clk_get(\"ipg\") failed\n");
40− return PTR_ERR(mxc_ipg_clk);
41− }
42−
43− mxc_ahb_clk = devm_clk_get(&pdev->dev, "ahb");
44− if (IS_ERR(mxc_ahb_clk)) {
45− dev_err(&pdev->dev, "clk_get(\"ahb\") failed\n");
46− return PTR_ERR(mxc_ahb_clk);
47− }
48−
49− mxc_per_clk = devm_clk_get(&pdev->dev, "per");
50− if (IS_ERR(mxc_per_clk)) {
51− dev_err(&pdev->dev, "clk_get(\"per\") failed\n");
52− return PTR_ERR(mxc_per_clk);
53− }
54−
55− clk_prepare_enable(mxc_ipg_clk);
56− clk_prepare_enable(mxc_ahb_clk);
57− clk_prepare_enable(mxc_per_clk);
58−
59− /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
60− if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) {
61− freq = clk_get_rate(mxc_per_clk);
62− if (pdata->phy_mode != FSL_USB2_PHY_ULPI &&
63− (freq < 59999000 || freq > 60001000)) {
64− dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq);
65− ret = -EINVAL;
66− goto eclkrate;
67− }
68− }
69−
70− return 0;
71−
72−eclkrate:
73− clk_disable_unprepare(mxc_ipg_clk);
74− clk_disable_unprepare(mxc_ahb_clk);
75− clk_disable_unprepare(mxc_per_clk);
76− mxc_per_clk = NULL;
77− return ret;
78−}
79−
80−int fsl_udc_clk_finalize(struct platform_device *pdev)
81−{
82− struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
83− int ret = 0;
84−
85− /* workaround ENGcm09152 for i.MX35 */
86− if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) {
87− unsigned int v;
88− struct resource *res = platform_get_resource
89− (pdev, IORESOURCE_MEM, 0);
90− void __iomem *phy_regs = ioremap(res->start +
91− MX35_USBPHYCTRL_OFFSET, 512);
92− if (!phy_regs) {
93− dev_err(&pdev->dev, "ioremap for phy address fails\n");
94− ret = -EINVAL;
95− goto ioremap_err;
96− }
97−
98− v = readl(phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
99− writel(v | USBPHYCTRL_EVDO,
100− phy_regs + USBPHYCTRL_OTGBASE_OFFSET);
101−
102− iounmap(phy_regs);
103− }
104−
105−
106−ioremap_err:
107− /* ULPI transceivers don't need usbpll */
108− if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
109− clk_disable_unprepare(mxc_per_clk);
110− mxc_per_clk = NULL;
111− }
112−
113− return ret;
114−}
115−
116−void fsl_udc_clk_release(void)
117−{
118− if (mxc_per_clk)
119− clk_disable_unprepare(mxc_per_clk);
120− clk_disable_unprepare(mxc_ahb_clk);
121− clk_disable_unprepare(mxc_ipg_clk);
122−}
drivers/usb/host/xhci.c+12−12
@@ -4770,19 +4770,19 @@ static u16 xhci_calculate_u1_timeout(struct xhci_hcd *xhci, · 4769 unmodified lines
47704770 {
47714771 unsigned long long timeout_ns;
47724772
4773+ if (xhci->quirks & XHCI_INTEL_HOST)
4774+ timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
4775+ else
4776+ timeout_ns = udev->u1_params.sel;
4777+
47734778 /* Prevent U1 if service interval is shorter than U1 exit latency */
47744779 if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) {
4775− if (xhci_service_interval_to_ns(desc) <= udev->u1_params.mel) {
4780+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) {
47764781 dev_dbg(&udev->dev, "Disable U1, ESIT shorter than exit latency\n");
47774782 return USB3_LPM_DISABLED;
47784783 }
47794784 }
47804785
4781− if (xhci->quirks & XHCI_INTEL_HOST)
4782− timeout_ns = xhci_calculate_intel_u1_timeout(udev, desc);
4783− else
4784− timeout_ns = udev->u1_params.sel;
4785−
47864786 /* The U1 timeout is encoded in 1us intervals.
47874787 * Don't return a timeout of zero, because that's USB3_LPM_DISABLED.
47884788 */
@@ -4834,19 +4834,19 @@ static u16 xhci_calculate_u2_timeout(struct xhci_hcd *xhci, · 45 unmodified lines
48344834 {
48354835 unsigned long long timeout_ns;
48364836
4837+ if (xhci->quirks & XHCI_INTEL_HOST)
4838+ timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc);
4839+ else
4840+ timeout_ns = udev->u2_params.sel;
4841+
48374842 /* Prevent U2 if service interval is shorter than U2 exit latency */
48384843 if (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc)) {
4839− if (xhci_service_interval_to_ns(desc) <= udev->u2_params.mel) {
4844+ if (xhci_service_interval_to_ns(desc) <= timeout_ns) {
48404845 dev_dbg(&udev->dev, "Disable U2, ESIT shorter than exit latency\n");
48414846 return USB3_LPM_DISABLED;
48424847 }
48434848 }
48444849
4845− if (xhci->quirks & XHCI_INTEL_HOST)
4846− timeout_ns = xhci_calculate_intel_u2_timeout(udev, desc);
4847− else
4848− timeout_ns = udev->u2_params.sel;
4849−
48504850 /* The U2 timeout is encoded in 256us intervals */
48514851 timeout_ns = DIV_ROUND_UP_ULL(timeout_ns, 256 * 1000);
48524852 /* If the necessary timeout value is bigger than what we can set in the
drivers/usb/misc/yurex.c+3−0
@@ -496,6 +496,9 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, · 495 unmodified lines
496496 timeout = schedule_timeout(YUREX_WRITE_TIMEOUT);
497497 finish_wait(&dev->waitq, &wait);
498498
499+ /* make sure URB is idle after timeout or (spurious) CMD_ACK */
500+ usb_kill_urb(dev->cntl_urb);
501+
499502 mutex_unlock(&dev->io_mutex);
500503
501504 if (retval < 0) {
drivers/usb/serial/iuu_phoenix.c+15−5
@@ -532,23 +532,29 @@ static int iuu_uart_flush(struct usb_serial_port *port) · 531 unmodified lines
532532 struct device *dev = &port->dev;
533533 int i;
534534 int status;
535− u8 rxcmd = IUU_UART_RX;
535+ u8 *rxcmd;
536536 struct iuu_private *priv = usb_get_serial_port_data(port);
537537
538538 if (iuu_led(port, 0xF000, 0, 0, 0xFF) < 0)
539539 return -EIO;
540540
541+ rxcmd = kmalloc(1, GFP_KERNEL);
542+ if (!rxcmd)
543+ return -ENOMEM;
544+
545+ rxcmd[0] = IUU_UART_RX;
546+
541547 for (i = 0; i < 2; i++) {
542− status = bulk_immediate(port, &rxcmd, 1);
548+ status = bulk_immediate(port, rxcmd, 1);
543549 if (status != IUU_OPERATION_OK) {
544550 dev_dbg(dev, "%s - uart_flush_write error\n", __func__);
545− return status;
551+ goto out_free;
546552 }
547553
548554 status = read_immediate(port, &priv->len, 1);
549555 if (status != IUU_OPERATION_OK) {
550556 dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
551− return status;
557+ goto out_free;
552558 }
553559
554560 if (priv->len > 0) {
@@ -556,12 +562,16 @@ static int iuu_uart_flush(struct usb_serial_port *port) · 1 unmodified line
556562 status = read_immediate(port, priv->buf, priv->len);
557563 if (status != IUU_OPERATION_OK) {
558564 dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
559− return status;
565+ goto out_free;
560566 }
561567 }
562568 }
563569 dev_dbg(dev, "%s - uart_flush_read OK!\n", __func__);
564570 iuu_led(port, 0, 0xF000, 0, 0xFF);
571+
572+out_free:
573+ kfree(rxcmd);
574+
565575 return status;
566576 }
567577
drivers/usb/serial/option.c+3−0
@@ -1117,6 +1117,8 @@ static const struct usb_device_id option_ids[] = { · 1116 unmodified lines
11171117 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
11181118 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
11191119 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1120+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0xff, 0x30) }, /* EM160R-GL */
1121+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0, 0) },
11201122 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
11211123 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
11221124 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
@@ -2057,6 +2059,7 @@ static const struct usb_device_id option_ids[] = { · 934 unmodified lines
20572059 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
20582060 .driver_info = RSVD(6) },
20592061 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
2062+ { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
20602063 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
20612064 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
20622065 { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
drivers/usb/storage/unusual_uas.h+7−0
@@ -90,6 +90,13 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999, · 89 unmodified lines
9090 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
9191 US_FL_BROKEN_FUA),
9292
93+/* Reported-by: Thinh Nguyen <thinhn@synopsys.com> */
94+UNUSUAL_DEV(0x154b, 0xf00b, 0x0000, 0x9999,
95+ "PNY",
96+ "Pro Elite SSD",
97+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
98+ US_FL_NO_ATA_1X),
99+
93100 /* Reported-by: Thinh Nguyen <thinhn@synopsys.com> */
94101 UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999,
95102 "PNY",
drivers/usb/typec/altmodes/Kconfig+1−1
@@ -20,6 +20,6 @@ config TYPEC_NVIDIA_ALTMODE · 19 unmodified lines
2020 to enable support for VirtualLink devices with NVIDIA GPUs.
2121
2222 To compile this driver as a module, choose M here: the
23− module will be called typec_displayport.
23+ module will be called typec_nvidia.
2424
2525 endmenu
drivers/usb/typec/class.c+2−0
@@ -766,6 +766,7 @@ int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmod · 765 unmodified lines
766766 return ret;
767767
768768 sysfs_notify(&partner->dev.kobj, NULL, "number_of_alternate_modes");
769+ kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
769770
770771 return 0;
771772 }
@@ -923,6 +924,7 @@ int typec_plug_set_num_altmodes(struct typec_plug *plug, int num_altmodes) · 151 unmodified lines
923924 return ret;
924925
925926 sysfs_notify(&plug->dev.kobj, NULL, "number_of_alternate_modes");
927+ kobject_uevent(&plug->dev.kobj, KOBJ_CHANGE);
926928
927929 return 0;
928930 }
drivers/usb/typec/mux/intel_pmc_mux.c+11−0
@@ -207,10 +207,21 @@ static int · 206 unmodified lines
207207 pmc_usb_mux_dp_hpd(struct pmc_usb_port *port, struct typec_displayport_data *dp)
208208 {
209209 u8 msg[2] = { };
210+ int ret;
210211
211212 msg[0] = PMC_USB_DP_HPD;
212213 msg[0] |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT;
213214
215+ /* Configure HPD first if HPD,IRQ comes together */
216+ if (!IOM_PORT_HPD_ASSERTED(port->iom_status) &&
217+ dp->status & DP_STATUS_IRQ_HPD &&
218+ dp->status & DP_STATUS_HPD_STATE) {
219+ msg[1] = PMC_USB_DP_HPD_LVL;
220+ ret = pmc_usb_command(port, msg, sizeof(msg));
221+ if (ret)
222+ return ret;
223+ }
224+
214225 if (dp->status & DP_STATUS_IRQ_HPD)
215226 msg[1] = PMC_USB_DP_HPD_IRQ;
216227
drivers/usb/usbip/vhci_hcd.c+2−0
@@ -396,6 +396,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, · 395 unmodified lines
396396 default:
397397 usbip_dbg_vhci_rh(" ClearPortFeature: default %x\n",
398398 wValue);
399+ if (wValue >= 32)
400+ goto error;
399401 vhci_hcd->port_status[rhport] &= ~(1 << wValue);
400402 break;
401403 }
include/linux/kcov.h+21−0
@@ -52,6 +52,25 @@ static inline void kcov_remote_start_usb(u64 id) · 51 unmodified lines
5252 kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id));
5353 }
5454
55+/*
56+ * The softirq flavor of kcov_remote_*() functions is introduced as a temporary
57+ * work around for kcov's lack of nested remote coverage sections support in
58+ * task context. Adding suport for nested sections is tracked in:
59+ * https://bugzilla.kernel.org/show_bug.cgi?id=210337
60+ */
61+
62+static inline void kcov_remote_start_usb_softirq(u64 id)
63+{
64+ if (in_serving_softirq())
65+ kcov_remote_start_usb(id);
66+}
67+
68+static inline void kcov_remote_stop_softirq(void)
69+{
70+ if (in_serving_softirq())
71+ kcov_remote_stop();
72+}
73+
5574 #else
5675
5776 static inline void kcov_task_init(struct task_struct *t) {}
@@ -66,6 +85,8 @@ static inline u64 kcov_common_handle(void) · 8 unmodified lines
6685 }
6786 static inline void kcov_remote_start_common(u64 id) {}
6887 static inline void kcov_remote_start_usb(u64 id) {}
88+static inline void kcov_remote_start_usb_softirq(u64 id) {}
89+static inline void kcov_remote_stop_softirq(void) {}
6990
7091 #endif /* CONFIG_KCOV */
7192 #endif /* _LINUX_KCOV_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t