1. 08 2月, 2014 2 次提交
  2. 06 2月, 2014 1 次提交
  3. 23 1月, 2014 1 次提交
    • S
      Revert "usbcore: set lpm_capable field for LPM capable root hubs" · 140e3026
      Sarah Sharp 提交于
      Commit 9df89d85 "usbcore: set
      lpm_capable field for LPM capable root hubs" was created under the
      assumption that all USB host controllers should have USB 3.0 Link PM
      enabled for all devices under the hosts.
      
      Unfortunately, that's not the case.  The xHCI driver relies on knowledge
      of the host hardware scheduler to calculate the LPM U1/U2 timeout
      values, and it only sets lpm_capable to one for Intel host controllers
      (that have the XHCI_LPM_SUPPORT quirk set).
      
      When LPM is enabled for some Fresco Logic hosts, it causes failures with
      a AgeStar 3UBT USB 3.0 hard drive dock:
      
      Jan 11 13:59:03 sg-laptop kernel: usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:03 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
      Jan 11 13:59:08 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
      Jan 11 13:59:08 sg-laptop kernel: usb-storage 3-1:1.0: USB Mass Storage device detected
      Jan 11 13:59:08 sg-laptop mtp-probe[613]: checking bus 3, device 2: "/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-1"
      Jan 11 13:59:08 sg-laptop mtp-probe[613]: bus: 3, device: 2 was not an MTP device
      Jan 11 13:59:08 sg-laptop kernel: scsi6 : usb-storage 3-1:1.0
      Jan 11 13:59:13 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
      Jan 11 13:59:18 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
      Jan 11 13:59:18 sg-laptop kernel: usbcore: registered new interface driver usb-storage
      Jan 11 13:59:40 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:41 sg-laptop kernel: usb 3-1: device descriptor read/8, error -71
      Jan 11 13:59:41 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
      Jan 11 13:59:46 sg-laptop kernel: usb 3-1: device descriptor read/8, error -110
      Jan 11 13:59:46 sg-laptop kernel: scsi 6:0:0:0: Device offlined - not ready after error recovery
      Jan 11 13:59:46 sg-laptop kernel: usb 3-1: USB disconnect, device number 2
      
      lspci for the affected host:
      
      04:00.0 0c03: 1b73:1000 (rev 04) (prog-if 30 [XHCI])
              Subsystem: 1043:1039
              Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
              Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
              Latency: 0, Cache Line Size: 64 bytes
              Interrupt: pin A routed to IRQ 19
              Region 0: Memory at dd200000 (32-bit, non-prefetchable) [size=64K]
              Capabilities: [50] Power Management version 3
                      Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
              Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
                      Address: 0000000000000000  Data: 0000
              Capabilities: [80] Express (v1) Endpoint, MSI 00
                      DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <2us, L1 <32us
                              ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                      DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                              RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                              MaxPayload 128 bytes, MaxReadReq 512 bytes
                      DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                      LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                              ClockPM- Surprise- LLActRep- BwNot-
                      LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                              ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                      LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
              Kernel driver in use: xhci_hcd
              Kernel modules: xhci_hcd
      
      The commit was backported to stable kernels, and will need to be
      reverted there as well.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Reported-by: NSergey Galanov <sergey.e.galanov@gmail.com>
      Cc: stable@vger.kernel.org
      140e3026
  4. 14 1月, 2014 1 次提交
  5. 13 1月, 2014 1 次提交
  6. 11 1月, 2014 2 次提交
  7. 09 1月, 2014 2 次提交
  8. 08 1月, 2014 2 次提交
    • R
    • A
      USB: fix race between hub_disconnect and recursively_mark_NOTATTACHED · 543d7784
      Alan Stern 提交于
      There is a race in the hub driver between hub_disconnect() and
      recursively_mark_NOTATTACHED().  This race can be triggered if the
      driver is unbound from a device at the same time as the bus's root hub
      is removed.  When the race occurs, it can cause an oops:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000015c
      IP: [<c16d5fb0>] recursively_mark_NOTATTACHED+0x20/0x60
      Call Trace:
       [<c16d5fc4>] recursively_mark_NOTATTACHED+0x34/0x60
       [<c16d5fc4>] recursively_mark_NOTATTACHED+0x34/0x60
       [<c16d5fc4>] recursively_mark_NOTATTACHED+0x34/0x60
       [<c16d5fc4>] recursively_mark_NOTATTACHED+0x34/0x60
       [<c16d6082>] usb_set_device_state+0x92/0x120
       [<c16d862b>] usb_disconnect+0x2b/0x1a0
       [<c16dd4c0>] usb_remove_hcd+0xb0/0x160
       [<c19ca846>] ? _raw_spin_unlock_irqrestore+0x26/0x50
       [<c1704efc>] ehci_mid_remove+0x1c/0x30
       [<c1704f26>] ehci_mid_stop_host+0x16/0x30
       [<c16f7698>] penwell_otg_work+0xd28/0x3520
       [<c19c945b>] ? __schedule+0x39b/0x7f0
       [<c19cdb9d>] ? sub_preempt_count+0x3d/0x50
       [<c125e97d>] process_one_work+0x11d/0x3d0
       [<c19c7f4d>] ? mutex_unlock+0xd/0x10
       [<c125e0e5>] ? manage_workers.isra.24+0x1b5/0x270
       [<c125f009>] worker_thread+0xf9/0x320
       [<c19ca846>] ? _raw_spin_unlock_irqrestore+0x26/0x50
       [<c125ef10>] ? rescuer_thread+0x2b0/0x2b0
       [<c1264ac4>] kthread+0x94/0xa0
       [<c19d0f77>] ret_from_kernel_thread+0x1b/0x28
       [<c1264a30>] ? kthread_create_on_node+0xc0/0xc0
      
      One problem is that recursively_mark_NOTATTACHED() uses the intfdata
      value and hub->hdev->maxchild while hub_disconnect() is clearing them.
      Another problem is that it uses hub->ports[i] while the port device is
      being released.
      
      To fix this race, we need to hold the device_state_lock while
      hub_disconnect() changes the values.  (Note that usb_disconnect()
      and hub_port_connect_change() already acquire this lock at similar
      critical times during a USB device's life cycle.)  We also need to
      remove the port devices after maxchild has been set to 0, instead of
      before.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: N"Du, Changbin" <changbinx.du@intel.com>
      Tested-by: N"Du, Changbin" <changbinx.du@intel.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      543d7784
  9. 22 12月, 2013 1 次提交
    • G
      USB: core: remove CONFIG_USB_DEBUG usage · 3482528e
      Greg Kroah-Hartman 提交于
      CONFIG_USB_DEBUG is going away, so remove the few places in the USB core
      that relied on them.
      
      This means that we always now do the "debug" checks for every urb
      submitted, which is a good idea, as who knows how many driver bugs we
      have been ignoring when people forget to enable this option.  Also, with
      the overall speed of USB, doing these extra checks should not cause any
      additional overhead.
      
      Also, no longer announce all devices being added to the system if
      CONFIG_USB_DEBUG is enabled, as it's not going to be around much longer.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3482528e
  10. 11 12月, 2013 1 次提交
    • D
      usb: xhci: change enumeration scheme to 'new scheme' by default · 48fc7dbd
      Dan Williams 提交于
      Change the default enumeration scheme for xhci attached non-SuperSpeed
      devices from:
      
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(8)
         GetDescriptor(18)
      
      ...to:
      
         Reset
         [xhci address-device BSR = 1]
         GetDescriptor(64)
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(18)
      
      ...as some devices misbehave when encountering a SetAddress command
      prior to GetDescriptor.  There are known legacy devices that require
      this scheme, but testing has found at least one USB3 device that fails
      enumeration when presented with this ordering.  For now, follow the ehci
      case and enable 'new scheme' by default for non-SuperSpeed devices.
      
      To support this enumeration scheme on xhci the AddressDevice operation
      needs to be performed twice.  The first instance of the command enables
      the HC's device and slot context info for the device, but omits sending
      the device a SetAddress command (BSR == block set address request).
      Then, after GetDescriptor completes, follow up with the full
      AddressDevice+SetAddress operation.
      
      As mentioned before, this ordering of events with USB3 devices causes an
      extra state transition to be exposed to xhci.  Previously USB3 devices
      would transition directly from 'enabled' to 'addressed' and never need
      to underrun responses to 'get descriptor'. We do see the 64-byte
      descriptor fetch the correct data, but the following 18-byte descriptor
      read after the reset gets:
      
      bLength            = 0
      bDescriptorType    = 0
      bcdUSB             = 0
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      instead of:
      
      bLength            = 12
      bDescriptorType    = 1
      bcdUSB             = 300
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      which results in the discovery process looping until falling back to
      'old scheme' enumeration.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NDavid Moore <david.moore@gmail.com>
      Suggested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      48fc7dbd
  11. 10 12月, 2013 2 次提交
  12. 09 12月, 2013 4 次提交
  13. 07 12月, 2013 2 次提交
    • R
      ACPI / bind: Rework struct acpi_bus_type · e3f02c52
      Rafael J. Wysocki 提交于
      Replace the .find_device function pointer in struct acpi_bus_type
      with a new one, .find_companion, that is supposed to point to a
      function returning struct acpi_device pointer (instead of an int)
      and takes one argument (instead of two).  This way the role of
      this callback is more clear and the implementation of it can
      be more straightforward.
      
      Update all of the users of struct acpi_bus_type (PCI, PNP/ACPI and
      USB) to reflect the structure change.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: Lan Tianyu <tianyu.lan@intel.com> # for USB/ACPI
      e3f02c52
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  14. 05 12月, 2013 1 次提交
  15. 04 12月, 2013 1 次提交
  16. 15 11月, 2013 1 次提交
  17. 25 10月, 2013 1 次提交
  18. 20 10月, 2013 1 次提交
  19. 17 10月, 2013 9 次提交
    • D
      usb: hub_activate kill an 'else' · fd1ac4cf
      Dan Williams 提交于
      Remove a few extra lines and make it clear that all implementations
      disable the port by sharing the same line of code.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      fd1ac4cf
    • J
      usb: hub: Clear Port Reset Change during init/resume · e92aee33
      Julius Werner 提交于
      This patch adds the Port Reset Change flag to the set of bits that are
      preemptively cleared on init/resume of a hub. In theory this bit should
      never be set unexpectedly... in practice it can still happen if BIOS,
      SMM or ACPI code plays around with USB devices without cleaning up
      correctly. This is especially dangerous for XHCI root hubs, which don't
      generate any more Port Status Change Events until all change bits are
      cleared, so this is a good precaution to have (similar to how it's
      already done for the Warm Port Reset Change flag).
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e92aee33
    • M
      drivers: usb: core: devio.c: Spaces to tabs for proc_control_compat() · 06793f2d
      Matthias Beyer 提交于
      Replaced spaces by tabs for proc_control_compat() function.
      Signed-off-by: NMatthias Beyer <mail@beyermatthias.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06793f2d
    • M
      drivers: usb: core: devio.c: Spaces to tabs for proc_reapurbnonblock() · 5b32c385
      Matthias Beyer 提交于
      Replaced spaces by tabs for proc_reapurbnonblock() function.
      Signed-off-by: NMatthias Beyer <mail@beyermatthias.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b32c385
    • S
      usb: Push USB2 LPM disable on disconnect into USB core. · f468f7b9
      Sarah Sharp 提交于
      The USB core currently handles enabling and disabling optional USB power
      management features during device transitions (device suspend/resume,
      driver bind/unbind, device reset, and device disconnect).  Those
      optional power features include Latency Tolerance Messaging (LTM),
      USB 3.0 Link PM, and USB 2.0 Link PM.
      
      The USB core currently enables LPM on device enumeration and disables
      USB 2.0 Link PM when the device is reset.  However, the xHCI driver
      disables LPM when the device is disconnected and the device context is
      freed.  Push the call up into the USB core, in order to be consistent
      with the core handling all power management enabling and disabling.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      f468f7b9
    • M
      xhci: Enable LPM support only for hardwired or BESL devices · 890dae88
      Mathias Nyman 提交于
      Some usb3 devices falsely claim they support usb2 hardware Link PM
      when connected to a usb2 port. We only trust hardwired devices
      or devices with the later BESL LPM support to be LPM enabled as default.
      
      [Note: Sarah re-worked the original patch to move the code into the USB
      core, and updated it to check whether the USB device supports BESL,
      instead of checking if the xHCI port it's connected to supports BESL
      encoding.]
      
      This patch should be backported to kernels as old as 3.11, that
      contain the commit a558ccdc "usb: xhci:
      add USB2 Link power management BESL support".  Without this fix, some
      USB 3.0 devices will not enumerate or work properly under USB 2.0 ports
      on Haswell-ULT systems.
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      890dae88
    • S
      usb: Don't enable USB 2.0 Link PM by default. · de68bab4
      Sarah Sharp 提交于
      How it's supposed to work:
      --------------------------
      
      USB 2.0 Link PM is a lower power state that some newer USB 2.0 devices
      support.  USB 3.0 devices certified by the USB-IF are required to
      support it if they are plugged into a USB 2.0 only port, or a USB 2.0
      cable is used.  USB 2.0 Link PM requires both a USB device and a host
      controller that supports USB 2.0 hardware-enabled LPM.
      
      USB 2.0 Link PM is designed to be enabled once by software, and the host
      hardware handles transitions to the L1 state automatically.  The premise
      of USB 2.0 Link PM is to be able to put the device into a lower power
      link state when the bus is idle or the device NAKs USB IN transfers for
      a specified amount of time.
      
      ...but hardware is broken:
      --------------------------
      
      It turns out many USB 3.0 devices claim to support USB 2.0 Link PM (by
      setting the LPM bit in their USB 2.0 BOS descriptor), but they don't
      actually implement it correctly.  This manifests as the USB device
      refusing to respond to transfers when it is plugged into a USB 2.0 only
      port under the Haswell-ULT/Lynx Point LP xHCI host.
      
      These devices pass the xHCI driver's simple test to enable USB 2.0 Link
      PM, wait for the port to enter L1, and then bring it back into L0.  They
      only start to break when L1 entry is interleaved with transfers.
      
      Some devices then fail to respond to the next control transfer (usually
      a Set Configuration).  This results in devices never enumerating.
      
      Other mass storage devices (such as a later model Western Digital My
      Passport USB 3.0 hard drive) respond fine to going into L1 between
      control transfers.  They ACK the entry, come out of L1 when the host
      needs to send a control transfer, and respond properly to those control
      transfers.  However, when the first READ10 SCSI command is sent, the
      device NAKs the data phase while it's reading from the spinning disk.
      Eventually, the host requests to put the link into L1, and the device
      ACKs that request.  Then it never responds to the data phase of the
      READ10 command.  This results in not being able to read from the drive.
      
      Some mass storage devices (like the Corsair Survivor USB 3.0 flash
      drive) are well behaved.  They ACK the entry into L1 during control
      transfers, and when SCSI commands start coming in, they NAK the requests
      to go into L1, because they need to be at full power.
      
      Not all USB 3.0 devices advertise USB 2.0 link PM support.  My Point
      Grey USB 3.0 webcam advertises itself as a USB 2.1 device, but doesn't
      have a USB 2.0 BOS descriptor, so we don't enable USB 2.0 Link PM.  I
      suspect that means the device isn't certified.
      
      What do we do about it?
      -----------------------
      
      There's really no good way for the kernel to test these devices.
      Therefore, the kernel needs to disable USB 2.0 Link PM by default, and
      distros will have to enable it by writing 1 to the sysfs file
      /sys/bus/usb/devices/../power/usb2_hardware_lpm.  Rip out the xHCI Link
      PM test, since it's not sufficient to detect these buggy devices, and
      don't automatically enable LPM after the device is addressed.
      
      This patch should be backported to kernels as old as 3.11, that
      contain the commit a558ccdc "usb: xhci:
      add USB2 Link power management BESL support".  Without this fix, some
      USB 3.0 devices will not enumerate or work properly under USB 2.0 ports
      on Haswell-ULT systems.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      de68bab4
    • S
      usb: Disable USB 2.0 Link PM before device reset. · dcc01c08
      Sarah Sharp 提交于
      Before the USB core resets a device, we need to disable the L1 timeout
      for the roothub, if USB 2.0 Link PM is enabled.  Otherwise the port may
      transition into L1 in between descriptor fetches, before we know if the
      USB device descriptors changed.  LPM will be re-enabled after the
      full device descriptors are fetched, and we can confirm the device still
      supports USB 2.0 LPM after the reset.
      
      We don't need to wait for the USB device to exit L1 before resetting the
      device, since the xHCI roothub port diagrams show a transition to the
      Reset state from any of the Ux states (see Figure 34 in the 2012-08-14
      xHCI specification update).
      
      This patch should be backported to kernels as old as 3.2, that contain
      the commit 65580b43 "xHCI: set USB2
      hardware LPM".  That was the first commit to enable USB 2.0
      hardware-driven Link Power Management.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      dcc01c08
    • O
      USB: quirks: add touchscreen that is dazzeled by remote wakeup · 614ced91
      Oliver Neukum 提交于
      The device descriptors are messed up after remote wakeup
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      614ced91
  20. 15 10月, 2013 2 次提交
  21. 14 10月, 2013 1 次提交
  22. 12 10月, 2013 1 次提交