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

Pull USB/PHY fixes from Greg KH:
"Here are a number of small USB and PHY driver fixes for 4.15-rc6.

Nothing major, but there are a number of regression fixes in here that
resolve issues that have been reported a bunch. There are also the
usual xhci fixes as well as a number of new usb serial device ids.

All of these have been in linux-next for a while with no reported
issues"

* tag 'usb-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201
xhci: Fix use-after-free in xhci debugfs
xhci: Fix xhci debugfs NULL pointer dereference in resume from hibernate
USB: serial: ftdi_sio: add id for Airbus DS P8GR
usb: Add device quirk for Logitech HD Pro Webcam C925e
usb: add RESET_RESUME for ELSA MicroLink 56K
usbip: fix usbip bind writing random string after command in match_busid
usbip: stub_rx: fix static checker warning on unnecessary checks
usbip: prevent leaking socket pointer address in messages
usbip: stub: stop printing kernel pointer addresses in messages
usbip: vhci: stop printing kernel pointer addresses in messages
USB: Fix off by one in type-specific length check of BOS SSP capability
USB: serial: option: adding support for YUGA CLM920-NC5
phy: rcar-gen3-usb2: select USB_COMMON
phy: rockchip-typec: add pm_runtime_disable in err case
phy: cpcap-usb: Fix platform_get_irq_byname's error checking.
phy: tegra: fix device-tree node lookups
USB: serial: qcserial: add Sierra Wireless EM7565
USB: serial: option: add support for Telit ME910 PID 0x1101
USB: chipidea: msm: fix ulpi-node lookup

+117 -104
+1 -1
drivers/phy/motorola/phy-cpcap-usb.c
··· 310 310 int irq, error; 311 311 312 312 irq = platform_get_irq_byname(pdev, name); 313 - if (!irq) 313 + if (irq < 0) 314 314 return -ENODEV; 315 315 316 316 error = devm_request_threaded_irq(ddata->dev, irq, NULL,
+2
drivers/phy/renesas/Kconfig
··· 12 12 tristate "Renesas R-Car generation 3 USB 2.0 PHY driver" 13 13 depends on ARCH_RENESAS 14 14 depends on EXTCON 15 + depends on USB_SUPPORT 15 16 select GENERIC_PHY 17 + select USB_COMMON 16 18 help 17 19 Support for USB 2.0 PHY found on Renesas R-Car generation 3 SoCs. 18 20
+2
drivers/phy/rockchip/phy-rockchip-typec.c
··· 1137 1137 if (IS_ERR(phy)) { 1138 1138 dev_err(dev, "failed to create phy: %s\n", 1139 1139 child_np->name); 1140 + pm_runtime_disable(dev); 1140 1141 return PTR_ERR(phy); 1141 1142 } 1142 1143 ··· 1147 1146 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 1148 1147 if (IS_ERR(phy_provider)) { 1149 1148 dev_err(dev, "Failed to register phy provider\n"); 1149 + pm_runtime_disable(dev); 1150 1150 return PTR_ERR(phy_provider); 1151 1151 } 1152 1152
+29 -29
drivers/phy/tegra/xusb.c
··· 75 75 static struct device_node * 76 76 tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name) 77 77 { 78 - /* 79 - * of_find_node_by_name() drops a reference, so make sure to grab one. 80 - */ 81 - struct device_node *np = of_node_get(padctl->dev->of_node); 78 + struct device_node *pads, *np; 82 79 83 - np = of_find_node_by_name(np, "pads"); 84 - if (np) 85 - np = of_find_node_by_name(np, name); 80 + pads = of_get_child_by_name(padctl->dev->of_node, "pads"); 81 + if (!pads) 82 + return NULL; 83 + 84 + np = of_get_child_by_name(pads, name); 85 + of_node_put(pads); 86 86 87 87 return np; 88 88 } ··· 90 90 static struct device_node * 91 91 tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index) 92 92 { 93 - /* 94 - * of_find_node_by_name() drops a reference, so make sure to grab one. 95 - */ 96 - struct device_node *np = of_node_get(pad->dev.of_node); 93 + struct device_node *np, *lanes; 97 94 98 - np = of_find_node_by_name(np, "lanes"); 99 - if (!np) 95 + lanes = of_get_child_by_name(pad->dev.of_node, "lanes"); 96 + if (!lanes) 100 97 return NULL; 101 98 102 - return of_find_node_by_name(np, pad->soc->lanes[index].name); 99 + np = of_get_child_by_name(lanes, pad->soc->lanes[index].name); 100 + of_node_put(lanes); 101 + 102 + return np; 103 103 } 104 104 105 105 static int ··· 195 195 unsigned int i; 196 196 int err; 197 197 198 - children = of_find_node_by_name(pad->dev.of_node, "lanes"); 198 + children = of_get_child_by_name(pad->dev.of_node, "lanes"); 199 199 if (!children) 200 200 return -ENODEV; 201 201 ··· 444 444 tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type, 445 445 unsigned int index) 446 446 { 447 - /* 448 - * of_find_node_by_name() drops a reference, so make sure to grab one. 449 - */ 450 - struct device_node *np = of_node_get(padctl->dev->of_node); 447 + struct device_node *ports, *np; 448 + char *name; 451 449 452 - np = of_find_node_by_name(np, "ports"); 453 - if (np) { 454 - char *name; 450 + ports = of_get_child_by_name(padctl->dev->of_node, "ports"); 451 + if (!ports) 452 + return NULL; 455 453 456 - name = kasprintf(GFP_KERNEL, "%s-%u", type, index); 457 - if (!name) 458 - return ERR_PTR(-ENOMEM); 459 - np = of_find_node_by_name(np, name); 460 - kfree(name); 454 + name = kasprintf(GFP_KERNEL, "%s-%u", type, index); 455 + if (!name) { 456 + of_node_put(ports); 457 + return ERR_PTR(-ENOMEM); 461 458 } 459 + np = of_get_child_by_name(ports, name); 460 + kfree(name); 461 + of_node_put(ports); 462 462 463 463 return np; 464 464 } ··· 847 847 848 848 static int tegra_xusb_padctl_probe(struct platform_device *pdev) 849 849 { 850 - struct device_node *np = of_node_get(pdev->dev.of_node); 850 + struct device_node *np = pdev->dev.of_node; 851 851 const struct tegra_xusb_padctl_soc *soc; 852 852 struct tegra_xusb_padctl *padctl; 853 853 const struct of_device_id *match; ··· 855 855 int err; 856 856 857 857 /* for backwards compatibility with old device trees */ 858 - np = of_find_node_by_name(np, "pads"); 858 + np = of_get_child_by_name(np, "pads"); 859 859 if (!np) { 860 860 dev_warn(&pdev->dev, "deprecated DT, using legacy driver\n"); 861 861 return tegra_xusb_padctl_legacy_probe(pdev);
+1 -1
drivers/usb/chipidea/ci_hdrc_msm.c
··· 247 247 if (ret) 248 248 goto err_mux; 249 249 250 - ulpi_node = of_find_node_by_name(of_node_get(pdev->dev.of_node), "ulpi"); 250 + ulpi_node = of_get_child_by_name(pdev->dev.of_node, "ulpi"); 251 251 if (ulpi_node) { 252 252 phy_node = of_get_next_available_child(ulpi_node, NULL); 253 253 ci->hsic = of_device_is_compatible(phy_node, "qcom,usb-hsic-phy");
+1 -1
drivers/usb/core/config.c
··· 1007 1007 case USB_SSP_CAP_TYPE: 1008 1008 ssp_cap = (struct usb_ssp_cap_descriptor *)buffer; 1009 1009 ssac = (le32_to_cpu(ssp_cap->bmAttributes) & 1010 - USB_SSP_SUBLINK_SPEED_ATTRIBS) + 1; 1010 + USB_SSP_SUBLINK_SPEED_ATTRIBS); 1011 1011 if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac)) 1012 1012 dev->bos->ssp_cap = ssp_cap; 1013 1013 break;
+5 -1
drivers/usb/core/quirks.c
··· 52 52 /* Microsoft LifeCam-VX700 v2.0 */ 53 53 { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, 54 54 55 - /* Logitech HD Pro Webcams C920, C920-C and C930e */ 55 + /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ 56 56 { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, 57 57 { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, 58 58 { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, 59 + { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT }, 59 60 60 61 /* Logitech ConferenceCam CC3000e */ 61 62 { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT }, ··· 149 148 150 149 /* Genesys Logic hub, internally used by KY-688 USB 3.1 Type-C Hub */ 151 150 { USB_DEVICE(0x05e3, 0x0612), .driver_info = USB_QUIRK_NO_LPM }, 151 + 152 + /* ELSA MicroLink 56K */ 153 + { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_RESET_RESUME }, 152 154 153 155 /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ 154 156 { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM },
+8 -8
drivers/usb/host/xhci-debugfs.c
··· 162 162 static int xhci_ring_enqueue_show(struct seq_file *s, void *unused) 163 163 { 164 164 dma_addr_t dma; 165 - struct xhci_ring *ring = s->private; 165 + struct xhci_ring *ring = *(struct xhci_ring **)s->private; 166 166 167 167 dma = xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue); 168 168 seq_printf(s, "%pad\n", &dma); ··· 173 173 static int xhci_ring_dequeue_show(struct seq_file *s, void *unused) 174 174 { 175 175 dma_addr_t dma; 176 - struct xhci_ring *ring = s->private; 176 + struct xhci_ring *ring = *(struct xhci_ring **)s->private; 177 177 178 178 dma = xhci_trb_virt_to_dma(ring->deq_seg, ring->dequeue); 179 179 seq_printf(s, "%pad\n", &dma); ··· 183 183 184 184 static int xhci_ring_cycle_show(struct seq_file *s, void *unused) 185 185 { 186 - struct xhci_ring *ring = s->private; 186 + struct xhci_ring *ring = *(struct xhci_ring **)s->private; 187 187 188 188 seq_printf(s, "%d\n", ring->cycle_state); 189 189 ··· 346 346 } 347 347 348 348 static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci, 349 - struct xhci_ring *ring, 349 + struct xhci_ring **ring, 350 350 const char *name, 351 351 struct dentry *parent) 352 352 { ··· 387 387 388 388 snprintf(epriv->name, sizeof(epriv->name), "ep%02d", ep_index); 389 389 epriv->root = xhci_debugfs_create_ring_dir(xhci, 390 - dev->eps[ep_index].new_ring, 390 + &dev->eps[ep_index].new_ring, 391 391 epriv->name, 392 392 spriv->root); 393 393 spriv->eps[ep_index] = epriv; ··· 423 423 priv->dev = dev; 424 424 dev->debugfs_private = priv; 425 425 426 - xhci_debugfs_create_ring_dir(xhci, dev->eps[0].ring, 426 + xhci_debugfs_create_ring_dir(xhci, &dev->eps[0].ring, 427 427 "ep00", priv->root); 428 428 429 429 xhci_debugfs_create_context_files(xhci, priv->root, slot_id); ··· 488 488 ARRAY_SIZE(xhci_extcap_dbc), 489 489 "reg-ext-dbc"); 490 490 491 - xhci_debugfs_create_ring_dir(xhci, xhci->cmd_ring, 491 + xhci_debugfs_create_ring_dir(xhci, &xhci->cmd_ring, 492 492 "command-ring", 493 493 xhci->debugfs_root); 494 494 495 - xhci_debugfs_create_ring_dir(xhci, xhci->event_ring, 495 + xhci_debugfs_create_ring_dir(xhci, &xhci->event_ring, 496 496 "event-ring", 497 497 xhci->debugfs_root); 498 498
+3
drivers/usb/host/xhci-pci.c
··· 178 178 xhci->quirks |= XHCI_BROKEN_STREAMS; 179 179 } 180 180 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && 181 + pdev->device == 0x0014) 182 + xhci->quirks |= XHCI_TRUST_TX_LENGTH; 183 + if (pdev->vendor == PCI_VENDOR_ID_RENESAS && 181 184 pdev->device == 0x0015) 182 185 xhci->quirks |= XHCI_RESET_ON_RESUME; 183 186 if (pdev->vendor == PCI_VENDOR_ID_VIA)
+3 -3
drivers/usb/host/xhci.c
··· 3525 3525 struct xhci_slot_ctx *slot_ctx; 3526 3526 int i, ret; 3527 3527 3528 - xhci_debugfs_remove_slot(xhci, udev->slot_id); 3529 - 3530 3528 #ifndef CONFIG_USB_DEFAULT_PERSIST 3531 3529 /* 3532 3530 * We called pm_runtime_get_noresume when the device was attached. ··· 3553 3555 } 3554 3556 3555 3557 ret = xhci_disable_slot(xhci, udev->slot_id); 3556 - if (ret) 3558 + if (ret) { 3559 + xhci_debugfs_remove_slot(xhci, udev->slot_id); 3557 3560 xhci_free_virt_device(xhci, udev->slot_id); 3561 + } 3558 3562 } 3559 3563 3560 3564 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
+1
drivers/usb/serial/ftdi_sio.c
··· 1013 1013 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 1014 1014 { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) }, 1015 1015 { USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) }, 1016 + { USB_DEVICE(AIRBUS_DS_VID, AIRBUS_DS_P8GR) }, 1016 1017 { } /* Terminating entry */ 1017 1018 }; 1018 1019
+6
drivers/usb/serial/ftdi_sio_ids.h
··· 915 915 #define ICPDAS_I7563U_PID 0x0105 916 916 917 917 /* 918 + * Airbus Defence and Space 919 + */ 920 + #define AIRBUS_DS_VID 0x1e8e /* Vendor ID */ 921 + #define AIRBUS_DS_P8GR 0x6001 /* Tetra P8GR */ 922 + 923 + /* 918 924 * RT Systems programming cables for various ham radios 919 925 */ 920 926 #define RTSYSTEMS_VID 0x2100 /* Vendor ID */
+17
drivers/usb/serial/option.c
··· 233 233 /* These Quectel products use Qualcomm's vendor ID */ 234 234 #define QUECTEL_PRODUCT_UC20 0x9003 235 235 #define QUECTEL_PRODUCT_UC15 0x9090 236 + /* These Yuga products use Qualcomm's vendor ID */ 237 + #define YUGA_PRODUCT_CLM920_NC5 0x9625 236 238 237 239 #define QUECTEL_VENDOR_ID 0x2c7c 238 240 /* These Quectel products use Quectel's vendor ID */ ··· 282 280 #define TELIT_PRODUCT_LE922_USBCFG3 0x1043 283 281 #define TELIT_PRODUCT_LE922_USBCFG5 0x1045 284 282 #define TELIT_PRODUCT_ME910 0x1100 283 + #define TELIT_PRODUCT_ME910_DUAL_MODEM 0x1101 285 284 #define TELIT_PRODUCT_LE920 0x1200 286 285 #define TELIT_PRODUCT_LE910 0x1201 287 286 #define TELIT_PRODUCT_LE910_USBCFG4 0x1206 ··· 648 645 .reserved = BIT(1) | BIT(3), 649 646 }; 650 647 648 + static const struct option_blacklist_info telit_me910_dual_modem_blacklist = { 649 + .sendsetup = BIT(0), 650 + .reserved = BIT(3), 651 + }; 652 + 651 653 static const struct option_blacklist_info telit_le910_blacklist = { 652 654 .sendsetup = BIT(0), 653 655 .reserved = BIT(1) | BIT(2), ··· 680 672 681 673 static const struct option_blacklist_info cinterion_rmnet2_blacklist = { 682 674 .reserved = BIT(4) | BIT(5), 675 + }; 676 + 677 + static const struct option_blacklist_info yuga_clm920_nc5_blacklist = { 678 + .reserved = BIT(1) | BIT(4), 683 679 }; 684 680 685 681 static const struct usb_device_id option_ids[] = { ··· 1190 1178 { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, 1191 1179 { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), 1192 1180 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1181 + /* Yuga products use Qualcomm vendor ID */ 1182 + { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), 1183 + .driver_info = (kernel_ulong_t)&yuga_clm920_nc5_blacklist }, 1193 1184 /* Quectel products using Quectel vendor ID */ 1194 1185 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), 1195 1186 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ··· 1259 1244 .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, 1260 1245 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), 1261 1246 .driver_info = (kernel_ulong_t)&telit_me910_blacklist }, 1247 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), 1248 + .driver_info = (kernel_ulong_t)&telit_me910_dual_modem_blacklist }, 1262 1249 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), 1263 1250 .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, 1264 1251 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
+3
drivers/usb/serial/qcserial.c
··· 162 162 {DEVICE_SWI(0x1199, 0x9079)}, /* Sierra Wireless EM74xx */ 163 163 {DEVICE_SWI(0x1199, 0x907a)}, /* Sierra Wireless EM74xx QDL */ 164 164 {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ 165 + {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ 166 + {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ 165 167 {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ 166 168 {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ 167 169 {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ ··· 344 342 break; 345 343 case 2: 346 344 dev_dbg(dev, "NMEA GPS interface found\n"); 345 + sendsetup = true; 347 346 break; 348 347 case 3: 349 348 dev_dbg(dev, "Modem port found\n");
+1 -2
drivers/usb/usbip/stub_dev.c
··· 149 149 * step 1? 150 150 */ 151 151 if (ud->tcp_socket) { 152 - dev_dbg(&sdev->udev->dev, "shutdown tcp_socket %p\n", 153 - ud->tcp_socket); 152 + dev_dbg(&sdev->udev->dev, "shutdown sockfd %d\n", ud->sockfd); 154 153 kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); 155 154 } 156 155
+3 -2
drivers/usb/usbip/stub_main.c
··· 237 237 struct stub_priv *priv; 238 238 struct urb *urb; 239 239 240 - dev_dbg(&sdev->udev->dev, "free sdev %p\n", sdev); 240 + dev_dbg(&sdev->udev->dev, "Stub device cleaning up urbs\n"); 241 241 242 242 while ((priv = stub_priv_pop(sdev))) { 243 243 urb = priv->urb; 244 - dev_dbg(&sdev->udev->dev, "free urb %p\n", urb); 244 + dev_dbg(&sdev->udev->dev, "free urb seqnum %lu\n", 245 + priv->seqnum); 245 246 usb_kill_urb(urb); 246 247 247 248 kmem_cache_free(stub_priv_cache, priv);
+3 -15
drivers/usb/usbip/stub_rx.c
··· 211 211 if (priv->seqnum != pdu->u.cmd_unlink.seqnum) 212 212 continue; 213 213 214 - dev_info(&priv->urb->dev->dev, "unlink urb %p\n", 215 - priv->urb); 216 - 217 214 /* 218 215 * This matched urb is not completed yet (i.e., be in 219 216 * flight in usb hcd hardware/driver). Now we are ··· 249 252 ret = usb_unlink_urb(priv->urb); 250 253 if (ret != -EINPROGRESS) 251 254 dev_err(&priv->urb->dev->dev, 252 - "failed to unlink a urb %p, ret %d\n", 253 - priv->urb, ret); 255 + "failed to unlink a urb # %lu, ret %d\n", 256 + priv->seqnum, ret); 254 257 255 258 return 0; 256 259 } ··· 338 341 goto err_ret; 339 342 340 343 epd = &ep->desc; 341 - 342 - /* validate transfer_buffer_length */ 343 - if (pdu->u.cmd_submit.transfer_buffer_length > INT_MAX) { 344 - dev_err(&sdev->udev->dev, 345 - "CMD_SUBMIT: -EMSGSIZE transfer_buffer_length %d\n", 346 - pdu->u.cmd_submit.transfer_buffer_length); 347 - return -1; 348 - } 349 344 350 345 if (usb_endpoint_xfer_control(epd)) { 351 346 if (dir == USBIP_DIR_OUT) ··· 471 482 } 472 483 473 484 /* allocate urb transfer buffer, if needed */ 474 - if (pdu->u.cmd_submit.transfer_buffer_length > 0 && 475 - pdu->u.cmd_submit.transfer_buffer_length <= INT_MAX) { 485 + if (pdu->u.cmd_submit.transfer_buffer_length > 0) { 476 486 priv->urb->transfer_buffer = 477 487 kzalloc(pdu->u.cmd_submit.transfer_buffer_length, 478 488 GFP_KERNEL);
+3 -3
drivers/usb/usbip/stub_tx.c
··· 88 88 /* link a urb to the queue of tx. */ 89 89 spin_lock_irqsave(&sdev->priv_lock, flags); 90 90 if (sdev->ud.tcp_socket == NULL) { 91 - usbip_dbg_stub_tx("ignore urb for closed connection %p", urb); 91 + usbip_dbg_stub_tx("ignore urb for closed connection\n"); 92 92 /* It will be freed in stub_device_cleanup_urbs(). */ 93 93 } else if (priv->unlinking) { 94 94 stub_enqueue_ret_unlink(sdev, priv->seqnum, urb->status); ··· 190 190 191 191 /* 1. setup usbip_header */ 192 192 setup_ret_submit_pdu(&pdu_header, urb); 193 - usbip_dbg_stub_tx("setup txdata seqnum: %d urb: %p\n", 194 - pdu_header.base.seqnum, urb); 193 + usbip_dbg_stub_tx("setup txdata seqnum: %d\n", 194 + pdu_header.base.seqnum); 195 195 usbip_header_correct_endian(&pdu_header, 1); 196 196 197 197 iov[iovnum].iov_base = &pdu_header;
+5 -11
drivers/usb/usbip/usbip_common.c
··· 317 317 struct msghdr msg = {.msg_flags = MSG_NOSIGNAL}; 318 318 int total = 0; 319 319 320 + if (!sock || !buf || !size) 321 + return -EINVAL; 322 + 320 323 iov_iter_kvec(&msg.msg_iter, READ|ITER_KVEC, &iov, 1, size); 321 324 322 325 usbip_dbg_xmit("enter\n"); 323 326 324 - if (!sock || !buf || !size) { 325 - pr_err("invalid arg, sock %p buff %p size %d\n", sock, buf, 326 - size); 327 - return -EINVAL; 328 - } 329 - 330 327 do { 331 - int sz = msg_data_left(&msg); 328 + msg_data_left(&msg); 332 329 sock->sk->sk_allocation = GFP_NOIO; 333 330 334 331 result = sock_recvmsg(sock, &msg, MSG_WAITALL); 335 - if (result <= 0) { 336 - pr_debug("receive sock %p buf %p size %u ret %d total %d\n", 337 - sock, buf + total, sz, result, total); 332 + if (result <= 0) 338 333 goto err; 339 - } 340 334 341 335 total += result; 342 336 } while (msg_data_left(&msg));
+1 -11
drivers/usb/usbip/vhci_hcd.c
··· 656 656 struct vhci_device *vdev; 657 657 unsigned long flags; 658 658 659 - usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", 660 - hcd, urb, mem_flags); 661 - 662 659 if (portnum > VHCI_HC_PORTS) { 663 660 pr_err("invalid port number %d\n", portnum); 664 661 return -ENODEV; ··· 819 822 struct vhci_device *vdev; 820 823 unsigned long flags; 821 824 822 - pr_info("dequeue a urb %p\n", urb); 823 - 824 825 spin_lock_irqsave(&vhci->lock, flags); 825 826 826 827 priv = urb->hcpriv; ··· 846 851 /* tcp connection is closed */ 847 852 spin_lock(&vdev->priv_lock); 848 853 849 - pr_info("device %p seems to be disconnected\n", vdev); 850 854 list_del(&priv->list); 851 855 kfree(priv); 852 856 urb->hcpriv = NULL; ··· 857 863 * vhci_rx will receive RET_UNLINK and give back the URB. 858 864 * Otherwise, we give back it here. 859 865 */ 860 - pr_info("gives back urb %p\n", urb); 861 - 862 866 usb_hcd_unlink_urb_from_ep(hcd, urb); 863 867 864 868 spin_unlock_irqrestore(&vhci->lock, flags); ··· 883 891 pr_info("seqnum max\n"); 884 892 885 893 unlink->unlink_seqnum = priv->seqnum; 886 - 887 - pr_info("device %p seems to be still connected\n", vdev); 888 894 889 895 /* send cmd_unlink and try to cancel the pending URB in the 890 896 * peer */ ··· 965 975 966 976 /* need this? see stub_dev.c */ 967 977 if (ud->tcp_socket) { 968 - pr_debug("shutdown tcp_socket %p\n", ud->tcp_socket); 978 + pr_debug("shutdown tcp_socket %d\n", ud->sockfd); 969 979 kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR); 970 980 } 971 981
+11 -12
drivers/usb/usbip/vhci_rx.c
··· 23 23 urb = priv->urb; 24 24 status = urb->status; 25 25 26 - usbip_dbg_vhci_rx("find urb %p vurb %p seqnum %u\n", 27 - urb, priv, seqnum); 26 + usbip_dbg_vhci_rx("find urb seqnum %u\n", seqnum); 28 27 29 28 switch (status) { 30 29 case -ENOENT: 31 30 /* fall through */ 32 31 case -ECONNRESET: 33 - dev_info(&urb->dev->dev, 34 - "urb %p was unlinked %ssynchronuously.\n", urb, 35 - status == -ENOENT ? "" : "a"); 32 + dev_dbg(&urb->dev->dev, 33 + "urb seq# %u was unlinked %ssynchronuously\n", 34 + seqnum, status == -ENOENT ? "" : "a"); 36 35 break; 37 36 case -EINPROGRESS: 38 37 /* no info output */ 39 38 break; 40 39 default: 41 - dev_info(&urb->dev->dev, 42 - "urb %p may be in a error, status %d\n", urb, 43 - status); 40 + dev_dbg(&urb->dev->dev, 41 + "urb seq# %u may be in a error, status %d\n", 42 + seqnum, status); 44 43 } 45 44 46 45 list_del(&priv->list); ··· 66 67 spin_unlock_irqrestore(&vdev->priv_lock, flags); 67 68 68 69 if (!urb) { 69 - pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum); 70 - pr_info("max seqnum %d\n", 70 + pr_err("cannot find a urb of seqnum %u max seqnum %d\n", 71 + pdu->base.seqnum, 71 72 atomic_read(&vhci_hcd->seqnum)); 72 73 usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); 73 74 return; ··· 90 91 if (usbip_dbg_flag_vhci_rx) 91 92 usbip_dump_urb(urb); 92 93 93 - usbip_dbg_vhci_rx("now giveback urb %p\n", urb); 94 + usbip_dbg_vhci_rx("now giveback urb %u\n", pdu->base.seqnum); 94 95 95 96 spin_lock_irqsave(&vhci->lock, flags); 96 97 usb_hcd_unlink_urb_from_ep(vhci_hcd_to_hcd(vhci_hcd), urb); ··· 157 158 pr_info("the urb (seqnum %d) was already given back\n", 158 159 pdu->base.seqnum); 159 160 } else { 160 - usbip_dbg_vhci_rx("now giveback urb %p\n", urb); 161 + usbip_dbg_vhci_rx("now giveback urb %d\n", pdu->base.seqnum); 161 162 162 163 /* If unlink is successful, status is -ECONNRESET */ 163 164 urb->status = pdu->u.ret_unlink.status;
+2 -1
drivers/usb/usbip/vhci_tx.c
··· 69 69 memset(&msg, 0, sizeof(msg)); 70 70 memset(&iov, 0, sizeof(iov)); 71 71 72 - usbip_dbg_vhci_tx("setup txdata urb %p\n", urb); 72 + usbip_dbg_vhci_tx("setup txdata urb seqnum %lu\n", 73 + priv->seqnum); 73 74 74 75 /* 1. setup usbip_header */ 75 76 setup_cmd_submit_pdu(&pdu_header, urb);
+6 -3
tools/usb/usbip/src/utils.c
··· 30 30 char command[SYSFS_BUS_ID_SIZE + 4]; 31 31 char match_busid_attr_path[SYSFS_PATH_MAX]; 32 32 int rc; 33 + int cmd_size; 33 34 34 35 snprintf(match_busid_attr_path, sizeof(match_busid_attr_path), 35 36 "%s/%s/%s/%s/%s/%s", SYSFS_MNT_PATH, SYSFS_BUS_NAME, ··· 38 37 attr_name); 39 38 40 39 if (add) 41 - snprintf(command, SYSFS_BUS_ID_SIZE + 4, "add %s", busid); 40 + cmd_size = snprintf(command, SYSFS_BUS_ID_SIZE + 4, "add %s", 41 + busid); 42 42 else 43 - snprintf(command, SYSFS_BUS_ID_SIZE + 4, "del %s", busid); 43 + cmd_size = snprintf(command, SYSFS_BUS_ID_SIZE + 4, "del %s", 44 + busid); 44 45 45 46 rc = write_sysfs_attribute(match_busid_attr_path, command, 46 - sizeof(command)); 47 + cmd_size); 47 48 if (rc < 0) { 48 49 dbg("failed to write match_busid: %s", strerror(errno)); 49 50 return -1;