Merge tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 00:06:09 +0000 (17:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Apr 2014 00:06:09 +0000 (17:06 -0700)
Pull USB patches from Greg KH:
 "Here's the big USB pull request for 3.15-rc1.

  The normal set of patches, lots of controller driver updates, and a
  smattering of individual USB driver updates as well.

  All have been in linux-next for a while"

* tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (249 commits)
  xhci: Transition maintainership to Mathias Nyman.
  USB: disable reset-resume when USB_QUIRK_RESET is set
  USB: unbind all interfaces before rebinding any
  usb: phy: Add ulpi IDs for SMSC USB3320 and TI TUSB1210
  usb: gadget: tcm_usb_gadget: stop format strings
  usb: gadget: f_fs: add missing spinlock and mutex unlock
  usb: gadget: composite: switch over to ERR_CAST()
  usb: gadget: inode: switch over to memdup_user()
  usb: gadget: f_subset: switch over to PTR_RET
  usb: gadget: lpc32xx_udc: fix wrong clk_put() sequence
  USB: keyspan: remove dead debugging code
  USB: serial: add missing newlines to dev_<level> messages.
  USB: serial: add missing braces
  USB: serial: continue to write on errors
  USB: serial: continue to read on errors
  USB: serial: make bulk_out_size a lower limit
  USB: cypress_m8: fix potential scheduling while atomic
  devicetree: bindings: document lsi,zevio-usb
  usb: chipidea: add support for USB OTG controller on LSI Zevio SoCs
  usb: chipidea: imx: Use dev_name() for ci_hdrc name to distinguish USBs
  ...

1  2 
MAINTAINERS
arch/arm/mach-shmobile/Kconfig
arch/mips/Kconfig
arch/sh/Kconfig
drivers/usb/core/devio.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/usb.h
drivers/usb/dwc3/dwc3-omap.c
include/linux/usb.h

diff --cc MAINTAINERS
Simple merge
index f6db7dcae3f4dd044bc8ffea87cbd7779dd4602b,a06590237209dee7a2024af25b7742dfc704aa2c..3b8c87461d6717ca0fc514424de3e443ac3f1990
@@@ -114,9 -102,6 +114,7 @@@ config ARCH_R8A777
        select CPU_V7
        select SH_CLK_CPG
        select ARM_GIC
-       select USB_ARCH_HAS_EHCI
-       select USB_ARCH_HAS_OHCI
 +      select SYS_SUPPORTS_SH_TMU
  
  config ARCH_R8A7779
        bool "R-Car H1 (R8A77790)"
        select ARM_GIC
        select CPU_V7
        select SH_CLK_CPG
-       select USB_ARCH_HAS_EHCI
-       select USB_ARCH_HAS_OHCI
        select RENESAS_INTC_IRQPIN
 +      select SYS_SUPPORTS_SH_TMU
  
  config ARCH_R8A7790
        bool "R-Car H2 (R8A77900)"
Simple merge
diff --cc arch/sh/Kconfig
index 364d204298fae1af77191ac5f496b6dc5cdb30d1,64455daa63a174b860d30d7ee13566a2cc91f09e..1399383315a36bdcaf06a79b0ef85a60cb8d33d7
@@@ -345,9 -354,8 +345,8 @@@ config CPU_SUBTYPE_SH772
        bool "Support SH7720 processor"
        select CPU_SH3
        select CPU_HAS_DSP
 -      select SYS_SUPPORTS_CMT
 +      select SYS_SUPPORTS_SH_CMT
        select ARCH_WANT_OPTIONAL_GPIOLIB
-       select USB_ARCH_HAS_OHCI
        select USB_OHCI_SH if USB_OHCI_HCD
        select PINCTRL
        help
@@@ -357,8 -365,7 +356,7 @@@ config CPU_SUBTYPE_SH772
        bool "Support SH7721 processor"
        select CPU_SH3
        select CPU_HAS_DSP
 -      select SYS_SUPPORTS_CMT
 +      select SYS_SUPPORTS_SH_CMT
-       select USB_ARCH_HAS_OHCI
        select USB_OHCI_SH if USB_OHCI_HCD
        help
          Select SH7721 if you have a SH3-DSP SH7721 CPU.
index 2a8afe6754b80245ce9726e8a3e20b7a9bb6dcd0,12401ee4ba0e44d66b3c38467c079e240abf3e1c..257876ea03a1a9102ac89d0282fb03affe813103
@@@ -769,6 -769,88 +769,88 @@@ static int check_ctrlrecip(struct usb_d
        return ret;
  }
  
 -static int parse_usbdevfs_streams(struct dev_state *ps,
+ static struct usb_host_endpoint *ep_to_host_endpoint(struct usb_device *dev,
+                                                    unsigned char ep)
+ {
+       if (ep & USB_ENDPOINT_DIR_MASK)
+               return dev->ep_in[ep & USB_ENDPOINT_NUMBER_MASK];
+       else
+               return dev->ep_out[ep & USB_ENDPOINT_NUMBER_MASK];
+ }
++static int parse_usbdevfs_streams(struct usb_dev_state *ps,
+                                 struct usbdevfs_streams __user *streams,
+                                 unsigned int *num_streams_ret,
+                                 unsigned int *num_eps_ret,
+                                 struct usb_host_endpoint ***eps_ret,
+                                 struct usb_interface **intf_ret)
+ {
+       unsigned int i, num_streams, num_eps;
+       struct usb_host_endpoint **eps;
+       struct usb_interface *intf = NULL;
+       unsigned char ep;
+       int ifnum, ret;
+       if (get_user(num_streams, &streams->num_streams) ||
+           get_user(num_eps, &streams->num_eps))
+               return -EFAULT;
+       if (num_eps < 1 || num_eps > USB_MAXENDPOINTS)
+               return -EINVAL;
+       /* The XHCI controller allows max 2 ^ 16 streams */
+       if (num_streams_ret && (num_streams < 2 || num_streams > 65536))
+               return -EINVAL;
+       eps = kmalloc(num_eps * sizeof(*eps), GFP_KERNEL);
+       if (!eps)
+               return -ENOMEM;
+       for (i = 0; i < num_eps; i++) {
+               if (get_user(ep, &streams->eps[i])) {
+                       ret = -EFAULT;
+                       goto error;
+               }
+               eps[i] = ep_to_host_endpoint(ps->dev, ep);
+               if (!eps[i]) {
+                       ret = -EINVAL;
+                       goto error;
+               }
+               /* usb_alloc/free_streams operate on an usb_interface */
+               ifnum = findintfep(ps->dev, ep);
+               if (ifnum < 0) {
+                       ret = ifnum;
+                       goto error;
+               }
+               if (i == 0) {
+                       ret = checkintf(ps, ifnum);
+                       if (ret < 0)
+                               goto error;
+                       intf = usb_ifnum_to_if(ps->dev, ifnum);
+               } else {
+                       /* Verify all eps belong to the same interface */
+                       if (ifnum != intf->altsetting->desc.bInterfaceNumber) {
+                               ret = -EINVAL;
+                               goto error;
+                       }
+               }
+       }
+       if (num_streams_ret)
+               *num_streams_ret = num_streams;
+       *num_eps_ret = num_eps;
+       *eps_ret = eps;
+       *intf_ret = intf;
+       return 0;
+ error:
+       kfree(eps);
+       return ret;
+ }
  static int match_devt(struct device *dev, void *data)
  {
        return dev->devt == (dev_t) (unsigned long) data;
@@@ -1043,7 -1125,21 +1125,21 @@@ static int proc_bulk(struct usb_dev_sta
        return ret;
  }
  
 -static int proc_resetep(struct dev_state *ps, void __user *arg)
+ static void check_reset_of_active_ep(struct usb_device *udev,
+               unsigned int epnum, char *ioctl_name)
+ {
+       struct usb_host_endpoint **eps;
+       struct usb_host_endpoint *ep;
+       eps = (epnum & USB_DIR_IN) ? udev->ep_in : udev->ep_out;
+       ep = eps[epnum & 0x0f];
+       if (ep && !list_empty(&ep->urb_list))
+               dev_warn(&udev->dev, "Process %d (%s) called USBDEVFS_%s for active endpoint 0x%02x\n",
+                               task_pid_nr(current), current->comm,
+                               ioctl_name, epnum);
+ }
 +static int proc_resetep(struct usb_dev_state *ps, void __user *arg)
  {
        unsigned int ep;
        int ret;
@@@ -1983,6 -2082,45 +2082,45 @@@ static int proc_disconnect_claim(struc
        return claimintf(ps, dc.interface);
  }
  
 -static int proc_alloc_streams(struct dev_state *ps, void __user *arg)
++static int proc_alloc_streams(struct usb_dev_state *ps, void __user *arg)
+ {
+       unsigned num_streams, num_eps;
+       struct usb_host_endpoint **eps;
+       struct usb_interface *intf;
+       int r;
+       r = parse_usbdevfs_streams(ps, arg, &num_streams, &num_eps,
+                                  &eps, &intf);
+       if (r)
+               return r;
+       destroy_async_on_interface(ps,
+                                  intf->altsetting[0].desc.bInterfaceNumber);
+       r = usb_alloc_streams(intf, eps, num_eps, num_streams, GFP_KERNEL);
+       kfree(eps);
+       return r;
+ }
 -static int proc_free_streams(struct dev_state *ps, void __user *arg)
++static int proc_free_streams(struct usb_dev_state *ps, void __user *arg)
+ {
+       unsigned num_eps;
+       struct usb_host_endpoint **eps;
+       struct usb_interface *intf;
+       int r;
+       r = parse_usbdevfs_streams(ps, arg, NULL, &num_eps, &eps, &intf);
+       if (r)
+               return r;
+       destroy_async_on_interface(ps,
+                                  intf->altsetting[0].desc.bInterfaceNumber);
+       r = usb_free_streams(intf, eps, num_eps, GFP_KERNEL);
+       kfree(eps);
+       return r;
+ }
  /*
   * NOTE:  All requests here that have interface numbers as parameters
   * are assuming that somehow the configuration has been prevented from
index 610735823d93fa94e54cbb231d7d4d56f7b38825,d670aaf13a3d5eb457edf424cf52b7757d2521d3..090469ebfcfff3a1fb686c4adbf0817bc1b27f22
@@@ -1040,8 -1049,9 +1049,9 @@@ static void hub_activate(struct usb_hu
                 */
                if (type == HUB_INIT) {
                        delay = hub_power_on(hub, false);
 -                      PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2);
 +                      INIT_DELAYED_WORK(&hub->init_work, hub_init_func2);
-                       schedule_delayed_work(&hub->init_work,
+                       queue_delayed_work(system_power_efficient_wq,
+                                       &hub->init_work,
                                        msecs_to_jiffies(delay));
  
                        /* Suppress autosuspend until init is done */
  
                /* Don't do a long sleep inside a workqueue routine */
                if (type == HUB_INIT2) {
 -                      PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func3);
 +                      INIT_DELAYED_WORK(&hub->init_work, hub_init_func3);
-                       schedule_delayed_work(&hub->init_work,
+                       queue_delayed_work(system_power_efficient_wq,
+                                       &hub->init_work,
                                        msecs_to_jiffies(delay));
                        return;         /* Continues at init3: below */
                } else {
Simple merge
index a87532845bf9b9e1eecceff9ab1d5a064e7607fe,0923add72b59e5cddd5458085b58054b35deab86..75bf649da82d58198f38752874f39a00e726065e
@@@ -55,10 -55,14 +55,10 @@@ extern int usb_match_one_id_intf(struc
  extern int usb_match_device(struct usb_device *dev,
                            const struct usb_device_id *id);
  extern void usb_forced_unbind_intf(struct usb_interface *intf);
- extern void usb_rebind_intf(struct usb_interface *intf);
+ extern void usb_unbind_and_rebind_marked_interfaces(struct usb_device *udev);
  
 -extern int usb_hub_claim_port(struct usb_device *hdev, unsigned port,
 -              struct dev_state *owner);
 -extern int usb_hub_release_port(struct usb_device *hdev, unsigned port,
 -              struct dev_state *owner);
  extern void usb_hub_release_all_ports(struct usb_device *hdev,
 -              struct dev_state *owner);
 +              struct usb_dev_state *owner);
  extern bool usb_device_is_owned(struct usb_device *udev);
  
  extern int  usb_hub_init(void);
Simple merge
Simple merge