1. 16 Aug, 2013 2 commits
    • Sarah Sharp's avatar
      Merge tag 'for-usb-2013-08-15-step-1' into for-usb-next · 5845c13a
      Sarah Sharp authored
      xhci: Step 1 to fix usb-linus and usb-next.
      
      Hi Greg,
      
      This is the first of three steps to fix your usb-linus and usb-next
      trees.  As I mentioned, commit 4fae6f0f
      "USB: handle LPM errors during device suspend correctly" was incorrectly
      added to usb-next when it should have been added to usb-linus and marked
      for stable.
      
      Two port power off bug fixes touch the same code that patch touches, but
      it's not easy to simply move commit 4fae6f0f patch to usb-linus because
      commit 28e86165 "USB: refactor code for
      enabling/disabling remote wakeup" also touched those code sections.
      
      I propose a two step process to fix this:
      
      1. Pull these four patches into usb-linus.
      
      2. Revert commit 28e86165 from usb-next.
         Merge usb-linus into usb-next, and resolve the conflicts.
      
      I will be sending pull requests for these steps.
      
      This pull request is step one, and contains the backported version of
      commit 4fae6f0f, the two port power off
      fixes, and an unrelated xhci-plat bug fix.
      
      Sarah Sharp
      
      Resolved conflicts:
      	drivers/usb/core/hub.c
      5845c13a
    • Greg Kroah-Hartman's avatar
      Merge tag 'for-usb-next-2013-08-15' of... · 224563b6
      Greg Kroah-Hartman authored
      Merge tag 'for-usb-next-2013-08-15' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next
      
      Sarah writes:
      
      xhci: Platform updates, 64-bit DMA, and trace events for 3.12.
      
      Hi Greg,
      
      This pull request includes one new feature for the xhci-plat driver (device
      tree support).  Felipe was fine with the patch last I checked, but hadn't
      provided an official Acked-by line.
      
      This pull request also includes 13 patches from my FOSS Outreach Program for
      Women (OPW) intern, Xenia.  She fixed a bug in the xHCI driver so that the
      driver can allocate 64-bit consistent DMA, converted the driver to use dynamic
      debugging, and added a bunch of new trace events for the xHCI driver.  The
      python plugin for trace-cmd should be up on git hub shortly, although the trace
      events are usable without it.
      
      I'm very happy with the progress that Xenia has made, and I look forward to her
      future contributions to the Linux kernel.
      
      Sarah Sharp
      224563b6
  2. 15 Aug, 2013 4 commits
    • Sarah Sharp's avatar
      xhci-plat: Don't enable legacy PCI interrupts. · 52fb6125
      Sarah Sharp authored
      The xHCI platform driver calls into usb_add_hcd to register the irq for
      its platform device.  It does not want the xHCI generic driver to
      register an interrupt for it at all.  The original code did that by
      setting the XHCI_BROKEN_MSI quirk, which tells the xHCI driver to not
      enable MSI or MSI-X for a PCI host.
      
      Unfortunately, if CONFIG_PCI is enabled, and CONFIG_USB_DW3 is enabled,
      the xHCI generic driver will attempt to register a legacy PCI interrupt
      for the xHCI platform device in xhci_try_enable_msi().  This will result
      in a bogus irq being registered, since the underlying device is a
      platform_device, not a pci_device, and thus the pci_device->irq pointer
      will be bogus.
      
      Add a new quirk, XHCI_PLAT, so that the xHCI generic driver can
      distinguish between a PCI device that can't handle MSI or MSI-X, and a
      platform device that should not have its interrupts touched at all.
      This quirk may be useful in the future, in case other corner cases like
      this arise.
      
      This patch should be backported to kernels as old as 3.9, that
      contain the commit 00eed9c8 "USB: xhci:
      correctly enable interrupts".
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: default avatarYu Y Wang <yu.y.wang@intel.com>
      Tested-by: default avatarYu Y Wang <yu.y.wang@intel.com>
      Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
      Cc: stable@vger.kernel.org
      52fb6125
    • Sarah Sharp's avatar
      usb: Don't fail port power resume on device disconnect. · d49dad3e
      Sarah Sharp authored
      Userspace can tell the kernel to power off any USB port, including ones
      that are visible and connectible to users.  When an attached USB device
      goes into suspend, the port will be powered off if the
      pm_qos_no_port_poweroff file for its port is set to 0, the device does
      not have remote wakeup enabled, and the device is marked as persistent.
      
      If the user disconnects the USB device while the port is powered off,
      the current code does not handle that properly.  If you disconnect a
      device, and then run `lsusb -v -s` for the device, the device disconnect
      does not get handled by the USB core.  The runtime resume of the port
      fails, because hub_port_debounce_be_connected() returns -ETIMEDOUT.
      
      This means the port resume fails and khubd doesn't handle the USB device
      disconnect.  This leaves the device listed in lsusb, and the port's
      runtime_status will be permanently marked as "error".
      
      Fix this by ignoring the return value of hub_port_debounce_be_connected.
      Users can disconnect USB devices while the ports are powered off, and we
      must be able to handle that.
      
      This patch should be backported to kernels as old as 3.9, that
      contain the commit ad493e5e "usb: add
      usb port auto power off mechanism"
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Lan Tianyu <tianyu.lan@intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      d49dad3e
    • Lan Tianyu's avatar
      usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend() · 98a4f1ff
      Lan Tianyu authored
      The pm qos NO_POWER_OFF flag is checked twice during usb device suspend
      to see if the usb port power off condition is met. This is redundant and
      also will prevent the port from being powered off if the NO_POWER_OFF
      flag is changed to 1 from 0 after the device was already suspended.
      
      More detail in the following link.
      	http://marc.info/?l=linux-usb&m=136543949130865&w=2
      
      This patch should be backported to kernels as old as 3.7, that
      contain the commit f7ac7787 "usb/acpi:
      Use ACPI methods to power off ports."
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      98a4f1ff
    • Alan Stern's avatar
      USB: handle LPM errors during device suspend correctly · aa5ceae2
      Alan Stern authored
      The hub driver's usb_port_suspend() routine doesn't handle errors
      related to Link Power Management properly.  It always returns failure,
      it doesn't try to clean up the wakeup setting, (in the case of system
      sleep) it doesn't try to go ahead with the port suspend regardless,
      and it doesn't try to apply the new power-off mechanism.
      
      This patch fixes these problems.
      
      Note: Sarah fixed this patch to apply against 3.11, since the original
      commit (4fae6f0f "USB: handle LPM errors
      during device suspend correctly") called usb_disable_remote_wakeup,
      which won't be added until 3.12.
      
      This patch should be backported to kernels as old as 3.5, that
      contain the commit 8306095f "USB:
      Disable USB 3.0 LPM in critical sections.".  There will be merge
      conflicts, since LTM wasn't added until 3.6.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      aa5ceae2
  3. 14 Aug, 2013 34 commits