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

Pull USB fixes from Greg KH:
"Here's a round of USB fixes for 4.0-rc3.

Nothing major, the usual gadget, xhci and usb-serial fixes and a few
new device ids as well.

All have been in linux-next successfully"

* tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
xhci: Workaround for PME stuck issues in Intel xhci
xhci: fix reporting of 0-sized URBs in control endpoint
usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards
USB: ch341: set tty baud speed according to tty struct
USB: serial: cp210x: Adding Seletek device id's
USB: pl2303: disable break on shutdown
USB: mxuport: fix null deref when used as a console
USB: serial: clean up bus probe error handling
USB: serial: fix port attribute-creation race
USB: serial: fix tty-device error handling at probe
USB: serial: fix potential use-after-free after failed probe
USB: console: add dummy __module_get
USB: ftdi_sio: add PIDs for Actisense USB devices
Revert "USB: serial: make bulk_out_size a lower limit"
cdc-acm: Add support for Denso cradle CU-321
usb-storage: support for more than 8 LUNs
uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539
USB: usbfs: don't leak kernel data in siginfo
xhci: Clear the host side toggle manually when endpoint is 'soft reset'
xhci: Allocate correct amount of scratchpad buffers
...

+375 -110
+2
drivers/usb/class/cdc-acm.c
··· 1650 1650 1651 1651 static const struct usb_device_id acm_ids[] = { 1652 1652 /* quirky and broken devices */ 1653 + { USB_DEVICE(0x076d, 0x0006), /* Denso Cradle CU-321 */ 1654 + .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */ 1653 1655 { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */ 1654 1656 .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */ 1655 1657 { USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */
+2
drivers/usb/core/devio.c
··· 501 501 as->status = urb->status; 502 502 signr = as->signr; 503 503 if (signr) { 504 + memset(&sinfo, 0, sizeof(sinfo)); 504 505 sinfo.si_signo = as->signr; 505 506 sinfo.si_errno = as->status; 506 507 sinfo.si_code = SI_ASYNCIO; ··· 2383 2382 wake_up_all(&ps->wait); 2384 2383 list_del_init(&ps->list); 2385 2384 if (ps->discsignr) { 2385 + memset(&sinfo, 0, sizeof(sinfo)); 2386 2386 sinfo.si_signo = ps->discsignr; 2387 2387 sinfo.si_errno = EPIPE; 2388 2388 sinfo.si_code = SI_ASYNCIO;
+28 -2
drivers/usb/dwc3/dwc3-omap.c
··· 205 205 omap->irq0_offset, value); 206 206 } 207 207 208 + static void dwc3_omap_write_irqmisc_clr(struct dwc3_omap *omap, u32 value) 209 + { 210 + dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_MISC + 211 + omap->irqmisc_offset, value); 212 + } 213 + 214 + static void dwc3_omap_write_irq0_clr(struct dwc3_omap *omap, u32 value) 215 + { 216 + dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_0 - 217 + omap->irq0_offset, value); 218 + } 219 + 208 220 static void dwc3_omap_set_mailbox(struct dwc3_omap *omap, 209 221 enum omap_dwc3_vbus_id_status status) 210 222 { ··· 357 345 358 346 static void dwc3_omap_disable_irqs(struct dwc3_omap *omap) 359 347 { 348 + u32 reg; 349 + 360 350 /* disable all IRQs */ 361 - dwc3_omap_write_irqmisc_set(omap, 0x00); 362 - dwc3_omap_write_irq0_set(omap, 0x00); 351 + reg = USBOTGSS_IRQO_COREIRQ_ST; 352 + dwc3_omap_write_irq0_clr(omap, reg); 353 + 354 + reg = (USBOTGSS_IRQMISC_OEVT | 355 + USBOTGSS_IRQMISC_DRVVBUS_RISE | 356 + USBOTGSS_IRQMISC_CHRGVBUS_RISE | 357 + USBOTGSS_IRQMISC_DISCHRGVBUS_RISE | 358 + USBOTGSS_IRQMISC_IDPULLUP_RISE | 359 + USBOTGSS_IRQMISC_DRVVBUS_FALL | 360 + USBOTGSS_IRQMISC_CHRGVBUS_FALL | 361 + USBOTGSS_IRQMISC_DISCHRGVBUS_FALL | 362 + USBOTGSS_IRQMISC_IDPULLUP_FALL); 363 + 364 + dwc3_omap_write_irqmisc_clr(omap, reg); 363 365 } 364 366 365 367 static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32);
-2
drivers/usb/gadget/configfs.c
··· 1161 1161 if (desc->opts_mutex) 1162 1162 mutex_lock(desc->opts_mutex); 1163 1163 memcpy(desc->ext_compat_id, page, l); 1164 - desc->ext_compat_id[l] = '\0'; 1165 1164 1166 1165 if (desc->opts_mutex) 1167 1166 mutex_unlock(desc->opts_mutex); ··· 1191 1192 if (desc->opts_mutex) 1192 1193 mutex_lock(desc->opts_mutex); 1193 1194 memcpy(desc->ext_compat_id + 8, page, l); 1194 - desc->ext_compat_id[l + 8] = '\0'; 1195 1195 1196 1196 if (desc->opts_mutex) 1197 1197 mutex_unlock(desc->opts_mutex);
+1 -1
drivers/usb/gadget/function/f_hid.c
··· 569 569 return status; 570 570 } 571 571 572 - const struct file_operations f_hidg_fops = { 572 + static const struct file_operations f_hidg_fops = { 573 573 .owner = THIS_MODULE, 574 574 .open = f_hidg_open, 575 575 .release = f_hidg_release,
+4 -1
drivers/usb/gadget/function/f_phonet.c
··· 417 417 return -EINVAL; 418 418 419 419 spin_lock(&port->lock); 420 - __pn_reset(f); 420 + 421 + if (fp->in_ep->driver_data) 422 + __pn_reset(f); 423 + 421 424 if (alt == 1) { 422 425 int i; 423 426
+2 -2
drivers/usb/gadget/function/f_sourcesink.c
··· 344 344 .bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL), 345 345 }; 346 346 347 - struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = { 347 + static struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = { 348 348 .bLength = USB_DT_SS_EP_COMP_SIZE, 349 349 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, 350 350 ··· 362 362 .bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL), 363 363 }; 364 364 365 - struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = { 365 + static struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = { 366 366 .bLength = USB_DT_SS_EP_COMP_SIZE, 367 367 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, 368 368
+17 -17
drivers/usb/gadget/function/f_uac2.c
··· 54 54 #define UNFLW_CTRL 8 55 55 #define OVFLW_CTRL 10 56 56 57 - const char *uac2_name = "snd_uac2"; 57 + static const char *uac2_name = "snd_uac2"; 58 58 59 59 struct uac2_req { 60 60 struct uac2_rtd_params *pp; /* parent param */ ··· 634 634 }; 635 635 636 636 /* Clock source for IN traffic */ 637 - struct uac_clock_source_descriptor in_clk_src_desc = { 637 + static struct uac_clock_source_descriptor in_clk_src_desc = { 638 638 .bLength = sizeof in_clk_src_desc, 639 639 .bDescriptorType = USB_DT_CS_INTERFACE, 640 640 ··· 646 646 }; 647 647 648 648 /* Clock source for OUT traffic */ 649 - struct uac_clock_source_descriptor out_clk_src_desc = { 649 + static struct uac_clock_source_descriptor out_clk_src_desc = { 650 650 .bLength = sizeof out_clk_src_desc, 651 651 .bDescriptorType = USB_DT_CS_INTERFACE, 652 652 ··· 658 658 }; 659 659 660 660 /* Input Terminal for USB_OUT */ 661 - struct uac2_input_terminal_descriptor usb_out_it_desc = { 661 + static struct uac2_input_terminal_descriptor usb_out_it_desc = { 662 662 .bLength = sizeof usb_out_it_desc, 663 663 .bDescriptorType = USB_DT_CS_INTERFACE, 664 664 ··· 672 672 }; 673 673 674 674 /* Input Terminal for I/O-In */ 675 - struct uac2_input_terminal_descriptor io_in_it_desc = { 675 + static struct uac2_input_terminal_descriptor io_in_it_desc = { 676 676 .bLength = sizeof io_in_it_desc, 677 677 .bDescriptorType = USB_DT_CS_INTERFACE, 678 678 ··· 686 686 }; 687 687 688 688 /* Ouput Terminal for USB_IN */ 689 - struct uac2_output_terminal_descriptor usb_in_ot_desc = { 689 + static struct uac2_output_terminal_descriptor usb_in_ot_desc = { 690 690 .bLength = sizeof usb_in_ot_desc, 691 691 .bDescriptorType = USB_DT_CS_INTERFACE, 692 692 ··· 700 700 }; 701 701 702 702 /* Ouput Terminal for I/O-Out */ 703 - struct uac2_output_terminal_descriptor io_out_ot_desc = { 703 + static struct uac2_output_terminal_descriptor io_out_ot_desc = { 704 704 .bLength = sizeof io_out_ot_desc, 705 705 .bDescriptorType = USB_DT_CS_INTERFACE, 706 706 ··· 713 713 .bmControls = (CONTROL_RDWR << COPY_CTRL), 714 714 }; 715 715 716 - struct uac2_ac_header_descriptor ac_hdr_desc = { 716 + static struct uac2_ac_header_descriptor ac_hdr_desc = { 717 717 .bLength = sizeof ac_hdr_desc, 718 718 .bDescriptorType = USB_DT_CS_INTERFACE, 719 719 ··· 751 751 }; 752 752 753 753 /* Audio Stream OUT Intface Desc */ 754 - struct uac2_as_header_descriptor as_out_hdr_desc = { 754 + static struct uac2_as_header_descriptor as_out_hdr_desc = { 755 755 .bLength = sizeof as_out_hdr_desc, 756 756 .bDescriptorType = USB_DT_CS_INTERFACE, 757 757 ··· 764 764 }; 765 765 766 766 /* Audio USB_OUT Format */ 767 - struct uac2_format_type_i_descriptor as_out_fmt1_desc = { 767 + static struct uac2_format_type_i_descriptor as_out_fmt1_desc = { 768 768 .bLength = sizeof as_out_fmt1_desc, 769 769 .bDescriptorType = USB_DT_CS_INTERFACE, 770 770 .bDescriptorSubtype = UAC_FORMAT_TYPE, ··· 772 772 }; 773 773 774 774 /* STD AS ISO OUT Endpoint */ 775 - struct usb_endpoint_descriptor fs_epout_desc = { 775 + static struct usb_endpoint_descriptor fs_epout_desc = { 776 776 .bLength = USB_DT_ENDPOINT_SIZE, 777 777 .bDescriptorType = USB_DT_ENDPOINT, 778 778 ··· 782 782 .bInterval = 1, 783 783 }; 784 784 785 - struct usb_endpoint_descriptor hs_epout_desc = { 785 + static struct usb_endpoint_descriptor hs_epout_desc = { 786 786 .bLength = USB_DT_ENDPOINT_SIZE, 787 787 .bDescriptorType = USB_DT_ENDPOINT, 788 788 ··· 828 828 }; 829 829 830 830 /* Audio Stream IN Intface Desc */ 831 - struct uac2_as_header_descriptor as_in_hdr_desc = { 831 + static struct uac2_as_header_descriptor as_in_hdr_desc = { 832 832 .bLength = sizeof as_in_hdr_desc, 833 833 .bDescriptorType = USB_DT_CS_INTERFACE, 834 834 ··· 841 841 }; 842 842 843 843 /* Audio USB_IN Format */ 844 - struct uac2_format_type_i_descriptor as_in_fmt1_desc = { 844 + static struct uac2_format_type_i_descriptor as_in_fmt1_desc = { 845 845 .bLength = sizeof as_in_fmt1_desc, 846 846 .bDescriptorType = USB_DT_CS_INTERFACE, 847 847 .bDescriptorSubtype = UAC_FORMAT_TYPE, ··· 849 849 }; 850 850 851 851 /* STD AS ISO IN Endpoint */ 852 - struct usb_endpoint_descriptor fs_epin_desc = { 852 + static struct usb_endpoint_descriptor fs_epin_desc = { 853 853 .bLength = USB_DT_ENDPOINT_SIZE, 854 854 .bDescriptorType = USB_DT_ENDPOINT, 855 855 ··· 859 859 .bInterval = 1, 860 860 }; 861 861 862 - struct usb_endpoint_descriptor hs_epin_desc = { 862 + static struct usb_endpoint_descriptor hs_epin_desc = { 863 863 .bLength = USB_DT_ENDPOINT_SIZE, 864 864 .bDescriptorType = USB_DT_ENDPOINT, 865 865 ··· 1563 1563 agdev->out_ep->driver_data = NULL; 1564 1564 } 1565 1565 1566 - struct usb_function *afunc_alloc(struct usb_function_instance *fi) 1566 + static struct usb_function *afunc_alloc(struct usb_function_instance *fi) 1567 1567 { 1568 1568 struct audio_dev *agdev; 1569 1569 struct f_uac2_opts *opts;
+1
drivers/usb/gadget/function/uvc_v4l2.c
··· 27 27 #include "uvc.h" 28 28 #include "uvc_queue.h" 29 29 #include "uvc_video.h" 30 + #include "uvc_v4l2.h" 30 31 31 32 /* -------------------------------------------------------------------------- 32 33 * Requests handling
+1
drivers/usb/gadget/function/uvc_video.c
··· 21 21 22 22 #include "uvc.h" 23 23 #include "uvc_queue.h" 24 + #include "uvc_video.h" 24 25 25 26 /* -------------------------------------------------------------------------- 26 27 * Video codecs
+4 -2
drivers/usb/gadget/legacy/g_ffs.c
··· 133 133 struct usb_configuration c; 134 134 int (*eth)(struct usb_configuration *c); 135 135 int num; 136 - } gfs_configurations[] = { 136 + }; 137 + 138 + static struct gfs_configuration gfs_configurations[] = { 137 139 #ifdef CONFIG_USB_FUNCTIONFS_RNDIS 138 140 { 139 141 .eth = bind_rndis_config, ··· 280 278 if (!try_module_get(THIS_MODULE)) 281 279 return ERR_PTR(-ENOENT); 282 280 283 - return 0; 281 + return NULL; 284 282 } 285 283 286 284 static void functionfs_release_dev(struct ffs_dev *dev)
+30
drivers/usb/host/xhci-pci.c
··· 37 37 38 38 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31 39 39 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31 40 + #define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5 41 + #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f 42 + #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2f 40 43 41 44 static const char hcd_name[] = "xhci_hcd"; 42 45 ··· 136 133 pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) { 137 134 xhci->quirks |= XHCI_SPURIOUS_REBOOT; 138 135 } 136 + if (pdev->vendor == PCI_VENDOR_ID_INTEL && 137 + (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || 138 + pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || 139 + pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI)) { 140 + xhci->quirks |= XHCI_PME_STUCK_QUIRK; 141 + } 139 142 if (pdev->vendor == PCI_VENDOR_ID_ETRON && 140 143 pdev->device == PCI_DEVICE_ID_EJ168) { 141 144 xhci->quirks |= XHCI_RESET_ON_RESUME; ··· 166 157 if (xhci->quirks & XHCI_RESET_ON_RESUME) 167 158 xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, 168 159 "QUIRK: Resetting on resume"); 160 + } 161 + 162 + /* 163 + * Make sure PME works on some Intel xHCI controllers by writing 1 to clear 164 + * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4 165 + */ 166 + static void xhci_pme_quirk(struct xhci_hcd *xhci) 167 + { 168 + u32 val; 169 + void __iomem *reg; 170 + 171 + reg = (void __iomem *) xhci->cap_regs + 0x80a4; 172 + val = readl(reg); 173 + writel(val | BIT(28), reg); 174 + readl(reg); 169 175 } 170 176 171 177 /* called during probe() after chip reset completes */ ··· 307 283 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 308 284 pdev->no_d3cold = true; 309 285 286 + if (xhci->quirks & XHCI_PME_STUCK_QUIRK) 287 + xhci_pme_quirk(xhci); 288 + 310 289 return xhci_suspend(xhci, do_wakeup); 311 290 } 312 291 ··· 339 312 340 313 if (pdev->vendor == PCI_VENDOR_ID_INTEL) 341 314 usb_enable_intel_xhci_ports(pdev); 315 + 316 + if (xhci->quirks & XHCI_PME_STUCK_QUIRK) 317 + xhci_pme_quirk(xhci); 342 318 343 319 retval = xhci_resume(xhci, hibernated); 344 320 return retval;
+9 -10
drivers/usb/host/xhci-plat.c
··· 83 83 if (irq < 0) 84 84 return -ENODEV; 85 85 86 - 87 - if (of_device_is_compatible(pdev->dev.of_node, 88 - "marvell,armada-375-xhci") || 89 - of_device_is_compatible(pdev->dev.of_node, 90 - "marvell,armada-380-xhci")) { 91 - ret = xhci_mvebu_mbus_init_quirk(pdev); 92 - if (ret) 93 - return ret; 94 - } 95 - 96 86 /* Initialize dma_mask and coherent_dma_mask to 32-bits */ 97 87 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); 98 88 if (ret) ··· 115 125 ret = clk_prepare_enable(clk); 116 126 if (ret) 117 127 goto put_hcd; 128 + } 129 + 130 + if (of_device_is_compatible(pdev->dev.of_node, 131 + "marvell,armada-375-xhci") || 132 + of_device_is_compatible(pdev->dev.of_node, 133 + "marvell,armada-380-xhci")) { 134 + ret = xhci_mvebu_mbus_init_quirk(pdev); 135 + if (ret) 136 + goto disable_clk; 118 137 } 119 138 120 139 ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
+9 -3
drivers/usb/host/xhci-ring.c
··· 1729 1729 if (!command) 1730 1730 return; 1731 1731 1732 - ep->ep_state |= EP_HALTED; 1732 + ep->ep_state |= EP_HALTED | EP_RECENTLY_HALTED; 1733 1733 ep->stopped_stream = stream_id; 1734 1734 1735 1735 xhci_queue_reset_ep(xhci, command, slot_id, ep_index); ··· 1946 1946 if (event_trb != ep_ring->dequeue) { 1947 1947 /* The event was for the status stage */ 1948 1948 if (event_trb == td->last_trb) { 1949 - if (td->urb->actual_length != 0) { 1949 + if (td->urb_length_set) { 1950 1950 /* Don't overwrite a previously set error code 1951 1951 */ 1952 1952 if ((*status == -EINPROGRESS || *status == 0) && ··· 1960 1960 td->urb->transfer_buffer_length; 1961 1961 } 1962 1962 } else { 1963 - /* Maybe the event was for the data stage? */ 1963 + /* 1964 + * Maybe the event was for the data stage? If so, update 1965 + * already the actual_length of the URB and flag it as 1966 + * set, so that it is not overwritten in the event for 1967 + * the last TRB. 1968 + */ 1969 + td->urb_length_set = true; 1964 1970 td->urb->actual_length = 1965 1971 td->urb->transfer_buffer_length - 1966 1972 EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
+91 -9
drivers/usb/host/xhci.c
··· 1338 1338 goto exit; 1339 1339 } 1340 1340 1341 + /* Reject urb if endpoint is in soft reset, queue must stay empty */ 1342 + if (xhci->devs[slot_id]->eps[ep_index].ep_state & EP_CONFIG_PENDING) { 1343 + xhci_warn(xhci, "Can't enqueue URB while ep is in soft reset\n"); 1344 + ret = -EINVAL; 1345 + } 1346 + 1341 1347 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) 1342 1348 size = urb->number_of_packets; 1343 1349 else ··· 2954 2948 } 2955 2949 } 2956 2950 2957 - /* Called when clearing halted device. The core should have sent the control 2951 + /* Called after clearing a halted device. USB core should have sent the control 2958 2952 * message to clear the device halt condition. The host side of the halt should 2959 - * already be cleared with a reset endpoint command issued when the STALL tx 2960 - * event was received. 2961 - * 2962 - * Context: in_interrupt 2953 + * already be cleared with a reset endpoint command issued immediately when the 2954 + * STALL tx event was received. 2963 2955 */ 2964 2956 2965 2957 void xhci_endpoint_reset(struct usb_hcd *hcd, 2966 2958 struct usb_host_endpoint *ep) 2967 2959 { 2968 2960 struct xhci_hcd *xhci; 2961 + struct usb_device *udev; 2962 + struct xhci_virt_device *virt_dev; 2963 + struct xhci_virt_ep *virt_ep; 2964 + struct xhci_input_control_ctx *ctrl_ctx; 2965 + struct xhci_command *command; 2966 + unsigned int ep_index, ep_state; 2967 + unsigned long flags; 2968 + u32 ep_flag; 2969 2969 2970 2970 xhci = hcd_to_xhci(hcd); 2971 + udev = (struct usb_device *) ep->hcpriv; 2972 + if (!ep->hcpriv) 2973 + return; 2974 + virt_dev = xhci->devs[udev->slot_id]; 2975 + ep_index = xhci_get_endpoint_index(&ep->desc); 2976 + virt_ep = &virt_dev->eps[ep_index]; 2977 + ep_state = virt_ep->ep_state; 2971 2978 2972 2979 /* 2973 - * We might need to implement the config ep cmd in xhci 4.8.1 note: 2980 + * Implement the config ep command in xhci 4.6.8 additional note: 2974 2981 * The Reset Endpoint Command may only be issued to endpoints in the 2975 2982 * Halted state. If software wishes reset the Data Toggle or Sequence 2976 2983 * Number of an endpoint that isn't in the Halted state, then software ··· 2991 2972 * for the target endpoint. that is in the Stopped state. 2992 2973 */ 2993 2974 2994 - /* For now just print debug to follow the situation */ 2995 - xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n", 2996 - ep->desc.bEndpointAddress); 2975 + if (ep_state & SET_DEQ_PENDING || ep_state & EP_RECENTLY_HALTED) { 2976 + virt_ep->ep_state &= ~EP_RECENTLY_HALTED; 2977 + xhci_dbg(xhci, "ep recently halted, no toggle reset needed\n"); 2978 + return; 2979 + } 2980 + 2981 + /* Only interrupt and bulk ep's use Data toggle, USB2 spec 5.5.4-> */ 2982 + if (usb_endpoint_xfer_control(&ep->desc) || 2983 + usb_endpoint_xfer_isoc(&ep->desc)) 2984 + return; 2985 + 2986 + ep_flag = xhci_get_endpoint_flag(&ep->desc); 2987 + 2988 + if (ep_flag == SLOT_FLAG || ep_flag == EP0_FLAG) 2989 + return; 2990 + 2991 + command = xhci_alloc_command(xhci, true, true, GFP_NOWAIT); 2992 + if (!command) { 2993 + xhci_err(xhci, "Could not allocate xHCI command structure.\n"); 2994 + return; 2995 + } 2996 + 2997 + spin_lock_irqsave(&xhci->lock, flags); 2998 + 2999 + /* block ringing ep doorbell */ 3000 + virt_ep->ep_state |= EP_CONFIG_PENDING; 3001 + 3002 + /* 3003 + * Make sure endpoint ring is empty before resetting the toggle/seq. 3004 + * Driver is required to synchronously cancel all transfer request. 3005 + * 3006 + * xhci 4.6.6 says we can issue a configure endpoint command on a 3007 + * running endpoint ring as long as it's idle (queue empty) 3008 + */ 3009 + 3010 + if (!list_empty(&virt_ep->ring->td_list)) { 3011 + dev_err(&udev->dev, "EP not empty, refuse reset\n"); 3012 + spin_unlock_irqrestore(&xhci->lock, flags); 3013 + goto cleanup; 3014 + } 3015 + 3016 + xhci_dbg(xhci, "Reset toggle/seq for slot %d, ep_index: %d\n", 3017 + udev->slot_id, ep_index); 3018 + 3019 + ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); 3020 + if (!ctrl_ctx) { 3021 + xhci_err(xhci, "Could not get input context, bad type. virt_dev: %p, in_ctx %p\n", 3022 + virt_dev, virt_dev->in_ctx); 3023 + spin_unlock_irqrestore(&xhci->lock, flags); 3024 + goto cleanup; 3025 + } 3026 + xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx, 3027 + virt_dev->out_ctx, ctrl_ctx, 3028 + ep_flag, ep_flag); 3029 + xhci_endpoint_copy(xhci, command->in_ctx, virt_dev->out_ctx, ep_index); 3030 + 3031 + xhci_queue_configure_endpoint(xhci, command, command->in_ctx->dma, 3032 + udev->slot_id, false); 3033 + xhci_ring_cmd_db(xhci); 3034 + spin_unlock_irqrestore(&xhci->lock, flags); 3035 + 3036 + wait_for_completion(command->completion); 3037 + 3038 + cleanup: 3039 + virt_ep->ep_state &= ~EP_CONFIG_PENDING; 3040 + xhci_free_command(xhci, command); 2997 3041 } 2998 3042 2999 3043 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
+9 -2
drivers/usb/host/xhci.h
··· 1 + 1 2 /* 2 3 * xHCI host controller driver 3 4 * ··· 89 88 #define HCS_IST(p) (((p) >> 0) & 0xf) 90 89 /* bits 4:7, max number of Event Ring segments */ 91 90 #define HCS_ERST_MAX(p) (((p) >> 4) & 0xf) 91 + /* bits 21:25 Hi 5 bits of Scratchpad buffers SW must allocate for the HW */ 92 92 /* bit 26 Scratchpad restore - for save/restore HW state - not used yet */ 93 - /* bits 27:31 number of Scratchpad buffers SW must allocate for the HW */ 94 - #define HCS_MAX_SCRATCHPAD(p) (((p) >> 27) & 0x1f) 93 + /* bits 27:31 Lo 5 bits of Scratchpad buffers SW must allocate for the HW */ 94 + #define HCS_MAX_SCRATCHPAD(p) ((((p) >> 16) & 0x3e0) | (((p) >> 27) & 0x1f)) 95 95 96 96 /* HCSPARAMS3 - hcs_params3 - bitmasks */ 97 97 /* bits 0:7, Max U1 to U0 latency for the roothub ports */ ··· 865 863 #define EP_HAS_STREAMS (1 << 4) 866 864 /* Transitioning the endpoint to not using streams, don't enqueue URBs */ 867 865 #define EP_GETTING_NO_STREAMS (1 << 5) 866 + #define EP_RECENTLY_HALTED (1 << 6) 867 + #define EP_CONFIG_PENDING (1 << 7) 868 868 /* ---- Related to URB cancellation ---- */ 869 869 struct list_head cancelled_td_list; 870 870 struct xhci_td *stopped_td; ··· 1292 1288 struct xhci_segment *start_seg; 1293 1289 union xhci_trb *first_trb; 1294 1290 union xhci_trb *last_trb; 1291 + /* actual_length of the URB has already been set */ 1292 + bool urb_length_set; 1295 1293 }; 1296 1294 1297 1295 /* xHCI command default timeout value */ ··· 1566 1560 #define XHCI_SPURIOUS_WAKEUP (1 << 18) 1567 1561 /* For controllers with a broken beyond repair streams implementation */ 1568 1562 #define XHCI_BROKEN_STREAMS (1 << 19) 1563 + #define XHCI_PME_STUCK_QUIRK (1 << 20) 1569 1564 unsigned int num_active_eps; 1570 1565 unsigned int limit_active_eps; 1571 1566 /* There are two roothubs to keep track of bus suspend info for */
+3 -3
drivers/usb/isp1760/isp1760-hcd.c
··· 1274 1274 for (slot = 0; slot < 32; slot++) 1275 1275 if (priv->atl_slots[slot].qh && time_after(jiffies, 1276 1276 priv->atl_slots[slot].timestamp + 1277 - SLOT_TIMEOUT * HZ / 1000)) { 1277 + msecs_to_jiffies(SLOT_TIMEOUT))) { 1278 1278 ptd_read(hcd->regs, ATL_PTD_OFFSET, slot, &ptd); 1279 1279 if (!FROM_DW0_VALID(ptd.dw0) && 1280 1280 !FROM_DW3_ACTIVE(ptd.dw3)) ··· 1286 1286 1287 1287 spin_unlock_irqrestore(&priv->lock, spinflags); 1288 1288 1289 - errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000; 1289 + errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD); 1290 1290 add_timer(&errata2_timer); 1291 1291 } 1292 1292 ··· 1336 1336 return retval; 1337 1337 1338 1338 setup_timer(&errata2_timer, errata2_function, (unsigned long)hcd); 1339 - errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000; 1339 + errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD); 1340 1340 add_timer(&errata2_timer); 1341 1341 1342 1342 chipid = reg_read32(hcd->regs, HC_CHIP_ID_REG);
+6 -4
drivers/usb/musb/musb_core.c
··· 1969 1969 goto fail0; 1970 1970 } 1971 1971 1972 - pm_runtime_use_autosuspend(musb->controller); 1973 - pm_runtime_set_autosuspend_delay(musb->controller, 200); 1974 - pm_runtime_enable(musb->controller); 1975 - 1976 1972 spin_lock_init(&musb->lock); 1977 1973 musb->board_set_power = plat->set_power; 1978 1974 musb->min_power = plat->min_power; ··· 1986 1990 musb_writew = musb_default_writew; 1987 1991 musb_readl = musb_default_readl; 1988 1992 musb_writel = musb_default_writel; 1993 + 1994 + /* We need musb_read/write functions initialized for PM */ 1995 + pm_runtime_use_autosuspend(musb->controller); 1996 + pm_runtime_set_autosuspend_delay(musb->controller, 200); 1997 + pm_runtime_irq_safe(musb->controller); 1998 + pm_runtime_enable(musb->controller); 1989 1999 1990 2000 /* The musb_platform_init() call: 1991 2001 * - adjusts musb->mregs
+29 -3
drivers/usb/musb/musb_dsps.c
··· 457 457 if (IS_ERR(musb->xceiv)) 458 458 return PTR_ERR(musb->xceiv); 459 459 460 + musb->phy = devm_phy_get(dev->parent, "usb2-phy"); 461 + 460 462 /* Returns zero if e.g. not clocked */ 461 463 rev = dsps_readl(reg_base, wrp->revision); 462 464 if (!rev) 463 465 return -ENODEV; 464 466 465 467 usb_phy_init(musb->xceiv); 468 + if (IS_ERR(musb->phy)) { 469 + musb->phy = NULL; 470 + } else { 471 + ret = phy_init(musb->phy); 472 + if (ret < 0) 473 + return ret; 474 + ret = phy_power_on(musb->phy); 475 + if (ret) { 476 + phy_exit(musb->phy); 477 + return ret; 478 + } 479 + } 480 + 466 481 setup_timer(&glue->timer, otg_timer, (unsigned long) musb); 467 482 468 483 /* Reset the musb */ ··· 517 502 518 503 del_timer_sync(&glue->timer); 519 504 usb_phy_shutdown(musb->xceiv); 505 + phy_power_off(musb->phy); 506 + phy_exit(musb->phy); 520 507 debugfs_remove_recursive(glue->dbgfs_root); 521 508 522 509 return 0; ··· 627 610 struct device *dev = musb->controller; 628 611 struct dsps_glue *glue = dev_get_drvdata(dev->parent); 629 612 const struct dsps_musb_wrapper *wrp = glue->wrp; 630 - int session_restart = 0; 613 + int session_restart = 0, error; 631 614 632 615 if (glue->sw_babble_enabled) 633 616 session_restart = sw_babble_control(musb); ··· 641 624 dsps_writel(musb->ctrl_base, wrp->control, (1 << wrp->reset)); 642 625 usleep_range(100, 200); 643 626 usb_phy_shutdown(musb->xceiv); 627 + error = phy_power_off(musb->phy); 628 + if (error) 629 + dev_err(dev, "phy shutdown failed: %i\n", error); 644 630 usleep_range(100, 200); 645 631 usb_phy_init(musb->xceiv); 632 + error = phy_power_on(musb->phy); 633 + if (error) 634 + dev_err(dev, "phy powerup failed: %i\n", error); 646 635 session_restart = 1; 647 636 } 648 637 ··· 710 687 struct musb_hdrc_config *config; 711 688 struct platform_device *musb; 712 689 struct device_node *dn = parent->dev.of_node; 713 - int ret; 690 + int ret, val; 714 691 715 692 memset(resources, 0, sizeof(resources)); 716 693 res = platform_get_resource_byname(parent, IORESOURCE_MEM, "mc"); ··· 762 739 pdata.mode = get_musb_port_mode(dev); 763 740 /* DT keeps this entry in mA, musb expects it as per USB spec */ 764 741 pdata.power = get_int_prop(dn, "mentor,power") / 2; 765 - config->multipoint = of_property_read_bool(dn, "mentor,multipoint"); 742 + 743 + ret = of_property_read_u32(dn, "mentor,multipoint", &val); 744 + if (!ret && val) 745 + config->multipoint = true; 766 746 767 747 ret = platform_device_add_data(musb, &pdata, sizeof(pdata)); 768 748 if (ret) {
+1 -1
drivers/usb/musb/musb_host.c
··· 2613 2613 .description = "musb-hcd", 2614 2614 .product_desc = "MUSB HDRC host driver", 2615 2615 .hcd_priv_size = sizeof(struct musb *), 2616 - .flags = HCD_USB2 | HCD_MEMORY, 2616 + .flags = HCD_USB2 | HCD_MEMORY | HCD_BH, 2617 2617 2618 2618 /* not using irq handler or reset hooks from usbcore, since 2619 2619 * those must be shared with peripheral code for OTG configs
+5 -2
drivers/usb/musb/omap2430.c
··· 516 516 struct omap2430_glue *glue; 517 517 struct device_node *np = pdev->dev.of_node; 518 518 struct musb_hdrc_config *config; 519 - int ret = -ENOMEM; 519 + int ret = -ENOMEM, val; 520 520 521 521 glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); 522 522 if (!glue) ··· 559 559 of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps); 560 560 of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits); 561 561 of_property_read_u32(np, "power", (u32 *)&pdata->power); 562 - config->multipoint = of_property_read_bool(np, "multipoint"); 562 + 563 + ret = of_property_read_u32(np, "multipoint", &val); 564 + if (!ret && val) 565 + config->multipoint = true; 563 566 564 567 pdata->board_data = data; 565 568 pdata->config = config;
+1
drivers/usb/renesas_usbhs/Kconfig
··· 6 6 tristate 'Renesas USBHS controller' 7 7 depends on USB_GADGET 8 8 depends on ARCH_SHMOBILE || SUPERH || COMPILE_TEST 9 + depends on EXTCON || !EXTCON # if EXTCON=m, USBHS cannot be built-in 9 10 default n 10 11 help 11 12 Renesas USBHS is a discrete USB host and peripheral controller chip
+20 -27
drivers/usb/serial/bus.c
··· 38 38 return 0; 39 39 } 40 40 41 - static ssize_t port_number_show(struct device *dev, 42 - struct device_attribute *attr, char *buf) 43 - { 44 - struct usb_serial_port *port = to_usb_serial_port(dev); 45 - 46 - return sprintf(buf, "%d\n", port->port_number); 47 - } 48 - static DEVICE_ATTR_RO(port_number); 49 - 50 41 static int usb_serial_device_probe(struct device *dev) 51 42 { 52 43 struct usb_serial_driver *driver; 53 44 struct usb_serial_port *port; 45 + struct device *tty_dev; 54 46 int retval = 0; 55 47 int minor; 56 48 57 49 port = to_usb_serial_port(dev); 58 - if (!port) { 59 - retval = -ENODEV; 60 - goto exit; 61 - } 50 + if (!port) 51 + return -ENODEV; 62 52 63 53 /* make sure suspend/resume doesn't race against port_probe */ 64 54 retval = usb_autopm_get_interface(port->serial->interface); 65 55 if (retval) 66 - goto exit; 56 + return retval; 67 57 68 58 driver = port->serial->type; 69 59 if (driver->port_probe) { 70 60 retval = driver->port_probe(port); 71 61 if (retval) 72 - goto exit_with_autopm; 73 - } 74 - 75 - retval = device_create_file(dev, &dev_attr_port_number); 76 - if (retval) { 77 - if (driver->port_remove) 78 - retval = driver->port_remove(port); 79 - goto exit_with_autopm; 62 + goto err_autopm_put; 80 63 } 81 64 82 65 minor = port->minor; 83 - tty_register_device(usb_serial_tty_driver, minor, dev); 66 + tty_dev = tty_register_device(usb_serial_tty_driver, minor, dev); 67 + if (IS_ERR(tty_dev)) { 68 + retval = PTR_ERR(tty_dev); 69 + goto err_port_remove; 70 + } 71 + 72 + usb_autopm_put_interface(port->serial->interface); 73 + 84 74 dev_info(&port->serial->dev->dev, 85 75 "%s converter now attached to ttyUSB%d\n", 86 76 driver->description, minor); 87 77 88 - exit_with_autopm: 78 + return 0; 79 + 80 + err_port_remove: 81 + if (driver->port_remove) 82 + driver->port_remove(port); 83 + err_autopm_put: 89 84 usb_autopm_put_interface(port->serial->interface); 90 - exit: 85 + 91 86 return retval; 92 87 } 93 88 ··· 108 113 109 114 minor = port->minor; 110 115 tty_unregister_device(usb_serial_tty_driver, minor); 111 - 112 - device_remove_file(&port->dev, &dev_attr_port_number); 113 116 114 117 driver = port->serial->type; 115 118 if (driver->port_remove)
+6 -9
drivers/usb/serial/ch341.c
··· 84 84 u8 line_status; /* active status of modem control inputs */ 85 85 }; 86 86 87 + static void ch341_set_termios(struct tty_struct *tty, 88 + struct usb_serial_port *port, 89 + struct ktermios *old_termios); 90 + 87 91 static int ch341_control_out(struct usb_device *dev, u8 request, 88 92 u16 value, u16 index) 89 93 { ··· 313 309 struct ch341_private *priv = usb_get_serial_port_data(port); 314 310 int r; 315 311 316 - priv->baud_rate = DEFAULT_BAUD_RATE; 317 - 318 312 r = ch341_configure(serial->dev, priv); 319 313 if (r) 320 314 goto out; 321 315 322 - r = ch341_set_handshake(serial->dev, priv->line_control); 323 - if (r) 324 - goto out; 325 - 326 - r = ch341_set_baudrate(serial->dev, priv); 327 - if (r) 328 - goto out; 316 + if (tty) 317 + ch341_set_termios(tty, port, NULL); 329 318 330 319 dev_dbg(&port->dev, "%s - submitting interrupt urb\n", __func__); 331 320 r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+2
drivers/usb/serial/console.c
··· 14 14 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 15 15 16 16 #include <linux/kernel.h> 17 + #include <linux/module.h> 17 18 #include <linux/slab.h> 18 19 #include <linux/tty.h> 19 20 #include <linux/console.h> ··· 145 144 init_ldsem(&tty->ldisc_sem); 146 145 INIT_LIST_HEAD(&tty->tty_files); 147 146 kref_get(&tty->driver->kref); 147 + __module_get(tty->driver->owner); 148 148 tty->ops = &usb_console_fake_tty_ops; 149 149 if (tty_init_termios(tty)) { 150 150 retval = -ENOMEM;
+2
drivers/usb/serial/cp210x.c
··· 147 147 { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */ 148 148 { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */ 149 149 { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */ 150 + { USB_DEVICE(0x16C0, 0x09B0) }, /* Lunatico Seletek */ 151 + { USB_DEVICE(0x16C0, 0x09B1) }, /* Lunatico Seletek */ 150 152 { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ 151 153 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ 152 154 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
+19
drivers/usb/serial/ftdi_sio.c
··· 799 799 { USB_DEVICE(FTDI_VID, FTDI_ELSTER_UNICOM_PID) }, 800 800 { USB_DEVICE(FTDI_VID, FTDI_PROPOX_JTAGCABLEII_PID) }, 801 801 { USB_DEVICE(FTDI_VID, FTDI_PROPOX_ISPCABLEIII_PID) }, 802 + { USB_DEVICE(FTDI_VID, CYBER_CORTEX_AV_PID), 803 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 802 804 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 803 805 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 804 806 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_H_PID), ··· 980 978 { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) }, 981 979 /* GE Healthcare devices */ 982 980 { USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) }, 981 + /* Active Research (Actisense) devices */ 982 + { USB_DEVICE(FTDI_VID, ACTISENSE_NDC_PID) }, 983 + { USB_DEVICE(FTDI_VID, ACTISENSE_USG_PID) }, 984 + { USB_DEVICE(FTDI_VID, ACTISENSE_NGT_PID) }, 985 + { USB_DEVICE(FTDI_VID, ACTISENSE_NGW_PID) }, 986 + { USB_DEVICE(FTDI_VID, ACTISENSE_D9AC_PID) }, 987 + { USB_DEVICE(FTDI_VID, ACTISENSE_D9AD_PID) }, 988 + { USB_DEVICE(FTDI_VID, ACTISENSE_D9AE_PID) }, 989 + { USB_DEVICE(FTDI_VID, ACTISENSE_D9AF_PID) }, 990 + { USB_DEVICE(FTDI_VID, CHETCO_SEAGAUGE_PID) }, 991 + { USB_DEVICE(FTDI_VID, CHETCO_SEASWITCH_PID) }, 992 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_NMEA2000_PID) }, 993 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ETHERNET_PID) }, 994 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_WIFI_PID) }, 995 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 996 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 997 + { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 983 998 { } /* Terminating entry */ 984 999 }; 985 1000
+23
drivers/usb/serial/ftdi_sio_ids.h
··· 38 38 39 39 #define FTDI_LUMEL_PD12_PID 0x6002 40 40 41 + /* Cyber Cortex AV by Fabulous Silicon (http://fabuloussilicon.com) */ 42 + #define CYBER_CORTEX_AV_PID 0x8698 43 + 41 44 /* 42 45 * Marvell OpenRD Base, Client 43 46 * http://www.open-rd.org ··· 1441 1438 */ 1442 1439 #define GE_HEALTHCARE_VID 0x1901 1443 1440 #define GE_HEALTHCARE_NEMO_TRACKER_PID 0x0015 1441 + 1442 + /* 1443 + * Active Research (Actisense) devices 1444 + */ 1445 + #define ACTISENSE_NDC_PID 0xD9A8 /* NDC USB Serial Adapter */ 1446 + #define ACTISENSE_USG_PID 0xD9A9 /* USG USB Serial Adapter */ 1447 + #define ACTISENSE_NGT_PID 0xD9AA /* NGT NMEA2000 Interface */ 1448 + #define ACTISENSE_NGW_PID 0xD9AB /* NGW NMEA2000 Gateway */ 1449 + #define ACTISENSE_D9AC_PID 0xD9AC /* Actisense Reserved */ 1450 + #define ACTISENSE_D9AD_PID 0xD9AD /* Actisense Reserved */ 1451 + #define ACTISENSE_D9AE_PID 0xD9AE /* Actisense Reserved */ 1452 + #define ACTISENSE_D9AF_PID 0xD9AF /* Actisense Reserved */ 1453 + #define CHETCO_SEAGAUGE_PID 0xA548 /* SeaGauge USB Adapter */ 1454 + #define CHETCO_SEASWITCH_PID 0xA549 /* SeaSwitch USB Adapter */ 1455 + #define CHETCO_SEASMART_NMEA2000_PID 0xA54A /* SeaSmart NMEA2000 Gateway */ 1456 + #define CHETCO_SEASMART_ETHERNET_PID 0xA54B /* SeaSmart Ethernet Gateway */ 1457 + #define CHETCO_SEASMART_WIFI_PID 0xA5AC /* SeaSmart Wifi Gateway */ 1458 + #define CHETCO_SEASMART_DISPLAY_PID 0xA5AD /* SeaSmart NMEA2000 Display */ 1459 + #define CHETCO_SEASMART_LITE_PID 0xA5AE /* SeaSmart Lite USB Adapter */ 1460 + #define CHETCO_SEASMART_ANALOG_PID 0xA5AF /* SeaSmart Analog Adapter */
+2 -1
drivers/usb/serial/mxuport.c
··· 1284 1284 } 1285 1285 1286 1286 /* Initial port termios */ 1287 - mxuport_set_termios(tty, port, NULL); 1287 + if (tty) 1288 + mxuport_set_termios(tty, port, NULL); 1288 1289 1289 1290 /* 1290 1291 * TODO: use RQ_VENDOR_GET_MSR, once we know what it
+13 -5
drivers/usb/serial/pl2303.c
··· 132 132 #define UART_OVERRUN_ERROR 0x40 133 133 #define UART_CTS 0x80 134 134 135 + static void pl2303_set_break(struct usb_serial_port *port, bool enable); 135 136 136 137 enum pl2303_type { 137 138 TYPE_01, /* Type 0 and 1 (difference unknown) */ ··· 616 615 { 617 616 usb_serial_generic_close(port); 618 617 usb_kill_urb(port->interrupt_in_urb); 618 + pl2303_set_break(port, false); 619 619 } 620 620 621 621 static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port) ··· 743 741 return -ENOIOCTLCMD; 744 742 } 745 743 746 - static void pl2303_break_ctl(struct tty_struct *tty, int break_state) 744 + static void pl2303_set_break(struct usb_serial_port *port, bool enable) 747 745 { 748 - struct usb_serial_port *port = tty->driver_data; 749 746 struct usb_serial *serial = port->serial; 750 747 u16 state; 751 748 int result; 752 749 753 - if (break_state == 0) 754 - state = BREAK_OFF; 755 - else 750 + if (enable) 756 751 state = BREAK_ON; 752 + else 753 + state = BREAK_OFF; 757 754 758 755 dev_dbg(&port->dev, "%s - turning break %s\n", __func__, 759 756 state == BREAK_OFF ? "off" : "on"); ··· 762 761 0, NULL, 0, 100); 763 762 if (result) 764 763 dev_err(&port->dev, "error sending break = %d\n", result); 764 + } 765 + 766 + static void pl2303_break_ctl(struct tty_struct *tty, int state) 767 + { 768 + struct usb_serial_port *port = tty->driver_data; 769 + 770 + pl2303_set_break(port, state); 765 771 } 766 772 767 773 static void pl2303_update_line_status(struct usb_serial_port *port,
+19 -2
drivers/usb/serial/usb-serial.c
··· 687 687 drv->dtr_rts(p, on); 688 688 } 689 689 690 + static ssize_t port_number_show(struct device *dev, 691 + struct device_attribute *attr, char *buf) 692 + { 693 + struct usb_serial_port *port = to_usb_serial_port(dev); 694 + 695 + return sprintf(buf, "%u\n", port->port_number); 696 + } 697 + static DEVICE_ATTR_RO(port_number); 698 + 699 + static struct attribute *usb_serial_port_attrs[] = { 700 + &dev_attr_port_number.attr, 701 + NULL 702 + }; 703 + ATTRIBUTE_GROUPS(usb_serial_port); 704 + 690 705 static const struct tty_port_operations serial_port_ops = { 691 706 .carrier_raised = serial_port_carrier_raised, 692 707 .dtr_rts = serial_port_dtr_rts, ··· 917 902 port->dev.driver = NULL; 918 903 port->dev.bus = &usb_serial_bus_type; 919 904 port->dev.release = &usb_serial_port_release; 905 + port->dev.groups = usb_serial_port_groups; 920 906 device_initialize(&port->dev); 921 907 } 922 908 ··· 956 940 port = serial->port[i]; 957 941 if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL)) 958 942 goto probe_error; 959 - buffer_size = max_t(int, serial->type->bulk_out_size, 960 - usb_endpoint_maxp(endpoint)); 943 + buffer_size = serial->type->bulk_out_size; 944 + if (!buffer_size) 945 + buffer_size = usb_endpoint_maxp(endpoint); 961 946 port->bulk_out_size = buffer_size; 962 947 port->bulk_out_endpointAddress = endpoint->bEndpointAddress; 963 948
+7
drivers/usb/storage/unusual_uas.h
··· 113 113 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 114 114 US_FL_NO_ATA_1X), 115 115 116 + /* Reported-by: Tom Arild Naess <tanaess@gmail.com> */ 117 + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999, 118 + "JMicron", 119 + "JMS539", 120 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 121 + US_FL_NO_REPORT_OPCODES), 122 + 116 123 /* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */ 117 124 UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, 118 125 "JMicron",
+6
drivers/usb/storage/usb.c
··· 889 889 !(us->fflags & US_FL_SCM_MULT_TARG)) { 890 890 mutex_lock(&us->dev_mutex); 891 891 us->max_lun = usb_stor_Bulk_max_lun(us); 892 + /* 893 + * Allow proper scanning of devices that present more than 8 LUNs 894 + * While not affecting other devices that may need the previous behavior 895 + */ 896 + if (us->max_lun >= 8) 897 + us_to_host(us)->max_lun = us->max_lun+1; 892 898 mutex_unlock(&us->dev_mutex); 893 899 } 894 900 scsi_scan_host(us_to_host(us));
+1 -2
include/linux/usb/serial.h
··· 190 190 * @num_ports: the number of different ports this device will have. 191 191 * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer 192 192 * (0 = end-point size) 193 - * @bulk_out_size: minimum number of bytes to allocate for bulk-out buffer 194 - * (0 = end-point size) 193 + * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) 195 194 * @calc_num_ports: pointer to a function to determine how many ports this 196 195 * device has dynamically. It will be called after the probe() 197 196 * callback is called, but before attach()