linux/drivers/usb/core
Sarah Sharp ff9d78b36f USB: Set usb_hcd->state and flags for shared roothubs.
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: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2011-03-13 18:23:33 -07:00
..
buffer.c USB: Core: Fix minor coding style issues 2011-01-22 19:35:39 -08:00
config.c USB: remove the usb_host_ss_ep_comp structure 2010-05-20 13:21:40 -07:00
devices.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
devio.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
driver.c usb: Always return 0 or -EBUSY to the runtime PM core. 2011-03-13 18:07:07 -07:00
endpoint.c usb: set ep_dev async suspend should be later than device_initialize 2011-01-22 18:36:42 -08:00
file.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
generic.c USB: accept RNDIS configs if there's no alternative 2010-08-10 14:35:43 -07:00
hcd-pci.c USB: Set usb_hcd->state and flags for shared roothubs. 2011-03-13 18:23:33 -07:00
hcd.c USB: Set usb_hcd->state and flags for shared roothubs. 2011-03-13 18:23:33 -07:00
hub.c usb: Change usb_hcd->bandwidth_mutex to a pointer. 2011-03-13 18:07:14 -07:00
inode.c fs: dcache remove dcache_lock 2011-01-07 17:50:23 +11:00
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
Makefile usb: makefile cleanup 2010-10-22 10:22:07 -07:00
message.c usb: Change usb_hcd->bandwidth_mutex to a pointer. 2011-03-13 18:07:14 -07:00
notify.c USB : correct comments in usb/core/notify.c 2008-02-01 14:34:44 -08:00
otg_whitelist.h USB: fix codingstyle issues in drivers/usb/core/*.h 2008-02-01 14:35:07 -08:00
quirks.c USB: improve uses of usb_mark_last_busy 2010-11-16 14:04:22 -08:00
sysfs.c USB: use the runtime-PM autosuspend implementation 2010-11-16 14:03:41 -08:00
urb.c USB: output an error message when the pipe type doesn't match the endpoint type 2010-10-22 10:21:27 -07:00
usb.c USB: use the runtime-PM autosuspend implementation 2010-11-16 14:03:41 -08:00
usb.h USB: add helper to convert USB error codes 2011-01-22 19:35:38 -08:00