Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt fixes from Greg KH:
"Here are a number of small USB and Thunderbolt driver fixes and new
device id changes for 6.2-rc5. Included in here are:

- thunderbolt bugfixes for reported problems

- new usb-serial driver ids added

- onboard_hub usb driver fixes for much-reported problems

- xhci bugfixes

- typec bugfixes

- ehci-fsl driver module alias fix

- iowarrior header size fix

- usb gadget driver fixes

All of these, except for the iowarrior fix, have been in linux-next
with no reported issues. The iowarrior fix passed the 0-day testing
and is a one digit change based on a reported problem in the driver
(which was written to a spec, not the real device that is now
available)"

* tag 'usb-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (40 commits)
USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100
usb: host: ehci-fsl: Fix module alias
usb: dwc3: fix extcon dependency
usb: core: hub: disable autosuspend for TI TUSB8041
USB: fix misleading usb_set_intfdata() kernel doc
usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
USB: gadget: Add ID numbers to configfs-gadget driver names
usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail
usb: gadget: g_webcam: Send color matching descriptor per frame
usb: typec: altmodes/displayport: Use proper macro for pin assignment check
usb: typec: altmodes/displayport: Fix pin assignment calculation
usb: typec: altmodes/displayport: Add pin assignment helper
usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
usb: misc: onboard_hub: Move 'attach' work to the driver
usb: misc: onboard_hub: Invert driver registration order
usb: ucsi: Ensure connector delayed work items are flushed
usb: musb: fix error return code in omap2430_probe()
usb: chipidea: core: fix possible constant 0 if use IS_ERR(ci->role_switch)
xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables
...

+334 -84
+4 -16
drivers/thunderbolt/retimer.c
··· 427 427 { 428 428 u32 status[TB_MAX_RETIMER_INDEX + 1] = {}; 429 429 int ret, i, last_idx = 0; 430 - struct usb4_port *usb4; 431 - 432 - usb4 = port->usb4; 433 - if (!usb4) 434 - return 0; 435 - 436 - pm_runtime_get_sync(&usb4->dev); 437 430 438 431 /* 439 432 * Send broadcast RT to make sure retimer indices facing this ··· 434 441 */ 435 442 ret = usb4_port_enumerate_retimers(port); 436 443 if (ret) 437 - goto out; 444 + return ret; 438 445 439 446 /* 440 447 * Enable sideband channel for each retimer. We can do this ··· 464 471 break; 465 472 } 466 473 467 - if (!last_idx) { 468 - ret = 0; 469 - goto out; 470 - } 474 + if (!last_idx) 475 + return 0; 471 476 472 477 /* Add on-board retimers if they do not exist already */ 478 + ret = 0; 473 479 for (i = 1; i <= last_idx; i++) { 474 480 struct tb_retimer *rt; 475 481 ··· 481 489 break; 482 490 } 483 491 } 484 - 485 - out: 486 - pm_runtime_mark_last_busy(&usb4->dev); 487 - pm_runtime_put_autosuspend(&usb4->dev); 488 492 489 493 return ret; 490 494 }
+15 -5
drivers/thunderbolt/tb.c
··· 628 628 * Downstream switch is reachable through two ports. 629 629 * Only scan on the primary port (link_nr == 0). 630 630 */ 631 + 632 + if (port->usb4) 633 + pm_runtime_get_sync(&port->usb4->dev); 634 + 631 635 if (tb_wait_for_port(port, false) <= 0) 632 - return; 636 + goto out_rpm_put; 633 637 if (port->remote) { 634 638 tb_port_dbg(port, "port already has a remote\n"); 635 - return; 639 + goto out_rpm_put; 636 640 } 637 641 638 642 tb_retimer_scan(port, true); ··· 651 647 */ 652 648 if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL) 653 649 tb_scan_xdomain(port); 654 - return; 650 + goto out_rpm_put; 655 651 } 656 652 657 653 if (tb_switch_configure(sw)) { 658 654 tb_switch_put(sw); 659 - return; 655 + goto out_rpm_put; 660 656 } 661 657 662 658 /* ··· 685 681 686 682 if (tb_switch_add(sw)) { 687 683 tb_switch_put(sw); 688 - return; 684 + goto out_rpm_put; 689 685 } 690 686 691 687 /* Link the switches using both links if available */ ··· 737 733 738 734 tb_add_dp_resources(sw); 739 735 tb_scan_switch(sw); 736 + 737 + out_rpm_put: 738 + if (port->usb4) { 739 + pm_runtime_mark_last_busy(&port->usb4->dev); 740 + pm_runtime_put_autosuspend(&port->usb4->dev); 741 + } 740 742 } 741 743 742 744 static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
+1 -1
drivers/thunderbolt/tunnel.c
··· 1275 1275 return; 1276 1276 } else if (!ret) { 1277 1277 /* Use maximum link rate if the link valid is not set */ 1278 - ret = usb4_usb3_port_max_link_rate(tunnel->src_port); 1278 + ret = tb_usb3_max_link_rate(tunnel->dst_port, tunnel->src_port); 1279 1279 if (ret < 0) { 1280 1280 tb_tunnel_warn(tunnel, "failed to read maximum link rate\n"); 1281 1281 return;
+12 -5
drivers/thunderbolt/xdomain.c
··· 1419 1419 * registered, we notify the userspace that it has changed. 1420 1420 */ 1421 1421 if (!update) { 1422 - struct tb_port *port; 1422 + /* 1423 + * Now disable lane 1 if bonding was not enabled. Do 1424 + * this only if bonding was possible at the beginning 1425 + * (that is we are the connection manager and there are 1426 + * two lanes). 1427 + */ 1428 + if (xd->bonding_possible) { 1429 + struct tb_port *port; 1423 1430 1424 - /* Now disable lane 1 if bonding was not enabled */ 1425 - port = tb_port_at(xd->route, tb_xdomain_parent(xd)); 1426 - if (!port->bonded) 1427 - tb_port_disable(port->dual_link_port); 1431 + port = tb_port_at(xd->route, tb_xdomain_parent(xd)); 1432 + if (!port->bonded) 1433 + tb_port_disable(port->dual_link_port); 1434 + } 1428 1435 1429 1436 if (device_add(&xd->dev)) { 1430 1437 dev_err(&xd->dev, "failed to add XDomain device\n");
+12
drivers/usb/cdns3/cdns3-gadget.c
··· 2614 2614 u8 req_on_hw_ring = 0; 2615 2615 unsigned long flags; 2616 2616 int ret = 0; 2617 + int val; 2617 2618 2618 2619 if (!ep || !request || !ep->desc) 2619 2620 return -EINVAL; ··· 2650 2649 2651 2650 /* Update ring only if removed request is on pending_req_list list */ 2652 2651 if (req_on_hw_ring && link_trb) { 2652 + /* Stop DMA */ 2653 + writel(EP_CMD_DFLUSH, &priv_dev->regs->ep_cmd); 2654 + 2655 + /* wait for DFLUSH cleared */ 2656 + readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val, 2657 + !(val & EP_CMD_DFLUSH), 1, 1000); 2658 + 2653 2659 link_trb->buffer = cpu_to_le32(TRB_BUFFER(priv_ep->trb_pool_dma + 2654 2660 ((priv_req->end_trb + 1) * TRB_SIZE))); 2655 2661 link_trb->control = cpu_to_le32((le32_to_cpu(link_trb->control) & TRB_CYCLE) | ··· 2667 2659 } 2668 2660 2669 2661 cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET); 2662 + 2663 + req = cdns3_next_request(&priv_ep->pending_req_list); 2664 + if (req) 2665 + cdns3_rearm_transfer(priv_ep, 1); 2670 2666 2671 2667 not_found: 2672 2668 spin_unlock_irqrestore(&priv_dev->lock, flags);
+2 -2
drivers/usb/chipidea/core.c
··· 1294 1294 cable_id = &ci->platdata->id_extcon; 1295 1295 cable_vbus = &ci->platdata->vbus_extcon; 1296 1296 1297 - if ((!IS_ERR(cable_id->edev) || !IS_ERR(ci->role_switch)) 1297 + if ((!IS_ERR(cable_id->edev) || ci->role_switch) 1298 1298 && ci->is_otg && 1299 1299 (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) 1300 1300 ci_irq(ci); 1301 1301 1302 - if ((!IS_ERR(cable_vbus->edev) || !IS_ERR(ci->role_switch)) 1302 + if ((!IS_ERR(cable_vbus->edev) || ci->role_switch) 1303 1303 && ci->is_otg && 1304 1304 (otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) 1305 1305 ci_irq(ci);
+13
drivers/usb/core/hub.c
··· 44 44 #define USB_PRODUCT_USB5534B 0x5534 45 45 #define USB_VENDOR_CYPRESS 0x04b4 46 46 #define USB_PRODUCT_CY7C65632 0x6570 47 + #define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451 48 + #define USB_PRODUCT_TUSB8041_USB3 0x8140 49 + #define USB_PRODUCT_TUSB8041_USB2 0x8142 47 50 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 48 51 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 49 52 ··· 5857 5854 .idVendor = USB_VENDOR_GENESYS_LOGIC, 5858 5855 .bInterfaceClass = USB_CLASS_HUB, 5859 5856 .driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND}, 5857 + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR 5858 + | USB_DEVICE_ID_MATCH_PRODUCT, 5859 + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, 5860 + .idProduct = USB_PRODUCT_TUSB8041_USB2, 5861 + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, 5862 + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR 5863 + | USB_DEVICE_ID_MATCH_PRODUCT, 5864 + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, 5865 + .idProduct = USB_PRODUCT_TUSB8041_USB3, 5866 + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, 5860 5867 { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS, 5861 5868 .bDeviceClass = USB_CLASS_HUB}, 5862 5869 { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,
+65
drivers/usb/core/usb-acpi.c
··· 37 37 } 38 38 EXPORT_SYMBOL_GPL(usb_acpi_power_manageable); 39 39 40 + #define UUID_USB_CONTROLLER_DSM "ce2ee385-00e6-48cb-9f05-2edb927c4899" 41 + #define USB_DSM_DISABLE_U1_U2_FOR_PORT 5 42 + 43 + /** 44 + * usb_acpi_port_lpm_incapable - check if lpm should be disabled for a port. 45 + * @hdev: USB device belonging to the usb hub 46 + * @index: zero based port index 47 + * 48 + * Some USB3 ports may not support USB3 link power management U1/U2 states 49 + * due to different retimer setup. ACPI provides _DSM method which returns 0x01 50 + * if U1 and U2 states should be disabled. Evaluate _DSM with: 51 + * Arg0: UUID = ce2ee385-00e6-48cb-9f05-2edb927c4899 52 + * Arg1: Revision ID = 0 53 + * Arg2: Function Index = 5 54 + * Arg3: (empty) 55 + * 56 + * Return 1 if USB3 port is LPM incapable, negative on error, otherwise 0 57 + */ 58 + 59 + int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) 60 + { 61 + union acpi_object *obj; 62 + acpi_handle port_handle; 63 + int port1 = index + 1; 64 + guid_t guid; 65 + int ret; 66 + 67 + ret = guid_parse(UUID_USB_CONTROLLER_DSM, &guid); 68 + if (ret) 69 + return ret; 70 + 71 + port_handle = usb_get_hub_port_acpi_handle(hdev, port1); 72 + if (!port_handle) { 73 + dev_dbg(&hdev->dev, "port-%d no acpi handle\n", port1); 74 + return -ENODEV; 75 + } 76 + 77 + if (!acpi_check_dsm(port_handle, &guid, 0, 78 + BIT(USB_DSM_DISABLE_U1_U2_FOR_PORT))) { 79 + dev_dbg(&hdev->dev, "port-%d no _DSM function %d\n", 80 + port1, USB_DSM_DISABLE_U1_U2_FOR_PORT); 81 + return -ENODEV; 82 + } 83 + 84 + obj = acpi_evaluate_dsm(port_handle, &guid, 0, 85 + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); 86 + 87 + if (!obj) 88 + return -ENODEV; 89 + 90 + if (obj->type != ACPI_TYPE_INTEGER) { 91 + dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); 92 + ACPI_FREE(obj); 93 + return -EINVAL; 94 + } 95 + 96 + if (obj->integer.value == 0x01) 97 + ret = 1; 98 + 99 + ACPI_FREE(obj); 100 + 101 + return ret; 102 + } 103 + EXPORT_SYMBOL_GPL(usb_acpi_port_lpm_incapable); 104 + 40 105 /** 41 106 * usb_acpi_set_power_state - control usb port's power via acpi power 42 107 * resource
+1 -1
drivers/usb/dwc3/Kconfig
··· 3 3 config USB_DWC3 4 4 tristate "DesignWare USB3 DRD Core Support" 5 5 depends on (USB || USB_GADGET) && HAS_DMA 6 + depends on (EXTCON || EXTCON=n) 6 7 select USB_XHCI_PLATFORM if USB_XHCI_HCD 7 8 select USB_ROLE_SWITCH if USB_DWC3_DUAL_ROLE 8 9 help ··· 45 44 config USB_DWC3_DUAL_ROLE 46 45 bool "Dual Role mode" 47 46 depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3)) 48 - depends on (EXTCON=y || EXTCON=USB_DWC3) 49 47 help 50 48 This is the default mode of working of DWC3 controller where 51 49 both host and gadget features are enabled.
+10 -2
drivers/usb/gadget/configfs.c
··· 393 393 WARN_ON(!list_empty(&gi->string_list)); 394 394 WARN_ON(!list_empty(&gi->available_func)); 395 395 kfree(gi->composite.gadget_driver.function); 396 + kfree(gi->composite.gadget_driver.driver.name); 396 397 kfree(gi); 397 398 } 398 399 ··· 1573 1572 .max_speed = USB_SPEED_SUPER_PLUS, 1574 1573 .driver = { 1575 1574 .owner = THIS_MODULE, 1576 - .name = "configfs-gadget", 1577 1575 }, 1578 1576 .match_existing_only = 1, 1579 1577 }; ··· 1623 1623 1624 1624 gi->composite.gadget_driver = configfs_driver_template; 1625 1625 1626 + gi->composite.gadget_driver.driver.name = kasprintf(GFP_KERNEL, 1627 + "configfs-gadget.%s", name); 1628 + if (!gi->composite.gadget_driver.driver.name) 1629 + goto err; 1630 + 1626 1631 gi->composite.gadget_driver.function = kstrdup(name, GFP_KERNEL); 1627 1632 gi->composite.name = gi->composite.gadget_driver.function; 1628 1633 1629 1634 if (!gi->composite.gadget_driver.function) 1630 - goto err; 1635 + goto out_free_driver_name; 1631 1636 1632 1637 return &gi->group; 1638 + 1639 + out_free_driver_name: 1640 + kfree(gi->composite.gadget_driver.driver.name); 1633 1641 err: 1634 1642 kfree(gi); 1635 1643 return ERR_PTR(-ENOMEM);
+7
drivers/usb/gadget/function/f_fs.c
··· 279 279 struct usb_request *req = ffs->ep0req; 280 280 int ret; 281 281 282 + if (!req) 283 + return -EINVAL; 284 + 282 285 req->zero = len < le16_to_cpu(ffs->ev.setup.wLength); 283 286 284 287 spin_unlock_irq(&ffs->ev.waitq.lock); ··· 1895 1892 ENTER(); 1896 1893 1897 1894 if (!WARN_ON(!ffs->gadget)) { 1895 + /* dequeue before freeing ep0req */ 1896 + usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req); 1897 + mutex_lock(&ffs->mutex); 1898 1898 usb_ep_free_request(ffs->gadget->ep0, ffs->ep0req); 1899 1899 ffs->ep0req = NULL; 1900 1900 ffs->gadget = NULL; 1901 1901 clear_bit(FFS_FL_BOUND, &ffs->flags); 1902 + mutex_unlock(&ffs->mutex); 1902 1903 ffs_data_put(ffs); 1903 1904 } 1904 1905 }
+3 -1
drivers/usb/gadget/function/f_ncm.c
··· 83 83 /* peak (theoretical) bulk transfer rate in bits-per-second */ 84 84 static inline unsigned ncm_bitrate(struct usb_gadget *g) 85 85 { 86 - if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) 86 + if (!g) 87 + return 0; 88 + else if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) 87 89 return 4250000000U; 88 90 else if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) 89 91 return 3750000000U;
+21 -7
drivers/usb/gadget/legacy/inode.c
··· 229 229 */ 230 230 231 231 static const char *CHIP; 232 + static DEFINE_MUTEX(sb_mutex); /* Serialize superblock operations */ 232 233 233 234 /*----------------------------------------------------------------------*/ 234 235 ··· 2011 2010 { 2012 2011 struct inode *inode; 2013 2012 struct dev_data *dev; 2013 + int rc; 2014 2014 2015 - if (the_device) 2016 - return -ESRCH; 2015 + mutex_lock(&sb_mutex); 2016 + 2017 + if (the_device) { 2018 + rc = -ESRCH; 2019 + goto Done; 2020 + } 2017 2021 2018 2022 CHIP = usb_get_gadget_udc_name(); 2019 - if (!CHIP) 2020 - return -ENODEV; 2023 + if (!CHIP) { 2024 + rc = -ENODEV; 2025 + goto Done; 2026 + } 2021 2027 2022 2028 /* superblock */ 2023 2029 sb->s_blocksize = PAGE_SIZE; ··· 2061 2053 * from binding to a controller. 2062 2054 */ 2063 2055 the_device = dev; 2064 - return 0; 2056 + rc = 0; 2057 + goto Done; 2065 2058 2066 - Enomem: 2059 + Enomem: 2067 2060 kfree(CHIP); 2068 2061 CHIP = NULL; 2062 + rc = -ENOMEM; 2069 2063 2070 - return -ENOMEM; 2064 + Done: 2065 + mutex_unlock(&sb_mutex); 2066 + return rc; 2071 2067 } 2072 2068 2073 2069 /* "mount -t gadgetfs path /dev/gadget" ends up here */ ··· 2093 2081 static void 2094 2082 gadgetfs_kill_sb (struct super_block *sb) 2095 2083 { 2084 + mutex_lock(&sb_mutex); 2096 2085 kill_litter_super (sb); 2097 2086 if (the_device) { 2098 2087 put_dev (the_device); ··· 2101 2088 } 2102 2089 kfree(CHIP); 2103 2090 CHIP = NULL; 2091 + mutex_unlock(&sb_mutex); 2104 2092 } 2105 2093 2106 2094 /*----------------------------------------------------------------------*/
+3
drivers/usb/gadget/legacy/webcam.c
··· 293 293 (const struct uvc_descriptor_header *) &uvc_format_yuv, 294 294 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 295 295 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 296 + (const struct uvc_descriptor_header *) &uvc_color_matching, 296 297 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 297 298 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 298 299 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, ··· 306 305 (const struct uvc_descriptor_header *) &uvc_format_yuv, 307 306 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 308 307 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 308 + (const struct uvc_descriptor_header *) &uvc_color_matching, 309 309 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 310 310 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 311 311 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, ··· 319 317 (const struct uvc_descriptor_header *) &uvc_format_yuv, 320 318 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 321 319 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 320 + (const struct uvc_descriptor_header *) &uvc_color_matching, 322 321 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 323 322 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 324 323 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
+1 -1
drivers/usb/host/ehci-fsl.c
··· 29 29 #include "ehci-fsl.h" 30 30 31 31 #define DRIVER_DESC "Freescale EHCI Host controller driver" 32 - #define DRV_NAME "ehci-fsl" 32 + #define DRV_NAME "fsl-ehci" 33 33 34 34 static struct hc_driver __read_mostly fsl_ehci_hc_driver; 35 35
+45
drivers/usb/host/xhci-pci.c
··· 78 78 static struct hc_driver __read_mostly xhci_pci_hc_driver; 79 79 80 80 static int xhci_pci_setup(struct usb_hcd *hcd); 81 + static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 82 + struct usb_tt *tt, gfp_t mem_flags); 81 83 82 84 static const struct xhci_driver_overrides xhci_pci_overrides __initconst = { 83 85 .reset = xhci_pci_setup, 86 + .update_hub_device = xhci_pci_update_hub_device, 84 87 }; 85 88 86 89 /* called after powerup, by probe or system-pm "wakeup" */ ··· 355 352 NULL); 356 353 ACPI_FREE(obj); 357 354 } 355 + 356 + static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) 357 + { 358 + struct xhci_hcd *xhci = hcd_to_xhci(hcd); 359 + struct xhci_hub *rhub = &xhci->usb3_rhub; 360 + int ret; 361 + int i; 362 + 363 + /* This is not the usb3 roothub we are looking for */ 364 + if (hcd != rhub->hcd) 365 + return; 366 + 367 + if (hdev->maxchild > rhub->num_ports) { 368 + dev_err(&hdev->dev, "USB3 roothub port number mismatch\n"); 369 + return; 370 + } 371 + 372 + for (i = 0; i < hdev->maxchild; i++) { 373 + ret = usb_acpi_port_lpm_incapable(hdev, i); 374 + 375 + dev_dbg(&hdev->dev, "port-%d disable U1/U2 _DSM: %d\n", i + 1, ret); 376 + 377 + if (ret >= 0) { 378 + rhub->ports[i]->lpm_incapable = ret; 379 + continue; 380 + } 381 + } 382 + } 383 + 358 384 #else 359 385 static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } 386 + static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) { } 360 387 #endif /* CONFIG_ACPI */ 361 388 362 389 /* called during probe() after chip reset completes */ ··· 417 384 418 385 /* Find any debug ports */ 419 386 return xhci_pci_reinit(xhci, pdev); 387 + } 388 + 389 + static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 390 + struct usb_tt *tt, gfp_t mem_flags) 391 + { 392 + /* Check if acpi claims some USB3 roothub ports are lpm incapable */ 393 + if (!hdev->parent) 394 + xhci_find_lpm_incapable_ports(hcd, hdev); 395 + 396 + return xhci_update_hub_device(hcd, hdev, tt, mem_flags); 420 397 } 421 398 422 399 /* ··· 497 454 498 455 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) 499 456 pm_runtime_allow(&dev->dev); 457 + 458 + dma_set_max_seg_size(&dev->dev, UINT_MAX); 500 459 501 460 return 0; 502 461
+4 -1
drivers/usb/host/xhci-ring.c
··· 1169 1169 struct xhci_virt_ep *ep; 1170 1170 struct xhci_ring *ring; 1171 1171 1172 - ep = &xhci->devs[slot_id]->eps[ep_index]; 1172 + ep = xhci_get_virt_ep(xhci, slot_id, ep_index); 1173 + if (!ep) 1174 + return; 1175 + 1173 1176 if ((ep->ep_state & EP_HAS_STREAMS) || 1174 1177 (ep->ep_state & EP_GETTING_NO_STREAMS)) { 1175 1178 int stream_id;
+17 -1
drivers/usb/host/xhci.c
··· 3974 3974 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 3975 3975 struct xhci_virt_device *virt_dev; 3976 3976 struct xhci_slot_ctx *slot_ctx; 3977 + unsigned long flags; 3977 3978 int i, ret; 3978 3979 3979 3980 /* ··· 4001 4000 virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; 4002 4001 virt_dev->udev = NULL; 4003 4002 xhci_disable_slot(xhci, udev->slot_id); 4003 + 4004 + spin_lock_irqsave(&xhci->lock, flags); 4004 4005 xhci_free_virt_device(xhci, udev->slot_id); 4006 + spin_unlock_irqrestore(&xhci->lock, flags); 4007 + 4005 4008 } 4006 4009 4007 4010 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) ··· 5049 5044 struct usb_device *udev, enum usb3_link_state state) 5050 5045 { 5051 5046 struct xhci_hcd *xhci; 5047 + struct xhci_port *port; 5052 5048 u16 hub_encoded_timeout; 5053 5049 int mel; 5054 5050 int ret; ··· 5065 5059 5066 5060 if (xhci_check_tier_policy(xhci, udev, state) < 0) 5067 5061 return USB3_LPM_DISABLED; 5062 + 5063 + /* If connected to root port then check port can handle lpm */ 5064 + if (udev->parent && !udev->parent->parent) { 5065 + port = xhci->usb3_rhub.ports[udev->portnum - 1]; 5066 + if (port->lpm_incapable) 5067 + return USB3_LPM_DISABLED; 5068 + } 5068 5069 5069 5070 hub_encoded_timeout = xhci_calculate_lpm_timeout(hcd, udev, state); 5070 5071 mel = calculate_max_exit_latency(udev, state, hub_encoded_timeout); ··· 5132 5119 /* Once a hub descriptor is fetched for a device, we need to update the xHC's 5133 5120 * internal data structures for the device. 5134 5121 */ 5135 - static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 5122 + int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 5136 5123 struct usb_tt *tt, gfp_t mem_flags) 5137 5124 { 5138 5125 struct xhci_hcd *xhci = hcd_to_xhci(hcd); ··· 5232 5219 xhci_free_command(xhci, config_cmd); 5233 5220 return ret; 5234 5221 } 5222 + EXPORT_SYMBOL_GPL(xhci_update_hub_device); 5235 5223 5236 5224 static int xhci_get_frame(struct usb_hcd *hcd) 5237 5225 { ··· 5516 5502 drv->check_bandwidth = over->check_bandwidth; 5517 5503 if (over->reset_bandwidth) 5518 5504 drv->reset_bandwidth = over->reset_bandwidth; 5505 + if (over->update_hub_device) 5506 + drv->update_hub_device = over->update_hub_device; 5519 5507 } 5520 5508 } 5521 5509 EXPORT_SYMBOL_GPL(xhci_init_driver);
+5
drivers/usb/host/xhci.h
··· 1735 1735 int hcd_portnum; 1736 1736 struct xhci_hub *rhub; 1737 1737 struct xhci_port_cap *port_cap; 1738 + unsigned int lpm_incapable:1; 1738 1739 }; 1739 1740 1740 1741 struct xhci_hub { ··· 1944 1943 struct usb_host_endpoint *ep); 1945 1944 int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); 1946 1945 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); 1946 + int (*update_hub_device)(struct usb_hcd *hcd, struct usb_device *hdev, 1947 + struct usb_tt *tt, gfp_t mem_flags); 1947 1948 }; 1948 1949 1949 1950 #define XHCI_CFC_DELAY 10 ··· 2125 2122 struct usb_host_endpoint *ep); 2126 2123 int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 2127 2124 void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 2125 + int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 2126 + struct usb_tt *tt, gfp_t mem_flags); 2128 2127 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); 2129 2128 int xhci_ext_cap_init(struct xhci_hcd *xhci); 2130 2129
+1 -1
drivers/usb/misc/iowarrior.c
··· 814 814 break; 815 815 816 816 case USB_DEVICE_ID_CODEMERCS_IOW100: 817 - dev->report_size = 13; 817 + dev->report_size = 12; 818 818 break; 819 819 } 820 820 }
+9 -9
drivers/usb/misc/onboard_usb_hub.c
··· 27 27 28 28 #include "onboard_usb_hub.h" 29 29 30 + static void onboard_hub_attach_usb_driver(struct work_struct *work); 31 + 30 32 static struct usb_device_driver onboard_hub_usbdev_driver; 33 + static DECLARE_WORK(attach_usb_driver_work, onboard_hub_attach_usb_driver); 31 34 32 35 /************************** Platform driver **************************/ 33 36 ··· 48 45 bool is_powered_on; 49 46 bool going_away; 50 47 struct list_head udev_list; 51 - struct work_struct attach_usb_driver_work; 52 48 struct mutex lock; 53 49 }; 54 50 ··· 273 271 * This needs to be done deferred to avoid self-deadlocks on systems 274 272 * with nested onboard hubs. 275 273 */ 276 - INIT_WORK(&hub->attach_usb_driver_work, onboard_hub_attach_usb_driver); 277 - schedule_work(&hub->attach_usb_driver_work); 274 + schedule_work(&attach_usb_driver_work); 278 275 279 276 return 0; 280 277 } ··· 285 284 struct usb_device *udev; 286 285 287 286 hub->going_away = true; 288 - 289 - if (&hub->attach_usb_driver_work != current_work()) 290 - cancel_work_sync(&hub->attach_usb_driver_work); 291 287 292 288 mutex_lock(&hub->lock); 293 289 ··· 431 433 { 432 434 int ret; 433 435 434 - ret = platform_driver_register(&onboard_hub_driver); 436 + ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); 435 437 if (ret) 436 438 return ret; 437 439 438 - ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); 440 + ret = platform_driver_register(&onboard_hub_driver); 439 441 if (ret) 440 - platform_driver_unregister(&onboard_hub_driver); 442 + usb_deregister_device_driver(&onboard_hub_usbdev_driver); 441 443 442 444 return ret; 443 445 } ··· 447 449 { 448 450 usb_deregister_device_driver(&onboard_hub_usbdev_driver); 449 451 platform_driver_unregister(&onboard_hub_driver); 452 + 453 + cancel_work_sync(&attach_usb_driver_work); 450 454 } 451 455 module_exit(onboard_hub_exit); 452 456
+3 -1
drivers/usb/musb/omap2430.c
··· 411 411 memset(musb_res, 0, sizeof(*musb_res) * ARRAY_SIZE(musb_res)); 412 412 413 413 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 414 - if (!res) 414 + if (!res) { 415 + ret = -EINVAL; 415 416 goto err2; 417 + } 416 418 417 419 musb_res[i].start = res->start; 418 420 musb_res[i].end = res->end;
+1
drivers/usb/serial/cp210x.c
··· 60 60 { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */ 61 61 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ 62 62 { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ 63 + { USB_DEVICE(0x0908, 0x0070) }, /* Siemens SCALANCE LPE-9000 USB Serial Console */ 63 64 { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ 64 65 { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */ 65 66 { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */
+17
drivers/usb/serial/option.c
··· 255 255 #define QUECTEL_PRODUCT_EP06 0x0306 256 256 #define QUECTEL_PRODUCT_EM05G 0x030a 257 257 #define QUECTEL_PRODUCT_EM060K 0x030b 258 + #define QUECTEL_PRODUCT_EM05G_CS 0x030c 259 + #define QUECTEL_PRODUCT_EM05CN_SG 0x0310 258 260 #define QUECTEL_PRODUCT_EM05G_SG 0x0311 261 + #define QUECTEL_PRODUCT_EM05CN 0x0312 262 + #define QUECTEL_PRODUCT_EM05G_GR 0x0313 263 + #define QUECTEL_PRODUCT_EM05G_RS 0x0314 259 264 #define QUECTEL_PRODUCT_EM12 0x0512 260 265 #define QUECTEL_PRODUCT_RM500Q 0x0800 261 266 #define QUECTEL_PRODUCT_RM520N 0x0801 267 + #define QUECTEL_PRODUCT_EC200U 0x0901 262 268 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 263 269 #define QUECTEL_PRODUCT_EC200T 0x6026 264 270 #define QUECTEL_PRODUCT_RM500K 0x7001 ··· 1165 1159 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1166 1160 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1167 1161 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, 1162 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN, 0xff), 1163 + .driver_info = RSVD(6) | ZLP }, 1164 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN_SG, 0xff), 1165 + .driver_info = RSVD(6) | ZLP }, 1168 1166 { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), 1167 + .driver_info = RSVD(6) | ZLP }, 1168 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff), 1169 + .driver_info = RSVD(6) | ZLP }, 1170 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_GR, 0xff), 1171 + .driver_info = RSVD(6) | ZLP }, 1172 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_RS, 0xff), 1169 1173 .driver_info = RSVD(6) | ZLP }, 1170 1174 { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff), 1171 1175 .driver_info = RSVD(6) | ZLP }, ··· 1196 1180 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, 1197 1181 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, 1198 1182 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, 1183 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, 1199 1184 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, 1200 1185 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, 1201 1186 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
+13
drivers/usb/storage/uas-detect.h
··· 116 116 if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2) 117 117 flags |= US_FL_NO_ATA_1X; 118 118 119 + /* 120 + * RTL9210-based enclosure from HIKSEMI, MD202 reportedly have issues 121 + * with UAS. This isn't distinguishable with just idVendor and 122 + * idProduct, use manufacturer and product too. 123 + * 124 + * Reported-by: Hongling Zeng <zenghongling@kylinos.cn> 125 + */ 126 + if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bda && 127 + le16_to_cpu(udev->descriptor.idProduct) == 0x9210 && 128 + (udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) && 129 + (udev->product && !strcmp(udev->product, "MD202"))) 130 + flags |= US_FL_IGNORE_UAS; 131 + 119 132 usb_stor_adjust_quirks(udev, &flags); 120 133 121 134 if (flags & US_FL_IGNORE_UAS) {
-7
drivers/usb/storage/unusual_uas.h
··· 83 83 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 84 84 US_FL_NO_REPORT_LUNS), 85 85 86 - /* Reported-by: Hongling Zeng <zenghongling@kylinos.cn> */ 87 - UNUSUAL_DEV(0x0bda, 0x9210, 0x0000, 0x9999, 88 - "Hiksemi", 89 - "External HDD", 90 - USB_SC_DEVICE, USB_PR_DEVICE, NULL, 91 - US_FL_IGNORE_UAS), 92 - 93 86 /* Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> */ 94 87 UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, 95 88 "Initio Corporation",
+14 -8
drivers/usb/typec/altmodes/displayport.c
··· 419 419 [DP_PIN_ASSIGN_F] = "F", 420 420 }; 421 421 422 + /* 423 + * Helper function to extract a peripheral's currently supported 424 + * Pin Assignments from its DisplayPort alternate mode state. 425 + */ 426 + static u8 get_current_pin_assignments(struct dp_altmode *dp) 427 + { 428 + if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_UFP_U_AS_DFP_D) 429 + return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo); 430 + else 431 + return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo); 432 + } 433 + 422 434 static ssize_t 423 435 pin_assignment_store(struct device *dev, struct device_attribute *attr, 424 436 const char *buf, size_t size) ··· 457 445 goto out_unlock; 458 446 } 459 447 460 - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) 461 - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); 462 - else 463 - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); 448 + assignments = get_current_pin_assignments(dp); 464 449 465 450 if (!(DP_CONF_GET_PIN_ASSIGN(conf) & assignments)) { 466 451 ret = -EINVAL; ··· 494 485 495 486 cur = get_count_order(DP_CONF_GET_PIN_ASSIGN(dp->data.conf)); 496 487 497 - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) 498 - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); 499 - else 500 - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); 488 + assignments = get_current_pin_assignments(dp); 501 489 502 490 for (i = 0; assignments; assignments >>= 1, i++) { 503 491 if (assignments & 1) {
+3 -4
drivers/usb/typec/tcpm/tcpm.c
··· 4594 4594 tcpm_set_state(port, ready_state(port), 0); 4595 4595 break; 4596 4596 case DR_SWAP_CHANGE_DR: 4597 - if (port->data_role == TYPEC_HOST) { 4598 - tcpm_unregister_altmodes(port); 4597 + tcpm_unregister_altmodes(port); 4598 + if (port->data_role == TYPEC_HOST) 4599 4599 tcpm_set_roles(port, true, port->pwr_role, 4600 4600 TYPEC_DEVICE); 4601 - } else { 4601 + else 4602 4602 tcpm_set_roles(port, true, port->pwr_role, 4603 4603 TYPEC_HOST); 4604 - } 4605 4604 tcpm_ams_finish(port); 4606 4605 tcpm_set_state(port, ready_state(port), 0); 4607 4606 break;
+21 -3
drivers/usb/typec/ucsi/ucsi.c
··· 187 187 188 188 struct ucsi_work { 189 189 struct delayed_work work; 190 + struct list_head node; 190 191 unsigned long delay; 191 192 unsigned int count; 192 193 struct ucsi_connector *con; ··· 203 202 mutex_lock(&con->lock); 204 203 205 204 if (!con->partner) { 205 + list_del(&uwork->node); 206 206 mutex_unlock(&con->lock); 207 207 kfree(uwork); 208 208 return; ··· 211 209 212 210 ret = uwork->cb(con); 213 211 214 - if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) 212 + if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) { 215 213 queue_delayed_work(con->wq, &uwork->work, uwork->delay); 216 - else 214 + } else { 215 + list_del(&uwork->node); 217 216 kfree(uwork); 217 + } 218 218 219 219 mutex_unlock(&con->lock); 220 220 } ··· 240 236 uwork->con = con; 241 237 uwork->cb = cb; 242 238 239 + list_add_tail(&uwork->node, &con->partner_tasks); 243 240 queue_delayed_work(con->wq, &uwork->work, delay); 244 241 245 242 return 0; ··· 1061 1056 INIT_WORK(&con->work, ucsi_handle_connector_change); 1062 1057 init_completion(&con->complete); 1063 1058 mutex_init(&con->lock); 1059 + INIT_LIST_HEAD(&con->partner_tasks); 1064 1060 con->num = index + 1; 1065 1061 con->ucsi = ucsi; 1066 1062 ··· 1426 1420 ucsi_unregister_altmodes(&ucsi->connector[i], 1427 1421 UCSI_RECIPIENT_CON); 1428 1422 ucsi_unregister_port_psy(&ucsi->connector[i]); 1429 - if (ucsi->connector[i].wq) 1423 + 1424 + if (ucsi->connector[i].wq) { 1425 + struct ucsi_work *uwork; 1426 + 1427 + mutex_lock(&ucsi->connector[i].lock); 1428 + /* 1429 + * queue delayed items immediately so they can execute 1430 + * and free themselves before the wq is destroyed 1431 + */ 1432 + list_for_each_entry(uwork, &ucsi->connector[i].partner_tasks, node) 1433 + mod_delayed_work(ucsi->connector[i].wq, &uwork->work, 0); 1434 + mutex_unlock(&ucsi->connector[i].lock); 1430 1435 destroy_workqueue(ucsi->connector[i].wq); 1436 + } 1431 1437 typec_unregister_port(ucsi->connector[i].port); 1432 1438 } 1433 1439
+1
drivers/usb/typec/ucsi/ucsi.h
··· 322 322 struct work_struct work; 323 323 struct completion complete; 324 324 struct workqueue_struct *wq; 325 + struct list_head partner_tasks; 325 326 326 327 struct typec_port *port; 327 328 struct typec_partner *partner;
+10 -8
include/linux/usb.h
··· 267 267 } 268 268 269 269 /** 270 - * usb_set_intfdata() - associate driver-specific data with the interface 271 - * @intf: the usb interface 272 - * @data: pointer to the device priv structure or %NULL 270 + * usb_set_intfdata() - associate driver-specific data with an interface 271 + * @intf: USB interface 272 + * @data: driver data 273 273 * 274 - * Drivers should use this function in their probe() to associate their 275 - * driver-specific data with the usb interface. 274 + * Drivers can use this function in their probe() callbacks to associate 275 + * driver-specific data with an interface. 276 276 * 277 - * When disconnecting, the core will take care of setting @intf back to %NULL, 278 - * so no actions are needed on the driver side. The interface should not be set 279 - * to %NULL before all actions completed (e.g. no outsanding URB remaining). 277 + * Note that there is generally no need to clear the driver-data pointer even 278 + * if some drivers do so for historical or implementation-specific reasons. 280 279 */ 281 280 static inline void usb_set_intfdata(struct usb_interface *intf, void *data) 282 281 { ··· 773 774 extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, 774 775 bool enable); 775 776 extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); 777 + extern int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index); 776 778 #else 777 779 static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, 778 780 bool enable) { return 0; } 779 781 static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) 780 782 { return true; } 783 + static inline int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) 784 + { return 0; } 781 785 #endif 782 786 783 787 /* USB autosuspend and autoresume */