]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge 4.3-rc7 into usb-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 21:39:46 +0000 (06:39 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 21:39:46 +0000 (06:39 +0900)
We want the USB and other fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1  2 
MAINTAINERS
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-ring.c

diff --combined MAINTAINERS
index 7f142e748bead56799f8c0cca226bc7740474a48,9de185da5f5b0dfe1be0730b8248b3aff44e0c84..04251673ec1495193f729912b69dc8d9bb7a1abd
@@@ -894,11 -894,12 +894,12 @@@ M:      Lennert Buytenhek <kernel@wantstofly
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  
- ARM/Allwinner A1X SoC support
+ ARM/Allwinner sunXi SoC support
  M:    Maxime Ripard <maxime.ripard@free-electrons.com>
+ M:    Chen-Yu Tsai <wens@csie.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
- N:    sun[x4567]i
+ N:    sun[x456789]i
  
  ARM/Allwinner SoC Clock Support
  M:    Emilio López <emilio@elopez.com.ar>
@@@ -1297,13 -1298,6 +1298,13 @@@ F:    arch/arm/mach-mediatek
  N:    mtk
  K:    mediatek
  
 +ARM/Mediatek USB3 PHY DRIVER
 +M:    Chunfeng Yun <chunfeng.yun@mediatek.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    linux-mediatek@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/phy/phy-mt65xx-usb3.c
 +
  ARM/MICREL KS8695 ARCHITECTURE
  M:    Greg Ungerer <gerg@uclinux.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -3598,6 -3592,13 +3599,13 @@@ F:    drivers/gpu/drm/i915
  F:    include/drm/i915*
  F:    include/uapi/drm/i915*
  
+ DRM DRIVERS FOR ATMEL HLCDC
+ M:    Boris Brezillon <boris.brezillon@free-electrons.com>
+ L:    dri-devel@lists.freedesktop.org
+ S:    Supported
+ F:    drivers/gpu/drm/atmel-hlcdc/
+ F:    Documentation/devicetree/bindings/drm/atmel/
  DRM DRIVERS FOR EXYNOS
  M:    Inki Dae <inki.dae@samsung.com>
  M:    Joonyoung Shim <jy0922.shim@samsung.com>
@@@ -3626,6 -3627,14 +3634,14 @@@ S:    Maintaine
  F:    drivers/gpu/drm/imx/
  F:    Documentation/devicetree/bindings/drm/imx/
  
+ DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets)
+ M:    Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
+ L:    dri-devel@lists.freedesktop.org
+ T:    git git://github.com/patjak/drm-gma500
+ S:    Maintained
+ F:    drivers/gpu/drm/gma500
+ F:    include/drm/gma500*
  DRM DRIVERS FOR NVIDIA TEGRA
  M:    Thierry Reding <thierry.reding@gmail.com>
  M:    Terje Bergström <tbergstrom@nvidia.com>
@@@ -6785,7 -6794,6 +6801,6 @@@ F:      drivers/scsi/megaraid
  
  MELLANOX ETHERNET DRIVER (mlx4_en)
  M:    Amir Vadai <amirv@mellanox.com>
- M:    Ido Shamay <idos@mellanox.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  W:    http://www.mellanox.com
@@@ -9108,6 -9116,15 +9123,15 @@@ S: Supporte
  F: Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt
  F: drivers/net/ethernet/synopsys/dwc_eth_qos.c
  
+ SYNOPSYS DESIGNWARE I2C DRIVER
+ M:    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+ M:    Jarkko Nikula <jarkko.nikula@linux.intel.com>
+ M:    Mika Westerberg <mika.westerberg@linux.intel.com>
+ L:    linux-i2c@vger.kernel.org
+ S:    Maintained
+ F:    drivers/i2c/busses/i2c-designware-*
+ F:    include/linux/platform_data/i2c-designware.h
  SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
  M:    Seungwon Jeon <tgih.jun@samsung.com>
  M:    Jaehoon Chung <jh80.chung@samsung.com>
@@@ -11658,6 -11675,7 +11682,7 @@@ F:   drivers/tty/serial/zs.
  ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR
  M:    Minchan Kim <minchan@kernel.org>
  M:    Nitin Gupta <ngupta@vflare.org>
+ R:    Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
  L:    linux-mm@kvack.org
  S:    Maintained
  F:    mm/zsmalloc.c
index 012d7f4c29015eec1c7ba071e17d2ebfdd06c566,c47d3e48058659230e8d48ed342f9c163b08732d..17f6897acde2a5a7674ccff44ddc55f0db192166
@@@ -147,6 -147,7 +147,7 @@@ static void xhci_pci_quirks(struct devi
        if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
                pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
                xhci->quirks |= XHCI_SPURIOUS_REBOOT;
+               xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
        }
        if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
                (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
@@@ -200,17 -201,15 +201,17 @@@ static int xhci_pci_setup(struct usb_hc
        struct pci_dev          *pdev = to_pci_dev(hcd->self.controller);
        int                     retval;
  
 +      xhci = hcd_to_xhci(hcd);
 +      if (!xhci->sbrn)
 +              pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn);
 +
        retval = xhci_gen_setup(hcd, xhci_pci_quirks);
        if (retval)
                return retval;
  
 -      xhci = hcd_to_xhci(hcd);
        if (!usb_hcd_is_primary_hcd(hcd))
                return 0;
  
 -      pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn);
        xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn);
  
        /* Find any debug ports */
index 4c54ccc1583abb8bcf0f3405d3765aaa8cc42714,97ffe39972735109f1ca1f86e003fe2550e4f936..fa836251ca21e4f19c59b3fd37b3b788b7b81008
@@@ -1453,7 -1453,7 +1453,7 @@@ static unsigned int find_faked_portnum_
                 * 1.1 ports are under the USB 2.0 hub.  If the port speed
                 * matches the device speed, it's a similar speed port.
                 */
 -              if ((port_speed == 0x03) == (hcd->speed == HCD_USB3))
 +              if ((port_speed == 0x03) == (hcd->speed >= HCD_USB3))
                        num_similar_speed_ports++;
        }
        return num_similar_speed_ports;
@@@ -1515,7 -1515,7 +1515,7 @@@ static void handle_port_status(struct x
  
        /* Find the right roothub. */
        hcd = xhci_to_hcd(xhci);
 -      if ((major_revision == 0x03) != (hcd->speed == HCD_USB3))
 +      if ((major_revision == 0x03) != (hcd->speed >= HCD_USB3))
                hcd = xhci->shared_hcd;
  
        if (major_revision == 0) {
         * correct bus_state structure.
         */
        bus_state = &xhci->bus_state[hcd_index(hcd)];
 -      if (hcd->speed == HCD_USB3)
 +      if (hcd->speed >= HCD_USB3)
                port_array = xhci->usb3_ports;
        else
                port_array = xhci->usb2_ports;
                usb_hcd_resume_root_hub(hcd);
        }
  
 -      if (hcd->speed == HCD_USB3 && (temp & PORT_PLS_MASK) == XDEV_INACTIVE)
 +      if (hcd->speed >= HCD_USB3 && (temp & PORT_PLS_MASK) == XDEV_INACTIVE)
                bus_state->port_remote_wakeup &= ~(1 << faked_port_index);
  
        if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) {
                        goto cleanup;
                }
  
 -              if (DEV_SUPERSPEED(temp)) {
 +              if (DEV_SUPERSPEED_ANY(temp)) {
                        xhci_dbg(xhci, "remote wake SS port %d\n", port_id);
                        /* Set a flag to say the port signaled remote wakeup,
                         * so we can tell the difference between the end of
        }
  
        if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_U0 &&
 -                      DEV_SUPERSPEED(temp)) {
 +                      DEV_SUPERSPEED_ANY(temp)) {
                xhci_dbg(xhci, "resume SS port %d finished\n", port_id);
                /* We've just brought the device into U0 through either the
                 * Resume state after a device remote wakeup, or through the
         * RExit to a disconnect state).  If so, let the the driver know it's
         * out of the RExit state.
         */
 -      if (!DEV_SUPERSPEED(temp) &&
 +      if (!DEV_SUPERSPEED_ANY(temp) &&
                        test_and_clear_bit(faked_port_index,
                                &bus_state->rexit_ports)) {
                complete(&bus_state->rexit_done[faked_port_index]);
                goto cleanup;
        }
  
 -      if (hcd->speed != HCD_USB3)
 +      if (hcd->speed < HCD_USB3)
                xhci_test_and_clear_bit(xhci, port_array, faked_port_index,
                                        PORT_PLC);
  
@@@ -2191,6 -2191,10 +2191,10 @@@ 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);
@@@ -2274,6 -2284,7 +2284,7 @@@ static int handle_tx_event(struct xhci_
        u32 trb_comp_code;
        int ret = 0;
        int td_num = 0;
+       bool handling_skipped_tds = false;
  
        slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));
        xdev = xhci->devs[slot_id];
                ep->skip = true;
                xhci_dbg(xhci, "Miss service interval error, set skip flag\n");
                goto cleanup;
+       case COMP_PING_ERR:
+               ep->skip = true;
+               xhci_dbg(xhci, "No Ping response error, Skip one Isoc TD\n");
+               goto cleanup;
        default:
                if (xhci_is_vendor_info_code(xhci, trb_comp_code)) {
                        status = 0;
                                                 ep, &status);
  
  cleanup:
+               handling_skipped_tds = ep->skip &&
+                       trb_comp_code != COMP_MISSED_INT &&
+                       trb_comp_code != COMP_PING_ERR;
                /*
-                * Do not update event ring dequeue pointer if ep->skip is set.
-                * Will roll back to continue process missed tds.
+                * Do not update event ring dequeue pointer if we're in a loop
+                * processing missed tds.
                 */
-               if (trb_comp_code == COMP_MISSED_INT || !ep->skip) {
+               if (!handling_skipped_tds)
                        inc_deq(xhci, xhci->event_ring);
-               }
  
                if (ret) {
                        urb = td->urb;
         * Process them as short transfer until reach the td pointed by
         * the event.
         */
-       } while (ep->skip && trb_comp_code != COMP_MISSED_INT);
+       } while (handling_skipped_tds);
  
        return 0;
  }
@@@ -3028,6 -3048,21 +3048,6 @@@ int xhci_queue_intr_tx(struct xhci_hcd 
        return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index);
  }
  
 -/*
 - * The TD size is the number of bytes remaining in the TD (including this TRB),
 - * right shifted by 10.
 - * It must fit in bits 21:17, so it can't be bigger than 31.
 - */
 -static u32 xhci_td_remainder(unsigned int remainder)
 -{
 -      u32 max = (1 << (21 - 17 + 1)) - 1;
 -
 -      if ((remainder >> 10) >= max)
 -              return max << 17;
 -      else
 -              return (remainder >> 10) << 17;
 -}
 -
  /*
   * For xHCI 1.0 host controllers, TD size is the number of max packet sized
   * packets remaining in the TD (*not* including this TRB).
   *
   * TD size = total_packet_count - packets_transferred
   *
 - * It must fit in bits 21:17, so it can't be bigger than 31.
 + * For xHCI 0.96 and older, TD size field should be the remaining bytes
 + * including this TRB, right shifted by 10
 + *
 + * For all hosts it must fit in bits 21:17, so it can't be bigger than 31.
 + * This is taken care of in the TRB_TD_SIZE() macro
 + *
   * The last TRB in a TD must have the TD size set to zero.
   */
 -static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,
 -              unsigned int total_packet_count, struct urb *urb,
 -              unsigned int num_trbs_left)
 +static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred,
 +                            int trb_buff_len, unsigned int td_total_len,
 +                            struct urb *urb, unsigned int num_trbs_left)
  {
 -      int packets_transferred;
 +      u32 maxp, total_packet_count;
 +
 +      if (xhci->hci_version < 0x100)
 +              return ((td_total_len - transferred) >> 10);
 +
 +      maxp = GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc));
 +      total_packet_count = DIV_ROUND_UP(td_total_len, maxp);
  
        /* One TRB with a zero-length data packet. */
 -      if (num_trbs_left == 0 || (running_total == 0 && trb_buff_len == 0))
 +      if (num_trbs_left == 0 || (transferred == 0 && trb_buff_len == 0) ||
 +          trb_buff_len == td_total_len)
                return 0;
  
 -      /* All the TRB queueing functions don't count the current TRB in
 -       * running_total.
 -       */
 -      packets_transferred = (running_total + trb_buff_len) /
 -              GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc));
 -
 -      if ((total_packet_count - packets_transferred) > 31)
 -              return 31 << 17;
 -      return (total_packet_count - packets_transferred) << 17;
 +      /* Queueing functions don't count the current TRB into transferred */
 +      return (total_packet_count - ((transferred + trb_buff_len) / maxp));
  }
  
 +
  static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
                struct urb *urb, int slot_id, unsigned int ep_index)
  {
                }
  
                /* Set the TRB length, TD size, and interrupter fields. */
 -              if (xhci->hci_version < 0x100) {
 -                      remainder = xhci_td_remainder(
 -                                      urb->transfer_buffer_length -
 -                                      running_total);
 -              } else {
 -                      remainder = xhci_v1_0_td_remainder(running_total,
 -                                      trb_buff_len, total_packet_count, urb,
 -                                      num_trbs - 1);
 -              }
 +              remainder = xhci_td_remainder(xhci, running_total, trb_buff_len,
 +                                         urb->transfer_buffer_length,
 +                                         urb, num_trbs - 1);
 +
                length_field = TRB_LEN(trb_buff_len) |
 -                      remainder |
 +                      TRB_TD_SIZE(remainder) |
                        TRB_INTR_TARGET(0);
  
                if (num_trbs > 1)
@@@ -3359,12 -3393,17 +3379,12 @@@ int xhci_queue_bulk_tx(struct xhci_hcd 
                        field |= TRB_ISP;
  
                /* Set the TRB length, TD size, and interrupter fields. */
 -              if (xhci->hci_version < 0x100) {
 -                      remainder = xhci_td_remainder(
 -                                      urb->transfer_buffer_length -
 -                                      running_total);
 -              } else {
 -                      remainder = xhci_v1_0_td_remainder(running_total,
 -                                      trb_buff_len, total_packet_count, urb,
 -                                      num_trbs - 1);
 -              }
 +              remainder = xhci_td_remainder(xhci, running_total, trb_buff_len,
 +                                         urb->transfer_buffer_length,
 +                                         urb, num_trbs - 1);
 +
                length_field = TRB_LEN(trb_buff_len) |
 -                      remainder |
 +                      TRB_TD_SIZE(remainder) |
                        TRB_INTR_TARGET(0);
  
                if (num_trbs > 1)
@@@ -3402,7 -3441,7 +3422,7 @@@ int xhci_queue_ctrl_tx(struct xhci_hcd 
        struct usb_ctrlrequest *setup;
        struct xhci_generic_trb *start_trb;
        int start_cycle;
 -      u32 field, length_field;
 +      u32 field, length_field, remainder;
        struct urb_priv *urb_priv;
        struct xhci_td *td;
  
        else
                field = TRB_TYPE(TRB_DATA);
  
 +      remainder = xhci_td_remainder(xhci, 0,
 +                                 urb->transfer_buffer_length,
 +                                 urb->transfer_buffer_length,
 +                                 urb, 1);
 +
        length_field = TRB_LEN(urb->transfer_buffer_length) |
 -              xhci_td_remainder(urb->transfer_buffer_length) |
 +              TRB_TD_SIZE(remainder) |
                TRB_INTR_TARGET(0);
 +
        if (urb->transfer_buffer_length > 0) {
                if (setup->bRequestType & USB_DIR_IN)
                        field |= TRB_DIR_IN;
@@@ -3812,12 -3845,17 +3832,12 @@@ static int xhci_queue_isoc_tx(struct xh
                                trb_buff_len = td_remain_len;
  
                        /* Set the TRB length, TD size, & interrupter fields. */
 -                      if (xhci->hci_version < 0x100) {
 -                              remainder = xhci_td_remainder(
 -                                              td_len - running_total);
 -                      } else {
 -                              remainder = xhci_v1_0_td_remainder(
 -                                              running_total, trb_buff_len,
 -                                              total_packet_count, urb,
 -                                              (trbs_per_td - j - 1));
 -                      }
 +                      remainder = xhci_td_remainder(xhci, running_total,
 +                                                 trb_buff_len, td_len,
 +                                                 urb, trbs_per_td - j - 1);
 +
                        length_field = TRB_LEN(trb_buff_len) |
 -                              remainder |
 +                              TRB_TD_SIZE(remainder) |
                                TRB_INTR_TARGET(0);
  
                        queue_trb(xhci, ep_ring, more_trbs_coming,