1. 23 Sep, 2009 40 commits
    • Sarah Sharp's avatar
      USB: xhci: Support USB hubs. · ac1c1b7f
      Sarah Sharp authored
      For a USB hub to work under an xHCI host controller, the xHC's internal
      scheduler must be made aware of the hub's characteristics.  Add an xHCI
      hook that the USB core will call after it fetches the hub descriptor.
      This hook will add hub information to the slot context for that device,
      including whether it has multiple TTs or a single TT, the number of ports
      on the hub, and TT think time.
      
      Setting up the slot context for the device is different for 0.95 and 0.96
      xHCI host controllers.
      
      Some of the slot context reserved fields in the 0.95 specification were
      changed into hub fields in the 0.96 specification.  Don't set the TT think
      time or number of ports for a hub if we're dealing with a 0.95-compliant
      xHCI host controller.
      
      The 0.95 xHCI specification says that to modify the hub flag, we need to
      issue an evaluate context command.  The 0.96 specification says that flag
      can be set with a configure endpoint command.  Issue the correct command
      based on the version reported by the hardware.
      
      This patch does not add support for multi-TT hubs.  Multi-TT hubs expose
      a single TT on alt setting 0, and multi-TT on alt setting 1.  The xHCI
      driver can't handle setting alternate interfaces yet.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ac1c1b7f
    • Sarah Sharp's avatar
      USB: xhci: Set multi-TT field for LS/FS devices under hubs. · 07b6de10
      Sarah Sharp authored
      When setting up a slot context for an address device command, set the
      multi-TT field if this is a low or full speed device under a HS hub with
      multiple transaction translators.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      07b6de10
    • Sarah Sharp's avatar
      USB: xhci: Set route string for all devices. · 4a0cd967
      Sarah Sharp authored
      The xHCI driver needs to set the route string in the slot context of all
      devices, not just SuperSpeed devices.  The route string concept was added
      in the USB 3.0 specification, section 10.1.3.2.  Each hub in the topology
      is expected to have no more than 15 ports in order for the route string of
      a device to be unique.  SuperSpeed hubs are restricted to only having 15
      ports, but FS/LS/HS hubs are not.  The xHCI specification says that if the
      port number the device is under is greater than 15, that portion of the
      route string shall be set to 15.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4a0cd967
    • Sarah Sharp's avatar
      USB: xhci: Fix command wait list handling. · a50c8aa9
      Sarah Sharp authored
      In the xHCI driver, configure endpoint commands that are submitted to the
      hardware may involve one of two data structures.  If the configure
      endpoint command is setting up a new configuration or modifying max packet
      sizes, the data structures and completions are statically allocated in the
      xhci_virt_device structure.  If the command is being used to set up
      streams or add hub information, then the data structures are dynamically
      allocated, and placed on a device command waiting list.
      
      Break out the code to check whether a completed command is in the device
      command waiting list.  Fix a subtle bug in the old code: continue
      processing the command if the command isn't in the wait list.  In the old
      code, if there was a command in the wait list, but it didn't match the
      completed command, the completed command event would be dropped.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a50c8aa9
    • Sarah Sharp's avatar
      USB: xhci: Change how xHCI commands are handled. · 913a8a34
      Sarah Sharp authored
      Some commands to the xHCI hardware cannot be allowed to fail due to out of
      memory issues or the command ring being full.
      
      Add a way to reserve a TRB on the command ring, and make all command
      queueing functions indicate whether they are using a reserved TRB.
      
      Add a way to pre-allocate all the memory a command might need.  A command
      needs an input context, a variable to store the status, and (optionally) a
      completion for the caller to wait on.  Change all code that assumes the
      input device context, status, and completion for a command is stored in
      the xhci virtual USB device structure (xhci_virt_device).
      
      Store pending completions in a FIFO in xhci_virt_device.  Make the event
      handler for a configure endpoint command check to see whether a pending
      command in the list has completed.  We need to use separate input device
      contexts for some configure endpoint commands, since multiple drivers can
      submit requests at the same time that require a configure endpoint
      command.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      913a8a34
    • Sarah Sharp's avatar
      USB: xhci: Refactor input device context setup. · 5270b951
      Sarah Sharp authored
      Refactor common code to set up the add and drop flags for the input device
      context setup.  This setup is used before a configure endpoint command for
      the reset endpoint quirk, and will be used for the command to alloc or
      free streams rings.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5270b951
    • Sarah Sharp's avatar
      USB: xhci: Endpoint representation refactoring. · 63a0d9ab
      Sarah Sharp authored
      The xhci_ring structure contained information that is really related to an
      endpoint, not a ring.  This will cause problems later when endpoint
      streams are supported and there are multiple rings per endpoint.
      
      Move the endpoint state and cancellation information into a new virtual
      endpoint structure, xhci_virt_ep.  The list of TRBs to be cancelled should
      be per endpoint, not per ring, for easy access.  There can be only one TRB
      that the endpoint stopped on after a stop endpoint command (even with
      streams enabled); move the stopped TRB information into the new virtual
      endpoint structure.  Also move the 31 endpoint rings and temporary ring
      storage from the virtual device structure (xhci_virt_device) into the
      virtual endpoint structure (xhci_virt_ep).
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      63a0d9ab
    • Randy Dunlap's avatar
      USB: gadget: ether needs to select CRC32 · 9e221be8
      Randy Dunlap authored
      Fix build error, ether uses/needs to select CRC32 config symbol:
      
      ether.c:(.text+0x271480): undefined reference to `crc32_le'
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9e221be8
    • Gergely Imreh's avatar
      USB: fix USBTMC get_capabilities success handling · d0a38365
      Gergely Imreh authored
      In order:
      Add reference to relevant section of USBTMC usb488 subclass specs.
      Print debug output of capabilities only when it was retrieved successfully.
      Clear return value on success, otherwise driver always reports failure.
      Signed-off-by: default avatarGergely Imreh <imrehg@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d0a38365
    • Oliver Neukum's avatar
      USB: fix missing error check in probing · 1e5ea5e3
      Oliver Neukum authored
      usb: check for IO errors usb_set_interface can return
      
      if they happen while unbinding a flag is set to retry upon probe
      if they happen during probe they are handled as probe errors
      Signed-off-by: default avatarOliver Neukum <oliver@neukum.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1e5ea5e3
    • Alan Stern's avatar
      USB: usbfs: add USBDEVFS_URB_BULK_CONTINUATION flag · 01c6460f
      Alan Stern authored
      This patch (as1283) adds a new flag, USBDEVFS_URB_BULK_CONTINUATION,
      to usbfs.  It is intended for userspace libraries such as libusb and
      openusb.  When they have to break up a single usbfs bulk transfer into
      multiple URBs, they will set the flag on all but the first URB of the
      series.
      
      If an error other than an unlink occurs, the kernel will automatically
      cancel all the following URBs for the same endpoint and refuse to
      accept new submissions, until an URB is encountered that is not marked
      as a BULK_CONTINUATION.  Such an URB would indicate the start of a new
      transfer or the presence of an older library, so the kernel returns to
      normal operation.
      
      This enables libraries to delimit bulk transfers correctly, even in
      the presence of early termination as indicated by short packets.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      
      01c6460f
    • Oliver Neukum's avatar
      USB: support for autosuspend in sierra while online · e6929a90
      Oliver Neukum authored
      This implements support for autosuspend in the sierra driver while online.
      Remote wakeup is used for reception. Transmission is facilitated with a queue
      and the asynchronous autopm mechanism. To prevent races a private flag
      for opened ports and a counter of running transmissions needs to be added.
      Signed-off-by: default avatarOliver Neukum <oliver@neukum.org>
      Tested-by: default avatarElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e6929a90
    • Jason Wessel's avatar
      USB: ehci-dbgp,ehci: Allow dbpg to work with suspend/resume · ad45f1dc
      Jason Wessel authored
      In order for the dbgp driver to survive suspend/resume, on every ehci
      resume operation the debug controller must get re-initialized.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: dbrownell@users.sourceforge.net
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ad45f1dc
    • Jason Wessel's avatar
      USB: ehci-dbgp,documentation: Documentation updates for ehci-dbgp · 9780bc41
      Jason Wessel authored
      Add missing information about requirements of using the EHCI usb debug
      controller as well as to mention you can use a debug controller other
      than the first one in the system.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Sarah Sharp <sarah.a.sharp@intel.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9780bc41
    • Jason Wessel's avatar
      USB: ehci-dbgp: errata for EHCI debug/host controller synchronization · 68d2956a
      Jason Wessel authored
      On some EHCI debug controllers after the host controller driver is
      activated, the debug controller will occasionally fail to submit a
      bulk write URB.  On controllers that exhibit this behavior a dummy
      bulk write must get submitted to resynchronize the device.
      
      The "dummy bulk write" does not get received by the host attached to
      the other end of the usb debug device.  The usb debug device simply
      acknowledges the "dummy bulk write" and returns to a usable state.
      
      The behavior, without this patch is that you see missing text from a
      complete kernel boot when using the keep option to the earlyprintk
      kernel argument.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      68d2956a
    • Jason Wessel's avatar
      USB: ehci-dbgp: errata for EHCI debug controller initialization · aab2d408
      Jason Wessel authored
      On some EHCI usb debug controllers, the EHCI debug device will fail to
      be seen after a port reset, after a warm reset.  Two options exist to
      get the device to initialize correctly.
      
      Option 1 is to unplug and plug in the device.
      
      Option 2 is to use the EHCI port test to get the usb debug device to
      start talking again.  At that point the debug controller port reset
      will succeed.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      CC: dbrownell@users.sourceforge.net
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      aab2d408
    • Jason Wessel's avatar
      USB: ehci-dbgp,ehci: Allow early or late use of the dbgp device · 8d053c79
      Jason Wessel authored
      If the EHCI debug port is initialized and in use, the EHCI host
      controller driver must follow two rules.
      
      1) If the EHCI host driver issues a controller reset, the debug
         controller driver re-initialization must get called after the reset
         is completed.
      
      2) The EHCI host driver should ignore any requests to the physical
         EHCI debug port when the EHCI debug port is in use.
      
      The code to check for the debug port was moved from ehci_pci_reinit()
      to ehci_pci_setup because it must get called prior to ehci_reset()
      which will clear the debug port registers.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: dbrownell@users.sourceforge.net
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8d053c79
    • Jason Wessel's avatar
      USB: ehci-dbgp: stability improvements and external re-init · 91777826
      Jason Wessel authored
      This patch implements several changes:
      
      1) Improve the capability to debug the dbgp driver
      
         The dbgp_ehci_status() was added in a number of places to report
         the critical ehci registers to diagnose the cause of a failure of
         the ehci-dbgp driver.
      
      2) Capability to survive the host controller initialization
      
         The dbgp_external_startup(), dbgp_not_safe, and dbgp_phys_port were
         added so as to allow the ehci-dbgp to re-initialize after the ehci
         host controller is reset by the standard host controller driver.
         This same routine is common for the early startup or
         re-initialization.
      
         This resulted in the need to move some of the initialization code
         out of the __init section because the ehci driver has the
         possibility to be loaded later on as a kernel module.
      
      3) Stability improvements for device initialization
      
         The device enumeration from 0 to 127 has the possibility to fail
         the first time after a warm reset on some older EHCI debug
         controllers.  The enumeration will be tried up to 3 times to
         account for this failure case.
      
         The dbg_wait_until_complete() was changed to wait up to 250 ms
         before failing which only comes into play during device
         initialization. The maximum delay will never get hit during the
         course of normal operation of the driver, unless the device got
         unplugged or there was a ehci controller failure, in which case the
         dbgp device driver will shut itself down.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: dbrownell@users.sourceforge.net
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      91777826
    • Jason Wessel's avatar
      early_printk: Allow more than one early console · c9530948
      Jason Wessel authored
      It is desirable to be able to use one early boot device to debug
      another or to have multiple places you can see the early boot
      diagnostics, such as the vga screen or serial device.
      
      This patch changes the early_printk console device registration to
      allow more than one early printk device to get registered via
      register_console().
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c9530948
    • Jason Wessel's avatar
      USB: dbgp: EHCI debug controller initialization delays · 56faf0f9
      Jason Wessel authored
      When using the EHCI host controller as a polled device, a bit more
      tolerance is required in terms of delays.  On some 3+ghz systems the
      cpu loops were faster than the EHCI device mmio and resulted in the
      controller failing to initialize.
      
      On at least one first generation EHCI controller when it was not
      operating in interrupt mode, it would fail to report a port change
      status, but executing the port reset allowed the debug controller to
      work correctly anyway.  This errata causes a one time 300ms delay in
      the boot time, where as the typical delay is 1-5ms for an EHCI
      controller that does not have this errata.
      
      The debug printk's were fixed to have the correct state messages, and
      there was a conversion from using early_printk to printk to avoid
      calling the dbgp driver while debugging the initialization.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      56faf0f9
    • Jason Wessel's avatar
      USB: ehci-dbgp: Execute early BIOS hand off · 093344e1
      Jason Wessel authored
      The PCI quirk code executes a BIOS hand off to obtain full control of
      the EHCI host controller, the self contained ehci-dbgp driver must do
      the same thing using the early PCI API, else the BIOS can cause a
      fatal fault.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: dbrownell@users.sourceforge.net
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      093344e1
    • Jason Wessel's avatar
      USB: dbgp: insert cr prior to nl as needed · 87a5d151
      Jason Wessel authored
      The rs232 drivers send a carriage return prior to a new line in the
      early printk code.
      
      The usb debug driver should do the same because you want to be able to
      use the same terminal programs and tools for analysis of early printk
      data.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      87a5d151
    • Jason Wessel's avatar
      USB: ehci,dbgp,early_printk: split ehci debug driver from early_printk.c · df6c5169
      Jason Wessel authored
      Move the dbgp early printk driver in advance of refactoring and adding
      new code, so the changes to this code are tracked separately from the
      move of the code.
      
      The drivers/usb/early directory will be the location of the current
      and future early usb code for driving usb devices prior initializing
      the standard interrupt driven USB drivers.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      df6c5169
    • Pete Zaitcev's avatar
      USB: unusual_devs.h: drop some unneeded floppy entries · fd4f3a93
      Pete Zaitcev authored
      We set pdt_1f_for_no_lun for UFI devices, so most floppy entiries should
      be unnecessary. This patch removes three entries which I'm certain are.
       - For Mitsumi I have a customer with RHEL 5 (bz#514296)
       - For SMSC I accessed Novell's Bugzilla and verified the entry
       - For Y-E I tested the patch with the actual device
      Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: default avatarPhil Dibowitz <phil@ipom.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      fd4f3a93
    • Rogério Brito's avatar
      USB: fix paths in usbmon documentation · f0cc82a8
      Rogério Brito authored
      Hi there.
      
      On Aug 21 2009, Alan Stern wrote:
      > On Thu, 20 Aug 2009, Rogério Brito wrote:
      > > Again, just reiterating, what I said before, even though I am not sure
      > > if I can reproduce it, I will try to.
      > 
      > A usbmon trace showing what happens when you plug in the drive and 
      > when you run smartctl would help.
      
      The documentation for usbmon in the kernel 2.6.31-rc7 kernel doesn't
      match what the kernel exposes in the debug fs tree. This patch fixes it.
      Signed-off-by: default avatarRogério Brito <rbrito@ime.usp.br>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f0cc82a8
    • Anand Gadiyar's avatar
      USB: OMAP: ISP1301: Compile fix · d77282c8
      Anand Gadiyar authored
      OMAP: ISP1301: Compile fix
      
      Fix this build error on non- OMAP-H2/H3/H4 systems:
      (factored out two empty functions as part of the fix)
      
        CC      drivers/usb/otg/isp1301_omap.o
      drivers/usb/otg/isp1301_omap.c: In function 'otg_update_isp':
      drivers/usb/otg/isp1301_omap.c:635: error: implicit declaration of function 'notresponding'
      drivers/usb/otg/isp1301_omap.c: In function 'b_peripheral':
      drivers/usb/otg/isp1301_omap.c:973: error: implicit declaration of function 'enable_vbus_draw'
      drivers/usb/otg/isp1301_omap.c: In function 'isp_update_otg':
      drivers/usb/otg/isp1301_omap.c:1003: error: implicit declaration of function 'enable_vbus_source'
      make[2]: *** [drivers/usb/otg/isp1301_omap.o] Error 1
      make[1]: *** [drivers/usb/otg] Error 2
      make: *** [drivers] Error 2
      Signed-off-by: default avatarAnand Gadiyar <gadiyar@ti.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d77282c8
    • Roel Kluin's avatar
      USB: gadget: double free_irq() in at91udc_probe() · 7f536692
      Roel Kluin authored
      If request_irq() fails, udp_irq is freed twice.
      Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7f536692
    • George Spelvin's avatar
      USB: Clean up root hub string descriptors · 392ca68b
      George Spelvin authored
      The previous code had a bug that would add a trailing null byte to
      the returned descriptor.
      Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      392ca68b
    • Roel Kluin's avatar
      USB: double put_tty_driver(gs_tty_driver) in gserial_setup() · 48d31677
      Roel Kluin authored
      If the driver cannot be registered, put_tty_driver(gs_tty_driver)
      occurred here as well as at label fail.
      
      put_tty_driver() already occurs at label fail
      Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      48d31677
    • Jiri Slaby's avatar
      USB: make usb_buffer_map_sg consistent with doc · 2912282c
      Jiri Slaby authored
      usb_buffer_map_sg should return negative on error according to
      its documentation. But dma_map_sg returns 0 on error. Take this
      into account and return -ENOMEM in such situation.
      
      While at it, return -EINVAL instead of -1 when wrong input is
      passed in.
      
      If this wasn't done, usb_sg_* operations used after usb_sg_init
      which returned 0 may cause oopses/deadlocks since we don't init
      structures/entries, esp. completion and status entry.
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2912282c
    • Alan Stern's avatar
      USB: EHCI: change deschedule logic for interrupt QHs · a448c9d8
      Alan Stern authored
      This patch (as1281) changes the way ehci-hcd deschedules interrupt
      QHs, copying the approach used for async QHs.  The caller is no longer
      responsible for rescheduling the QH if its queue is non-empty; instead
      the reschedule is done directly by intr_deschedule(), after calling
      qh_completions().  This is exactly the same as how end_unlink_async()
      works.
      
      ehci_urb_dequeue() and intr_deschedule() now correctly handle the case
      where they are called while another interrupt URB for the same QH is
      being given back.  This was a surprisingly large blind spot.  And
      scan_periodic() now respects the new needs_rescan flag.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a448c9d8
    • Alan Stern's avatar
      USB: EHCI: rescan the queue after an unlink · 3a44494e
      Alan Stern authored
      This patch (as1280) fixes an obscure bug in ehci-hcd's dequeuing logic
      for async URBs.  If a later URB is unlinked and the completion
      routine unlinks an earlier URB, then the earlier URB won't be given
      back in a timely manner because the endpoint queue isn't rescanned as
      it should be.
      
      Similar bugs occur if an endpoint is reset or a halt is cleared while
      a completion routine is running, because the subroutines don't test
      for the COMPLETING state.
      
      All these problems are solved by adding a new needs_rescan flag to the
      ehci_qh structure.  If the flag is set while scanning through an idle
      QH, the scan will be repeated.  If the QH isn't idle then an unlink
      cycle will be initiated, and the proper action will be taken when it
      becomes idle.
      
      Also, an unnecessary test is removed from qh_link_async(): That
      routine is never called if the QH's state isn't IDLE.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3a44494e
    • Anton Vorontsov's avatar
      USB: fsl_qe_udc: Add fsl,mpc8323-qe-usb compatible entry · 04c4ab17
      Anton Vorontsov authored
      Current bindings specify that "fsl,mpc8323-qe-usb" compatible entry
      should be used as a base match for QE UDCs, so update the driver to
      comply with the bindings.
      Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04c4ab17
    • Frank Schaefer's avatar
      USB-serial: pl2303: use 1.5 instead of 2 stop bits with 5 data bits · 29cf1b72
      Frank Schaefer authored
      This is how "real" UARTs (e.g. 16550) work and AFAIK what RS232 specifies, too.
      Make the driver more compliant.
      Signed-off-by: default avatarFrank Schaefer <schaefer.frank@gmx.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      29cf1b72
    • Frank Schaefer's avatar
      USB-serial: pl2303: add space/mark parity · 6dd81b45
      Frank Schaefer authored
      The device supports it, so why not use it ? Works fine !
      Signed-off-by: default avatarFrank Schaefer <schaefer.frank@gmx.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6dd81b45
    • Frank Schaefer's avatar
      USB-serial: pl2303: fix baud rate handling in case of unsupported values · 25b82868
      Frank Schaefer authored
      According to the datasheets, the PL2303 supports a set of 25 baudrates.
      The baudrate is set as a 4 byte value directly.
      
      During my experiments with device 067b:2303 (PL2303X), I noticed that
       - the bridge-controller always uses 9600 baud if invalid/unsupported baud rate
         values are set
       - the baud rate value returned by usb_control_msg(..., GET_LINE_REQUEST, ...)
         does not reflect the actually used baudrate. Always the last set value is
         returned, even if it was invalid and not used by the controller.
      
      This patch fixes the following issues with the current code:
      1.) make sure that only supported baudrates are set (are there any buggy
          chip revisions out there which don't "like" other values... ?).
      2.) always set the baudrate to the next nearest supported baudrate.
      3.) applications can now read back the resulting baudrate properly, because
          tty_encode_baud_rate(...) is now fed with the actually used baudrate.
      Signed-off-by: default avatarFrank Schaefer <schaefer.frank@gmx.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      25b82868
    • Olivier Bornet's avatar
      USB: iuu_phoenix: add a way to select the default VCC · e55c6d06
      Olivier Bornet authored
      Using the module parameter vcc_default, you can choose the default VCC value.
      Signed-off-by: default avatarOlivier Bornet <Olivier.Bornet@puck.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e55c6d06
    • Olivier Bornet's avatar
      02b18066
    • Olivier Bornet's avatar
      USB: iuu_phoenix: add support for changing VCC · 20eda943
      Olivier Bornet authored
      You can now set the IUU reader to 3.3V VCC instead of 5V VCC, using the sysfs
      parameter vcc_mode. Valid values are 3 and 5.
      Signed-off-by: default avatarOlivier Bornet <Olivier.Bornet@puck.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      20eda943
    • Olivier Bornet's avatar