1. 15 12月, 2015 5 次提交
  2. 12 12月, 2015 2 次提交
    • A
      USB: add quirk for devices with broken LPM · ad87e032
      Alan Stern 提交于
      Some USB device / host controller combinations seem to have problems
      with Link Power Management.  For example, Steinar found that his xHCI
      controller wouldn't handle bandwidth calculations correctly for two
      video cards simultaneously when LPM was enabled, even though the bus
      had plenty of bandwidth available.
      
      This patch introduces a new quirk flag for devices that should remain
      disabled for LPM, and creates quirk entries for Steinar's devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NSteinar H. Gunderson <sgunderson@bigfoot.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ad87e032
    • M
      xhci: fix usb2 resume timing and races. · f69115fd
      Mathias Nyman 提交于
      According to USB 2 specs ports need to signal resume for at least 20ms,
      in practice even longer, before moving to U0 state.
      Both host and devices can initiate resume.
      
      On device initiated resume, a port status interrupt with the port in resume
      state in issued. The interrupt handler tags a resume_done[port]
      timestamp with current time + USB_RESUME_TIMEOUT, and kick roothub timer.
      Root hub timer requests for port status, finds the port in resume state,
      checks if resume_done[port] timestamp passed, and set port to U0 state.
      
      On host initiated resume, current code sets the port to resume state,
      sleep 20ms, and finally sets the port to U0 state. This should also
      be changed to work in a similar way as the device initiated resume, with
      timestamp tagging, but that is not yet tested and will be a separate
      fix later.
      
      There are a few issues with this approach
      
      1. A host initiated resume will also generate a resume event. The event
         handler will find the port in resume state, believe it's a device
         initiated resume, and act accordingly.
      
      2. A port status request might cut the resume signalling short if a
         get_port_status request is handled during the host resume signalling.
         The port will be found in resume state. The timestamp is not set leading
         to time_after_eq(jiffies, timestamp) returning true, as timestamp = 0.
         get_port_status will proceed with moving the port to U0.
      
      3. If an error, or anything else happens to the port during device
         initiated resume signalling it will leave all the device resume
         parameters hanging uncleared, preventing further suspend, returning
         -EBUSY, and cause the pm thread to busyloop trying to enter suspend.
      
      Fix this by using the existing resuming_ports bitfield to indicate that
      resume signalling timing is taken care of.
      Check if the resume_done[port] is set before using it for timestamp
      comparison, and also clear out any resume signalling related variables
      if port is not in U0 or Resume state
      
      This issue was discovered when a PM thread busylooped, trying to runtime
      suspend the xhci USB 2 roothub on a Dell XPS
      
      Cc: stable <stable@vger.kernel.org>
      Reported-by: NDaniel J Blueman <daniel@quora.org>
      Tested-by: NDaniel J Blueman <daniel@quora.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f69115fd
  3. 09 12月, 2015 1 次提交
  4. 08 12月, 2015 3 次提交
  5. 05 12月, 2015 4 次提交
    • A
      USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq · 4a0c4c36
      Alexandre Belloni 提交于
      The interrupt handler, ohci_hcd_at91_overcurrent_irq may be called right
      after registration. At that time, pdev->dev.platform_data is not yet set,
      leading to a NULL pointer dereference.
      
      Fixes: e4df9227 (USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probe)
      Reported-by: NPeter Rosin <peda@axentia.se>
      Tested-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Cc: stable@vger.kernel.org # 4.3+
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a0c4c36
    • D
      usb: Quiet down false peer failure messages · 6406eeb3
      Don Zickus 提交于
      My recent Intel box is spewing these messages:
      
      xhci_hcd 0000:00:14.0: xHCI Host Controller
      xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2
      usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
      usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
      usb usb2: Product: xHCI Host Controller
      usb usb2: Manufacturer: Linux 4.3.0+ xhci-hcd
      usb usb2: SerialNumber: 0000:00:14.0
      hub 2-0:1.0: USB hub found
      hub 2-0:1.0: 6 ports detected
      usb: failed to peer usb2-port2 and usb1-port1 by location (usb2-port2:none) (usb1-port1:usb2-port1)
      usb usb2-port2: failed to peer to usb1-port1 (-16)
      usb: port power management may be unreliable
      usb: failed to peer usb2-port3 and usb1-port1 by location (usb2-port3:none) (usb1-port1:usb2-port1)
      usb usb2-port3: failed to peer to usb1-port1 (-16)
      usb: failed to peer usb2-port5 and usb1-port1 by location (usb2-port5:none) (usb1-port1:usb2-port1)
      usb usb2-port5: failed to peer to usb1-port1 (-16)
      usb: failed to peer usb2-port6 and usb1-port1 by location (usb2-port6:none) (usb1-port1:usb2-port1)
      usb usb2-port6: failed to peer to usb1-port1 (-16)
      
      Diving into the acpi tables, I noticed the EHCI hub has 12 ports while the XHCI
      hub has 8 ports.  Most of those ports are of connect type USB_PORT_NOT_USED
      (including port 1 of the EHCI hub).
      
      Further the unused ports have location data initialized to 0x80000000.
      
      Now each unused port on the xhci hub walks the port list and finds a matching
      peer with port1 of the EHCI hub because the zero'd out group id bits falsely match.
      After port1 of the XHCI hub, each following matching peer will generate the
      above warning.
      
      These warnings seem to be harmless for this scenario as I don't think it
      matters that unused ports could not create a peer link.
      
      The attached patch utilizes that assumption and just turns the pr_warn into
      pr_debug to quiet things down.
      
      Tested on my Intel box.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6406eeb3
    • C
      usb: xhci: fix config fail of FS hub behind a HS hub with MTT · 096b110a
      Chunfeng Yun 提交于
      if a full speed hub connects to a high speed hub which
      supports MTT, the MTT field of its slot context will be set
      to 1 when xHCI driver setups an xHCI virtual device in
      xhci_setup_addressable_virt_dev(); once usb core fetch its
      hub descriptor, and need to update the xHC's internal data
      structures for the device, the HUB field of its slot context
      will be set to 1 too, meanwhile MTT is also set before,
      this will cause configure endpoint command fail, so in the
      case, we should clear MTT to 0 for full speed hub according
      to section 6.2.2
      Signed-off-by: NChunfeng Yun <chunfeng.yun@mediatek.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      096b110a
    • M
      xhci: Fix memory leak in xhci_pme_acpi_rtd3_enable() · 84ed9152
      Mika Westerberg 提交于
      There is a memory leak because acpi_evaluate_dsm() actually returns an
      object which the caller is supposed to release. Fix this by calling
      ACPI_FREE() for the returned object (this expands to kfree() so passing
      NULL there is fine as well).
      
      While there correct indentation in !CONFIG_ACPI case.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: stable <stable@vger.kernel.org> # v4.2
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84ed9152
  6. 02 12月, 2015 5 次提交
  7. 01 12月, 2015 1 次提交
    • F
      usb: dwc3: gadget: don't prestart interrupt endpoints · 62e345ae
      Felipe Balbi 提交于
      Because interrupt endpoints usually transmit such
      small amounts of data, it seems pointless to prestart
      transfers and try to get speed improvements. This
      patch also sorts out a problem with CDC ECM function
      where its notification endpoint gets stuck in busy
      state and we continuously issue Update Transfer
      commands.
      
      Fixes: 8a1a9c9e ("usb: dwc3: gadget: start transfer on XFER_COMPLETE")
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      62e345ae
  8. 23 11月, 2015 3 次提交
    • J
      USB: serial: Another Infineon flash loader USB ID · a0e80fbd
      Jonas Jonsson 提交于
      The flash loader has been seen on a Telit UE910 modem. The flash loader
      is a bit special, it presents both an ACM and CDC Data interface but
      only the latter is useful. Unless a magic string is sent to the device
      it will disappear and the regular modem device appears instead.
      Signed-off-by: NJonas Jonsson <jonas@ludd.ltu.se>
      Tested-by: NDaniele Palmas <dnlplm@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      a0e80fbd
    • J
      USB: cdc_acm: Ignore Infineon Flash Loader utility · f33a7f72
      Jonas Jonsson 提交于
      Some modems, such as the Telit UE910, are using an Infineon Flash Loader
      utility. It has two interfaces, 2/2/0 (Abstract Modem) and 10/0/0 (CDC
      Data). The latter can be used as a serial interface to upgrade the
      firmware of the modem. However, that isn't possible when the cdc-acm
      driver takes control of the device.
      
      The following is an explanation of the behaviour by Daniele Palmas during
      discussion on linux-usb.
      
      "This is what happens when the device is turned on (without modifying
      the drivers):
      
      [155492.352031] usb 1-3: new high-speed USB device number 27 using ehci-pci
      [155492.485429] usb 1-3: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11
      [155492.485436] usb 1-3: New USB device found, idVendor=058b, idProduct=0041
      [155492.485439] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
      [155492.485952] cdc_acm 1-3:1.0: ttyACM0: USB ACM device
      
      This is the flashing device that is caught by the cdc-acm driver. Once
      the ttyACM appears, the application starts sending a magic string
      (simple write on the file descriptor) to keep the device in flashing
      mode. If this magic string is not properly received in a certain time
      interval, the modem goes on in normal operative mode:
      
      [155493.748094] usb 1-3: USB disconnect, device number 27
      [155494.916025] usb 1-3: new high-speed USB device number 28 using ehci-pci
      [155495.059978] usb 1-3: New USB device found, idVendor=1bc7, idProduct=0021
      [155495.059983] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [155495.059986] usb 1-3: Product: 6 CDC-ACM + 1 CDC-ECM
      [155495.059989] usb 1-3: Manufacturer: Telit
      [155495.059992] usb 1-3: SerialNumber: 359658044004697
      [155495.138958] cdc_acm 1-3:1.0: ttyACM0: USB ACM device
      [155495.140832] cdc_acm 1-3:1.2: ttyACM1: USB ACM device
      [155495.142827] cdc_acm 1-3:1.4: ttyACM2: USB ACM device
      [155495.144462] cdc_acm 1-3:1.6: ttyACM3: USB ACM device
      [155495.145967] cdc_acm 1-3:1.8: ttyACM4: USB ACM device
      [155495.147588] cdc_acm 1-3:1.10: ttyACM5: USB ACM device
      [155495.154322] cdc_ether 1-3:1.12 wwan0: register 'cdc_ether' at usb-0000:00:1a.7-3, Mobile Broadband Network Device, 00:00:11:12:13:14
      
      Using the cdc-acm driver, the string, though being sent in the same way
      than using the usb-serial-simple driver (I can confirm that the data is
      passing properly since I used an hw usb sniffer), does not make the
      device to stay in flashing mode."
      Signed-off-by: NJonas Jonsson <jonas@ludd.ltu.se>
      Tested-by: NDaniele Palmas <dnlplm@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f33a7f72
    • K
      USB: cp210x: Remove CP2110 ID from compatibility list · 7c90e610
      Konstantin Shkolnyy 提交于
      CP2110 ID (0x10c4, 0xea80) doesn't belong here because it's a HID
      and completely different from CP210x devices.
      Signed-off-by: NKonstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      7c90e610
  9. 20 11月, 2015 13 次提交
  10. 19 11月, 2015 3 次提交
    • D
      usb: gadget: functionfs: fix missing access_ok checks · 7fe9a937
      Daniel Walter 提交于
      use safe copy_*_user instead of unsafe __copy_*_user
      functions when accessing userland memory.
      Signed-off-by: NDaniel Walter <dwalter@sigma-star.at>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      7fe9a937
    • A
      usb: musb: USB_TI_CPPI41_DMA requires dmaengine support · 183e53e8
      Arnd Bergmann 提交于
      The CPPI-4.1 driver selects TI_CPPI41, which is a dmaengine
      driver and that may not be available when CONFIG_DMADEVICES
      is not set:
      
      warning: (USB_TI_CPPI41_DMA) selects TI_CPPI41 which has unmet direct dependencies (DMADEVICES && ARCH_OMAP)
      
      This adds an extra dependency to avoid generating warnings in randconfig
      builds. Ideally we'd remove the 'select' statement, but that has the
      potential to break defconfig files.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 411dd19c ("usb: musb: Kconfig: Select the DMA driver if DMA mode of MUSB is enabled")
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      183e53e8
    • M
      xhci: Fix a race in usb2 LPM resume, blocking U3 for usb2 devices · dad67d5f
      Mathias Nyman 提交于
      Clear device initiated resume variables once device is fully up and running
      in U0 state.
      
      Resume needs to be signaled for 20ms for usb2 devices before they can be
      moved to U0 state.
      
      An interrupt is triggered if a device initiates resume. As we handle the
      event in interrupt context we can not sleep for 20ms, so we instead set
      a resume flag, a timestamp, and start the roothub polling.
      
      The roothub code will later move the port to U0 when it finds a port in
      resume state with the resume flag set, and timestamp passed by 20ms.
      
      A host initiated resume is however not done in interrupt context, and
      host initiated resume code will directly signal resume, wait 20ms and then
      move the port to U0.
      
      These two codepaths can race, if we are in the middle of a host initated
      resume, while sleeping for 20ms, we may handle a port event and find the
      port in resume state. The port event handling code will assume the resume
      was device initiated and set the resume flag and timestamp.
      
      Root hub code will however not catch the port in resume state again as the
      host initated resume code has already moved the port to U0.
      The resume flag and timestamp will remain set for this port preventing port
      from suspending again  (LPM setting port to U3)
      
      Fix this for now by always clearing the device initated resume parameters
      once port is in U0
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dad67d5f