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-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are a number of USB driver fixes for reported problems for
4.17-rc3.

The "largest" here is a number of phy core changes for reported
problems with the -rc1 release. There's also the usual musb and xhci
fixes, as well as new device id updates. There are also some usbip
fixes for reported problems as more people start to use that code with
containers.

All of these have been in linux-next with no reported issues, except
the last few new device ids, which are "obviously correct" :)"

* tag 'usb-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
USB: musb: dsps: drop duplicate phy initialisation
USB: musb: host: prevent core phy initialisation
usb: core: phy: add the SPDX-License-Identifier and include guard
xhci: Fix Kernel oops in xhci dbgtty
usb: select USB_COMMON for usb role switch config
usb: core: phy: add missing forward declaration for "struct device"
usb: core: phy: make it a no-op if CONFIG_GENERIC_PHY is disabled
usb: core: use phy_exit during suspend if wake up is not supported
usb: core: split usb_phy_roothub_{init,alloc}
usb: core: phy: fix return value of usb_phy_roothub_exit()
usb: typec: ucsi: Increase command completion timeout value
Revert "xhci: plat: Register shutdown for xhci_plat"
usb: core: Add quirk for HP v222w 16GB Mini
Documentation: typec.rst: Use literal-block element with ascii art
usb: typec: ucsi: fix tracepoint related build error
usbip: usbip_event: fix to not print kernel pointer address
usbip: usbip_host: fix to hold parent lock for device_attach() calls
usbip: vhci_hcd: Fix usb device and sockfd leaks
usbip: vhci_hcd: check rhport before using in vhci_hub_control()
USB: Increment wakeup count on remote wakeup.
...

+185 -61
+4 -1
Documentation/devicetree/bindings/usb/usb-xhci.txt
··· 28 28 - interrupts: one XHCI interrupt should be described here. 29 29 30 30 Optional properties: 31 - - clocks: reference to a clock 31 + - clocks: reference to the clocks 32 + - clock-names: mandatory if there is a second clock, in this case 33 + the name must be "core" for the first clock and "reg" for the 34 + second one 32 35 - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM 33 36 - usb3-lpm-capable: determines if platform is USB3 LPM capable 34 37 - quirk-broken-port-ped: set if the controller has broken port disable mechanism
+1 -1
Documentation/driver-api/usb/typec.rst
··· 210 210 role. USB Type-C Connector Class does not supply separate API for them. The 211 211 port drivers can use USB Role Class API with those. 212 212 213 - Illustration of the muxes behind a connector that supports an alternate mode: 213 + Illustration of the muxes behind a connector that supports an alternate mode:: 214 214 215 215 ------------------------ 216 216 | Connector |
+1
drivers/usb/Kconfig
··· 207 207 208 208 config USB_ROLE_SWITCH 209 209 tristate 210 + select USB_COMMON 210 211 211 212 endif # USB_SUPPORT
+13 -6
drivers/usb/core/hcd.c
··· 2262 2262 hcd->state = HC_STATE_SUSPENDED; 2263 2263 2264 2264 if (!PMSG_IS_AUTO(msg)) 2265 - usb_phy_roothub_power_off(hcd->phy_roothub); 2265 + usb_phy_roothub_suspend(hcd->self.sysdev, 2266 + hcd->phy_roothub); 2266 2267 2267 2268 /* Did we race with a root-hub wakeup event? */ 2268 2269 if (rhdev->do_remote_wakeup) { ··· 2303 2302 } 2304 2303 2305 2304 if (!PMSG_IS_AUTO(msg)) { 2306 - status = usb_phy_roothub_power_on(hcd->phy_roothub); 2305 + status = usb_phy_roothub_resume(hcd->self.sysdev, 2306 + hcd->phy_roothub); 2307 2307 if (status) 2308 2308 return status; 2309 2309 } ··· 2346 2344 } 2347 2345 } else { 2348 2346 hcd->state = old_state; 2349 - usb_phy_roothub_power_off(hcd->phy_roothub); 2347 + usb_phy_roothub_suspend(hcd->self.sysdev, hcd->phy_roothub); 2350 2348 dev_dbg(&rhdev->dev, "bus %s fail, err %d\n", 2351 2349 "resume", status); 2352 2350 if (status != -ESHUTDOWN) ··· 2379 2377 2380 2378 spin_lock_irqsave (&hcd_root_hub_lock, flags); 2381 2379 if (hcd->rh_registered) { 2380 + pm_wakeup_event(&hcd->self.root_hub->dev, 0); 2382 2381 set_bit(HCD_FLAG_WAKEUP_PENDING, &hcd->flags); 2383 2382 queue_work(pm_wq, &hcd->wakeup_work); 2384 2383 } ··· 2761 2758 } 2762 2759 2763 2760 if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { 2764 - hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev); 2761 + hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev); 2765 2762 if (IS_ERR(hcd->phy_roothub)) { 2766 2763 retval = PTR_ERR(hcd->phy_roothub); 2767 - goto err_phy_roothub_init; 2764 + goto err_phy_roothub_alloc; 2768 2765 } 2766 + 2767 + retval = usb_phy_roothub_init(hcd->phy_roothub); 2768 + if (retval) 2769 + goto err_phy_roothub_alloc; 2769 2770 2770 2771 retval = usb_phy_roothub_power_on(hcd->phy_roothub); 2771 2772 if (retval) ··· 2943 2936 usb_phy_roothub_power_off(hcd->phy_roothub); 2944 2937 err_usb_phy_roothub_power_on: 2945 2938 usb_phy_roothub_exit(hcd->phy_roothub); 2946 - err_phy_roothub_init: 2939 + err_phy_roothub_alloc: 2947 2940 if (hcd->remove_phy && hcd->usb_phy) { 2948 2941 usb_phy_shutdown(hcd->usb_phy); 2949 2942 usb_put_phy(hcd->usb_phy);
+9 -1
drivers/usb/core/hub.c
··· 653 653 unsigned int portnum) 654 654 { 655 655 struct usb_hub *hub; 656 + struct usb_port *port_dev; 656 657 657 658 if (!hdev) 658 659 return; 659 660 660 661 hub = usb_hub_to_struct_hub(hdev); 661 662 if (hub) { 663 + port_dev = hub->ports[portnum - 1]; 664 + if (port_dev && port_dev->child) 665 + pm_wakeup_event(&port_dev->child->dev, 0); 666 + 662 667 set_bit(portnum, hub->wakeup_bits); 663 668 kick_hub_wq(hub); 664 669 } ··· 3439 3434 3440 3435 /* Skip the initial Clear-Suspend step for a remote wakeup */ 3441 3436 status = hub_port_status(hub, port1, &portstatus, &portchange); 3442 - if (status == 0 && !port_is_suspended(hub, portstatus)) 3437 + if (status == 0 && !port_is_suspended(hub, portstatus)) { 3438 + if (portchange & USB_PORT_STAT_C_SUSPEND) 3439 + pm_wakeup_event(&udev->dev, 0); 3443 3440 goto SuspendCleared; 3441 + } 3444 3442 3445 3443 /* see 7.1.7.7; affects power usage, but not budgeting */ 3446 3444 if (hub_is_superspeed(hub->hdev))
+66 -27
drivers/usb/core/phy.c
··· 19 19 struct list_head list; 20 20 }; 21 21 22 - static struct usb_phy_roothub *usb_phy_roothub_alloc(struct device *dev) 23 - { 24 - struct usb_phy_roothub *roothub_entry; 25 - 26 - roothub_entry = devm_kzalloc(dev, sizeof(*roothub_entry), GFP_KERNEL); 27 - if (!roothub_entry) 28 - return ERR_PTR(-ENOMEM); 29 - 30 - INIT_LIST_HEAD(&roothub_entry->list); 31 - 32 - return roothub_entry; 33 - } 34 - 35 22 static int usb_phy_roothub_add_phy(struct device *dev, int index, 36 23 struct list_head *list) 37 24 { ··· 32 45 return PTR_ERR(phy); 33 46 } 34 47 35 - roothub_entry = usb_phy_roothub_alloc(dev); 36 - if (IS_ERR(roothub_entry)) 37 - return PTR_ERR(roothub_entry); 48 + roothub_entry = devm_kzalloc(dev, sizeof(*roothub_entry), GFP_KERNEL); 49 + if (!roothub_entry) 50 + return -ENOMEM; 51 + 52 + INIT_LIST_HEAD(&roothub_entry->list); 38 53 39 54 roothub_entry->phy = phy; 40 55 ··· 45 56 return 0; 46 57 } 47 58 48 - struct usb_phy_roothub *usb_phy_roothub_init(struct device *dev) 59 + struct usb_phy_roothub *usb_phy_roothub_alloc(struct device *dev) 49 60 { 50 61 struct usb_phy_roothub *phy_roothub; 51 - struct usb_phy_roothub *roothub_entry; 52 - struct list_head *head; 53 62 int i, num_phys, err; 63 + 64 + if (!IS_ENABLED(CONFIG_GENERIC_PHY)) 65 + return NULL; 54 66 55 67 num_phys = of_count_phandle_with_args(dev->of_node, "phys", 56 68 "#phy-cells"); 57 69 if (num_phys <= 0) 58 70 return NULL; 59 71 60 - phy_roothub = usb_phy_roothub_alloc(dev); 61 - if (IS_ERR(phy_roothub)) 62 - return phy_roothub; 72 + phy_roothub = devm_kzalloc(dev, sizeof(*phy_roothub), GFP_KERNEL); 73 + if (!phy_roothub) 74 + return ERR_PTR(-ENOMEM); 75 + 76 + INIT_LIST_HEAD(&phy_roothub->list); 63 77 64 78 for (i = 0; i < num_phys; i++) { 65 79 err = usb_phy_roothub_add_phy(dev, i, &phy_roothub->list); 66 80 if (err) 67 - goto err_out; 81 + return ERR_PTR(err); 68 82 } 83 + 84 + return phy_roothub; 85 + } 86 + EXPORT_SYMBOL_GPL(usb_phy_roothub_alloc); 87 + 88 + int usb_phy_roothub_init(struct usb_phy_roothub *phy_roothub) 89 + { 90 + struct usb_phy_roothub *roothub_entry; 91 + struct list_head *head; 92 + int err; 93 + 94 + if (!phy_roothub) 95 + return 0; 69 96 70 97 head = &phy_roothub->list; 71 98 ··· 91 86 goto err_exit_phys; 92 87 } 93 88 94 - return phy_roothub; 89 + return 0; 95 90 96 91 err_exit_phys: 97 92 list_for_each_entry_continue_reverse(roothub_entry, head, list) 98 93 phy_exit(roothub_entry->phy); 99 94 100 - err_out: 101 - return ERR_PTR(err); 95 + return err; 102 96 } 103 97 EXPORT_SYMBOL_GPL(usb_phy_roothub_init); 104 98 ··· 115 111 list_for_each_entry(roothub_entry, head, list) { 116 112 err = phy_exit(roothub_entry->phy); 117 113 if (err) 118 - ret = ret; 114 + ret = err; 119 115 } 120 116 121 117 return ret; ··· 160 156 phy_power_off(roothub_entry->phy); 161 157 } 162 158 EXPORT_SYMBOL_GPL(usb_phy_roothub_power_off); 159 + 160 + int usb_phy_roothub_suspend(struct device *controller_dev, 161 + struct usb_phy_roothub *phy_roothub) 162 + { 163 + usb_phy_roothub_power_off(phy_roothub); 164 + 165 + /* keep the PHYs initialized so the device can wake up the system */ 166 + if (device_may_wakeup(controller_dev)) 167 + return 0; 168 + 169 + return usb_phy_roothub_exit(phy_roothub); 170 + } 171 + EXPORT_SYMBOL_GPL(usb_phy_roothub_suspend); 172 + 173 + int usb_phy_roothub_resume(struct device *controller_dev, 174 + struct usb_phy_roothub *phy_roothub) 175 + { 176 + int err; 177 + 178 + /* if the device can't wake up the system _exit was called */ 179 + if (!device_may_wakeup(controller_dev)) { 180 + err = usb_phy_roothub_init(phy_roothub); 181 + if (err) 182 + return err; 183 + } 184 + 185 + err = usb_phy_roothub_power_on(phy_roothub); 186 + 187 + /* undo _init if _power_on failed */ 188 + if (err && !device_may_wakeup(controller_dev)) 189 + usb_phy_roothub_exit(phy_roothub); 190 + 191 + return err; 192 + } 193 + EXPORT_SYMBOL_GPL(usb_phy_roothub_resume);
+21 -1
drivers/usb/core/phy.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* 3 + * USB roothub wrapper 4 + * 5 + * Copyright (C) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com> 6 + */ 7 + 8 + #ifndef __USB_CORE_PHY_H_ 9 + #define __USB_CORE_PHY_H_ 10 + 11 + struct device; 1 12 struct usb_phy_roothub; 2 13 3 - struct usb_phy_roothub *usb_phy_roothub_init(struct device *dev); 14 + struct usb_phy_roothub *usb_phy_roothub_alloc(struct device *dev); 15 + 16 + int usb_phy_roothub_init(struct usb_phy_roothub *phy_roothub); 4 17 int usb_phy_roothub_exit(struct usb_phy_roothub *phy_roothub); 5 18 6 19 int usb_phy_roothub_power_on(struct usb_phy_roothub *phy_roothub); 7 20 void usb_phy_roothub_power_off(struct usb_phy_roothub *phy_roothub); 21 + 22 + int usb_phy_roothub_suspend(struct device *controller_dev, 23 + struct usb_phy_roothub *phy_roothub); 24 + int usb_phy_roothub_resume(struct device *controller_dev, 25 + struct usb_phy_roothub *phy_roothub); 26 + 27 + #endif /* __USB_CORE_PHY_H_ */
+3
drivers/usb/core/quirks.c
··· 186 186 { USB_DEVICE(0x03f0, 0x0701), .driver_info = 187 187 USB_QUIRK_STRING_FETCH_255 }, 188 188 189 + /* HP v222w 16GB Mini USB Drive */ 190 + { USB_DEVICE(0x03f0, 0x3f40), .driver_info = USB_QUIRK_DELAY_INIT }, 191 + 189 192 /* Creative SB Audigy 2 NX */ 190 193 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, 191 194
+5 -3
drivers/usb/host/xhci-dbgtty.c
··· 320 320 321 321 void xhci_dbc_tty_unregister_driver(void) 322 322 { 323 - tty_unregister_driver(dbc_tty_driver); 324 - put_tty_driver(dbc_tty_driver); 325 - dbc_tty_driver = NULL; 323 + if (dbc_tty_driver) { 324 + tty_unregister_driver(dbc_tty_driver); 325 + put_tty_driver(dbc_tty_driver); 326 + dbc_tty_driver = NULL; 327 + } 326 328 } 327 329 328 330 static void dbc_rx_push(unsigned long _port)
+4 -1
drivers/usb/host/xhci-pci.c
··· 126 126 if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info()) 127 127 xhci->quirks |= XHCI_AMD_PLL_FIX; 128 128 129 - if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x43bb) 129 + if (pdev->vendor == PCI_VENDOR_ID_AMD && 130 + (pdev->device == 0x15e0 || 131 + pdev->device == 0x15e1 || 132 + pdev->device == 0x43bb)) 130 133 xhci->quirks |= XHCI_SUSPEND_DELAY; 131 134 132 135 if (pdev->vendor == PCI_VENDOR_ID_AMD)
+23 -9
drivers/usb/host/xhci-plat.c
··· 157 157 struct resource *res; 158 158 struct usb_hcd *hcd; 159 159 struct clk *clk; 160 + struct clk *reg_clk; 160 161 int ret; 161 162 int irq; 162 163 ··· 227 226 hcd->rsrc_len = resource_size(res); 228 227 229 228 /* 230 - * Not all platforms have a clk so it is not an error if the 231 - * clock does not exists. 229 + * Not all platforms have clks so it is not an error if the 230 + * clock do not exist. 232 231 */ 232 + reg_clk = devm_clk_get(&pdev->dev, "reg"); 233 + if (!IS_ERR(reg_clk)) { 234 + ret = clk_prepare_enable(reg_clk); 235 + if (ret) 236 + goto put_hcd; 237 + } else if (PTR_ERR(reg_clk) == -EPROBE_DEFER) { 238 + ret = -EPROBE_DEFER; 239 + goto put_hcd; 240 + } 241 + 233 242 clk = devm_clk_get(&pdev->dev, NULL); 234 243 if (!IS_ERR(clk)) { 235 244 ret = clk_prepare_enable(clk); 236 245 if (ret) 237 - goto put_hcd; 246 + goto disable_reg_clk; 238 247 } else if (PTR_ERR(clk) == -EPROBE_DEFER) { 239 248 ret = -EPROBE_DEFER; 240 - goto put_hcd; 249 + goto disable_reg_clk; 241 250 } 242 251 243 252 xhci = hcd_to_xhci(hcd); ··· 263 252 device_wakeup_enable(hcd->self.controller); 264 253 265 254 xhci->clk = clk; 255 + xhci->reg_clk = reg_clk; 266 256 xhci->main_hcd = hcd; 267 257 xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, 268 258 dev_name(&pdev->dev), hcd); ··· 332 320 usb_put_hcd(xhci->shared_hcd); 333 321 334 322 disable_clk: 335 - if (!IS_ERR(clk)) 336 - clk_disable_unprepare(clk); 323 + clk_disable_unprepare(clk); 324 + 325 + disable_reg_clk: 326 + clk_disable_unprepare(reg_clk); 337 327 338 328 put_hcd: 339 329 usb_put_hcd(hcd); ··· 352 338 struct usb_hcd *hcd = platform_get_drvdata(dev); 353 339 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 354 340 struct clk *clk = xhci->clk; 341 + struct clk *reg_clk = xhci->reg_clk; 355 342 356 343 xhci->xhc_state |= XHCI_STATE_REMOVING; 357 344 ··· 362 347 usb_remove_hcd(hcd); 363 348 usb_put_hcd(xhci->shared_hcd); 364 349 365 - if (!IS_ERR(clk)) 366 - clk_disable_unprepare(clk); 350 + clk_disable_unprepare(clk); 351 + clk_disable_unprepare(reg_clk); 367 352 usb_put_hcd(hcd); 368 353 369 354 pm_runtime_set_suspended(&dev->dev); ··· 435 420 static struct platform_driver usb_xhci_driver = { 436 421 .probe = xhci_plat_probe, 437 422 .remove = xhci_plat_remove, 438 - .shutdown = usb_hcd_platform_shutdown, 439 423 .driver = { 440 424 .name = "xhci-hcd", 441 425 .pm = &xhci_plat_pm_ops,
+2 -1
drivers/usb/host/xhci.h
··· 1729 1729 int page_shift; 1730 1730 /* msi-x vectors */ 1731 1731 int msix_count; 1732 - /* optional clock */ 1732 + /* optional clocks */ 1733 1733 struct clk *clk; 1734 + struct clk *reg_clk; 1734 1735 /* data structures */ 1735 1736 struct xhci_device_context_array *dcbaa; 1736 1737 struct xhci_ring *cmd_ring;
-2
drivers/usb/musb/musb_dsps.c
··· 451 451 if (!rev) 452 452 return -ENODEV; 453 453 454 - usb_phy_init(musb->xceiv); 455 454 if (IS_ERR(musb->phy)) { 456 455 musb->phy = NULL; 457 456 } else { ··· 500 501 struct dsps_glue *glue = dev_get_drvdata(dev->parent); 501 502 502 503 del_timer_sync(&musb->dev_timer); 503 - usb_phy_shutdown(musb->xceiv); 504 504 phy_power_off(musb->phy); 505 505 phy_exit(musb->phy); 506 506 debugfs_remove_recursive(glue->dbgfs_root);
+1
drivers/usb/musb/musb_host.c
··· 2754 2754 hcd->self.otg_port = 1; 2755 2755 musb->xceiv->otg->host = &hcd->self; 2756 2756 hcd->power_budget = 2 * (power_budget ? : 250); 2757 + hcd->skip_phy_initialization = 1; 2757 2758 2758 2759 ret = usb_add_hcd(hcd, 0, 0); 2759 2760 if (ret < 0)
+1
drivers/usb/serial/Kconfig
··· 62 62 - Fundamental Software dongle. 63 63 - Google USB serial devices 64 64 - HP4x calculators 65 + - Libtransistor USB console 65 66 - a number of Motorola phones 66 67 - Motorola Tetra devices 67 68 - Novatel Wireless GPS receivers
+1
drivers/usb/serial/cp210x.c
··· 214 214 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ 215 215 { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ 216 216 { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ 217 + { USB_DEVICE(0x3923, 0x7A0B) }, /* National Instruments USB Serial Console */ 217 218 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ 218 219 { } /* Terminating Entry */ 219 220 };
+2 -1
drivers/usb/serial/ftdi_sio.c
··· 1898 1898 return ftdi_jtag_probe(serial); 1899 1899 1900 1900 if (udev->product && 1901 - (!strcmp(udev->product, "BeagleBone/XDS100V2") || 1901 + (!strcmp(udev->product, "Arrow USB Blaster") || 1902 + !strcmp(udev->product, "BeagleBone/XDS100V2") || 1902 1903 !strcmp(udev->product, "SNAP Connect E10"))) 1903 1904 return ftdi_jtag_probe(serial); 1904 1905
+7
drivers/usb/serial/usb-serial-simple.c
··· 63 63 0x01) } 64 64 DEVICE(google, GOOGLE_IDS); 65 65 66 + /* Libtransistor USB console */ 67 + #define LIBTRANSISTOR_IDS() \ 68 + { USB_DEVICE(0x1209, 0x8b00) } 69 + DEVICE(libtransistor, LIBTRANSISTOR_IDS); 70 + 66 71 /* ViVOpay USB Serial Driver */ 67 72 #define VIVOPAY_IDS() \ 68 73 { USB_DEVICE(0x1d5f, 0x1004) } /* ViVOpay 8800 */ ··· 115 110 &funsoft_device, 116 111 &flashloader_device, 117 112 &google_device, 113 + &libtransistor_device, 118 114 &vivopay_device, 119 115 &moto_modem_device, 120 116 &motorola_tetra_device, ··· 132 126 FUNSOFT_IDS(), 133 127 FLASHLOADER_IDS(), 134 128 GOOGLE_IDS(), 129 + LIBTRANSISTOR_IDS(), 135 130 VIVOPAY_IDS(), 136 131 MOTO_IDS(), 137 132 MOTOROLA_TETRA_IDS(),
+1 -1
drivers/usb/typec/ucsi/Makefile
··· 5 5 6 6 typec_ucsi-y := ucsi.o 7 7 8 - typec_ucsi-$(CONFIG_FTRACE) += trace.o 8 + typec_ucsi-$(CONFIG_TRACING) += trace.o 9 9 10 10 obj-$(CONFIG_UCSI_ACPI) += ucsi_acpi.o
+1 -1
drivers/usb/typec/ucsi/ucsi.c
··· 28 28 * difficult to estimate the time it takes for the system to process the command 29 29 * before it is actually passed to the PPM. 30 30 */ 31 - #define UCSI_TIMEOUT_MS 1000 31 + #define UCSI_TIMEOUT_MS 5000 32 32 33 33 /* 34 34 * UCSI_SWAP_TIMEOUT_MS - Timeout for role swap requests
+5
drivers/usb/usbip/stub_main.c
··· 186 186 if (!bid) 187 187 return -ENODEV; 188 188 189 + /* device_attach() callers should hold parent lock for USB */ 190 + if (bid->udev->dev.parent) 191 + device_lock(bid->udev->dev.parent); 189 192 ret = device_attach(&bid->udev->dev); 193 + if (bid->udev->dev.parent) 194 + device_unlock(bid->udev->dev.parent); 190 195 if (ret < 0) { 191 196 dev_err(&bid->udev->dev, "rebind failed\n"); 192 197 return ret;
+1 -1
drivers/usb/usbip/usbip_common.h
··· 243 243 #define VUDC_EVENT_ERROR_USB (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE) 244 244 #define VUDC_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE) 245 245 246 - #define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_BYE) 246 + #define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_RESET | USBIP_EH_BYE) 247 247 #define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET) 248 248 #define VDEV_EVENT_ERROR_TCP (USBIP_EH_SHUTDOWN | USBIP_EH_RESET) 249 249 #define VDEV_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE)
-4
drivers/usb/usbip/usbip_event.c
··· 91 91 unset_event(ud, USBIP_EH_UNUSABLE); 92 92 } 93 93 94 - /* Stop the error handler. */ 95 - if (ud->event & USBIP_EH_BYE) 96 - usbip_dbg_eh("removed %p\n", ud); 97 - 98 94 wake_up(&ud->eh_waitq); 99 95 } 100 96 }
+13
drivers/usb/usbip/vhci_hcd.c
··· 354 354 usbip_dbg_vhci_rh(" ClearHubFeature\n"); 355 355 break; 356 356 case ClearPortFeature: 357 + if (rhport < 0) 358 + goto error; 357 359 switch (wValue) { 358 360 case USB_PORT_FEAT_SUSPEND: 359 361 if (hcd->speed == HCD_USB3) { ··· 513 511 goto error; 514 512 } 515 513 514 + if (rhport < 0) 515 + goto error; 516 + 516 517 vhci_hcd->port_status[rhport] |= USB_PORT_STAT_SUSPEND; 517 518 break; 518 519 case USB_PORT_FEAT_POWER: 519 520 usbip_dbg_vhci_rh( 520 521 " SetPortFeature: USB_PORT_FEAT_POWER\n"); 522 + if (rhport < 0) 523 + goto error; 521 524 if (hcd->speed == HCD_USB3) 522 525 vhci_hcd->port_status[rhport] |= USB_SS_PORT_STAT_POWER; 523 526 else ··· 531 524 case USB_PORT_FEAT_BH_PORT_RESET: 532 525 usbip_dbg_vhci_rh( 533 526 " SetPortFeature: USB_PORT_FEAT_BH_PORT_RESET\n"); 527 + if (rhport < 0) 528 + goto error; 534 529 /* Applicable only for USB3.0 hub */ 535 530 if (hcd->speed != HCD_USB3) { 536 531 pr_err("USB_PORT_FEAT_BH_PORT_RESET req not " ··· 543 534 case USB_PORT_FEAT_RESET: 544 535 usbip_dbg_vhci_rh( 545 536 " SetPortFeature: USB_PORT_FEAT_RESET\n"); 537 + if (rhport < 0) 538 + goto error; 546 539 /* if it's already enabled, disable */ 547 540 if (hcd->speed == HCD_USB3) { 548 541 vhci_hcd->port_status[rhport] = 0; ··· 565 554 default: 566 555 usbip_dbg_vhci_rh(" SetPortFeature: default %d\n", 567 556 wValue); 557 + if (rhport < 0) 558 + goto error; 568 559 if (hcd->speed == HCD_USB3) { 569 560 if ((vhci_hcd->port_status[rhport] & 570 561 USB_SS_PORT_STAT_POWER) != 0) {