Commit 4742eb3dadbb6970a8f267e4605192d1e8199425

Authored by Linus Torvalds

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

Showing 14 changed files Side-by-side Diff

drivers/usb/core/quirks.c
... ... @@ -44,6 +44,9 @@
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  
drivers/usb/dwc3/ep0.c
... ... @@ -791,6 +791,10 @@
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");
... ... @@ -800,10 +804,6 @@
800 804  
801 805 return;
802 806 }
803   -
804   - r = next_request(&ep0->request_list);
805   - if (!r)
806   - return;
807 807  
808 808 ur = &r->request;
809 809  
drivers/usb/host/xhci-hub.c
... ... @@ -22,7 +22,6 @@
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"
... ... @@ -1149,9 +1148,7 @@
1149 1148 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
1150 1149 * is enabled, so also enable remote wake here.
1151 1150 */
1152   - if (hcd->self.root_hub->do_remote_wakeup
1153   - && device_may_wakeup(hcd->self.controller)) {
1154   -
  1151 + if (hcd->self.root_hub->do_remote_wakeup) {
1155 1152 if (t1 & PORT_CONNECT) {
1156 1153 t2 |= PORT_WKOC_E | PORT_WKDISC_E;
1157 1154 t2 &= ~PORT_WKCONN_E;
drivers/usb/host/xhci-pci.c
... ... @@ -281,7 +281,7 @@
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)
drivers/usb/host/xhci-plat.c
... ... @@ -204,7 +204,15 @@
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)
drivers/usb/host/xhci-ring.c
... ... @@ -1067,9 +1067,8 @@
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  
1076 1075  
... ... @@ -1823,23 +1822,14 @@
1823 1822 ep->stopped_td = td;
1824 1823 return 0;
1825 1824 } else {
1826   - if (trb_comp_code == COMP_STALL) {
1827   - /* The transfer is completed from the driver's
1828   - * perspective, but we need to issue a set dequeue
1829   - * command for this stalled endpoint to move the dequeue
1830   - * pointer past the TD. We can't do that here because
1831   - * the halt condition must be cleared first. Let the
1832   - * USB class driver clear the stall later.
  1825 + if (trb_comp_code == COMP_STALL ||
  1826 + xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
  1827 + trb_comp_code)) {
  1828 + /* Issue a reset endpoint command to clear the host side
  1829 + * halt, followed by a set dequeue command to move the
  1830 + * dequeue pointer past the TD.
  1831 + * The class driver clears the device side halt later.
1833 1832 */
1834   - ep->stopped_td = td;
1835   - ep->stopped_stream = ep_ring->stream_id;
1836   - } else if (xhci_requires_manual_halt_cleanup(xhci,
1837   - ep_ctx, trb_comp_code)) {
1838   - /* Other types of errors halt the endpoint, but the
1839   - * class driver doesn't call usb_reset_endpoint() unless
1840   - * the error is -EPIPE. Clear the halted status in the
1841   - * xHCI hardware manually.
1842   - */
1843 1833 xhci_cleanup_halted_endpoint(xhci,
1844 1834 slot_id, ep_index, ep_ring->stream_id,
1845 1835 td, event_trb);
... ... @@ -1958,9 +1948,7 @@
1958 1948 else
1959 1949 td->urb->actual_length = 0;
1960 1950  
1961   - xhci_cleanup_halted_endpoint(xhci,
1962   - slot_id, ep_index, 0, td, event_trb);
1963   - return finish_td(xhci, td, event_trb, event, ep, status, true);
  1951 + return finish_td(xhci, td, event_trb, event, ep, status, false);
1964 1952 }
1965 1953 /*
1966 1954 * Did we transfer any data, despite the errors that might have
... ... @@ -2519,17 +2507,8 @@
2519 2507 if (ret) {
2520 2508 urb = td->urb;
2521 2509 urb_priv = urb->hcpriv;
2522   - /* Leave the TD around for the reset endpoint function
2523   - * to use(but only if it's not a control endpoint,
2524   - * since we already queued the Set TR dequeue pointer
2525   - * command for stalled control endpoints).
2526   - */
2527   - if (usb_endpoint_xfer_control(&urb->ep->desc) ||
2528   - (trb_comp_code != COMP_STALL &&
2529   - trb_comp_code != COMP_BABBLE))
2530   - xhci_urb_free_priv(xhci, urb_priv);
2531   - else
2532   - kfree(urb_priv);
  2510 +
  2511 + xhci_urb_free_priv(xhci, urb_priv);
2533 2512  
2534 2513 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
2535 2514 if ((urb->actual_length != urb->transfer_buffer_length &&
drivers/usb/host/xhci.c
... ... @@ -35,6 +35,8 @@
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);
41 43  
... ... @@ -851,13 +853,47 @@
851 853 xhci_set_cmd_ring_deq(xhci);
852 854 }
853 855  
  856 +static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
  857 +{
  858 + int port_index;
  859 + __le32 __iomem **port_array;
  860 + unsigned long flags;
  861 + u32 t1, t2;
  862 +
  863 + spin_lock_irqsave(&xhci->lock, flags);
  864 +
  865 + /* disble usb3 ports Wake bits*/
  866 + port_index = xhci->num_usb3_ports;
  867 + port_array = xhci->usb3_ports;
  868 + while (port_index--) {
  869 + t1 = readl(port_array[port_index]);
  870 + t1 = xhci_port_state_to_neutral(t1);
  871 + t2 = t1 & ~PORT_WAKE_BITS;
  872 + if (t1 != t2)
  873 + writel(t2, port_array[port_index]);
  874 + }
  875 +
  876 + /* disble usb2 ports Wake bits*/
  877 + port_index = xhci->num_usb2_ports;
  878 + port_array = xhci->usb2_ports;
  879 + while (port_index--) {
  880 + t1 = readl(port_array[port_index]);
  881 + t1 = xhci_port_state_to_neutral(t1);
  882 + t2 = t1 & ~PORT_WAKE_BITS;
  883 + if (t1 != t2)
  884 + writel(t2, port_array[port_index]);
  885 + }
  886 +
  887 + spin_unlock_irqrestore(&xhci->lock, flags);
  888 +}
  889 +
854 890 /*
855 891 * Stop HC (not bus-specific)
856 892 *
857 893 * This is called when the machine transition into S3/S4 mode.
858 894 *
859 895 */
860   -int xhci_suspend(struct xhci_hcd *xhci)
  896 +int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
861 897 {
862 898 int rc = 0;
863 899 unsigned int delay = XHCI_MAX_HALT_USEC;
... ... @@ -868,6 +904,10 @@
868 904 xhci->shared_hcd->state != HC_STATE_SUSPENDED)
869 905 return -EINVAL;
870 906  
  907 + /* Clear root port wake on bits if wakeup not allowed. */
  908 + if (!do_wakeup)
  909 + xhci_disable_port_wake_on_bits(xhci);
  910 +
871 911 /* Don't poll the roothubs on bus suspend. */
872 912 xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
873 913 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
874 914  
875 915  
876 916  
877 917  
878 918  
879 919  
880 920  
... ... @@ -2912,68 +2952,33 @@
2912 2952 }
2913 2953 }
2914 2954  
2915   -/* Deal with stalled endpoints. The core should have sent the control message
2916   - * to clear the halt condition. However, we need to make the xHCI hardware
2917   - * reset its sequence number, since a device will expect a sequence number of
2918   - * zero after the halt condition is cleared.
  2955 +/* Called when clearing halted device. The core should have sent the control
  2956 + * message to clear the device halt condition. The host side of the halt should
  2957 + * already be cleared with a reset endpoint command issued when the STALL tx
  2958 + * event was received.
  2959 + *
2919 2960 * Context: in_interrupt
2920 2961 */
  2962 +
2921 2963 void xhci_endpoint_reset(struct usb_hcd *hcd,
2922 2964 struct usb_host_endpoint *ep)
2923 2965 {
2924 2966 struct xhci_hcd *xhci;
2925   - struct usb_device *udev;
2926   - unsigned int ep_index;
2927   - unsigned long flags;
2928   - int ret;
2929   - struct xhci_virt_ep *virt_ep;
2930   - struct xhci_command *command;
2931 2967  
2932 2968 xhci = hcd_to_xhci(hcd);
2933   - udev = (struct usb_device *) ep->hcpriv;
2934   - /* Called with a root hub endpoint (or an endpoint that wasn't added
2935   - * with xhci_add_endpoint()
2936   - */
2937   - if (!ep->hcpriv)
2938   - return;
2939   - ep_index = xhci_get_endpoint_index(&ep->desc);
2940   - virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index];
2941   - if (!virt_ep->stopped_td) {
2942   - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
2943   - "Endpoint 0x%x not halted, refusing to reset.",
2944   - ep->desc.bEndpointAddress);
2945   - return;
2946   - }
2947   - if (usb_endpoint_xfer_control(&ep->desc)) {
2948   - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
2949   - "Control endpoint stall already handled.");
2950   - return;
2951   - }
2952 2969  
2953   - command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
2954   - if (!command)
2955   - return;
2956   -
2957   - xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
2958   - "Queueing reset endpoint command");
2959   - spin_lock_irqsave(&xhci->lock, flags);
2960   - ret = xhci_queue_reset_ep(xhci, command, udev->slot_id, ep_index);
2961 2970 /*
2962   - * Can't change the ring dequeue pointer until it's transitioned to the
2963   - * stopped state, which is only upon a successful reset endpoint
2964   - * command. Better hope that last command worked!
  2971 + * We might need to implement the config ep cmd in xhci 4.8.1 note:
  2972 + * The Reset Endpoint Command may only be issued to endpoints in the
  2973 + * Halted state. If software wishes reset the Data Toggle or Sequence
  2974 + * Number of an endpoint that isn't in the Halted state, then software
  2975 + * may issue a Configure Endpoint Command with the Drop and Add bits set
  2976 + * for the target endpoint. that is in the Stopped state.
2965 2977 */
2966   - if (!ret) {
2967   - xhci_cleanup_stalled_ring(xhci, udev, ep_index);
2968   - kfree(virt_ep->stopped_td);
2969   - xhci_ring_cmd_db(xhci);
2970   - }
2971   - virt_ep->stopped_td = NULL;
2972   - virt_ep->stopped_stream = 0;
2973   - spin_unlock_irqrestore(&xhci->lock, flags);
2974 2978  
2975   - if (ret)
2976   - xhci_warn(xhci, "FIXME allocate a new ring segment\n");
  2979 + /* For now just print debug to follow the situation */
  2980 + xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n",
  2981 + ep->desc.bEndpointAddress);
2977 2982 }
2978 2983  
2979 2984 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
drivers/usb/host/xhci.h
... ... @@ -1746,7 +1746,7 @@
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
drivers/usb/serial/cp210x.c
... ... @@ -120,6 +120,7 @@
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 */
drivers/usb/serial/ftdi_sio.c
... ... @@ -470,6 +470,39 @@
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) },
drivers/usb/serial/ftdi_sio_ids.h
... ... @@ -926,8 +926,8 @@
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,8 +1186,39 @@
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)
drivers/usb/serial/keyspan.c
... ... @@ -311,24 +311,30 @@
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 }
335 341  
... ... @@ -649,14 +655,19 @@
649 655 } else {
650 656 /* some bytes had errors, every byte has status */
651 657 for (i = 0; i + 1 < urb->actual_length; i += 2) {
652   - int stat = data[i], flag = 0;
653   - if (stat & RXERROR_OVERRUN)
654   - flag |= TTY_OVERRUN;
655   - if (stat & RXERROR_FRAMING)
656   - flag |= TTY_FRAME;
657   - if (stat & RXERROR_PARITY)
658   - flag |= TTY_PARITY;
  658 + int stat = data[i];
  659 + int flag = TTY_NORMAL;
  660 +
  661 + if (stat & RXERROR_OVERRUN) {
  662 + tty_insert_flip_char(&port->port, 0,
  663 + TTY_OVERRUN);
  664 + }
659 665 /* XXX should handle break (0x10) */
  666 + if (stat & RXERROR_PARITY)
  667 + flag = TTY_PARITY;
  668 + else if (stat & RXERROR_FRAMING)
  669 + flag = TTY_FRAME;
  670 +
660 671 tty_insert_flip_char(&port->port, data[i+1],
661 672 flag);
662 673 }
663 674  
664 675  
... ... @@ -713,15 +724,19 @@
713 724 */
714 725 for (x = 0; x + 1 < len &&
715 726 i + 1 < urb->actual_length; x += 2) {
716   - int stat = data[i], flag = 0;
  727 + int stat = data[i];
  728 + int flag = TTY_NORMAL;
717 729  
718   - if (stat & RXERROR_OVERRUN)
719   - flag |= TTY_OVERRUN;
720   - if (stat & RXERROR_FRAMING)
721   - flag |= TTY_FRAME;
722   - if (stat & RXERROR_PARITY)
723   - flag |= TTY_PARITY;
  730 + if (stat & RXERROR_OVERRUN) {
  731 + tty_insert_flip_char(&port->port, 0,
  732 + TTY_OVERRUN);
  733 + }
724 734 /* XXX should handle break (0x10) */
  735 + if (stat & RXERROR_PARITY)
  736 + flag = TTY_PARITY;
  737 + else if (stat & RXERROR_FRAMING)
  738 + flag = TTY_FRAME;
  739 +
725 740 tty_insert_flip_char(&port->port, data[i+1],
726 741 flag);
727 742 i += 2;
728 743  
729 744  
730 745  
... ... @@ -773,25 +788,31 @@
773 788 if ((data[0] & 0x80) == 0) {
774 789 /* no errors on individual bytes, only
775 790 possible overrun err*/
776   - if (data[0] & RXERROR_OVERRUN)
777   - err = TTY_OVERRUN;
778   - else
779   - err = 0;
  791 + if (data[0] & RXERROR_OVERRUN) {
  792 + tty_insert_flip_char(&port->port, 0,
  793 + TTY_OVERRUN);
  794 + }
780 795 for (i = 1; i < urb->actual_length ; ++i)
781 796 tty_insert_flip_char(&port->port,
782   - data[i], err);
  797 + data[i], TTY_NORMAL);
783 798 } else {
784 799 /* some bytes had errors, every byte has status */
785 800 dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
786 801 for (i = 0; i + 1 < urb->actual_length; i += 2) {
787   - int stat = data[i], flag = 0;
788   - if (stat & RXERROR_OVERRUN)
789   - flag |= TTY_OVERRUN;
790   - if (stat & RXERROR_FRAMING)
791   - flag |= TTY_FRAME;
792   - if (stat & RXERROR_PARITY)
793   - flag |= TTY_PARITY;
  802 + int stat = data[i];
  803 + int flag = TTY_NORMAL;
  804 +
  805 + if (stat & RXERROR_OVERRUN) {
  806 + tty_insert_flip_char(
  807 + &port->port, 0,
  808 + TTY_OVERRUN);
  809 + }
794 810 /* XXX should handle break (0x10) */
  811 + if (stat & RXERROR_PARITY)
  812 + flag = TTY_PARITY;
  813 + else if (stat & RXERROR_FRAMING)
  814 + flag = TTY_FRAME;
  815 +
795 816 tty_insert_flip_char(&port->port,
796 817 data[i+1], flag);
797 818 }
drivers/usb/serial/ssu100.c
... ... @@ -490,10 +490,9 @@
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  
500 499  
... ... @@ -511,12 +510,8 @@
511 510 if ((len >= 4) &&
512 511 (packet[0] == 0x1b) && (packet[1] == 0x1b) &&
513 512 ((packet[2] == 0x00) || (packet[2] == 0x01))) {
514   - if (packet[2] == 0x00) {
  513 + if (packet[2] == 0x00)
515 514 ssu100_update_lsr(port, packet[3], &flag);
516   - if (flag == TTY_OVERRUN)
517   - tty_insert_flip_char(&port->port, 0,
518   - TTY_OVERRUN);
519   - }
520 515 if (packet[2] == 0x01)
521 516 ssu100_update_msr(port, packet[3]);
522 517  
drivers/usb/storage/unusual_uas.h
... ... @@ -103,4 +103,11 @@
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),