Merge tag 'usb-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Jul 2017 20:42:04 +0000 (13:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Jul 2017 20:42:04 +0000 (13:42 -0700)
Pull USB fixes from Greg KH:
 "Here are some remaining USB fixes for 4.13-rc1. They were originally
  scheduled for 4.12-final, but I didn't send them to you in time.
  Because of that, they were in a separate branch from the larger USB
  set of patches, so here they are in a separate pull request.

  Nothing major here a all, just three small patches:

   - some usb-serial new device ids
   - xhci bugfix for some crazy AMD hardware

  All of these have been in linux-next for a long time with no reported
  issues"

* tag 'usb-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  xhci: Limit USB2 port wake support for AMD Promontory hosts
  USB: serial: qcserial: new Sierra Wireless EM7305 device ID
  USB: serial: option: add two Longcheer device ids

1  2 
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.h
drivers/usb/serial/qcserial.c

index 783e6687bf4a528404523d04330d2655a0a512ce,0965bae95a7b82878057a5ee147aca074590468a..53882e2babbb2ec3903aebdb14b9fd3a28482d47
  #define PCI_DEVICE_ID_INTEL_APL_XHCI                  0x5aa8
  #define PCI_DEVICE_ID_INTEL_DNV_XHCI                  0x19d0
  
+ #define PCI_DEVICE_ID_AMD_PROMONTORYA_4                       0x43b9
+ #define PCI_DEVICE_ID_AMD_PROMONTORYA_3                       0x43ba
+ #define PCI_DEVICE_ID_AMD_PROMONTORYA_2                       0x43bb
+ #define PCI_DEVICE_ID_AMD_PROMONTORYA_1                       0x43bc
  static const char hcd_name[] = "xhci_hcd";
  
  static struct hc_driver __read_mostly xhci_pci_hc_driver;
@@@ -135,6 -140,13 +140,13 @@@ static void xhci_pci_quirks(struct devi
        if (pdev->vendor == PCI_VENDOR_ID_AMD)
                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  
+       if ((pdev->vendor == PCI_VENDOR_ID_AMD) &&
+               ((pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4) ||
+               (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_3) ||
+               (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2) ||
+               (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1)))
+               xhci->quirks |= XHCI_U2_DISABLE_WAKE;
        if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
                xhci->quirks |= XHCI_LPM_SUPPORT;
                xhci->quirks |= XHCI_INTEL_HOST;
  #ifdef CONFIG_ACPI
  static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev)
  {
 -      static const u8 intel_dsm_uuid[] = {
 -              0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45,
 -              0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23,
 -      };
 +      static const guid_t intel_dsm_guid =
 +              GUID_INIT(0xac340cb7, 0xe901, 0x45bf,
 +                        0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23);
        union acpi_object *obj;
  
 -      obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1,
 +      obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), &intel_dsm_guid, 3, 1,
                                NULL);
        ACPI_FREE(obj);
  }
diff --combined drivers/usb/host/xhci.h
index 650a2d9d4aecd29e2066ed0b4e1a55443a9176bc,dcd9649808c05ea144194f26a545902fbd140409..3c6da1f93c845a6373deffcbf81be9530b03b122
@@@ -924,6 -924,8 +924,6 @@@ struct xhci_virt_ep 
  #define EP_GETTING_NO_STREAMS (1 << 5)
        /* ----  Related to URB cancellation ---- */
        struct list_head        cancelled_td_list;
 -      struct xhci_td          *stopped_td;
 -      unsigned int            stopped_stream;
        /* Watchdog timer for stop endpoint command to cancel URBs */
        struct timer_list       stop_cmd_timer;
        struct xhci_hcd         *xhci;
@@@ -991,6 -993,10 +991,6 @@@ struct xhci_virt_device 
        struct xhci_container_ctx       *out_ctx;
        /* Used for addressing devices and configuration changes */
        struct xhci_container_ctx       *in_ctx;
 -      /* Rings saved to ensure old alt settings can be re-instated */
 -      struct xhci_ring                **ring_cache;
 -      int                             num_rings_cached;
 -#define       XHCI_MAX_RINGS_CACHED   31
        struct xhci_virt_ep             eps[31];
        u8                              fake_port;
        u8                              real_port;
@@@ -1204,11 -1210,6 +1204,11 @@@ struct xhci_event_cmd 
  /* Stop Ring - Transfer State Preserve */
  #define TRB_TSP               (1<<9)
  
 +enum xhci_ep_reset_type {
 +      EP_HARD_RESET,
 +      EP_SOFT_RESET,
 +};
 +
  /* Force Event */
  #define TRB_TO_VF_INTR_TARGET(p)      (((p) & (0x3ff << 22)) >> 22)
  #define TRB_TO_VF_ID(p)                       (((p) & (0xff << 16)) >> 16)
@@@ -1526,7 -1527,6 +1526,7 @@@ struct xhci_dequeue_state 
        struct xhci_segment *new_deq_seg;
        union xhci_trb *new_deq_ptr;
        int new_cycle_state;
 +      unsigned int stream_id;
  };
  
  enum xhci_ring_type {
@@@ -1819,6 -1819,7 +1819,7 @@@ struct xhci_hcd 
  /* For controller with a broken Port Disable implementation */
  #define XHCI_BROKEN_PORT_PED  (1 << 25)
  #define XHCI_LIMIT_ENDPOINT_INTERVAL_7        (1 << 26)
+ #define XHCI_U2_DISABLE_WAKE  (1 << 27)
  
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
@@@ -1960,7 -1961,7 +1961,7 @@@ int xhci_endpoint_init(struct xhci_hcd 
  void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring);
  int xhci_ring_expansion(struct xhci_hcd *xhci, struct xhci_ring *ring,
                                unsigned int num_trbs, gfp_t flags);
 -void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci,
 +void xhci_free_endpoint_ring(struct xhci_hcd *xhci,
                struct xhci_virt_device *virt_dev,
                unsigned int ep_index);
  struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
@@@ -2044,8 -2045,7 +2045,8 @@@ int xhci_queue_configure_endpoint(struc
  int xhci_queue_evaluate_context(struct xhci_hcd *xhci, struct xhci_command *cmd,
                dma_addr_t in_ctx_ptr, u32 slot_id, bool command_must_succeed);
  int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd,
 -              int slot_id, unsigned int ep_index);
 +              int slot_id, unsigned int ep_index,
 +              enum xhci_ep_reset_type reset_type);
  int xhci_queue_reset_device(struct xhci_hcd *xhci, struct xhci_command *cmd,
                u32 slot_id);
  void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
                struct xhci_dequeue_state *state);
  void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
                unsigned int slot_id, unsigned int ep_index,
 -              unsigned int stream_id,
                struct xhci_dequeue_state *deq_state);
 -void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
 -              unsigned int ep_index, struct xhci_td *td);
 +void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, unsigned int ep_index,
 +              unsigned int stream_id, struct xhci_td *td);
  void xhci_stop_endpoint_command_watchdog(unsigned long arg);
  void xhci_handle_command_timeout(struct work_struct *work);
  
index 4ac137d070fbc55fef25556c52d2f9449a866dbc,652b4334b26dd62eb966bda17d3a52251471587c..ebc0beea69d63efe165423799fd741214e99d15c
@@@ -158,6 -158,7 +158,7 @@@ static const struct usb_device_id id_ta
        {DEVICE_SWI(0x1199, 0x9056)},   /* Sierra Wireless Modem */
        {DEVICE_SWI(0x1199, 0x9060)},   /* Sierra Wireless Modem */
        {DEVICE_SWI(0x1199, 0x9061)},   /* Sierra Wireless Modem */
+       {DEVICE_SWI(0x1199, 0x9063)},   /* Sierra Wireless EM7305 */
        {DEVICE_SWI(0x1199, 0x9070)},   /* Sierra Wireless MC74xx */
        {DEVICE_SWI(0x1199, 0x9071)},   /* Sierra Wireless MC74xx */
        {DEVICE_SWI(0x1199, 0x9078)},   /* Sierra Wireless EM74xx */
@@@ -454,8 -455,6 +455,8 @@@ static struct usb_serial_driver qcdevic
        .write               = usb_wwan_write,
        .write_room          = usb_wwan_write_room,
        .chars_in_buffer     = usb_wwan_chars_in_buffer,
 +      .tiocmget            = usb_wwan_tiocmget,
 +      .tiocmset            = usb_wwan_tiocmset,
        .attach              = qc_attach,
        .release             = qc_release,
        .port_probe          = usb_wwan_port_probe,