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

Pull USB fixes from Greg KH:
"Here are some small USB driver fixes for reported issues for 5.5-rc2

There's the usual gadget and xhci fixes, as well as some other
problems that syzbot has been finding during it's fuzzing runs. Full
details are in the shortlog.

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

* tag 'usb-5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (21 commits)
usb: dwc3: pci: add ID for the Intel Comet Lake -H variant
xhci: make sure interrupts are restored to correct state
xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour.
xhci: Increase STS_HALT timeout in xhci_suspend()
usb: xhci: only set D3hot for pci device
xhci: fix USB3 device initiated resume race with roothub autosuspend
xhci: Fix memory leak in xhci_add_in_port()
USB: Fix incorrect DMA allocations for local memory pool drivers
usb: gadget: fix wrong endpoint desc
usb: dwc3: ep0: Clear started flag on completion
usb: dwc3: gadget: Clear started flag for non-IOC
usb: dwc3: gadget: Fix logical condition
USB: atm: ueagle-atm: add missing endpoint check
USB: adutux: fix interface sanity check
USB: idmouse: fix interface sanity checks
USB: serial: io_edgeport: fix epic endpoint lookup
usb: mon: Fix a deadlock in usbmon between mmap and read
usb: common: usb-conn-gpio: Don't log an error on probe deferral
usb: core: urb: fix URB structure initialization function
usb: typec: fix use after free in typec_register_port()
...

+135 -67
+12 -6
drivers/usb/atm/ueagle-atm.c
··· 2124 2124 /* 2125 2125 * Start the modem : init the data and start kernel thread 2126 2126 */ 2127 - static int uea_boot(struct uea_softc *sc) 2127 + static int uea_boot(struct uea_softc *sc, struct usb_interface *intf) 2128 2128 { 2129 - int ret, size; 2130 2129 struct intr_pkt *intr; 2130 + int ret = -ENOMEM; 2131 + int size; 2131 2132 2132 2133 uea_enters(INS_TO_USBDEV(sc)); 2133 2134 ··· 2153 2152 if (UEA_CHIP_VERSION(sc) == ADI930) 2154 2153 load_XILINX_firmware(sc); 2155 2154 2155 + if (intf->cur_altsetting->desc.bNumEndpoints < 1) { 2156 + ret = -ENODEV; 2157 + goto err0; 2158 + } 2159 + 2156 2160 intr = kmalloc(size, GFP_KERNEL); 2157 2161 if (!intr) 2158 2162 goto err0; ··· 2169 2163 usb_fill_int_urb(sc->urb_int, sc->usb_dev, 2170 2164 usb_rcvintpipe(sc->usb_dev, UEA_INTR_PIPE), 2171 2165 intr, size, uea_intr, sc, 2172 - sc->usb_dev->actconfig->interface[0]->altsetting[0]. 2173 - endpoint[0].desc.bInterval); 2166 + intf->cur_altsetting->endpoint[0].desc.bInterval); 2174 2167 2175 2168 ret = usb_submit_urb(sc->urb_int, GFP_KERNEL); 2176 2169 if (ret < 0) { ··· 2184 2179 sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm"); 2185 2180 if (IS_ERR(sc->kthread)) { 2186 2181 uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); 2182 + ret = PTR_ERR(sc->kthread); 2187 2183 goto err2; 2188 2184 } 2189 2185 ··· 2199 2193 kfree(intr); 2200 2194 err0: 2201 2195 uea_leaves(INS_TO_USBDEV(sc)); 2202 - return -ENOMEM; 2196 + return ret; 2203 2197 } 2204 2198 2205 2199 /* ··· 2554 2548 } 2555 2549 } 2556 2550 2557 - ret = uea_boot(sc); 2551 + ret = uea_boot(sc, intf); 2558 2552 if (ret < 0) 2559 2553 goto error; 2560 2554
+2 -1
drivers/usb/common/usb-conn-gpio.c
··· 156 156 157 157 info->vbus = devm_regulator_get(dev, "vbus"); 158 158 if (IS_ERR(info->vbus)) { 159 - dev_err(dev, "failed to get vbus\n"); 159 + if (PTR_ERR(info->vbus) != -EPROBE_DEFER) 160 + dev_err(dev, "failed to get vbus\n"); 160 161 return PTR_ERR(info->vbus); 161 162 } 162 163
+21 -21
drivers/usb/core/hcd.c
··· 1409 1409 if (usb_endpoint_xfer_control(&urb->ep->desc)) { 1410 1410 if (hcd->self.uses_pio_for_control) 1411 1411 return ret; 1412 - if (hcd_uses_dma(hcd)) { 1412 + if (hcd->localmem_pool) { 1413 + ret = hcd_alloc_coherent( 1414 + urb->dev->bus, mem_flags, 1415 + &urb->setup_dma, 1416 + (void **)&urb->setup_packet, 1417 + sizeof(struct usb_ctrlrequest), 1418 + DMA_TO_DEVICE); 1419 + if (ret) 1420 + return ret; 1421 + urb->transfer_flags |= URB_SETUP_MAP_LOCAL; 1422 + } else if (hcd_uses_dma(hcd)) { 1413 1423 if (object_is_on_stack(urb->setup_packet)) { 1414 1424 WARN_ONCE(1, "setup packet is on stack\n"); 1415 1425 return -EAGAIN; ··· 1434 1424 urb->setup_dma)) 1435 1425 return -EAGAIN; 1436 1426 urb->transfer_flags |= URB_SETUP_MAP_SINGLE; 1437 - } else if (hcd->localmem_pool) { 1438 - ret = hcd_alloc_coherent( 1439 - urb->dev->bus, mem_flags, 1440 - &urb->setup_dma, 1441 - (void **)&urb->setup_packet, 1442 - sizeof(struct usb_ctrlrequest), 1443 - DMA_TO_DEVICE); 1444 - if (ret) 1445 - return ret; 1446 - urb->transfer_flags |= URB_SETUP_MAP_LOCAL; 1447 1427 } 1448 1428 } 1449 1429 1450 1430 dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; 1451 1431 if (urb->transfer_buffer_length != 0 1452 1432 && !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)) { 1453 - if (hcd_uses_dma(hcd)) { 1433 + if (hcd->localmem_pool) { 1434 + ret = hcd_alloc_coherent( 1435 + urb->dev->bus, mem_flags, 1436 + &urb->transfer_dma, 1437 + &urb->transfer_buffer, 1438 + urb->transfer_buffer_length, 1439 + dir); 1440 + if (ret == 0) 1441 + urb->transfer_flags |= URB_MAP_LOCAL; 1442 + } else if (hcd_uses_dma(hcd)) { 1454 1443 if (urb->num_sgs) { 1455 1444 int n; 1456 1445 ··· 1500 1491 else 1501 1492 urb->transfer_flags |= URB_DMA_MAP_SINGLE; 1502 1493 } 1503 - } else if (hcd->localmem_pool) { 1504 - ret = hcd_alloc_coherent( 1505 - urb->dev->bus, mem_flags, 1506 - &urb->transfer_dma, 1507 - &urb->transfer_buffer, 1508 - urb->transfer_buffer_length, 1509 - dir); 1510 - if (ret == 0) 1511 - urb->transfer_flags |= URB_MAP_LOCAL; 1512 1494 } 1513 1495 if (ret && (urb->transfer_flags & (URB_SETUP_MAP_SINGLE | 1514 1496 URB_SETUP_MAP_LOCAL)))
+1
drivers/usb/core/urb.c
··· 45 45 if (urb) { 46 46 memset(urb, 0, sizeof(*urb)); 47 47 kref_init(&urb->kref); 48 + INIT_LIST_HEAD(&urb->urb_list); 48 49 INIT_LIST_HEAD(&urb->anchor_list); 49 50 } 50 51 }
+5 -1
drivers/usb/dwc3/dwc3-pci.c
··· 29 29 #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa 30 30 #define PCI_DEVICE_ID_INTEL_APL 0x5aaa 31 31 #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 32 - #define PCI_DEVICE_ID_INTEL_CMLH 0x02ee 32 + #define PCI_DEVICE_ID_INTEL_CMLLP 0x02ee 33 + #define PCI_DEVICE_ID_INTEL_CMLH 0x06ee 33 34 #define PCI_DEVICE_ID_INTEL_GLK 0x31aa 34 35 #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee 35 36 #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e ··· 308 307 309 308 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), 310 309 (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, 310 + 311 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLLP), 312 + (kernel_ulong_t) &dwc3_pci_intel_properties, }, 311 313 312 314 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLH), 313 315 (kernel_ulong_t) &dwc3_pci_intel_properties, },
+8
drivers/usb/dwc3/ep0.c
··· 1117 1117 void dwc3_ep0_interrupt(struct dwc3 *dwc, 1118 1118 const struct dwc3_event_depevt *event) 1119 1119 { 1120 + struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; 1121 + u8 cmd; 1122 + 1120 1123 switch (event->endpoint_event) { 1121 1124 case DWC3_DEPEVT_XFERCOMPLETE: 1122 1125 dwc3_ep0_xfer_complete(dwc, event); ··· 1132 1129 case DWC3_DEPEVT_XFERINPROGRESS: 1133 1130 case DWC3_DEPEVT_RXTXFIFOEVT: 1134 1131 case DWC3_DEPEVT_STREAMEVT: 1132 + break; 1135 1133 case DWC3_DEPEVT_EPCMDCMPLT: 1134 + cmd = DEPEVT_PARAMETER_CMD(event->parameters); 1135 + 1136 + if (cmd == DWC3_DEPCMD_ENDTRANSFER) 1137 + dep->flags &= ~DWC3_EP_TRANSFER_STARTED; 1136 1138 break; 1137 1139 } 1138 1140 }
+4 -1
drivers/usb/dwc3/gadget.c
··· 2491 2491 2492 2492 req->request.actual = req->request.length - req->remaining; 2493 2493 2494 - if (!dwc3_gadget_ep_request_completed(req) && 2494 + if (!dwc3_gadget_ep_request_completed(req) || 2495 2495 req->num_pending_sgs) { 2496 2496 __dwc3_gadget_kick_transfer(dep); 2497 2497 goto out; ··· 2718 2718 ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params); 2719 2719 WARN_ON_ONCE(ret); 2720 2720 dep->resource_index = 0; 2721 + 2722 + if (!interrupt) 2723 + dep->flags &= ~DWC3_EP_TRANSFER_STARTED; 2721 2724 2722 2725 if (dwc3_is_usb31(dwc) || dwc->revision < DWC3_REVISION_310A) 2723 2726 udelay(100);
+5 -1
drivers/usb/gadget/function/f_ecm.c
··· 621 621 622 622 DBG(cdev, "ecm deactivated\n"); 623 623 624 - if (ecm->port.in_ep->enabled) 624 + if (ecm->port.in_ep->enabled) { 625 625 gether_disconnect(&ecm->port); 626 + } else { 627 + ecm->port.in_ep->desc = NULL; 628 + ecm->port.out_ep->desc = NULL; 629 + } 626 630 627 631 usb_ep_disable(ecm->notify); 628 632 ecm->notify->desc = NULL;
+1
drivers/usb/gadget/function/f_rndis.c
··· 618 618 gether_disconnect(&rndis->port); 619 619 620 620 usb_ep_disable(rndis->notify); 621 + rndis->notify->desc = NULL; 621 622 } 622 623 623 624 /*-------------------------------------------------------------------------*/
+16 -6
drivers/usb/host/xhci-hub.c
··· 806 806 807 807 static int xhci_handle_usb2_port_link_resume(struct xhci_port *port, 808 808 u32 *status, u32 portsc, 809 - unsigned long flags) 809 + unsigned long *flags) 810 810 { 811 811 struct xhci_bus_state *bus_state; 812 812 struct xhci_hcd *xhci; ··· 860 860 xhci_test_and_clear_bit(xhci, port, PORT_PLC); 861 861 xhci_set_link_state(xhci, port, XDEV_U0); 862 862 863 - spin_unlock_irqrestore(&xhci->lock, flags); 863 + spin_unlock_irqrestore(&xhci->lock, *flags); 864 864 time_left = wait_for_completion_timeout( 865 865 &bus_state->rexit_done[wIndex], 866 866 msecs_to_jiffies(XHCI_MAX_REXIT_TIMEOUT_MS)); 867 - spin_lock_irqsave(&xhci->lock, flags); 867 + spin_lock_irqsave(&xhci->lock, *flags); 868 868 869 869 if (time_left) { 870 870 slot_id = xhci_find_slot_id_by_port(hcd, xhci, ··· 920 920 { 921 921 struct xhci_bus_state *bus_state; 922 922 struct xhci_hcd *xhci; 923 + struct usb_hcd *hcd; 923 924 u32 link_state; 924 925 u32 portnum; 925 926 926 927 bus_state = &port->rhub->bus_state; 927 928 xhci = hcd_to_xhci(port->rhub->hcd); 929 + hcd = port->rhub->hcd; 928 930 link_state = portsc & PORT_PLS_MASK; 929 931 portnum = port->hcd_portnum; 930 932 ··· 954 952 bus_state->suspended_ports &= ~(1 << portnum); 955 953 } 956 954 955 + /* remote wake resume signaling complete */ 956 + if (bus_state->port_remote_wakeup & (1 << portnum) && 957 + link_state != XDEV_RESUME && 958 + link_state != XDEV_RECOVERY) { 959 + bus_state->port_remote_wakeup &= ~(1 << portnum); 960 + usb_hcd_end_port_resume(&hcd->self, portnum); 961 + } 962 + 957 963 xhci_hub_report_usb3_link_state(xhci, status, portsc); 958 964 xhci_del_comp_mod_timer(xhci, portsc, portnum); 959 965 } 960 966 961 967 static void xhci_get_usb2_port_status(struct xhci_port *port, u32 *status, 962 - u32 portsc, unsigned long flags) 968 + u32 portsc, unsigned long *flags) 963 969 { 964 970 struct xhci_bus_state *bus_state; 965 971 u32 link_state; ··· 1017 1007 static u32 xhci_get_port_status(struct usb_hcd *hcd, 1018 1008 struct xhci_bus_state *bus_state, 1019 1009 u16 wIndex, u32 raw_port_status, 1020 - unsigned long flags) 1010 + unsigned long *flags) 1021 1011 __releases(&xhci->lock) 1022 1012 __acquires(&xhci->lock) 1023 1013 { ··· 1140 1130 } 1141 1131 trace_xhci_get_port_status(wIndex, temp); 1142 1132 status = xhci_get_port_status(hcd, bus_state, wIndex, temp, 1143 - flags); 1133 + &flags); 1144 1134 if (status == 0xffffffff) 1145 1135 goto error; 1146 1136
+4
drivers/usb/host/xhci-mem.c
··· 1909 1909 xhci->usb3_rhub.num_ports = 0; 1910 1910 xhci->num_active_eps = 0; 1911 1911 kfree(xhci->usb2_rhub.ports); 1912 + kfree(xhci->usb2_rhub.psi); 1912 1913 kfree(xhci->usb3_rhub.ports); 1914 + kfree(xhci->usb3_rhub.psi); 1913 1915 kfree(xhci->hw_ports); 1914 1916 kfree(xhci->rh_bw); 1915 1917 kfree(xhci->ext_caps); 1916 1918 1917 1919 xhci->usb2_rhub.ports = NULL; 1920 + xhci->usb2_rhub.psi = NULL; 1918 1921 xhci->usb3_rhub.ports = NULL; 1922 + xhci->usb3_rhub.psi = NULL; 1919 1923 xhci->hw_ports = NULL; 1920 1924 xhci->rh_bw = NULL; 1921 1925 xhci->ext_caps = NULL;
+13
drivers/usb/host/xhci-pci.c
··· 521 521 } 522 522 #endif /* CONFIG_PM */ 523 523 524 + static void xhci_pci_shutdown(struct usb_hcd *hcd) 525 + { 526 + struct xhci_hcd *xhci = hcd_to_xhci(hcd); 527 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 528 + 529 + xhci_shutdown(hcd); 530 + 531 + /* Yet another workaround for spurious wakeups at shutdown with HSW */ 532 + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) 533 + pci_set_power_state(pdev, PCI_D3hot); 534 + } 535 + 524 536 /*-------------------------------------------------------------------------*/ 525 537 526 538 /* PCI driver selection metadata; PCI hotplugging uses this */ ··· 568 556 #ifdef CONFIG_PM 569 557 xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend; 570 558 xhci_pci_hc_driver.pci_resume = xhci_pci_resume; 559 + xhci_pci_hc_driver.shutdown = xhci_pci_shutdown; 571 560 #endif 572 561 return pci_register_driver(&xhci_pci_driver); 573 562 }
+3 -3
drivers/usb/host/xhci-ring.c
··· 1628 1628 slot_id = xhci_find_slot_id_by_port(hcd, xhci, hcd_portnum + 1); 1629 1629 if (slot_id && xhci->devs[slot_id]) 1630 1630 xhci->devs[slot_id]->flags |= VDEV_PORT_ERROR; 1631 - bus_state->port_remote_wakeup &= ~(1 << hcd_portnum); 1632 1631 } 1633 1632 1634 1633 if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_RESUME) { ··· 1647 1648 */ 1648 1649 bus_state->port_remote_wakeup |= 1 << hcd_portnum; 1649 1650 xhci_test_and_clear_bit(xhci, port, PORT_PLC); 1651 + usb_hcd_start_port_resume(&hcd->self, hcd_portnum); 1650 1652 xhci_set_link_state(xhci, port, XDEV_U0); 1651 1653 /* Need to wait until the next link state change 1652 1654 * indicates the device is actually in U0. ··· 1688 1688 if (slot_id && xhci->devs[slot_id]) 1689 1689 xhci_ring_device(xhci, slot_id); 1690 1690 if (bus_state->port_remote_wakeup & (1 << hcd_portnum)) { 1691 - bus_state->port_remote_wakeup &= ~(1 << hcd_portnum); 1692 1691 xhci_test_and_clear_bit(xhci, port, PORT_PLC); 1693 1692 usb_wakeup_notification(hcd->self.root_hub, 1694 1693 hcd_portnum + 1); ··· 2381 2382 case COMP_SUCCESS: 2382 2383 if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) 2383 2384 break; 2384 - if (xhci->quirks & XHCI_TRUST_TX_LENGTH) 2385 + if (xhci->quirks & XHCI_TRUST_TX_LENGTH || 2386 + ep_ring->last_td_was_short) 2385 2387 trb_comp_code = COMP_SHORT_PACKET; 2386 2388 else 2387 2389 xhci_warn_ratelimited(xhci,
+3 -6
drivers/usb/host/xhci.c
··· 770 770 * 771 771 * This will only ever be called with the main usb_hcd (the USB3 roothub). 772 772 */ 773 - static void xhci_shutdown(struct usb_hcd *hcd) 773 + void xhci_shutdown(struct usb_hcd *hcd) 774 774 { 775 775 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 776 776 ··· 789 789 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 790 790 "xhci_shutdown completed - status = %x", 791 791 readl(&xhci->op_regs->status)); 792 - 793 - /* Yet another workaround for spurious wakeups at shutdown with HSW */ 794 - if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) 795 - pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot); 796 792 } 793 + EXPORT_SYMBOL_GPL(xhci_shutdown); 797 794 798 795 #ifdef CONFIG_PM 799 796 static void xhci_save_registers(struct xhci_hcd *xhci) ··· 970 973 int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) 971 974 { 972 975 int rc = 0; 973 - unsigned int delay = XHCI_MAX_HALT_USEC; 976 + unsigned int delay = XHCI_MAX_HALT_USEC * 2; 974 977 struct usb_hcd *hcd = xhci_to_hcd(xhci); 975 978 u32 command; 976 979 u32 res;
+1
drivers/usb/host/xhci.h
··· 2050 2050 int xhci_reset(struct xhci_hcd *xhci); 2051 2051 int xhci_run(struct usb_hcd *hcd); 2052 2052 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks); 2053 + void xhci_shutdown(struct usb_hcd *hcd); 2053 2054 void xhci_init_driver(struct hc_driver *drv, 2054 2055 const struct xhci_driver_overrides *over); 2055 2056 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
+1 -1
drivers/usb/misc/adutux.c
··· 669 669 init_waitqueue_head(&dev->read_wait); 670 670 init_waitqueue_head(&dev->write_wait); 671 671 672 - res = usb_find_common_endpoints_reverse(&interface->altsetting[0], 672 + res = usb_find_common_endpoints_reverse(interface->cur_altsetting, 673 673 NULL, NULL, 674 674 &dev->interrupt_in_endpoint, 675 675 &dev->interrupt_out_endpoint);
+1 -1
drivers/usb/misc/idmouse.c
··· 322 322 int result; 323 323 324 324 /* check if we have gotten the data or the hid interface */ 325 - iface_desc = &interface->altsetting[0]; 325 + iface_desc = interface->cur_altsetting; 326 326 if (iface_desc->desc.bInterfaceClass != 0x0A) 327 327 return -ENODEV; 328 328
+21 -11
drivers/usb/mon/mon_bin.c
··· 1039 1039 1040 1040 mutex_lock(&rp->fetch_lock); 1041 1041 spin_lock_irqsave(&rp->b_lock, flags); 1042 - mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE); 1043 - kfree(rp->b_vec); 1044 - rp->b_vec = vec; 1045 - rp->b_size = size; 1046 - rp->b_read = rp->b_in = rp->b_out = rp->b_cnt = 0; 1047 - rp->cnt_lost = 0; 1042 + if (rp->mmap_active) { 1043 + mon_free_buff(vec, size/CHUNK_SIZE); 1044 + kfree(vec); 1045 + ret = -EBUSY; 1046 + } else { 1047 + mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE); 1048 + kfree(rp->b_vec); 1049 + rp->b_vec = vec; 1050 + rp->b_size = size; 1051 + rp->b_read = rp->b_in = rp->b_out = rp->b_cnt = 0; 1052 + rp->cnt_lost = 0; 1053 + } 1048 1054 spin_unlock_irqrestore(&rp->b_lock, flags); 1049 1055 mutex_unlock(&rp->fetch_lock); 1050 1056 } ··· 1222 1216 static void mon_bin_vma_open(struct vm_area_struct *vma) 1223 1217 { 1224 1218 struct mon_reader_bin *rp = vma->vm_private_data; 1219 + unsigned long flags; 1220 + 1221 + spin_lock_irqsave(&rp->b_lock, flags); 1225 1222 rp->mmap_active++; 1223 + spin_unlock_irqrestore(&rp->b_lock, flags); 1226 1224 } 1227 1225 1228 1226 static void mon_bin_vma_close(struct vm_area_struct *vma) 1229 1227 { 1228 + unsigned long flags; 1229 + 1230 1230 struct mon_reader_bin *rp = vma->vm_private_data; 1231 + spin_lock_irqsave(&rp->b_lock, flags); 1231 1232 rp->mmap_active--; 1233 + spin_unlock_irqrestore(&rp->b_lock, flags); 1232 1234 } 1233 1235 1234 1236 /* ··· 1248 1234 unsigned long offset, chunk_idx; 1249 1235 struct page *pageptr; 1250 1236 1251 - mutex_lock(&rp->fetch_lock); 1252 1237 offset = vmf->pgoff << PAGE_SHIFT; 1253 - if (offset >= rp->b_size) { 1254 - mutex_unlock(&rp->fetch_lock); 1238 + if (offset >= rp->b_size) 1255 1239 return VM_FAULT_SIGBUS; 1256 - } 1257 1240 chunk_idx = offset / CHUNK_SIZE; 1258 1241 pageptr = rp->b_vec[chunk_idx].pg; 1259 1242 get_page(pageptr); 1260 - mutex_unlock(&rp->fetch_lock); 1261 1243 vmf->page = pageptr; 1262 1244 return 0; 1263 1245 }
+1 -1
drivers/usb/roles/class.c
··· 169 169 void usb_role_switch_put(struct usb_role_switch *sw) 170 170 { 171 171 if (!IS_ERR_OR_NULL(sw)) { 172 - put_device(&sw->dev); 173 172 module_put(sw->dev.parent->driver->owner); 173 + put_device(&sw->dev); 174 174 } 175 175 } 176 176 EXPORT_SYMBOL_GPL(usb_role_switch_put);
+6 -4
drivers/usb/serial/io_edgeport.c
··· 2901 2901 response = 0; 2902 2902 2903 2903 if (edge_serial->is_epic) { 2904 + struct usb_host_interface *alt; 2905 + 2906 + alt = serial->interface->cur_altsetting; 2907 + 2904 2908 /* EPIC thing, set up our interrupt polling now and our read 2905 2909 * urb, so that the device knows it really is connected. */ 2906 2910 interrupt_in_found = bulk_in_found = bulk_out_found = false; 2907 - for (i = 0; i < serial->interface->altsetting[0] 2908 - .desc.bNumEndpoints; ++i) { 2911 + for (i = 0; i < alt->desc.bNumEndpoints; ++i) { 2909 2912 struct usb_endpoint_descriptor *endpoint; 2910 2913 int buffer_size; 2911 2914 2912 - endpoint = &serial->interface->altsetting[0]. 2913 - endpoint[i].desc; 2915 + endpoint = &alt->endpoint[i].desc; 2914 2916 buffer_size = usb_endpoint_maxp(endpoint); 2915 2917 if (!interrupt_in_found && 2916 2918 (usb_endpoint_is_int_in(endpoint))) {
+2 -1
drivers/usb/storage/scsiglue.c
··· 135 135 * For such controllers we need to make sure the block layer sets 136 136 * up bounce buffers in addressable memory. 137 137 */ 138 - if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus))) 138 + if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) || 139 + (bus_to_hcd(us->pusb_dev->bus)->localmem_pool != NULL)) 139 140 blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH); 140 141 141 142 /*
+4 -2
drivers/usb/typec/class.c
··· 1612 1612 1613 1613 port->sw = typec_switch_get(&port->dev); 1614 1614 if (IS_ERR(port->sw)) { 1615 + ret = PTR_ERR(port->sw); 1615 1616 put_device(&port->dev); 1616 - return ERR_CAST(port->sw); 1617 + return ERR_PTR(ret); 1617 1618 } 1618 1619 1619 1620 port->mux = typec_mux_get(&port->dev, NULL); 1620 1621 if (IS_ERR(port->mux)) { 1622 + ret = PTR_ERR(port->mux); 1621 1623 put_device(&port->dev); 1622 - return ERR_CAST(port->mux); 1624 + return ERR_PTR(ret); 1623 1625 } 1624 1626 1625 1627 ret = device_add(&port->dev);