]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'usb/usb-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 11 Feb 2016 02:54:40 +0000 (13:54 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 11 Feb 2016 02:54:40 +0000 (13:54 +1100)
1  2 
drivers/usb/core/hcd-pci.c
drivers/usb/core/urb.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
include/linux/device.h

index c3640f8a8fb34440a8cb96b0320c26835131cbef,22a9ac25b85058a858c235c856c1f7a8654ae544..f9d42cf23e55f80104066f6c38b6deda9943f458
@@@ -28,6 -28,7 +28,6 @@@
  #ifdef CONFIG_PPC_PMAC
  #include <asm/machdep.h>
  #include <asm/pmac_feature.h>
 -#include <asm/pci-bridge.h>
  #include <asm/prom.h>
  #endif
  
@@@ -196,7 -197,7 +196,7 @@@ int usb_hcd_pci_probe(struct pci_dev *d
         * The xHCI driver has its own irq management
         * make sure irq setup is not touched for xhci in generic hcd code
         */
-       if ((driver->flags & HCD_MASK) != HCD_USB3) {
+       if ((driver->flags & HCD_MASK) < HCD_USB3) {
                if (!dev->irq) {
                        dev_err(&dev->dev,
                        "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
diff --combined drivers/usb/core/urb.c
index f33b6e02b9fd6cfb3c4c10b51ec8a504f5eba34f,c601e25b609fb58e6842c18e62e5c484c98182ae..2509fc1237cf1db67c9c27ff8e3f24440f51469a
@@@ -401,7 -401,7 +401,7 @@@ int usb_submit_urb(struct urb *urb, gfp
                /* SuperSpeed isoc endpoints have up to 16 bursts of up to
                 * 3 packets each
                 */
-               if (dev->speed == USB_SPEED_SUPER) {
+               if (dev->speed >= USB_SPEED_SUPER) {
                        int     burst = 1 + ep->ss_ep_comp.bMaxBurst;
                        int     mult = USB_SS_MULT(ep->ss_ep_comp.bmAttributes);
                        max *= burst;
         */
  
        /* Check that the pipe's type matches the endpoint's type */
 -      if (usb_pipetype(urb->pipe) != pipetypes[xfertype])
 -              dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
 +      dev_WARN(&dev->dev, usb_pipetype(urb->pipe) != pipetypes[xfertype],
 +                      "BOGUS urb xfer, pipe %x != type %x\n",
                        usb_pipetype(urb->pipe), pipetypes[xfertype]);
  
        /* Check against a simple/standard policy */
        allowed &= urb->transfer_flags;
  
        /* warn if submitter gave bogus flags */
 -      if (allowed != urb->transfer_flags)
 -              dev_WARN(&dev->dev, "BOGUS urb flags, %x --> %x\n",
 +      dev_WARN(&dev->dev, allowed != urb->transfer_flags,
 +                      "BOGUS urb flags, %x --> %x\n",
                        urb->transfer_flags, allowed);
  
        /*
                }
                /* too big? */
                switch (dev->speed) {
+               case USB_SPEED_SUPER_PLUS:
                case USB_SPEED_SUPER:   /* units are 125us */
                        /* Handle up to 2^(16-1) microframes */
                        if (urb->interval > (1 << 15))
index 3915657e6078b66211fd699eab9bf227752f1ffc,cd336226ad478af8a3a2578f914e3065e687aea7..6773e508d9bb67619a5c576ee6a9794a8b702dd7
@@@ -2193,6 -2193,10 +2193,6 @@@ static int process_bulk_intr_td(struct 
                }
        /* Fast path - was this the last TRB in the TD for this URB? */
        } else if (event_trb == td->last_trb) {
 -              if (td->urb_length_set && trb_comp_code == COMP_SHORT_TX)
 -                      return finish_td(xhci, td, event_trb, event, ep,
 -                                       status, false);
 -
                if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
                        td->urb->actual_length =
                                td->urb->transfer_buffer_length -
                        td->urb->actual_length +=
                                TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -
                                EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
 -
 -              if (trb_comp_code == COMP_SHORT_TX) {
 -                      xhci_dbg(xhci, "mid bulk/intr SP, wait for last TRB event\n");
 -                      td->urb_length_set = true;
 -                      return 0;
 -              }
        }
  
        return finish_td(xhci, td, event_trb, event, ep, status, false);
@@@ -3563,7 -3573,7 +3563,7 @@@ static unsigned int xhci_get_burst_coun
  {
        unsigned int max_burst;
  
-       if (xhci->hci_version < 0x100 || udev->speed != USB_SPEED_SUPER)
+       if (xhci->hci_version < 0x100 || udev->speed < USB_SPEED_SUPER)
                return 0;
  
        max_burst = urb->ep->ss_ep_comp.bMaxBurst;
@@@ -3589,6 -3599,7 +3589,7 @@@ static unsigned int xhci_get_last_burst
                return 0;
  
        switch (udev->speed) {
+       case USB_SPEED_SUPER_PLUS:
        case USB_SPEED_SUPER:
                /* bMaxBurst is zero based: 0 means 1 packet per burst */
                max_burst = urb->ep->ss_ep_comp.bMaxBurst;
diff --combined drivers/usb/host/xhci.c
index 0c8087d3c3138f72e6eeaedc928c09453ab32285,503d82fb0dd582b799ae8ca76e846517ee3bae81..d51ee0c3cf9f009d3f9098bfa77434a6ed4695b6
@@@ -1554,9 -1554,7 +1554,9 @@@ int xhci_urb_dequeue(struct usb_hcd *hc
                xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
                                "HW died, freeing TD.");
                urb_priv = urb->hcpriv;
 -              for (i = urb_priv->td_cnt; i < urb_priv->length; i++) {
 +              for (i = urb_priv->td_cnt;
 +                   i < urb_priv->length && xhci->devs[urb->dev->slot_id];
 +                   i++) {
                        td = urb_priv->td[i];
                        if (!list_empty(&td->td_list))
                                list_del_init(&td->td_list);
@@@ -2086,6 -2084,7 +2086,7 @@@ static unsigned int xhci_get_block_size
        case USB_SPEED_HIGH:
                return HS_BLOCK;
        case USB_SPEED_SUPER:
+       case USB_SPEED_SUPER_PLUS:
                return SS_BLOCK;
        case USB_SPEED_UNKNOWN:
        case USB_SPEED_WIRELESS:
@@@ -2211,7 -2210,7 +2212,7 @@@ static int xhci_check_bw_table(struct x
        unsigned int packets_remaining = 0;
        unsigned int i;
  
-       if (virt_dev->udev->speed == USB_SPEED_SUPER)
+       if (virt_dev->udev->speed >= USB_SPEED_SUPER)
                return xhci_check_ss_bw(xhci, virt_dev);
  
        if (virt_dev->udev->speed == USB_SPEED_HIGH) {
@@@ -2412,7 -2411,7 +2413,7 @@@ void xhci_drop_ep_from_interval_table(s
        if (xhci_is_async_ep(ep_bw->type))
                return;
  
-       if (udev->speed == USB_SPEED_SUPER) {
+       if (udev->speed >= USB_SPEED_SUPER) {
                if (xhci_is_sync_in_ep(ep_bw->type))
                        xhci->devs[udev->slot_id]->bw_table->ss_bw_in -=
                                xhci_get_ss_bw_consumed(ep_bw);
                interval_bw->overhead[HS_OVERHEAD_TYPE] -= 1;
                break;
        case USB_SPEED_SUPER:
+       case USB_SPEED_SUPER_PLUS:
        case USB_SPEED_UNKNOWN:
        case USB_SPEED_WIRELESS:
                /* Should never happen because only LS/FS/HS endpoints will get
@@@ -2509,6 -2509,7 +2511,7 @@@ static void xhci_add_ep_to_interval_tab
                interval_bw->overhead[HS_OVERHEAD_TYPE] += 1;
                break;
        case USB_SPEED_SUPER:
+       case USB_SPEED_SUPER_PLUS:
        case USB_SPEED_UNKNOWN:
        case USB_SPEED_WIRELESS:
                /* Should never happen because only LS/FS/HS endpoints will get
@@@ -4897,6 -4898,7 +4900,7 @@@ int xhci_gen_setup(struct usb_hcd *hcd
                if (xhci->sbrn == 0x31) {
                        xhci_info(xhci, "Host supports USB 3.1 Enhanced SuperSpeed\n");
                        hcd->speed = HCD_USB31;
+                       hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
                }
                /* xHCI private pointer was set in xhci_pci_probe for the second
                 * registered roothub.
diff --combined drivers/usb/host/xhci.h
index cc651383ce5a85d713c66b032a0aa30bd4331dc8,9f28bea65fedc1d2c8aba3a78b252470e7224934..e1bee3fe1a394ae7d39edd919aca493da91cb86b
@@@ -343,6 -343,7 +343,7 @@@ struct xhci_op_regs 
  #define       SLOT_SPEED_LS           (XDEV_LS << 10)
  #define       SLOT_SPEED_HS           (XDEV_HS << 10)
  #define       SLOT_SPEED_SS           (XDEV_SS << 10)
+ #define       SLOT_SPEED_SSP          (XDEV_SSP << 10)
  /* Port Indicator Control */
  #define PORT_LED_OFF  (0 << 14)
  #define PORT_LED_AMBER        (1 << 14)
@@@ -1631,7 -1632,6 +1632,7 @@@ struct xhci_hcd 
  #define XHCI_BROKEN_STREAMS   (1 << 19)
  #define XHCI_PME_STUCK_QUIRK  (1 << 20)
  #define XHCI_MTK_HOST         (1 << 21)
 +#define XHCI_SSIC_PORT_UNUSED (1 << 22)
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
        /* There are two roothubs to keep track of bus suspend info for */
diff --combined include/linux/device.h
index 22225cc33e14353fd8221fce0a741f4787447157,2d0e6e541d525dd0be21dfe2dea20df7204e791a..6c1a8ce77e3b391396939a7e7663c7bc21745608
@@@ -958,6 -958,11 +958,11 @@@ static inline void device_lock(struct d
        mutex_lock(&dev->mutex);
  }
  
+ static inline int device_lock_interruptible(struct device *dev)
+ {
+       return mutex_lock_interruptible(&dev->mutex);
+ }
  static inline int device_trylock(struct device *dev)
  {
        return mutex_trylock(&dev->mutex);
@@@ -1291,9 -1296,8 +1296,9 @@@ do {                                                                    
   * dev_WARN*() acts like dev_printk(), but with the key difference of
   * using WARN/WARN_ONCE to include file/line information and a backtrace.
   */
 -#define dev_WARN(dev, format, arg...) \
 -      WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg);
 +#define dev_WARN(dev, condition, format, arg...)              \
 +      WARN(condition, "%s %s: " format,                       \
 +                      dev_driver_string(dev), dev_name(dev), ## arg)
  
  #define dev_WARN_ONCE(dev, condition, format, arg...) \
        WARN_ONCE(condition, "%s %s: " format, \