1. 15 11月, 2011 1 次提交
    • A
      USB: Remove the SAW_IRQ hcd flag · 968b822c
      Alan Stern 提交于
      The HCD_FLAG_SAW_IRQ flag was introduced in order to catch IRQ routing
      errors: If an URB was unlinked and the host controller hadn't gotten
      any IRQs, it seemed likely that the IRQs were directed to the wrong
      vector.
      
      This warning hasn't come up in many years, as far as I know; interrupt
      routing now seems to be well under control.  Therefore there's no
      reason to keep the flag around any more.  This patch (as1495) finally
      removes it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      968b822c
  2. 18 9月, 2011 1 次提交
  3. 15 3月, 2011 1 次提交
  4. 14 3月, 2011 2 次提交
    • S
      USB: Set usb_hcd->state and flags for shared roothubs. · ff9d78b3
      Sarah Sharp 提交于
      The hcd->flags are in a sorry state.  Some of them are clearly specific to
      the particular roothub (HCD_POLL_RH, HCD_POLL_PENDING, and
      HCD_WAKEUP_PENDING), but some flags are related to PCI device state
      (HCD_HW_ACCESSIBLE and HCD_SAW_IRQ).  This is an issue when one PCI device
      can have two roothubs that share the same IRQ line and hardware.
      
      Make sure to set HCD_FLAG_SAW_IRQ for both roothubs when an interrupt is
      serviced, or an URB is unlinked without an interrupt.  (We can't tell if
      the host actually serviced an interrupt for a particular bus, but we can
      tell it serviced some interrupt.)
      
      HCD_HW_ACCESSIBLE is set once by usb_add_hcd(), which is set for both
      roothubs as they are added, so it doesn't need to be modified.
      HCD_POLL_RH and HCD_POLL_PENDING are only checked by the USB core, and
      they are never set by the xHCI driver, since the roothub never needs to be
      polled.
      
      The usb_hcd's state field is a similar mess.  Sometimes the state applies
      to the underlying hardware: HC_STATE_HALT, HC_STATE_RUNNING, and
      HC_STATE_QUIESCING.  But sometimes the state refers to the roothub state:
      HC_STATE_RESUMING and HC_STATE_SUSPENDED.
      
      Alan Stern recently made the USB core not rely on the hcd->state variable.
      Internally, the xHCI driver still checks for HC_STATE_SUSPENDED, so leave
      that code in.  Remove all references to HC_STATE_HALT, since the xHCI
      driver only sets and doesn't test those variables.  We still have to set
      HC_STATE_RUNNING, since Alan's patch has a bug that means the roothub
      won't get registered if we don't set that.
      
      Alan's patch made the USB core check a different variable when trying to
      determine whether to suspend a roothub.  The xHCI host has a split
      roothub, where two buses are registered for one PCI device.  Each bus in
      the xHCI split roothub can be suspended separately, but both buses must be
      suspended before the PCI device can be suspended.  Therefore, make sure
      that the USB core checks HCD_RH_RUNNING() for both roothubs before
      suspending the PCI host.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      ff9d78b3
    • S
      usb: Make usb_hcd_pci_probe labels more descriptive. · 8766c815
      Sarah Sharp 提交于
      Make the labels for the goto statements in usb_hcd_pci_probe()
      describe the cleanup they do, rather than being numbered err[1-4].
      This makes it easier to add error handling later.
      
      The error handling for this function looks a little fishy, since
      set_hs_companion() isn't called until the very end of the function, and
      clear_hs_companion() is called if this function fails earlier than that.
      But it should be harmless to clear a NULL pointer, so leave the error
      handling as-is.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      8766c815
  5. 08 3月, 2011 1 次提交
    • A
      USB: move usbcore away from hcd->state · 9b37596a
      Alan Stern 提交于
      The hcd->state variable is a disaster.  It's not clearly owned by
      either usbcore or the host controller drivers, and they both change it
      from time to time, potentially stepping on each other's toes.  It's
      not protected by any locks.  And there's no mechanism to prevent it
      from going through an invalid transition.
      
      This patch (as1451) takes a first step toward fixing these problems.
      As it turns out, usbcore uses hcd->state for essentially only two
      things: checking whether the controller's root hub is running and
      checking whether the controller has died.  Therefore the patch adds
      two new atomic bitflags to the hcd structure, to store these pieces of
      information.  The new flags are used only by usbcore, and a private
      spinlock prevents invalid combinations (a dead controller's root hub
      cannot be running).
      
      The patch does not change the places where usbcore sets hcd->state,
      since HCDs may depend on them.  Furthermore, there is one place in
      usb_hcd_irq() where usbcore still must use hcd->state: An HCD's
      interrupt handler can implicitly indicate that the controller died by
      setting hcd->state to HC_STATE_HALT.  Nevertheless, the new code is a
      big improvement over the current code.
      
      The patch makes one other change.  The hcd_bus_suspend() and
      hcd_bus_resume() routines now check first whether the host controller
      has died; if it has then they return immediately without calling the
      HCD's bus_suspend or bus_resume methods.
      
      This fixes the major problem reported in Bugzilla #29902: The system
      fails to suspend after a host controller dies during system resume.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NAlex Terekhov <a.terekhov@gmail.com>
      CC: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9b37596a
  6. 15 1月, 2011 1 次提交
  7. 17 11月, 2010 1 次提交
  8. 23 10月, 2010 1 次提交
    • A
      OHCI: work around for nVidia shutdown problem · 3df7169e
      Alan Stern 提交于
      This patch (as1417) fixes a problem affecting some (or all) nVidia
      chipsets.  When the computer is shut down, the OHCI controllers
      continue to power the USB buses and evidently they drive a Reset
      signal out all their ports.  This prevents attached devices from going
      to low power.  Mouse LEDs stay on, for example, which is disconcerting
      for users and a drain on laptop batteries.
      
      The fix involves leaving each OHCI controller in the OPERATIONAL state
      during system shutdown rather than putting it in the RESET state.
      Although this nominally means the controller is running, in fact it's
      not doing very much since all the schedules are all disabled.  However
      there is ongoing DMA to the Host Controller Communications Area, so
      the patch also disables the bus-master capability of all PCI USB
      controllers after the shutdown routine runs.
      
      The fix is applied only to nVidia-based PCI OHCI controllers, so it
      shouldn't cause problems on systems using other hardware.  As an added
      safety measure, in case the kernel encounters one of these running
      controllers during boot, the patch changes quirk_usb_handoff_ohci()
      (which runs early on during PCI discovery) to reset the controller
      before anything bad can happen.
      Reported-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: David Brownell <david-b@pacbell.net>
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      CC: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3df7169e
  9. 11 8月, 2010 7 次提交
  10. 21 5月, 2010 1 次提交
  11. 27 2月, 2010 1 次提交
    • A
      USB: implement non-tree resume ordering constraints for PCI host controllers · 6d19c009
      Alan Stern 提交于
      This patch (as1331) adds non-tree ordering constraints needed for
      proper resume of PCI USB host controllers from hibernation.  The main
      issue is that non-high-speed devices must not be resumed before the
      high-speed root hub, because it is the ehci_bus_resume() routine which
      takes care of handing the device connection over to the companion
      controller.  If the device resume is attempted before the handover
      then the device won't be found and it will be treated as though it had
      disconnected.
      
      The patch adds a new field to the usb_bus structure; for each
      full/low-speed bus this field will contain a pointer to the companion
      high-speed bus (if one exists).  It is used during normal device
      resume; if the hs_companion pointer isn't NULL then we wait for the
      root-hub device on the hs_companion bus.
      
      A secondary issue is that an EHCI controlller shouldn't be resumed
      before any of its companions.  On some machines I have observed
      handovers failing if the companion controller is reinitialized after
      the handover.  Thus, the EHCI resume routine must wait for the
      companion controllers to be resumed.
      
      The patch also fixes a small bug in usb_hcd_pci_probe(); an error path
      jumps to the wrong label, causing a memory leak.
      
      [rjw: Fixed compilation for CONFIG_PM_SLEEP unset.]
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      6d19c009
  12. 16 12月, 2009 1 次提交
  13. 16 6月, 2009 2 次提交
  14. 18 2月, 2009 1 次提交
  15. 28 1月, 2009 2 次提交
    • R
      USB: Fix suspend-resume of PCI USB controllers · a15d95a0
      Rafael J. Wysocki 提交于
      Commit a0d4922d
      (USB: fix up suspend and resume for PCI host controllers) attempted
      to fix the suspend-resume of PCI USB controllers, but unfortunately
      it did that incorrectly and interrupts are left enabled by the USB
      controllers' ->suspend_late() callback as a result.  This leads to
      serious problems during suspend which are very difficult to debug.
      
      Fix the issue by removing the ->suspend_late() callback of PCI
      USB controllers and moving the code from there to the ->suspend()
      callback executed with interrupts enabled.  Additionally, make
      the ->resume() callback of PCI USB controllers execute
      pci_enable_wake(dev, PCI_D0, false) to disable wake-up from the
      full power state (PCI_D0).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NAndrey Borzenkov <arvidjaar@mail.ru>
      Tested-by: N"Jeff Chua" <jeff.chua.linux@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: "Zdenek Kabelac" <zdenek.kabelac@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a15d95a0
    • A
      USB: don't enable wakeup by default for PCI host controllers · bcca06ef
      Alan Stern 提交于
      This patch (as1199) changes the initial wakeup settings for PCI USB
      host controllers.  The controllers are marked as capable of waking the
      system, but wakeup is not enabled by default.
      
      It turns out that enabling wakeup for USB host controllers has a lot
      of bad consequences.  As the simplest example, if a USB mouse or
      keyboard is unplugged immediately after the computer is put to sleep,
      the unplug will cause the system to wake back up again!  We are better
      off marking them as wakeup-capable and leaving wakeup disabled.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NRafael J. Wysocki <rjw@sisk.pl>
      CC: David Brownell <david-b@pacbell.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bcca06ef
  16. 08 1月, 2009 2 次提交
    • A
      USB: automatically enable wakeup for PCI host controllers · 6fd9086a
      Alan Stern 提交于
      This patch (as1193b) enables wakeup during initialization for all PCI
      host controllers, and it removes some code (and comments!) that are no
      longer needed now that the PCI core automatically initializes wakeup
      settings for all new devices.
      
      The idea is that the bus should initialize wakeup, and the bus glue
      or controller driver should enable it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6fd9086a
    • A
      USB: fix up suspend and resume for PCI host controllers · a0d4922d
      Alan Stern 提交于
      This patch (as1192) rearranges the USB PCI host controller suspend and
      resume and resume routines:
      
      	Use pci_wake_from_d3() for enabling and disabling wakeup,
      	instead of pci_enable_wake().
      
      	Carry out the actual state change while interrupts are
      	disabled.
      
      	Change the order of the preparations to agree with the
      	general recommendation for PCI devices, instead of
      	messing around with the wakeup settings while the device
      	is in D3.
      
      		In .suspend:
      			Call the underlying driver to disable IRQ
      				generation;
      			pci_wake_from_d3(device_may_wakeup());
      			pci_disable_device();
      
      		In .suspend_late:
      			pci_save_state();
      			pci_set_power_state(D3hot);
      			(for PPC_PMAC) Disable ASIC clocks
      
      		In .resume_early:
      			(for PPC_PMAC) Enable ASIC clocks
      			pci_set_power_state(D0);
      			pci_restore_state();
      
      		In .resume:
      			pci_enable_device();
      			pci_set_master();
      			pci_wake_from_d3(0);
      			Call the underlying driver to reenable IRQ
      				generation
      
      	Add the necessary .suspend_late and .resume_early method
      	pointers to the PCI host controller drivers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Rafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a0d4922d
  17. 25 4月, 2008 2 次提交
  18. 02 2月, 2008 3 次提交
  19. 18 12月, 2007 1 次提交
  20. 13 7月, 2007 1 次提交
  21. 28 9月, 2006 1 次提交
    • A
      USB: Properly unregister reboot notifier in case of failure in ehci hcd · 64a21d02
      Aleksey Gorelov 提交于
      If some problem occurs during ehci startup, for instance, request_irq fails,
      echi hcd driver tries it best to cleanup, but fails to unregister reboot
      notifier, which in turn leads to crash on reboot/poweroff.
      
      The following patch resolves this problem by not using reboot notifiers
      anymore, but instead making ehci/ohci driver get its own shutdown method.  For
      PCI, it is done through pci glue, for everything else through platform driver
      glue.
      
      One downside: sa1111 does not use platform driver stuff, and does not have its
      own shutdown hook, so no 'shutdown' is called for it now.  I'm not sure if it
      is really necessary on that platform, though.
      Signed-off-by: NAleks Gorelov <dared1st@yahoo.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      64a21d02
  22. 26 9月, 2006 1 次提交
  23. 03 7月, 2006 1 次提交
  24. 01 7月, 2006 1 次提交
  25. 15 4月, 2006 1 次提交
    • A
      [PATCH] pm: print name of failed suspend function · 02669492
      Andrew Morton 提交于
      Print more diagnostic info to help identify the source of power management
      suspend failures.
      
      Example:
      
      usb_hcd_pci_suspend(): pci_set_power_state+0x0/0x1af() returns -22
      pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x11b() returns -22
      suspend_device(): pci_device_suspend+0x0/0x34() returns -22
      
      Work-in-progress.  It needs lots more suspend_report_result() calls sprinkled
      everywhere.
      
      Cc: Patrick Mochel <mochel@digitalimplant.org>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Nigel Cunningham <nigel@suspend2.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      02669492
  26. 28 3月, 2006 1 次提交
  27. 21 3月, 2006 1 次提交