OpenCloudOS-Kernel/include/linux/usb
Alan Stern 9b37596a2e USB: move usbcore away from hcd->state
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: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Alex Terekhov <a.terekhov@gmail.com>
CC: <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 12:14:06 -08:00
..
Kbuild USB: gadget: export functionfs.h to the includes available for userspace 2011-02-04 11:57:21 -08:00
association.h
atmel_usba_udc.h
audio-v2.h ALSA: usb-audio: move and add some comments 2010-06-23 16:09:50 +02:00
audio.h ALSA: usb-audio: unify UAC macros and struct names 2010-06-23 16:09:26 +02:00
c67x00.h
cdc.h CDC NCM errata updates for cdc.h 2011-02-08 13:54:42 -08:00
ch9.h USB: fix unsafe USB_SS_MAX_STREAMS() definition 2011-02-25 11:40:01 -08:00
ch11.h USB: usb.h: Make comment match the defines it describes 2011-02-17 10:53:25 -08:00
composite.h usb gadget: don't save bind callback in struct usb_configuration 2010-10-22 10:21:26 -07:00
ehci_def.h USB: EHCI: EHCI 1.1 addendum: preparation 2010-08-10 14:35:35 -07:00
functionfs.h USB: gadget: f_fs: functionfs_add() renamed to functionfs_bind_config() 2010-08-10 14:35:36 -07:00
g_hid.h
g_printer.h
gadget.h usb gadget: don't save bind callback in struct usb_gadget_driver 2010-10-22 10:21:25 -07:00
gadgetfs.h
gpio_vbus.h
hcd.h USB: move usbcore away from hcd->state 2011-03-07 12:14:06 -08:00
input.h
intel_mid_otg.h USB OTG: Add common data structure for Intel MID Platform (Langwell/Penwell) 2010-10-22 10:21:33 -07:00
iowarrior.h
irda.h
isp116x.h
isp1362.h
isp1760.h
langwell_otg.h USB OTG Langwell: Update OTG Kconfig and driver version. 2010-10-22 10:21:33 -07:00
langwell_udc.h
m66592.h
midi.h
msm_hsusb.h USB: OTG: msm: Add support for power management 2010-12-10 14:23:32 -08:00
msm_hsusb_hw.h USB: Fix trout build failure with ci13xxx_msm gadget 2011-02-04 12:38:14 -08:00
musb.h Merge branch 'usb-next' into musb-merge 2010-12-16 10:05:06 -08:00
net2280.h
otg.h usb: otg: notifier: switch to atomic notifier 2011-02-18 14:05:54 +02:00
quirks.h USB delay init quirk for logitech Harmony 700-series devices 2010-08-10 14:35:41 -07:00
r8a66597.h
rndis_host.h
serial.h USB: serial drivers need to use larger bulk-in buffers 2011-02-25 11:38:32 -08:00
sl811.h
storage.h USB: Move USB Storage definitions to their own header file 2010-10-22 10:21:50 -07:00
tmc.h
ulpi.h USB: otg/ulpi: extend the generic ulpi driver. 2010-08-10 14:35:40 -07:00
usbnet.h usbnet: changes for upcoming cdc_ncm driver 2010-12-06 12:59:02 -08:00
video.h V4L/DVB: uvc: Move constants and structures definitions to linux/usb/video.h 2010-08-02 16:43:15 -03:00
wusb-wa.h
wusb.h