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

Pull USB fixes from Greg KH:
"Here are some USB driver fixes and new device ids for 3.18-rc7.

Full details are in the shortlog, and all of these have been in the
linux-next tree for a while"

* tag 'usb-3.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000
usb: xhci: rework root port wake bits if controller isn't allowed to wakeup
USB: xhci: Reset a halted endpoint immediately when we encounter a stall.
Revert "xhci: clear root port wake on bits if controller isn't wake-up capable"
USB: xhci: don't start a halted endpoint before its new dequeue is set
USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012
USB: ssu100: fix overrun-error reporting
USB: keyspan: fix overrun-error reporting
USB: keyspan: fix tty line-status reporting
usb: serial: ftdi_sio: add PIDs for Matrix Orbital products
usb: dwc3: ep0: fix for dead code
USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick

+224 -144
+3
drivers/usb/core/quirks.c
··· 44 44 /* Creative SB Audigy 2 NX */ 45 45 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, 46 46 47 + /* Microsoft Wireless Laser Mouse 6000 Receiver */ 48 + { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME }, 49 + 47 50 /* Microsoft LifeCam-VX700 v2.0 */ 48 51 { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, 49 52
+4 -4
drivers/usb/dwc3/ep0.c
··· 791 791 792 792 trb = dwc->ep0_trb; 793 793 794 + r = next_request(&ep0->request_list); 795 + if (!r) 796 + return; 797 + 794 798 status = DWC3_TRB_SIZE_TRBSTS(trb->size); 795 799 if (status == DWC3_TRBSTS_SETUP_PENDING) { 796 800 dwc3_trace(trace_dwc3_ep0, "Setup Pending received"); ··· 804 800 805 801 return; 806 802 } 807 - 808 - r = next_request(&ep0->request_list); 809 - if (!r) 810 - return; 811 803 812 804 ur = &r->request; 813 805
+1 -4
drivers/usb/host/xhci-hub.c
··· 22 22 23 23 24 24 #include <linux/slab.h> 25 - #include <linux/device.h> 26 25 #include <asm/unaligned.h> 27 26 28 27 #include "xhci.h" ··· 1148 1149 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME 1149 1150 * is enabled, so also enable remote wake here. 1150 1151 */ 1151 - if (hcd->self.root_hub->do_remote_wakeup 1152 - && device_may_wakeup(hcd->self.controller)) { 1153 - 1152 + if (hcd->self.root_hub->do_remote_wakeup) { 1154 1153 if (t1 & PORT_CONNECT) { 1155 1154 t2 |= PORT_WKOC_E | PORT_WKDISC_E; 1156 1155 t2 &= ~PORT_WKCONN_E;
+1 -1
drivers/usb/host/xhci-pci.c
··· 281 281 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 282 282 pdev->no_d3cold = true; 283 283 284 - return xhci_suspend(xhci); 284 + return xhci_suspend(xhci, do_wakeup); 285 285 } 286 286 287 287 static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
+9 -1
drivers/usb/host/xhci-plat.c
··· 204 204 struct usb_hcd *hcd = dev_get_drvdata(dev); 205 205 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 206 206 207 - return xhci_suspend(xhci); 207 + /* 208 + * xhci_suspend() needs `do_wakeup` to know whether host is allowed 209 + * to do wakeup during suspend. Since xhci_plat_suspend is currently 210 + * only designed for system suspend, device_may_wakeup() is enough 211 + * to dertermine whether host is allowed to do wakeup. Need to 212 + * reconsider this when xhci_plat_suspend enlarges its scope, e.g., 213 + * also applies to runtime suspend. 214 + */ 215 + return xhci_suspend(xhci, device_may_wakeup(dev)); 208 216 } 209 217 210 218 static int xhci_plat_resume(struct device *dev)
+11 -32
drivers/usb/host/xhci-ring.c
··· 1067 1067 false); 1068 1068 xhci_ring_cmd_db(xhci); 1069 1069 } else { 1070 - /* Clear our internal halted state and restart the ring(s) */ 1070 + /* Clear our internal halted state */ 1071 1071 xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED; 1072 - ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 1073 1072 } 1074 1073 } 1075 1074 ··· 1822 1823 ep->stopped_td = td; 1823 1824 return 0; 1824 1825 } else { 1825 - if (trb_comp_code == COMP_STALL) { 1826 - /* The transfer is completed from the driver's 1827 - * perspective, but we need to issue a set dequeue 1828 - * command for this stalled endpoint to move the dequeue 1829 - * pointer past the TD. We can't do that here because 1830 - * the halt condition must be cleared first. Let the 1831 - * USB class driver clear the stall later. 1832 - */ 1833 - ep->stopped_td = td; 1834 - ep->stopped_stream = ep_ring->stream_id; 1835 - } else if (xhci_requires_manual_halt_cleanup(xhci, 1836 - ep_ctx, trb_comp_code)) { 1837 - /* Other types of errors halt the endpoint, but the 1838 - * class driver doesn't call usb_reset_endpoint() unless 1839 - * the error is -EPIPE. Clear the halted status in the 1840 - * xHCI hardware manually. 1826 + if (trb_comp_code == COMP_STALL || 1827 + xhci_requires_manual_halt_cleanup(xhci, ep_ctx, 1828 + trb_comp_code)) { 1829 + /* Issue a reset endpoint command to clear the host side 1830 + * halt, followed by a set dequeue command to move the 1831 + * dequeue pointer past the TD. 1832 + * The class driver clears the device side halt later. 1841 1833 */ 1842 1834 xhci_cleanup_halted_endpoint(xhci, 1843 1835 slot_id, ep_index, ep_ring->stream_id, ··· 1948 1958 else 1949 1959 td->urb->actual_length = 0; 1950 1960 1951 - xhci_cleanup_halted_endpoint(xhci, 1952 - slot_id, ep_index, 0, td, event_trb); 1953 - return finish_td(xhci, td, event_trb, event, ep, status, true); 1961 + return finish_td(xhci, td, event_trb, event, ep, status, false); 1954 1962 } 1955 1963 /* 1956 1964 * Did we transfer any data, despite the errors that might have ··· 2507 2519 if (ret) { 2508 2520 urb = td->urb; 2509 2521 urb_priv = urb->hcpriv; 2510 - /* Leave the TD around for the reset endpoint function 2511 - * to use(but only if it's not a control endpoint, 2512 - * since we already queued the Set TR dequeue pointer 2513 - * command for stalled control endpoints). 2514 - */ 2515 - if (usb_endpoint_xfer_control(&urb->ep->desc) || 2516 - (trb_comp_code != COMP_STALL && 2517 - trb_comp_code != COMP_BABBLE)) 2518 - xhci_urb_free_priv(xhci, urb_priv); 2519 - else 2520 - kfree(urb_priv); 2522 + 2523 + xhci_urb_free_priv(xhci, urb_priv); 2521 2524 2522 2525 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); 2523 2526 if ((urb->actual_length != urb->transfer_buffer_length &&
+56 -51
drivers/usb/host/xhci.c
··· 35 35 #define DRIVER_AUTHOR "Sarah Sharp" 36 36 #define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver" 37 37 38 + #define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) 39 + 38 40 /* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */ 39 41 static int link_quirk; 40 42 module_param(link_quirk, int, S_IRUGO | S_IWUSR); ··· 853 851 xhci_set_cmd_ring_deq(xhci); 854 852 } 855 853 854 + static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) 855 + { 856 + int port_index; 857 + __le32 __iomem **port_array; 858 + unsigned long flags; 859 + u32 t1, t2; 860 + 861 + spin_lock_irqsave(&xhci->lock, flags); 862 + 863 + /* disble usb3 ports Wake bits*/ 864 + port_index = xhci->num_usb3_ports; 865 + port_array = xhci->usb3_ports; 866 + while (port_index--) { 867 + t1 = readl(port_array[port_index]); 868 + t1 = xhci_port_state_to_neutral(t1); 869 + t2 = t1 & ~PORT_WAKE_BITS; 870 + if (t1 != t2) 871 + writel(t2, port_array[port_index]); 872 + } 873 + 874 + /* disble usb2 ports Wake bits*/ 875 + port_index = xhci->num_usb2_ports; 876 + port_array = xhci->usb2_ports; 877 + while (port_index--) { 878 + t1 = readl(port_array[port_index]); 879 + t1 = xhci_port_state_to_neutral(t1); 880 + t2 = t1 & ~PORT_WAKE_BITS; 881 + if (t1 != t2) 882 + writel(t2, port_array[port_index]); 883 + } 884 + 885 + spin_unlock_irqrestore(&xhci->lock, flags); 886 + } 887 + 856 888 /* 857 889 * Stop HC (not bus-specific) 858 890 * 859 891 * This is called when the machine transition into S3/S4 mode. 860 892 * 861 893 */ 862 - int xhci_suspend(struct xhci_hcd *xhci) 894 + int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) 863 895 { 864 896 int rc = 0; 865 897 unsigned int delay = XHCI_MAX_HALT_USEC; ··· 903 867 if (hcd->state != HC_STATE_SUSPENDED || 904 868 xhci->shared_hcd->state != HC_STATE_SUSPENDED) 905 869 return -EINVAL; 870 + 871 + /* Clear root port wake on bits if wakeup not allowed. */ 872 + if (!do_wakeup) 873 + xhci_disable_port_wake_on_bits(xhci); 906 874 907 875 /* Don't poll the roothubs on bus suspend. */ 908 876 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); ··· 2952 2912 } 2953 2913 } 2954 2914 2955 - /* Deal with stalled endpoints. The core should have sent the control message 2956 - * to clear the halt condition. However, we need to make the xHCI hardware 2957 - * reset its sequence number, since a device will expect a sequence number of 2958 - * zero after the halt condition is cleared. 2915 + /* Called when clearing halted device. The core should have sent the control 2916 + * message to clear the device halt condition. The host side of the halt should 2917 + * already be cleared with a reset endpoint command issued when the STALL tx 2918 + * event was received. 2919 + * 2959 2920 * Context: in_interrupt 2960 2921 */ 2922 + 2961 2923 void xhci_endpoint_reset(struct usb_hcd *hcd, 2962 2924 struct usb_host_endpoint *ep) 2963 2925 { 2964 2926 struct xhci_hcd *xhci; 2965 - struct usb_device *udev; 2966 - unsigned int ep_index; 2967 - unsigned long flags; 2968 - int ret; 2969 - struct xhci_virt_ep *virt_ep; 2970 - struct xhci_command *command; 2971 2927 2972 2928 xhci = hcd_to_xhci(hcd); 2973 - udev = (struct usb_device *) ep->hcpriv; 2974 - /* Called with a root hub endpoint (or an endpoint that wasn't added 2975 - * with xhci_add_endpoint() 2976 - */ 2977 - if (!ep->hcpriv) 2978 - return; 2979 - ep_index = xhci_get_endpoint_index(&ep->desc); 2980 - virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index]; 2981 - if (!virt_ep->stopped_td) { 2982 - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, 2983 - "Endpoint 0x%x not halted, refusing to reset.", 2984 - ep->desc.bEndpointAddress); 2985 - return; 2986 - } 2987 - if (usb_endpoint_xfer_control(&ep->desc)) { 2988 - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, 2989 - "Control endpoint stall already handled."); 2990 - return; 2991 - } 2992 2929 2993 - command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC); 2994 - if (!command) 2995 - return; 2996 - 2997 - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, 2998 - "Queueing reset endpoint command"); 2999 - spin_lock_irqsave(&xhci->lock, flags); 3000 - ret = xhci_queue_reset_ep(xhci, command, udev->slot_id, ep_index); 3001 2930 /* 3002 - * Can't change the ring dequeue pointer until it's transitioned to the 3003 - * stopped state, which is only upon a successful reset endpoint 3004 - * command. Better hope that last command worked! 2931 + * We might need to implement the config ep cmd in xhci 4.8.1 note: 2932 + * The Reset Endpoint Command may only be issued to endpoints in the 2933 + * Halted state. If software wishes reset the Data Toggle or Sequence 2934 + * Number of an endpoint that isn't in the Halted state, then software 2935 + * may issue a Configure Endpoint Command with the Drop and Add bits set 2936 + * for the target endpoint. that is in the Stopped state. 3005 2937 */ 3006 - if (!ret) { 3007 - xhci_cleanup_stalled_ring(xhci, udev, ep_index); 3008 - kfree(virt_ep->stopped_td); 3009 - xhci_ring_cmd_db(xhci); 3010 - } 3011 - virt_ep->stopped_td = NULL; 3012 - virt_ep->stopped_stream = 0; 3013 - spin_unlock_irqrestore(&xhci->lock, flags); 3014 2938 3015 - if (ret) 3016 - xhci_warn(xhci, "FIXME allocate a new ring segment\n"); 2939 + /* For now just print debug to follow the situation */ 2940 + xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n", 2941 + ep->desc.bEndpointAddress); 3017 2942 } 3018 2943 3019 2944 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
+1 -1
drivers/usb/host/xhci.h
··· 1746 1746 void xhci_init_driver(struct hc_driver *drv, int (*setup_fn)(struct usb_hcd *)); 1747 1747 1748 1748 #ifdef CONFIG_PM 1749 - int xhci_suspend(struct xhci_hcd *xhci); 1749 + int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup); 1750 1750 int xhci_resume(struct xhci_hcd *xhci, bool hibernated); 1751 1751 #else 1752 1752 #define xhci_suspend NULL
+1
drivers/usb/serial/cp210x.c
··· 120 120 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ 121 121 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ 122 122 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ 123 + { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */ 123 124 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ 124 125 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ 125 126 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
+33
drivers/usb/serial/ftdi_sio.c
··· 470 470 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) }, 471 471 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) }, 472 472 { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) }, 473 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) }, 474 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) }, 475 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) }, 476 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) }, 477 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) }, 478 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) }, 479 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) }, 480 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) }, 481 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) }, 482 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) }, 483 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) }, 484 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) }, 485 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) }, 486 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) }, 487 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) }, 488 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) }, 489 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) }, 490 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) }, 491 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) }, 492 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) }, 493 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) }, 494 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) }, 495 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) }, 496 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) }, 497 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) }, 498 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) }, 499 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) }, 500 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) }, 501 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) }, 502 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) }, 503 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) }, 504 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) }, 505 + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) }, 473 506 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, 474 507 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 475 508 { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
+35 -4
drivers/usb/serial/ftdi_sio_ids.h
··· 926 926 #define BAYER_CONTOUR_CABLE_PID 0x6001 927 927 928 928 /* 929 - * The following are the values for the Matrix Orbital FTDI Range 930 - * Anything in this range will use an FT232RL. 929 + * Matrix Orbital Intelligent USB displays. 930 + * http://www.matrixorbital.com 931 931 */ 932 932 #define MTXORB_VID 0x1B3D 933 933 #define MTXORB_FTDI_RANGE_0100_PID 0x0100 ··· 1186 1186 #define MTXORB_FTDI_RANGE_01FD_PID 0x01FD 1187 1187 #define MTXORB_FTDI_RANGE_01FE_PID 0x01FE 1188 1188 #define MTXORB_FTDI_RANGE_01FF_PID 0x01FF 1189 - 1190 - 1189 + #define MTXORB_FTDI_RANGE_4701_PID 0x4701 1190 + #define MTXORB_FTDI_RANGE_9300_PID 0x9300 1191 + #define MTXORB_FTDI_RANGE_9301_PID 0x9301 1192 + #define MTXORB_FTDI_RANGE_9302_PID 0x9302 1193 + #define MTXORB_FTDI_RANGE_9303_PID 0x9303 1194 + #define MTXORB_FTDI_RANGE_9304_PID 0x9304 1195 + #define MTXORB_FTDI_RANGE_9305_PID 0x9305 1196 + #define MTXORB_FTDI_RANGE_9306_PID 0x9306 1197 + #define MTXORB_FTDI_RANGE_9307_PID 0x9307 1198 + #define MTXORB_FTDI_RANGE_9308_PID 0x9308 1199 + #define MTXORB_FTDI_RANGE_9309_PID 0x9309 1200 + #define MTXORB_FTDI_RANGE_930A_PID 0x930A 1201 + #define MTXORB_FTDI_RANGE_930B_PID 0x930B 1202 + #define MTXORB_FTDI_RANGE_930C_PID 0x930C 1203 + #define MTXORB_FTDI_RANGE_930D_PID 0x930D 1204 + #define MTXORB_FTDI_RANGE_930E_PID 0x930E 1205 + #define MTXORB_FTDI_RANGE_930F_PID 0x930F 1206 + #define MTXORB_FTDI_RANGE_9310_PID 0x9310 1207 + #define MTXORB_FTDI_RANGE_9311_PID 0x9311 1208 + #define MTXORB_FTDI_RANGE_9312_PID 0x9312 1209 + #define MTXORB_FTDI_RANGE_9313_PID 0x9313 1210 + #define MTXORB_FTDI_RANGE_9314_PID 0x9314 1211 + #define MTXORB_FTDI_RANGE_9315_PID 0x9315 1212 + #define MTXORB_FTDI_RANGE_9316_PID 0x9316 1213 + #define MTXORB_FTDI_RANGE_9317_PID 0x9317 1214 + #define MTXORB_FTDI_RANGE_9318_PID 0x9318 1215 + #define MTXORB_FTDI_RANGE_9319_PID 0x9319 1216 + #define MTXORB_FTDI_RANGE_931A_PID 0x931A 1217 + #define MTXORB_FTDI_RANGE_931B_PID 0x931B 1218 + #define MTXORB_FTDI_RANGE_931C_PID 0x931C 1219 + #define MTXORB_FTDI_RANGE_931D_PID 0x931D 1220 + #define MTXORB_FTDI_RANGE_931E_PID 0x931E 1221 + #define MTXORB_FTDI_RANGE_931F_PID 0x931F 1191 1222 1192 1223 /* 1193 1224 * The Mobility Lab (TML)
+59 -38
drivers/usb/serial/keyspan.c
··· 311 311 if ((data[0] & 0x80) == 0) { 312 312 /* no errors on individual bytes, only 313 313 possible overrun err */ 314 - if (data[0] & RXERROR_OVERRUN) 315 - err = TTY_OVERRUN; 316 - else 317 - err = 0; 314 + if (data[0] & RXERROR_OVERRUN) { 315 + tty_insert_flip_char(&port->port, 0, 316 + TTY_OVERRUN); 317 + } 318 318 for (i = 1; i < urb->actual_length ; ++i) 319 - tty_insert_flip_char(&port->port, data[i], err); 319 + tty_insert_flip_char(&port->port, data[i], 320 + TTY_NORMAL); 320 321 } else { 321 322 /* some bytes had errors, every byte has status */ 322 323 dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); 323 324 for (i = 0; i + 1 < urb->actual_length; i += 2) { 324 - int stat = data[i], flag = 0; 325 - if (stat & RXERROR_OVERRUN) 326 - flag |= TTY_OVERRUN; 327 - if (stat & RXERROR_FRAMING) 328 - flag |= TTY_FRAME; 329 - if (stat & RXERROR_PARITY) 330 - flag |= TTY_PARITY; 325 + int stat = data[i]; 326 + int flag = TTY_NORMAL; 327 + 328 + if (stat & RXERROR_OVERRUN) { 329 + tty_insert_flip_char(&port->port, 0, 330 + TTY_OVERRUN); 331 + } 331 332 /* XXX should handle break (0x10) */ 333 + if (stat & RXERROR_PARITY) 334 + flag = TTY_PARITY; 335 + else if (stat & RXERROR_FRAMING) 336 + flag = TTY_FRAME; 337 + 332 338 tty_insert_flip_char(&port->port, data[i+1], 333 339 flag); 334 340 } ··· 655 649 } else { 656 650 /* some bytes had errors, every byte has status */ 657 651 for (i = 0; i + 1 < urb->actual_length; i += 2) { 658 - int stat = data[i], flag = 0; 659 - if (stat & RXERROR_OVERRUN) 660 - flag |= TTY_OVERRUN; 661 - if (stat & RXERROR_FRAMING) 662 - flag |= TTY_FRAME; 663 - if (stat & RXERROR_PARITY) 664 - flag |= TTY_PARITY; 652 + int stat = data[i]; 653 + int flag = TTY_NORMAL; 654 + 655 + if (stat & RXERROR_OVERRUN) { 656 + tty_insert_flip_char(&port->port, 0, 657 + TTY_OVERRUN); 658 + } 665 659 /* XXX should handle break (0x10) */ 660 + if (stat & RXERROR_PARITY) 661 + flag = TTY_PARITY; 662 + else if (stat & RXERROR_FRAMING) 663 + flag = TTY_FRAME; 664 + 666 665 tty_insert_flip_char(&port->port, data[i+1], 667 666 flag); 668 667 } ··· 724 713 */ 725 714 for (x = 0; x + 1 < len && 726 715 i + 1 < urb->actual_length; x += 2) { 727 - int stat = data[i], flag = 0; 716 + int stat = data[i]; 717 + int flag = TTY_NORMAL; 728 718 729 - if (stat & RXERROR_OVERRUN) 730 - flag |= TTY_OVERRUN; 731 - if (stat & RXERROR_FRAMING) 732 - flag |= TTY_FRAME; 733 - if (stat & RXERROR_PARITY) 734 - flag |= TTY_PARITY; 719 + if (stat & RXERROR_OVERRUN) { 720 + tty_insert_flip_char(&port->port, 0, 721 + TTY_OVERRUN); 722 + } 735 723 /* XXX should handle break (0x10) */ 724 + if (stat & RXERROR_PARITY) 725 + flag = TTY_PARITY; 726 + else if (stat & RXERROR_FRAMING) 727 + flag = TTY_FRAME; 728 + 736 729 tty_insert_flip_char(&port->port, data[i+1], 737 730 flag); 738 731 i += 2; ··· 788 773 if ((data[0] & 0x80) == 0) { 789 774 /* no errors on individual bytes, only 790 775 possible overrun err*/ 791 - if (data[0] & RXERROR_OVERRUN) 792 - err = TTY_OVERRUN; 793 - else 794 - err = 0; 776 + if (data[0] & RXERROR_OVERRUN) { 777 + tty_insert_flip_char(&port->port, 0, 778 + TTY_OVERRUN); 779 + } 795 780 for (i = 1; i < urb->actual_length ; ++i) 796 781 tty_insert_flip_char(&port->port, 797 - data[i], err); 782 + data[i], TTY_NORMAL); 798 783 } else { 799 784 /* some bytes had errors, every byte has status */ 800 785 dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); 801 786 for (i = 0; i + 1 < urb->actual_length; i += 2) { 802 - int stat = data[i], flag = 0; 803 - if (stat & RXERROR_OVERRUN) 804 - flag |= TTY_OVERRUN; 805 - if (stat & RXERROR_FRAMING) 806 - flag |= TTY_FRAME; 807 - if (stat & RXERROR_PARITY) 808 - flag |= TTY_PARITY; 787 + int stat = data[i]; 788 + int flag = TTY_NORMAL; 789 + 790 + if (stat & RXERROR_OVERRUN) { 791 + tty_insert_flip_char( 792 + &port->port, 0, 793 + TTY_OVERRUN); 794 + } 809 795 /* XXX should handle break (0x10) */ 796 + if (stat & RXERROR_PARITY) 797 + flag = TTY_PARITY; 798 + else if (stat & RXERROR_FRAMING) 799 + flag = TTY_FRAME; 800 + 810 801 tty_insert_flip_char(&port->port, 811 802 data[i+1], flag); 812 803 }
+3 -8
drivers/usb/serial/ssu100.c
··· 490 490 if (*tty_flag == TTY_NORMAL) 491 491 *tty_flag = TTY_FRAME; 492 492 } 493 - if (lsr & UART_LSR_OE){ 493 + if (lsr & UART_LSR_OE) { 494 494 port->icount.overrun++; 495 - if (*tty_flag == TTY_NORMAL) 496 - *tty_flag = TTY_OVERRUN; 495 + tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); 497 496 } 498 497 } 499 498 ··· 510 511 if ((len >= 4) && 511 512 (packet[0] == 0x1b) && (packet[1] == 0x1b) && 512 513 ((packet[2] == 0x00) || (packet[2] == 0x01))) { 513 - if (packet[2] == 0x00) { 514 + if (packet[2] == 0x00) 514 515 ssu100_update_lsr(port, packet[3], &flag); 515 - if (flag == TTY_OVERRUN) 516 - tty_insert_flip_char(&port->port, 0, 517 - TTY_OVERRUN); 518 - } 519 516 if (packet[2] == 0x01) 520 517 ssu100_update_msr(port, packet[3]); 521 518
+7
drivers/usb/storage/unusual_uas.h
··· 103 103 "VL711", 104 104 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 105 105 US_FL_NO_ATA_1X), 106 + 107 + /* Reported-by: Hans de Goede <hdegoede@redhat.com> */ 108 + UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, 109 + "Hitachi", 110 + "External HDD", 111 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 112 + US_FL_IGNORE_UAS),