1. 11 4月, 2012 7 次提交
    • S
      xhci: Restore event ring dequeue pointer on resume. · fb3d85bc
      Sarah Sharp 提交于
      The xhci_save_registers() function saved the event ring dequeue pointer
      in the s3 register structure, but xhci_restore_registers() never
      restored it.  No other code in the xHCI successful resume path would
      ever restore it either.  Fix that.
      
      This should be backported to kernels as old as 2.6.37, that contain the
      commit 5535b1d5 "USB: xHCI: PCI power
      management implementation".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NElric Fu <elricfu1@gmail.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      fb3d85bc
    • S
      xhci: Don't write zeroed pointers to xHC registers. · 159e1fcc
      Sarah Sharp 提交于
      When xhci_mem_cleanup() is called, we can't be sure if the xHC is
      actually halted.  We can ask the xHC to halt by writing to the RUN bit
      in the command register, but that might timeout due to a HW hang.
      
      If the host controller is still running, we should not write zeroed
      values to the event ring dequeue pointers or base tables, the DCBAA
      pointers, or the command ring pointers.  Eric Fu reports his VIA VL800
      host accesses the event ring pointers after a failed register restore on
      resume from suspend.  The hypothesis is that the host never actually
      halted before the register write to change the event ring pointer to
      zero.
      
      Remove all writes of zeroed values to pointer registers in
      xhci_mem_cleanup().  Instead, make all callers of the function reset the
      host controller first, which will reset those registers to zero.
      xhci_mem_init() is the only caller that doesn't first halt and reset the
      host controller before calling xhci_mem_cleanup().
      
      This should be backported to kernels as old as 2.6.32.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NElric Fu <elricfu1@gmail.com>
      Cc: stable@vger.kernel.org
      159e1fcc
    • S
      xhci: Warn when hosts don't halt. · 5af98bb0
      Sarah Sharp 提交于
      Eric Fu reports a problem with his VIA host controller fetching a zeroed
      event ring pointer on resume from suspend.  The host should have been
      halted, but we can't be sure because that code ignores the return value
      from xhci_halt().  Print a warning when the host controller refuses to
      halt within XHCI_MAX_HALT_USEC (currently 16 seconds).
      
      (Update: it turns out that the VIA host controller is reporting a halted
      state when it fetches the zeroed event ring pointer.  However, we still
      need this warning for other host controllers.)
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      5af98bb0
    • F
      xhci: don't re-enable IE constantly · 4e833c0b
      Felipe Balbi 提交于
      While we're at that, define IMAN bitfield to aid readability.
      
      The interrupt enable bit should be set once on driver init, and we
      shouldn't need to continually re-enable it.  Commit c21599a3 introduced
      a read of the irq_pending register, and that allows us to preserve the
      state of the IE bit.  Before that commit, we were blindly writing 0x3 to
      the register.
      
      This patch should be backported to kernels as old as 2.6.36, or ones
      that contain the commit c21599a3 "USB:
      xhci: Reduce reads and writes of interrupter registers".
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      4e833c0b
    • G
      usb: xhci: fix section mismatch in linux-next · a46c46a1
      Gerard Snitselaar 提交于
      xhci_unregister_pci() is called in xhci_hcd_init().
      Signed-off-by: NGerard Snitselaar <dev@snitselaar.org>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      a46c46a1
    • A
      xHCI: correct to print the true HSEE of USBCMD · bb334e90
      Alex He 提交于
      Correct the print of HSEE of USBCMD in xhci-dbg.c.
      Signed-off-by: NAlex He <alex.he@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      bb334e90
    • J
      USB: serial: fix race between probe and open · a65a6f14
      Johan Hovold 提交于
      Fix race between probe and open by making sure that the disconnected
      flag is not cleared until all ports have been registered.
      
      A call to tty_open while probe is running may get a reference to the
      serial structure in serial_install before its ports have been
      registered. This may lead to usb_serial_core calling driver open before
      port is fully initialised.
      
      With ftdi_sio this result in the following NULL-pointer dereference as
      the private data has not been initialised at open:
      
      [  199.698286] IP: [<f811a089>] ftdi_open+0x59/0xe0 [ftdi_sio]
      [  199.698297] *pde = 00000000
      [  199.698303] Oops: 0000 [#1] PREEMPT SMP
      [  199.698313] Modules linked in: ftdi_sio usbserial
      [  199.698323]
      [  199.698327] Pid: 1146, comm: ftdi_open Not tainted 3.2.11 #70 Dell Inc. Vostro 1520/0T816J
      [  199.698339] EIP: 0060:[<f811a089>] EFLAGS: 00010286 CPU: 0
      [  199.698344] EIP is at ftdi_open+0x59/0xe0 [ftdi_sio]
      [  199.698348] EAX: 0000003e EBX: f5067000 ECX: 00000000 EDX: 80000600
      [  199.698352] ESI: f48d8800 EDI: 00000001 EBP: f515dd54 ESP: f515dcfc
      [  199.698356]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [  199.698361] Process ftdi_open (pid: 1146, ti=f515c000 task=f481e040 task.ti=f515c000)
      [  199.698364] Stack:
      [  199.698368]  f811a9fe f811a9e0 f811b3ef 00000000 00000000 00001388 00000000 f4a86800
      [  199.698387]  00000002 00000000 f806e68e 00000000 f532765c f481e040 00000246 22222222
      [  199.698479]  22222222 22222222 22222222 f5067004 f5327600 f5327638 f515dd74 f806e6ab
      [  199.698496] Call Trace:
      [  199.698504]  [<f806e68e>] ? serial_activate+0x2e/0x70 [usbserial]
      [  199.698511]  [<f806e6ab>] serial_activate+0x4b/0x70 [usbserial]
      [  199.698521]  [<c126380c>] tty_port_open+0x7c/0xd0
      [  199.698527]  [<f806e660>] ? serial_set_termios+0xa0/0xa0 [usbserial]
      [  199.698534]  [<f806e76f>] serial_open+0x2f/0x70 [usbserial]
      [  199.698540]  [<c125d07c>] tty_open+0x20c/0x510
      [  199.698546]  [<c10e9eb7>] chrdev_open+0xe7/0x230
      [  199.698553]  [<c10e48f2>] __dentry_open+0x1f2/0x390
      [  199.698559]  [<c144bfec>] ? _raw_spin_unlock+0x2c/0x50
      [  199.698565]  [<c10e4b76>] nameidata_to_filp+0x66/0x80
      [  199.698570]  [<c10e9dd0>] ? cdev_put+0x20/0x20
      [  199.698576]  [<c10f3e08>] do_last+0x198/0x730
      [  199.698581]  [<c10f4440>] path_openat+0xa0/0x350
      [  199.698587]  [<c10f47d5>] do_filp_open+0x35/0x80
      [  199.698593]  [<c144bfec>] ? _raw_spin_unlock+0x2c/0x50
      [  199.698599]  [<c10ff110>] ? alloc_fd+0xc0/0x100
      [  199.698605]  [<c10f0b72>] ? getname_flags+0x72/0x120
      [  199.698611]  [<c10e4450>] do_sys_open+0xf0/0x1c0
      [  199.698617]  [<c11fcc08>] ? trace_hardirqs_on_thunk+0xc/0x10
      [  199.698623]  [<c10e458e>] sys_open+0x2e/0x40
      [  199.698628]  [<c144c990>] sysenter_do_call+0x12/0x36
      [  199.698632] Code: 85 89 00 00 00 8b 16 8b 4d c0 c1 e2 08 c7 44 24 14 88 13 00 00 81 ca 00 00 00 80 c7 44 24 10 00 00 00 00 c7 44 24 0c 00 00 00 00 <0f> b7 41 78 31 c9 89 44 24 08 c7 44 24 04 00 00 00 00 c7 04 24
      [  199.698884] EIP: [<f811a089>] ftdi_open+0x59/0xe0 [ftdi_sio] SS:ESP 0068:f515dcfc
      [  199.698893] CR2: 0000000000000078
      [  199.698925] ---[ end trace 77c43ec023940cff ]---
      Reported-and-tested-by: NKen Huang <csuhgw@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a65a6f14
  2. 10 4月, 2012 11 次提交
    • A
      UHCI: hub_status_data should indicate if ports are resuming · b446b96f
      Alan Stern 提交于
      This patch (as1538) causes uhci_hub_status_data() to return a nonzero
      value when any port is undergoing a resume transition while the root
      hub is suspended.  This will allow usbcore to handle races between
      root-hub suspend and port wakeup.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b446b96f
    • A
      EHCI: keep track of ports being resumed and indicate in hub_status_data · a448e4dc
      Alan Stern 提交于
      This patch (as1537) adds a bit-array to ehci-hcd for keeping track of
      which ports are undergoing a resume transition.  If any of the bits
      are set when ehci_hub_status_data() is called, the routine will return
      a nonzero value even if no ports have any status changes pending.
      This will allow usbcore to handle races between root-hub suspend and
      port wakeup.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      CC: Chen Peter-B29397 <B29397@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a448e4dc
    • A
      USB: fix race between root-hub suspend and remote wakeup · 879d38e6
      Alan Stern 提交于
      This patch (as1533) fixes a race between root-hub suspend and remote
      wakeup.  If a wakeup event occurs while a root hub is suspending, it
      might not cause the suspend to fail.  Although the host controller
      drivers check for pending wakeup events at the start of their
      bus_suspend routines, they generally do not check for wakeup events
      while the routines are running.
      
      In addition, if a wakeup event occurs any time after khubd is frozen
      and before the root hub is fully suspended, it might not cause a
      system sleep transition to fail.  For example, the host controller
      drivers do not fail root-hub suspends when a connect-change event is
      pending.
      
      To fix both these issues, this patch causes hcd_bus_suspend() to query
      the controller driver's hub_status_data method after a root hub is
      suspended, if the root hub is enabled for wakeup.  Any pending status
      changes will count as wakeup events, causing the root hub to be
      resumed and the overall suspend to fail with -EBUSY.
      
      A significant point is that not all events are reflected immediately
      in the status bits.  Both EHCI and UHCI controllers notify the CPU
      when remote wakeup begins on a port, but the port's suspend-change
      status bit doesn't get set until after the port has completed the
      transition out of the suspend state, some 25 milliseconds later.
      Consequently, the patch will interpret any nonzero return value from
      hub_status_data as indicating a pending event, even if none of the
      status bits are set in the data buffer.  Follow-up patches make the
      necessary changes to ehci-hcd and uhci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      CC: Chen Peter-B29397 <B29397@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      879d38e6
    • A
      USB: sierra: add support for Sierra Wireless MC7710 · c5d703dc
      Anton Samokhvalov 提交于
      Just add new device id. 3G works fine, LTE not tested.
      Signed-off-by: NAnton Samokhvalov <pg83@yandex.ru>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c5d703dc
    • S
      USB: ftdi_sio: fix race condition in TIOCMIWAIT, and abort of TIOCMIWAIT when the device is removed · 876ae50d
      Simon Arlott 提交于
      There are two issues here, one is that the device is generating
      spurious very fast modem status line changes somewhere:
      
      CTS becomes high then low 18µs later:
      [121226.924373] ftdi_process_packet: prev rng=0 dsr=10 dcd=0 cts=6
      [121226.924378] ftdi_process_packet: status=10 prev=00 diff=10
      [121226.924382] ftdi_process_packet: now rng=0 dsr=10 dcd=0 cts=7
      (wake_up_interruptible is called)
      [121226.924391] ftdi_process_packet: prev rng=0 dsr=10 dcd=0 cts=7
      [121226.924394] ftdi_process_packet: status=00 prev=10 diff=10
      [121226.924397] ftdi_process_packet: now rng=0 dsr=10 dcd=0 cts=8
      (wake_up_interruptible is called)
      
      This wakes up the task in TIOCMIWAIT:
      [121226.924405] ftdi_ioctl: 19451 rng=0->0 dsr=10->10 dcd=0->0 cts=6->8
      (wait from 20:51:46 returns and observes both changes)
      
      Which then calls TIOCMIWAIT again:
      20:51:46.400239 ioctl(3, TIOCMIWAIT, 0x20) = 0
      22:11:09.441818 ioctl(3, TIOCMGET, [TIOCM_DTR|TIOCM_RTS]) = 0
      22:11:09.442812 ioctl(3, TIOCMIWAIT, 0x20) = -1 EIO (Input/output error)
      (the second wake_up_interruptible takes effect and an I/O error occurs)
      
      The other issue is that TIOCMIWAIT will wait forever (unless the task is
      interrupted) if the device is removed.
      
      This change removes the -EIO return that occurs if the counts don't
      appear to have changed. Multiple counts may have been processed as
      one or the waiting task may have started waiting after recording the
      current count.
      
      It adds a bool to indicate that the device has been removed so that
      TIOCMIWAIT doesn't wait forever, and wakes up any tasks so that they can
      return -EIO.
      Signed-off-by: NSimon Arlott <simon@fire.lp0.eu>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      876ae50d
    • S
      USB: ftdi_sio: fix status line change handling for TIOCMIWAIT and TIOCGICOUNT · fca5430d
      Simon Arlott 提交于
      Handling of TIOCMIWAIT was changed by commit 1d749f9a
       USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers
      
      FTDI_STATUS_B0_MASK does not indicate the changed modem status lines,
      it indicates the value of the current modem status lines. An xor is
      still required to determine which lines have changed.
      
      The count was only being incremented if the line was high. The only
      reason TIOCMIWAIT still worked was because the status packet is
      repeated every 1ms, so the count was always changing. The wakeup
      itself still ran based on the status lines changing.
      
      This change fixes handling of updates to the modem status lines and
      allows multiple processes to use TIOCMIWAIT concurrently.
      
      Tested with two processes waiting on different status lines being
      toggled independently.
      Signed-off-by: NSimon Arlott <simon@fire.lp0.eu>
      Cc: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fca5430d
    • A
      USB: don't ignore suspend errors for root hubs · cd4376e2
      Alan Stern 提交于
      This patch (as1532) fixes a mistake in the USB suspend code.  When the
      system is going to sleep, we should ignore errors in powering down USB
      devices, because they don't really matter.  The devices will go to low
      power anyway when the entire USB bus gets suspended (except for
      SuperSpeed devices; maybe they will need special treatment later).
      
      However we should not ignore errors in suspending root hubs,
      especially if the error indicates that the suspend raced with a wakeup
      request.  Doing so might leave the bus powered on while the system was
      supposed to be asleep, or it might cause the suspend of the root hub's
      parent controller device to fail, or it might cause a wakeup request
      to be ignored.
      
      The patch fixes the problem by ignoring errors only when the device in
      question is not a root hub.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NChen Peter <B29397@freescale.com>
      CC: <stable@vger.kernel.org>
      Tested-by: NChen Peter <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd4376e2
    • A
      USB: fix bug in serial driver unregistration · 891a3b1f
      Alan Stern 提交于
      This patch (as1536) fixes a bug in the USB serial core.  Unloading and
      reloading a serial driver while a serial device is plugged in causes
      errors because of the code in usb_serial_disconnect() that tries to
      make sure the port_remove method is called.  With the new order of
      driver registration introduced in the 3.4 kernel, this is definitely
      not the right thing to do (if indeed it ever was).
      
      The patch removes that whole section code, along with the mechanism
      for keeping track of each port's registration state, which is no
      longer needed.  The driver core can handle all that stuff for us.
      
      Note: This has been tested only with one or two USB serial drivers.
      In theory, other drivers might still run into trouble.  But if they
      do, it will be the fault of the drivers, not of this patch -- that is,
      the drivers will need to be fixed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      891a3b1f
    • A
      USB: serial: metro-usb: Fix idProduct for Uni-Directional mode. · 3a450850
      Aleksey Babahin 提交于
      The right idProduct for Metrologic Bar Code Scanner
      in Uni-Directional Serial Emulation mode is 0x0700.
      
      Also rename idProduct for Bi-Directional mode to be a bit more informative.
      Signed-off-by: NAleksey Babahin <tamerlan311@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a450850
    • S
      USB: option: re-add NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED to option_id array · 9ac2feb2
      Santiago Garcia Mantinan 提交于
      Re-add NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED to option_id array
      Signed-off-by: NSantiago Garcia Mantinan <manty@debian.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ac2feb2
    • J
      USB: pl2303: fix DTR/RTS being raised on baud rate change · ce5c9851
      Johan Hovold 提交于
      DTR/RTS should only be raised when changing baudrate from B0 and not on
      any baud rate change (> B0).
      Reported-by: NSøren Holm <sgh@sgh.dk>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce5c9851
  3. 07 4月, 2012 11 次提交
  4. 06 4月, 2012 11 次提交