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

Pull USB fixes from Greg KH:
"Here is a number of USB gadget and other driver fixes for 4.18-rc3.

There's a bunch of them here, most of them being gadget driver and
xhci host controller fixes for reported issues (as normal), but there
are also some new device ids, and some fixes for the typec code.

There is an acpi core patch in here that was acked by the acpi
maintainer as it is needed for the typec fixes in order to properly
solve a problem in that driver.

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

* tag 'usb-4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
usb: chipidea: host: fix disconnection detect issue
usb: typec: tcpm: fix logbuffer index is wrong if _tcpm_log is re-entered
typec: tcpm: Fix a msecs vs jiffies bug
NFC: pn533: Fix wrong GFP flag usage
usb: cdc_acm: Add quirk for Uniden UBC125 scanner
staging/typec: fix tcpci_rt1711h build errors
usb: typec: ucsi: Fix for incorrect status data issue
usb: typec: ucsi: acpi: Workaround for cache mode issue
acpi: Add helper for deactivating memory region
usb: xhci: increase CRS timeout value
usb: xhci: tegra: fix runtime PM error handling
usb: xhci: remove the code build warning
xhci: Fix kernel oops in trace_xhci_free_virt_device
xhci: Fix perceived dead host due to runtime suspend race with event handler
dwc2: gadget: Fix ISOC IN DDMA PID bitfield value calculation
usb: gadget: dwc2: fix memory leak in gadget_init()
usb: gadget: composite: fix delayed_status race condition when set_interface
usb: dwc2: fix isoc split in transfer with no data
usb: dwc2: alloc dma aligned buffer for isoc split in
usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub
...

+373 -66
+1 -1
Documentation/usb/gadget_configfs.txt
··· 226 where <config name>.<number> specify the configuration and <function> is 227 a symlink to a function being removed from the configuration, e.g.: 228 229 - $ rm configfs/c.1/ncm.usb0 230 231 ... 232 ...
··· 226 where <config name>.<number> specify the configuration and <function> is 227 a symlink to a function being removed from the configuration, e.g.: 228 229 + $ rm configs/c.1/ncm.usb0 230 231 ... 232 ...
+72
drivers/acpi/osl.c
··· 45 #include <linux/uaccess.h> 46 #include <linux/io-64-nonatomic-lo-hi.h> 47 48 #include "internal.h" 49 50 #define _COMPONENT ACPI_OS_SERVICES ··· 1491 return acpi_check_resource_conflict(&res); 1492 } 1493 EXPORT_SYMBOL(acpi_check_region); 1494 1495 /* 1496 * Let drivers know whether the resource checks are effective
··· 45 #include <linux/uaccess.h> 46 #include <linux/io-64-nonatomic-lo-hi.h> 47 48 + #include "acpica/accommon.h" 49 + #include "acpica/acnamesp.h" 50 #include "internal.h" 51 52 #define _COMPONENT ACPI_OS_SERVICES ··· 1489 return acpi_check_resource_conflict(&res); 1490 } 1491 EXPORT_SYMBOL(acpi_check_region); 1492 + 1493 + static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level, 1494 + void *_res, void **return_value) 1495 + { 1496 + struct acpi_mem_space_context **mem_ctx; 1497 + union acpi_operand_object *handler_obj; 1498 + union acpi_operand_object *region_obj2; 1499 + union acpi_operand_object *region_obj; 1500 + struct resource *res = _res; 1501 + acpi_status status; 1502 + 1503 + region_obj = acpi_ns_get_attached_object(handle); 1504 + if (!region_obj) 1505 + return AE_OK; 1506 + 1507 + handler_obj = region_obj->region.handler; 1508 + if (!handler_obj) 1509 + return AE_OK; 1510 + 1511 + if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 1512 + return AE_OK; 1513 + 1514 + if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) 1515 + return AE_OK; 1516 + 1517 + region_obj2 = acpi_ns_get_secondary_object(region_obj); 1518 + if (!region_obj2) 1519 + return AE_OK; 1520 + 1521 + mem_ctx = (void *)&region_obj2->extra.region_context; 1522 + 1523 + if (!(mem_ctx[0]->address >= res->start && 1524 + mem_ctx[0]->address < res->end)) 1525 + return AE_OK; 1526 + 1527 + status = handler_obj->address_space.setup(region_obj, 1528 + ACPI_REGION_DEACTIVATE, 1529 + NULL, (void **)mem_ctx); 1530 + if (ACPI_SUCCESS(status)) 1531 + region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); 1532 + 1533 + return status; 1534 + } 1535 + 1536 + /** 1537 + * acpi_release_memory - Release any mappings done to a memory region 1538 + * @handle: Handle to namespace node 1539 + * @res: Memory resource 1540 + * @level: A level that terminates the search 1541 + * 1542 + * Walks through @handle and unmaps all SystemMemory Operation Regions that 1543 + * overlap with @res and that have already been activated (mapped). 1544 + * 1545 + * This is a helper that allows drivers to place special requirements on memory 1546 + * region that may overlap with operation regions, primarily allowing them to 1547 + * safely map the region as non-cached memory. 1548 + * 1549 + * The unmapped Operation Regions will be automatically remapped next time they 1550 + * are called, so the drivers do not need to do anything else. 1551 + */ 1552 + acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, 1553 + u32 level) 1554 + { 1555 + if (!(res->flags & IORESOURCE_MEM)) 1556 + return AE_TYPE; 1557 + 1558 + return acpi_walk_namespace(ACPI_TYPE_REGION, handle, level, 1559 + acpi_deactivate_mem_region, NULL, res, NULL); 1560 + } 1561 + EXPORT_SYMBOL_GPL(acpi_release_memory); 1562 1563 /* 1564 * Let drivers know whether the resource checks are effective
+2 -2
drivers/nfc/pn533/usb.c
··· 74 struct sk_buff *skb = NULL; 75 76 if (!urb->status) { 77 - skb = alloc_skb(urb->actual_length, GFP_KERNEL); 78 if (!skb) { 79 nfc_err(&phy->udev->dev, "failed to alloc memory\n"); 80 } else { ··· 186 187 if (dev->protocol_type == PN533_PROTO_REQ_RESP) { 188 /* request for response for sent packet directly */ 189 - rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC); 190 if (rc) 191 goto error; 192 } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {
··· 74 struct sk_buff *skb = NULL; 75 76 if (!urb->status) { 77 + skb = alloc_skb(urb->actual_length, GFP_ATOMIC); 78 if (!skb) { 79 nfc_err(&phy->udev->dev, "failed to alloc memory\n"); 80 } else { ··· 186 187 if (dev->protocol_type == PN533_PROTO_REQ_RESP) { 188 /* request for response for sent packet directly */ 189 + rc = pn533_submit_urb_for_response(phy, GFP_KERNEL); 190 if (rc) 191 goto error; 192 } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {
+1
drivers/staging/typec/Kconfig
··· 11 12 config TYPEC_RT1711H 13 tristate "Richtek RT1711H Type-C chip driver" 14 select TYPEC_TCPCI 15 help 16 Richtek RT1711H Type-C chip driver that works with
··· 11 12 config TYPEC_RT1711H 13 tristate "Richtek RT1711H Type-C chip driver" 14 + depends on I2C 15 select TYPEC_TCPCI 16 help 17 Richtek RT1711H Type-C chip driver that works with
+4 -1
drivers/usb/chipidea/host.c
··· 124 125 hcd->power_budget = ci->platdata->power_budget; 126 hcd->tpl_support = ci->platdata->tpl_support; 127 - if (ci->phy || ci->usb_phy) 128 hcd->skip_phy_initialization = 1; 129 130 ehci = hcd_to_ehci(hcd); 131 ehci->caps = ci->hw_bank.cap;
··· 124 125 hcd->power_budget = ci->platdata->power_budget; 126 hcd->tpl_support = ci->platdata->tpl_support; 127 + if (ci->phy || ci->usb_phy) { 128 hcd->skip_phy_initialization = 1; 129 + if (ci->usb_phy) 130 + hcd->usb_phy = ci->usb_phy; 131 + } 132 133 ehci = hcd_to_ehci(hcd); 134 ehci->caps = ci->hw_bank.cap;
+3
drivers/usb/class/cdc-acm.c
··· 1758 { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ 1759 .driver_info = SINGLE_RX_URB, 1760 }, 1761 { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ 1762 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1763 },
··· 1758 { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ 1759 .driver_info = SINGLE_RX_URB, 1760 }, 1761 + { USB_DEVICE(0x1965, 0x0018), /* Uniden UBC125XLT */ 1762 + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1763 + }, 1764 { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ 1765 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ 1766 },
+3
drivers/usb/dwc2/core.h
··· 1004 * @frame_list_sz: Frame list size 1005 * @desc_gen_cache: Kmem cache for generic descriptors 1006 * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors 1007 * 1008 * These are for peripheral mode: 1009 * ··· 1178 u32 frame_list_sz; 1179 struct kmem_cache *desc_gen_cache; 1180 struct kmem_cache *desc_hsisoc_cache; 1181 1182 #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ 1183
··· 1004 * @frame_list_sz: Frame list size 1005 * @desc_gen_cache: Kmem cache for generic descriptors 1006 * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors 1007 + * @unaligned_cache: Kmem cache for DMA mode to handle non-aligned buf 1008 * 1009 * These are for peripheral mode: 1010 * ··· 1177 u32 frame_list_sz; 1178 struct kmem_cache *desc_gen_cache; 1179 struct kmem_cache *desc_hsisoc_cache; 1180 + struct kmem_cache *unaligned_cache; 1181 + #define DWC2_KMEM_UNALIGNED_BUF_SIZE 1024 1182 1183 #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */ 1184
+12 -8
drivers/usb/dwc2/gadget.c
··· 812 u32 index; 813 u32 maxsize = 0; 814 u32 mask = 0; 815 816 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); 817 ··· 841 ((len << DEV_DMA_NBYTES_SHIFT) & mask)); 842 843 if (hs_ep->dir_in) { 844 - desc->status |= ((hs_ep->mc << DEV_DMA_ISOC_PID_SHIFT) & 845 DEV_DMA_ISOC_PID_MASK) | 846 ((len % hs_ep->ep.maxpacket) ? 847 DEV_DMA_SHORT : 0) | ··· 889 struct dwc2_dma_desc *desc; 890 891 if (list_empty(&hs_ep->queue)) { 892 dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); 893 return; 894 } ··· 2761 */ 2762 tmp = dwc2_hsotg_read_frameno(hsotg); 2763 2764 - dwc2_hsotg_complete_request(hsotg, ep, get_ep_head(ep), 0); 2765 - 2766 if (using_desc_dma(hsotg)) { 2767 if (ep->target_frame == TARGET_FRAME_INITIAL) { 2768 /* Start first ISO Out */ ··· 2821 2822 tmp = dwc2_hsotg_read_frameno(hsotg); 2823 if (using_desc_dma(hsotg)) { 2824 - dwc2_hsotg_complete_request(hsotg, hs_ep, 2825 - get_ep_head(hs_ep), 0); 2826 - 2827 hs_ep->target_frame = tmp; 2828 dwc2_gadget_incr_frame_num(hs_ep); 2829 dwc2_gadget_start_isoc_ddma(hs_ep); ··· 4740 } 4741 4742 ret = usb_add_gadget_udc(dev, &hsotg->gadget); 4743 - if (ret) 4744 return ret; 4745 - 4746 dwc2_hsotg_dump(hsotg); 4747 4748 return 0; ··· 4758 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) 4759 { 4760 usb_del_gadget_udc(&hsotg->gadget); 4761 4762 return 0; 4763 }
··· 812 u32 index; 813 u32 maxsize = 0; 814 u32 mask = 0; 815 + u8 pid = 0; 816 817 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask); 818 ··· 840 ((len << DEV_DMA_NBYTES_SHIFT) & mask)); 841 842 if (hs_ep->dir_in) { 843 + if (len) 844 + pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket); 845 + else 846 + pid = 1; 847 + desc->status |= ((pid << DEV_DMA_ISOC_PID_SHIFT) & 848 DEV_DMA_ISOC_PID_MASK) | 849 ((len % hs_ep->ep.maxpacket) ? 850 DEV_DMA_SHORT : 0) | ··· 884 struct dwc2_dma_desc *desc; 885 886 if (list_empty(&hs_ep->queue)) { 887 + hs_ep->target_frame = TARGET_FRAME_INITIAL; 888 dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__); 889 return; 890 } ··· 2755 */ 2756 tmp = dwc2_hsotg_read_frameno(hsotg); 2757 2758 if (using_desc_dma(hsotg)) { 2759 if (ep->target_frame == TARGET_FRAME_INITIAL) { 2760 /* Start first ISO Out */ ··· 2817 2818 tmp = dwc2_hsotg_read_frameno(hsotg); 2819 if (using_desc_dma(hsotg)) { 2820 hs_ep->target_frame = tmp; 2821 dwc2_gadget_incr_frame_num(hs_ep); 2822 dwc2_gadget_start_isoc_ddma(hs_ep); ··· 4739 } 4740 4741 ret = usb_add_gadget_udc(dev, &hsotg->gadget); 4742 + if (ret) { 4743 + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, 4744 + hsotg->ctrl_req); 4745 return ret; 4746 + } 4747 dwc2_hsotg_dump(hsotg); 4748 4749 return 0; ··· 4755 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg) 4756 { 4757 usb_del_gadget_udc(&hsotg->gadget); 4758 + dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req); 4759 4760 return 0; 4761 }
+87 -6
drivers/usb/dwc2/hcd.c
··· 1567 } 1568 1569 if (hsotg->params.host_dma) { 1570 - dwc2_writel((u32)chan->xfer_dma, 1571 - hsotg->regs + HCDMA(chan->hc_num)); 1572 if (dbg_hc(chan)) 1573 dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n", 1574 - (unsigned long)chan->xfer_dma, chan->hc_num); 1575 } 1576 1577 /* Start the split */ ··· 2634 } 2635 } 2636 2637 #define DWC2_USB_DMA_ALIGN 4 2638 2639 struct dma_aligned_buffer { ··· 2839 2840 /* Set the transfer attributes */ 2841 dwc2_hc_init_xfer(hsotg, chan, qtd); 2842 2843 if (chan->ep_type == USB_ENDPOINT_XFER_INT || 2844 chan->ep_type == USB_ENDPOINT_XFER_ISOC) ··· 5310 } 5311 } 5312 5313 hsotg->otg_port = 1; 5314 hsotg->frame_list = NULL; 5315 hsotg->frame_list_dma = 0; ··· 5357 return 0; 5358 5359 error4: 5360 - kmem_cache_destroy(hsotg->desc_gen_cache); 5361 kmem_cache_destroy(hsotg->desc_hsisoc_cache); 5362 error3: 5363 dwc2_hcd_release(hsotg); 5364 error2: ··· 5400 usb_remove_hcd(hcd); 5401 hsotg->priv = NULL; 5402 5403 - kmem_cache_destroy(hsotg->desc_gen_cache); 5404 kmem_cache_destroy(hsotg->desc_hsisoc_cache); 5405 5406 dwc2_hcd_release(hsotg); 5407 usb_put_hcd(hcd); ··· 5514 dwc2_writel(hprt0, hsotg->regs + HPRT0); 5515 5516 /* Wait for the HPRT0.PrtSusp register field to be set */ 5517 - if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300)) 5518 dev_warn(hsotg->dev, "Suspend wasn't generated\n"); 5519 5520 /* ··· 5694 __func__); 5695 return ret; 5696 } 5697 5698 hsotg->hibernated = 0; 5699 hsotg->bus_suspended = 0;
··· 1567 } 1568 1569 if (hsotg->params.host_dma) { 1570 + dma_addr_t dma_addr; 1571 + 1572 + if (chan->align_buf) { 1573 + if (dbg_hc(chan)) 1574 + dev_vdbg(hsotg->dev, "align_buf\n"); 1575 + dma_addr = chan->align_buf; 1576 + } else { 1577 + dma_addr = chan->xfer_dma; 1578 + } 1579 + dwc2_writel((u32)dma_addr, hsotg->regs + HCDMA(chan->hc_num)); 1580 + 1581 if (dbg_hc(chan)) 1582 dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n", 1583 + (unsigned long)dma_addr, chan->hc_num); 1584 } 1585 1586 /* Start the split */ ··· 2625 } 2626 } 2627 2628 + static int dwc2_alloc_split_dma_aligned_buf(struct dwc2_hsotg *hsotg, 2629 + struct dwc2_qh *qh, 2630 + struct dwc2_host_chan *chan) 2631 + { 2632 + if (!hsotg->unaligned_cache || 2633 + chan->max_packet > DWC2_KMEM_UNALIGNED_BUF_SIZE) 2634 + return -ENOMEM; 2635 + 2636 + if (!qh->dw_align_buf) { 2637 + qh->dw_align_buf = kmem_cache_alloc(hsotg->unaligned_cache, 2638 + GFP_ATOMIC | GFP_DMA); 2639 + if (!qh->dw_align_buf) 2640 + return -ENOMEM; 2641 + } 2642 + 2643 + qh->dw_align_buf_dma = dma_map_single(hsotg->dev, qh->dw_align_buf, 2644 + DWC2_KMEM_UNALIGNED_BUF_SIZE, 2645 + DMA_FROM_DEVICE); 2646 + 2647 + if (dma_mapping_error(hsotg->dev, qh->dw_align_buf_dma)) { 2648 + dev_err(hsotg->dev, "can't map align_buf\n"); 2649 + chan->align_buf = 0; 2650 + return -EINVAL; 2651 + } 2652 + 2653 + chan->align_buf = qh->dw_align_buf_dma; 2654 + return 0; 2655 + } 2656 + 2657 #define DWC2_USB_DMA_ALIGN 4 2658 2659 struct dma_aligned_buffer { ··· 2801 2802 /* Set the transfer attributes */ 2803 dwc2_hc_init_xfer(hsotg, chan, qtd); 2804 + 2805 + /* For non-dword aligned buffers */ 2806 + if (hsotg->params.host_dma && qh->do_split && 2807 + chan->ep_is_in && (chan->xfer_dma & 0x3)) { 2808 + dev_vdbg(hsotg->dev, "Non-aligned buffer\n"); 2809 + if (dwc2_alloc_split_dma_aligned_buf(hsotg, qh, chan)) { 2810 + dev_err(hsotg->dev, 2811 + "Failed to allocate memory to handle non-aligned buffer\n"); 2812 + /* Add channel back to free list */ 2813 + chan->align_buf = 0; 2814 + chan->multi_count = 0; 2815 + list_add_tail(&chan->hc_list_entry, 2816 + &hsotg->free_hc_list); 2817 + qtd->in_process = 0; 2818 + qh->channel = NULL; 2819 + return -ENOMEM; 2820 + } 2821 + } else { 2822 + /* 2823 + * We assume that DMA is always aligned in non-split 2824 + * case or split out case. Warn if not. 2825 + */ 2826 + WARN_ON_ONCE(hsotg->params.host_dma && 2827 + (chan->xfer_dma & 0x3)); 2828 + chan->align_buf = 0; 2829 + } 2830 2831 if (chan->ep_type == USB_ENDPOINT_XFER_INT || 2832 chan->ep_type == USB_ENDPOINT_XFER_ISOC) ··· 5246 } 5247 } 5248 5249 + if (hsotg->params.host_dma) { 5250 + /* 5251 + * Create kmem caches to handle non-aligned buffer 5252 + * in Buffer DMA mode. 5253 + */ 5254 + hsotg->unaligned_cache = kmem_cache_create("dwc2-unaligned-dma", 5255 + DWC2_KMEM_UNALIGNED_BUF_SIZE, 4, 5256 + SLAB_CACHE_DMA, NULL); 5257 + if (!hsotg->unaligned_cache) 5258 + dev_err(hsotg->dev, 5259 + "unable to create dwc2 unaligned cache\n"); 5260 + } 5261 + 5262 hsotg->otg_port = 1; 5263 hsotg->frame_list = NULL; 5264 hsotg->frame_list_dma = 0; ··· 5280 return 0; 5281 5282 error4: 5283 + kmem_cache_destroy(hsotg->unaligned_cache); 5284 kmem_cache_destroy(hsotg->desc_hsisoc_cache); 5285 + kmem_cache_destroy(hsotg->desc_gen_cache); 5286 error3: 5287 dwc2_hcd_release(hsotg); 5288 error2: ··· 5322 usb_remove_hcd(hcd); 5323 hsotg->priv = NULL; 5324 5325 + kmem_cache_destroy(hsotg->unaligned_cache); 5326 kmem_cache_destroy(hsotg->desc_hsisoc_cache); 5327 + kmem_cache_destroy(hsotg->desc_gen_cache); 5328 5329 dwc2_hcd_release(hsotg); 5330 usb_put_hcd(hcd); ··· 5435 dwc2_writel(hprt0, hsotg->regs + HPRT0); 5436 5437 /* Wait for the HPRT0.PrtSusp register field to be set */ 5438 + if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000)) 5439 dev_warn(hsotg->dev, "Suspend wasn't generated\n"); 5440 5441 /* ··· 5615 __func__); 5616 return ret; 5617 } 5618 + 5619 + dwc2_hcd_rem_wakeup(hsotg); 5620 5621 hsotg->hibernated = 0; 5622 hsotg->bus_suspended = 0;
+8
drivers/usb/dwc2/hcd.h
··· 76 * (micro)frame 77 * @xfer_buf: Pointer to current transfer buffer position 78 * @xfer_dma: DMA address of xfer_buf 79 * @xfer_len: Total number of bytes to transfer 80 * @xfer_count: Number of bytes transferred so far 81 * @start_pkt_count: Packet count at start of transfer ··· 135 136 u8 *xfer_buf; 137 dma_addr_t xfer_dma; 138 u32 xfer_len; 139 u32 xfer_count; 140 u16 start_pkt_count; ··· 305 * speed. Note that this is in "schedule slice" which 306 * is tightly packed. 307 * @ntd: Actual number of transfer descriptors in a list 308 * @qtd_list: List of QTDs for this QH 309 * @channel: Host channel currently processing transfers for this QH 310 * @qh_list_entry: Entry for QH in either the periodic or non-periodic ··· 356 struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; 357 u32 ls_start_schedule_slice; 358 u16 ntd; 359 struct list_head qtd_list; 360 struct dwc2_host_chan *channel; 361 struct list_head qh_list_entry;
··· 76 * (micro)frame 77 * @xfer_buf: Pointer to current transfer buffer position 78 * @xfer_dma: DMA address of xfer_buf 79 + * @align_buf: In Buffer DMA mode this will be used if xfer_buf is not 80 + * DWORD aligned 81 * @xfer_len: Total number of bytes to transfer 82 * @xfer_count: Number of bytes transferred so far 83 * @start_pkt_count: Packet count at start of transfer ··· 133 134 u8 *xfer_buf; 135 dma_addr_t xfer_dma; 136 + dma_addr_t align_buf; 137 u32 xfer_len; 138 u32 xfer_count; 139 u16 start_pkt_count; ··· 302 * speed. Note that this is in "schedule slice" which 303 * is tightly packed. 304 * @ntd: Actual number of transfer descriptors in a list 305 + * @dw_align_buf: Used instead of original buffer if its physical address 306 + * is not dword-aligned 307 + * @dw_align_buf_dma: DMA address for dw_align_buf 308 * @qtd_list: List of QTDs for this QH 309 * @channel: Host channel currently processing transfers for this QH 310 * @qh_list_entry: Entry for QH in either the periodic or non-periodic ··· 350 struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES]; 351 u32 ls_start_schedule_slice; 352 u16 ntd; 353 + u8 *dw_align_buf; 354 + dma_addr_t dw_align_buf_dma; 355 struct list_head qtd_list; 356 struct dwc2_host_chan *channel; 357 struct list_head qh_list_entry;
+9 -2
drivers/usb/dwc2/hcd_intr.c
··· 942 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; 943 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, 944 DWC2_HC_XFER_COMPLETE, NULL); 945 - if (!len) { 946 qtd->complete_split = 0; 947 - qtd->isoc_split_offset = 0; 948 return 0; 949 } 950 951 frame_desc->actual_length += len; 952 953 qtd->isoc_split_offset += len; 954
··· 942 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; 943 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd, 944 DWC2_HC_XFER_COMPLETE, NULL); 945 + if (!len && !qtd->isoc_split_offset) { 946 qtd->complete_split = 0; 947 return 0; 948 } 949 950 frame_desc->actual_length += len; 951 + 952 + if (chan->align_buf) { 953 + dev_vdbg(hsotg->dev, "non-aligned buffer\n"); 954 + dma_unmap_single(hsotg->dev, chan->qh->dw_align_buf_dma, 955 + DWC2_KMEM_UNALIGNED_BUF_SIZE, DMA_FROM_DEVICE); 956 + memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma), 957 + chan->qh->dw_align_buf, len); 958 + } 959 960 qtd->isoc_split_offset += len; 961
+4 -1
drivers/usb/dwc2/hcd_queue.c
··· 383 /* Get the map and adjust if this is a multi_tt hub */ 384 map = qh->dwc_tt->periodic_bitmaps; 385 if (qh->dwc_tt->usb_tt->multi) 386 - map += DWC2_ELEMENTS_PER_LS_BITMAP * qh->ttport; 387 388 return map; 389 } ··· 1696 1697 if (qh->desc_list) 1698 dwc2_hcd_qh_free_ddma(hsotg, qh); 1699 kfree(qh); 1700 } 1701
··· 383 /* Get the map and adjust if this is a multi_tt hub */ 384 map = qh->dwc_tt->periodic_bitmaps; 385 if (qh->dwc_tt->usb_tt->multi) 386 + map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1); 387 388 return map; 389 } ··· 1696 1697 if (qh->desc_list) 1698 dwc2_hcd_qh_free_ddma(hsotg, qh); 1699 + else if (hsotg->unaligned_cache && qh->dw_align_buf) 1700 + kmem_cache_free(hsotg->unaligned_cache, qh->dw_align_buf); 1701 + 1702 kfree(qh); 1703 } 1704
+13 -10
drivers/usb/dwc3/core.c
··· 1272 if (!dwc->clks) 1273 return -ENOMEM; 1274 1275 - dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); 1276 dwc->dev = dev; 1277 1278 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 1306 if (IS_ERR(dwc->reset)) 1307 return PTR_ERR(dwc->reset); 1308 1309 - ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); 1310 - if (ret == -EPROBE_DEFER) 1311 - return ret; 1312 - /* 1313 - * Clocks are optional, but new DT platforms should support all clocks 1314 - * as required by the DT-binding. 1315 - */ 1316 - if (ret) 1317 - dwc->num_clks = 0; 1318 1319 ret = reset_control_deassert(dwc->reset); 1320 if (ret)
··· 1272 if (!dwc->clks) 1273 return -ENOMEM; 1274 1275 dwc->dev = dev; 1276 1277 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ··· 1307 if (IS_ERR(dwc->reset)) 1308 return PTR_ERR(dwc->reset); 1309 1310 + if (dev->of_node) { 1311 + dwc->num_clks = ARRAY_SIZE(dwc3_core_clks); 1312 + 1313 + ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); 1314 + if (ret == -EPROBE_DEFER) 1315 + return ret; 1316 + /* 1317 + * Clocks are optional, but new DT platforms should support all 1318 + * clocks as required by the DT-binding. 1319 + */ 1320 + if (ret) 1321 + dwc->num_clks = 0; 1322 + } 1323 1324 ret = reset_control_deassert(dwc->reset); 1325 if (ret)
+2 -1
drivers/usb/dwc3/dwc3-of-simple.c
··· 165 166 reset_control_put(simple->resets); 167 168 - pm_runtime_put_sync(dev); 169 pm_runtime_disable(dev); 170 171 return 0; 172 }
··· 165 166 reset_control_put(simple->resets); 167 168 pm_runtime_disable(dev); 169 + pm_runtime_put_noidle(dev); 170 + pm_runtime_set_suspended(dev); 171 172 return 0; 173 }
+2
drivers/usb/dwc3/dwc3-pci.c
··· 34 #define PCI_DEVICE_ID_INTEL_GLK 0x31aa 35 #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee 36 #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e 37 38 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" 39 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 ··· 290 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, 291 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, 292 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, 293 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, 294 { } /* Terminating Entry */ 295 };
··· 34 #define PCI_DEVICE_ID_INTEL_GLK 0x31aa 35 #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee 36 #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e 37 + #define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee 38 39 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511" 40 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4 ··· 289 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), }, 290 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), }, 291 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), }, 292 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICLLP), }, 293 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, 294 { } /* Terminating Entry */ 295 };
+5 -8
drivers/usb/dwc3/dwc3-qcom.c
··· 490 qcom->dwc3 = of_find_device_by_node(dwc3_np); 491 if (!qcom->dwc3) { 492 dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); 493 goto depopulate; 494 } 495 ··· 548 return 0; 549 } 550 551 - #ifdef CONFIG_PM_SLEEP 552 - static int dwc3_qcom_pm_suspend(struct device *dev) 553 { 554 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 555 int ret = 0; ··· 560 return ret; 561 } 562 563 - static int dwc3_qcom_pm_resume(struct device *dev) 564 { 565 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 566 int ret; ··· 571 572 return ret; 573 } 574 - #endif 575 576 - #ifdef CONFIG_PM 577 - static int dwc3_qcom_runtime_suspend(struct device *dev) 578 { 579 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 580 581 return dwc3_qcom_suspend(qcom); 582 } 583 584 - static int dwc3_qcom_runtime_resume(struct device *dev) 585 { 586 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 587 588 return dwc3_qcom_resume(qcom); 589 } 590 - #endif 591 592 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { 593 SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume)
··· 490 qcom->dwc3 = of_find_device_by_node(dwc3_np); 491 if (!qcom->dwc3) { 492 dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); 493 + ret = -ENODEV; 494 goto depopulate; 495 } 496 ··· 547 return 0; 548 } 549 550 + static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) 551 { 552 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 553 int ret = 0; ··· 560 return ret; 561 } 562 563 + static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) 564 { 565 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 566 int ret; ··· 571 572 return ret; 573 } 574 575 + static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) 576 { 577 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 578 579 return dwc3_qcom_suspend(qcom); 580 } 581 582 + static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev) 583 { 584 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 585 586 return dwc3_qcom_resume(qcom); 587 } 588 589 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { 590 SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume)
+3
drivers/usb/gadget/composite.c
··· 1719 */ 1720 if (w_value && !f->get_alt) 1721 break; 1722 value = f->set_alt(f, w_index, w_value); 1723 if (value == USB_GADGET_DELAYED_STATUS) { 1724 DBG(cdev, ··· 1730 DBG(cdev, "delayed_status count %d\n", 1731 cdev->delayed_status); 1732 } 1733 break; 1734 case USB_REQ_GET_INTERFACE: 1735 if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
··· 1719 */ 1720 if (w_value && !f->get_alt) 1721 break; 1722 + 1723 + spin_lock(&cdev->lock); 1724 value = f->set_alt(f, w_index, w_value); 1725 if (value == USB_GADGET_DELAYED_STATUS) { 1726 DBG(cdev, ··· 1728 DBG(cdev, "delayed_status count %d\n", 1729 cdev->delayed_status); 1730 } 1731 + spin_unlock(&cdev->lock); 1732 break; 1733 case USB_REQ_GET_INTERFACE: 1734 if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
+18 -8
drivers/usb/gadget/function/f_fs.c
··· 215 216 struct mm_struct *mm; 217 struct work_struct work; 218 219 struct usb_ep *ep; 220 struct usb_request *req; ··· 1073 return 0; 1074 } 1075 1076 static int ffs_aio_cancel(struct kiocb *kiocb) 1077 { 1078 struct ffs_io_data *io_data = kiocb->private; 1079 - struct ffs_epfile *epfile = kiocb->ki_filp->private_data; 1080 int value; 1081 1082 ENTER(); 1083 1084 - spin_lock_irq(&epfile->ffs->eps_lock); 1085 - 1086 - if (likely(io_data && io_data->ep && io_data->req)) 1087 - value = usb_ep_dequeue(io_data->ep, io_data->req); 1088 - else 1089 value = -EINVAL; 1090 - 1091 - spin_unlock_irq(&epfile->ffs->eps_lock); 1092 1093 return value; 1094 }
··· 215 216 struct mm_struct *mm; 217 struct work_struct work; 218 + struct work_struct cancellation_work; 219 220 struct usb_ep *ep; 221 struct usb_request *req; ··· 1072 return 0; 1073 } 1074 1075 + static void ffs_aio_cancel_worker(struct work_struct *work) 1076 + { 1077 + struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, 1078 + cancellation_work); 1079 + 1080 + ENTER(); 1081 + 1082 + usb_ep_dequeue(io_data->ep, io_data->req); 1083 + } 1084 + 1085 static int ffs_aio_cancel(struct kiocb *kiocb) 1086 { 1087 struct ffs_io_data *io_data = kiocb->private; 1088 + struct ffs_data *ffs = io_data->ffs; 1089 int value; 1090 1091 ENTER(); 1092 1093 + if (likely(io_data && io_data->ep && io_data->req)) { 1094 + INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker); 1095 + queue_work(ffs->io_completion_wq, &io_data->cancellation_work); 1096 + value = -EINPROGRESS; 1097 + } else { 1098 value = -EINVAL; 1099 + } 1100 1101 return value; 1102 }
+2 -2
drivers/usb/host/xhci-mem.c
··· 886 887 dev = xhci->devs[slot_id]; 888 889 - trace_xhci_free_virt_device(dev); 890 - 891 xhci->dcbaa->dev_context_ptrs[slot_id] = 0; 892 if (!dev) 893 return; 894 895 if (dev->tt_info) 896 old_active_eps = dev->tt_info->active_eps;
··· 886 887 dev = xhci->devs[slot_id]; 888 889 xhci->dcbaa->dev_context_ptrs[slot_id] = 0; 890 if (!dev) 891 return; 892 + 893 + trace_xhci_free_virt_device(dev); 894 895 if (dev->tt_info) 896 old_active_eps = dev->tt_info->active_eps;
+3 -3
drivers/usb/host/xhci-tegra.c
··· 481 unsigned long mask; 482 unsigned int port; 483 bool idle, enable; 484 - int err; 485 486 memset(&rsp, 0, sizeof(rsp)); 487 ··· 1223 pm_runtime_disable(&pdev->dev); 1224 usb_put_hcd(tegra->hcd); 1225 disable_xusbc: 1226 - if (!&pdev->dev.pm_domain) 1227 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); 1228 disable_xusba: 1229 - if (!&pdev->dev.pm_domain) 1230 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); 1231 put_padctl: 1232 tegra_xusb_padctl_put(tegra->padctl);
··· 481 unsigned long mask; 482 unsigned int port; 483 bool idle, enable; 484 + int err = 0; 485 486 memset(&rsp, 0, sizeof(rsp)); 487 ··· 1223 pm_runtime_disable(&pdev->dev); 1224 usb_put_hcd(tegra->hcd); 1225 disable_xusbc: 1226 + if (!pdev->dev.pm_domain) 1227 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC); 1228 disable_xusba: 1229 + if (!pdev->dev.pm_domain) 1230 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA); 1231 put_padctl: 1232 tegra_xusb_padctl_put(tegra->padctl);
+31 -5
drivers/usb/host/xhci-trace.h
··· 171 TP_ARGS(ring, trb) 172 ); 173 174 DECLARE_EVENT_CLASS(xhci_log_virt_dev, 175 TP_PROTO(struct xhci_virt_device *vdev), 176 TP_ARGS(vdev), ··· 235 ); 236 237 DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, 238 - TP_PROTO(struct xhci_virt_device *vdev), 239 - TP_ARGS(vdev) 240 - ); 241 - 242 - DEFINE_EVENT(xhci_log_virt_dev, xhci_free_virt_device, 243 TP_PROTO(struct xhci_virt_device *vdev), 244 TP_ARGS(vdev) 245 );
··· 171 TP_ARGS(ring, trb) 172 ); 173 174 + DECLARE_EVENT_CLASS(xhci_log_free_virt_dev, 175 + TP_PROTO(struct xhci_virt_device *vdev), 176 + TP_ARGS(vdev), 177 + TP_STRUCT__entry( 178 + __field(void *, vdev) 179 + __field(unsigned long long, out_ctx) 180 + __field(unsigned long long, in_ctx) 181 + __field(u8, fake_port) 182 + __field(u8, real_port) 183 + __field(u16, current_mel) 184 + 185 + ), 186 + TP_fast_assign( 187 + __entry->vdev = vdev; 188 + __entry->in_ctx = (unsigned long long) vdev->in_ctx->dma; 189 + __entry->out_ctx = (unsigned long long) vdev->out_ctx->dma; 190 + __entry->fake_port = (u8) vdev->fake_port; 191 + __entry->real_port = (u8) vdev->real_port; 192 + __entry->current_mel = (u16) vdev->current_mel; 193 + ), 194 + TP_printk("vdev %p ctx %llx | %llx fake_port %d real_port %d current_mel %d", 195 + __entry->vdev, __entry->in_ctx, __entry->out_ctx, 196 + __entry->fake_port, __entry->real_port, __entry->current_mel 197 + ) 198 + ); 199 + 200 + DEFINE_EVENT(xhci_log_free_virt_dev, xhci_free_virt_device, 201 + TP_PROTO(struct xhci_virt_device *vdev), 202 + TP_ARGS(vdev) 203 + ); 204 + 205 DECLARE_EVENT_CLASS(xhci_log_virt_dev, 206 TP_PROTO(struct xhci_virt_device *vdev), 207 TP_ARGS(vdev), ··· 204 ); 205 206 DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, 207 TP_PROTO(struct xhci_virt_device *vdev), 208 TP_ARGS(vdev) 209 );
+43 -4
drivers/usb/host/xhci.c
··· 908 spin_unlock_irqrestore(&xhci->lock, flags); 909 } 910 911 /* 912 * Stop HC (not bus-specific) 913 * ··· 1044 */ 1045 int xhci_resume(struct xhci_hcd *xhci, bool hibernated) 1046 { 1047 - u32 command, temp = 0, status; 1048 struct usb_hcd *hcd = xhci_to_hcd(xhci); 1049 struct usb_hcd *secondary_hcd; 1050 int retval = 0; ··· 1078 command = readl(&xhci->op_regs->command); 1079 command |= CMD_CRS; 1080 writel(command, &xhci->op_regs->command); 1081 if (xhci_handshake(&xhci->op_regs->status, 1082 - STS_RESTORE, 0, 10 * 1000)) { 1083 xhci_warn(xhci, "WARN: xHC restore state timeout\n"); 1084 spin_unlock_irq(&xhci->lock); 1085 return -ETIMEDOUT; ··· 1174 done: 1175 if (retval == 0) { 1176 /* Resume root hubs only when have pending events. */ 1177 - status = readl(&xhci->op_regs->status); 1178 - if (status & STS_EINT) { 1179 usb_hcd_resume_root_hub(xhci->shared_hcd); 1180 usb_hcd_resume_root_hub(hcd); 1181 }
··· 908 spin_unlock_irqrestore(&xhci->lock, flags); 909 } 910 911 + static bool xhci_pending_portevent(struct xhci_hcd *xhci) 912 + { 913 + struct xhci_port **ports; 914 + int port_index; 915 + u32 status; 916 + u32 portsc; 917 + 918 + status = readl(&xhci->op_regs->status); 919 + if (status & STS_EINT) 920 + return true; 921 + /* 922 + * Checking STS_EINT is not enough as there is a lag between a change 923 + * bit being set and the Port Status Change Event that it generated 924 + * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. 925 + */ 926 + 927 + port_index = xhci->usb2_rhub.num_ports; 928 + ports = xhci->usb2_rhub.ports; 929 + while (port_index--) { 930 + portsc = readl(ports[port_index]->addr); 931 + if (portsc & PORT_CHANGE_MASK || 932 + (portsc & PORT_PLS_MASK) == XDEV_RESUME) 933 + return true; 934 + } 935 + port_index = xhci->usb3_rhub.num_ports; 936 + ports = xhci->usb3_rhub.ports; 937 + while (port_index--) { 938 + portsc = readl(ports[port_index]->addr); 939 + if (portsc & PORT_CHANGE_MASK || 940 + (portsc & PORT_PLS_MASK) == XDEV_RESUME) 941 + return true; 942 + } 943 + return false; 944 + } 945 + 946 /* 947 * Stop HC (not bus-specific) 948 * ··· 1009 */ 1010 int xhci_resume(struct xhci_hcd *xhci, bool hibernated) 1011 { 1012 + u32 command, temp = 0; 1013 struct usb_hcd *hcd = xhci_to_hcd(xhci); 1014 struct usb_hcd *secondary_hcd; 1015 int retval = 0; ··· 1043 command = readl(&xhci->op_regs->command); 1044 command |= CMD_CRS; 1045 writel(command, &xhci->op_regs->command); 1046 + /* 1047 + * Some controllers take up to 55+ ms to complete the controller 1048 + * restore so setting the timeout to 100ms. Xhci specification 1049 + * doesn't mention any timeout value. 1050 + */ 1051 if (xhci_handshake(&xhci->op_regs->status, 1052 + STS_RESTORE, 0, 100 * 1000)) { 1053 xhci_warn(xhci, "WARN: xHC restore state timeout\n"); 1054 spin_unlock_irq(&xhci->lock); 1055 return -ETIMEDOUT; ··· 1134 done: 1135 if (retval == 0) { 1136 /* Resume root hubs only when have pending events. */ 1137 + if (xhci_pending_portevent(xhci)) { 1138 usb_hcd_resume_root_hub(xhci->shared_hcd); 1139 usb_hcd_resume_root_hub(hcd); 1140 }
+4
drivers/usb/host/xhci.h
··· 382 #define PORT_PLC (1 << 22) 383 /* port configure error change - port failed to configure its link partner */ 384 #define PORT_CEC (1 << 23) 385 /* Cold Attach Status - xHC can set this bit to report device attached during 386 * Sx state. Warm port reset should be perfomed to clear this bit and move port 387 * to connected state.
··· 382 #define PORT_PLC (1 << 22) 383 /* port configure error change - port failed to configure its link partner */ 384 #define PORT_CEC (1 << 23) 385 + #define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ 386 + PORT_RC | PORT_PLC | PORT_CEC) 387 + 388 + 389 /* Cold Attach Status - xHC can set this bit to report device attached during 390 * Sx state. Warm port reset should be perfomed to clear this bit and move port 391 * to connected state.
+14
drivers/usb/serial/cp210x.c
··· 95 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ 96 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 97 { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ 98 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ 99 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ 100 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ ··· 115 { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ 116 { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ 117 { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ 118 { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ 119 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ 120 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ ··· 130 { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ 131 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ 132 { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ 133 { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ 134 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ 135 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ 136 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ ··· 142 { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ 143 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ 144 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 145 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ 146 { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ 147 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ 148 { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ 149 { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ 150 { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ 151 { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ 152 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 153 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 154 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ 155 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ 156 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ 157 { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ 158 { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */
··· 95 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ 96 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 97 { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */ 98 + { USB_DEVICE(0x10C4, 0x817C) }, /* CESINEL MEDCAL N Power Quality Monitor */ 99 + { USB_DEVICE(0x10C4, 0x817D) }, /* CESINEL MEDCAL NT Power Quality Monitor */ 100 + { USB_DEVICE(0x10C4, 0x817E) }, /* CESINEL MEDCAL S Power Quality Monitor */ 101 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ 102 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ 103 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ ··· 112 { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */ 113 { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */ 114 { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */ 115 + { USB_DEVICE(0x10C4, 0x82EF) }, /* CESINEL FALCO 6105 AC Power Supply */ 116 + { USB_DEVICE(0x10C4, 0x82F1) }, /* CESINEL MEDCAL EFD Earth Fault Detector */ 117 + { USB_DEVICE(0x10C4, 0x82F2) }, /* CESINEL MEDCAL ST Network Analyzer */ 118 { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */ 119 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */ 120 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ ··· 124 { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */ 125 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ 126 { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */ 127 + { USB_DEVICE(0x10C4, 0x851E) }, /* CESINEL MEDCAL PT Network Analyzer */ 128 { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */ 129 + { USB_DEVICE(0x10C4, 0x85B8) }, /* CESINEL ReCon T Energy Logger */ 130 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ 131 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ 132 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ ··· 134 { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ 135 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ 136 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 137 + { USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */ 138 + { USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */ 139 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ 140 { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */ 141 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */ 142 { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ 143 + { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ 144 { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ 145 { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ 146 { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ 147 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 148 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 149 + { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */ 150 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ 151 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ 152 + { USB_DEVICE(0x10C4, 0xEA7A) }, /* Silicon Labs Windows Update (CP2105) */ 153 + { USB_DEVICE(0x10C4, 0xEA7B) }, /* Silicon Labs Windows Update (CP2108) */ 154 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ 155 { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */ 156 { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */
+6 -4
drivers/usb/typec/tcpm.c
··· 418 u64 ts_nsec = local_clock(); 419 unsigned long rem_nsec; 420 421 if (!port->logbuffer[port->logbuffer_head]) { 422 port->logbuffer[port->logbuffer_head] = 423 kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL); 424 - if (!port->logbuffer[port->logbuffer_head]) 425 return; 426 } 427 428 vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); 429 - 430 - mutex_lock(&port->logbuffer_lock); 431 432 if (tcpm_log_full(port)) { 433 port->logbuffer_head = max(port->logbuffer_head - 1, 0); ··· 3044 tcpm_port_is_sink(port) && 3045 time_is_after_jiffies(port->delayed_runtime)) { 3046 tcpm_set_state(port, SNK_DISCOVERY, 3047 - port->delayed_runtime - jiffies); 3048 break; 3049 } 3050 tcpm_set_state(port, unattached_state(port), 0);
··· 418 u64 ts_nsec = local_clock(); 419 unsigned long rem_nsec; 420 421 + mutex_lock(&port->logbuffer_lock); 422 if (!port->logbuffer[port->logbuffer_head]) { 423 port->logbuffer[port->logbuffer_head] = 424 kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL); 425 + if (!port->logbuffer[port->logbuffer_head]) { 426 + mutex_unlock(&port->logbuffer_lock); 427 return; 428 + } 429 } 430 431 vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args); 432 433 if (tcpm_log_full(port)) { 434 port->logbuffer_head = max(port->logbuffer_head - 1, 0); ··· 3043 tcpm_port_is_sink(port) && 3044 time_is_after_jiffies(port->delayed_runtime)) { 3045 tcpm_set_state(port, SNK_DISCOVERY, 3046 + jiffies_to_msecs(port->delayed_runtime - 3047 + jiffies)); 3048 break; 3049 } 3050 tcpm_set_state(port, unattached_state(port), 0);
+13
drivers/usb/typec/ucsi/ucsi.c
··· 350 } 351 352 if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) { 353 if (con->status.connected) 354 ucsi_register_partner(con); 355 else
··· 350 } 351 352 if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) { 353 + typec_set_pwr_role(con->port, con->status.pwr_dir); 354 + 355 + switch (con->status.partner_type) { 356 + case UCSI_CONSTAT_PARTNER_TYPE_UFP: 357 + typec_set_data_role(con->port, TYPEC_HOST); 358 + break; 359 + case UCSI_CONSTAT_PARTNER_TYPE_DFP: 360 + typec_set_data_role(con->port, TYPEC_DEVICE); 361 + break; 362 + default: 363 + break; 364 + } 365 + 366 if (con->status.connected) 367 ucsi_register_partner(con); 368 else
+5
drivers/usb/typec/ucsi/ucsi_acpi.c
··· 79 return -ENODEV; 80 } 81 82 /* 83 * NOTE: The memory region for the data structures is used also in an 84 * operation region, which means ACPI has already reserved it. Therefore
··· 79 return -ENODEV; 80 } 81 82 + /* This will make sure we can use ioremap_nocache() */ 83 + status = acpi_release_memory(ACPI_HANDLE(&pdev->dev), res, 1); 84 + if (ACPI_FAILURE(status)) 85 + return -ENOMEM; 86 + 87 /* 88 * NOTE: The memory region for the data structures is used also in an 89 * operation region, which means ACPI has already reserved it. Therefore
+3
include/linux/acpi.h
··· 443 int acpi_check_region(resource_size_t start, resource_size_t n, 444 const char *name); 445 446 int acpi_resources_are_enforced(void); 447 448 #ifdef CONFIG_HIBERNATION
··· 443 int acpi_check_region(resource_size_t start, resource_size_t n, 444 const char *name); 445 446 + acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, 447 + u32 level); 448 + 449 int acpi_resources_are_enforced(void); 450 451 #ifdef CONFIG_HIBERNATION