linux/drivers
Alan Stern 71b7497c07 USB: OHCI: fix endless polling behavior
This patch (as1149) fixes an obscure problem in OHCI polling.  In the
current code, if the RHSC interrupt status flag turns on at a time
when RHSC interrupts are disabled, it will remain on forever:

	The interrupt handler is the only place where RHSC status
	gets turned back off;

	The interrupt handler won't turn RHSC status off because it
	doesn't turn off status flags if the corresponding interrupt
	isn't enabled;

	RHSC interrupts will never get enabled because
	ohci_root_hub_state_changes() doesn't reenable RHSC if RHSC
	status is on!

As a result we will continue polling indefinitely instead of reverting
to interrupt-driven operation, and the root hub will not autosuspend.
This particular sequence of events is not at all unusual; in fact
plugging a USB device into an OHCI controller will usually cause it to
occur.

Of course, this is a bug.  The proper thing to do is to turn off RHSC
status just before reading the actual port status values.  That way
either a port status change will be detected (if it occurs before the
status read) or it will turn RHSC back on.  Possibly both, but that
won't hurt anything.

We can still check for systems in which RHSC is totally broken, by
re-reading RHSC after clearing it and before reading the port
statuses.  (This re-read has to be done anyway, to post the earlier
write.)  If RHSC is on but no port-change statuses are set, then we
know that RHSC is broken and we can avoid re-enabling it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17 14:41:04 -07:00
..
accessibility
acpi rtc-cmos: move wake setup from ACPI glue into RTC driver 2008-10-14 16:08:21 -07:00
amba
ata Merge commit 'origin' 2008-10-15 11:31:54 +11:00
atm
auxdisplay
base Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
block ub: remove sg_stat 2008-10-17 14:40:52 -07:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
cdrom
char Merge branch 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6 2008-10-16 12:43:49 -07:00
clocksource
connector
cpufreq
cpuidle
crypto
dca device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
dio
dma
edac edac i5000: fix thermal issues 2008-10-16 11:21:48 -07:00
eisa
firewire firewire: fix ioctl() return code 2008-10-15 22:21:10 +02:00
firmware Merge branch 'core-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-10-16 15:17:40 -07:00
gpio gpiolib: request/free hooks 2008-10-16 11:21:40 -07:00
gpu misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
hid Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
hwmon hwmon: (adm1026) Prevent log spamming 2008-10-17 17:51:20 +02:00
i2c hwmon: (ams) Convert to a new-style i2c driver 2008-10-17 17:51:12 +02:00
ide block: remove __generic_unplug_device() from exports 2008-10-17 14:03:08 +02:00
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2008-10-16 15:02:24 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-17 09:00:23 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-10-16 11:52:08 -07:00
isdn device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
leds device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
lguest
macintosh device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
mca
md Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-17 09:00:23 -07:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
memstick
message i2o: Fix 32/64bit DMA locking 2008-10-16 11:21:38 -07:00
mfd Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
misc Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
mmc Merge branch 'fixes' into for-linus 2008-10-15 23:16:07 +01:00
mtd Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-17 08:58:52 -07:00
nubus nubus: fix mis-indented statement 2008-10-16 11:21:30 -07:00
of Merge commit 'gcl/gcl-next' 2008-10-14 10:11:27 +11:00
oprofile Merge branch 'linus' into oprofile-v2 2008-10-13 11:05:51 +02:00
parisc
parport parport: remove CVS keywords 2008-10-16 11:21:49 -07:00
pci {pci,pnp} quirks.c: don't use deprecated print_fn_descriptor_symbol() 2008-10-16 16:11:43 -07:00
pcmcia [ARM] 5307/1: pxa: fix CM-X2XX PCMCIA build error 2008-10-15 12:34:50 +01:00
pnp {pci,pnp} quirks.c: don't use deprecated print_fn_descriptor_symbol() 2008-10-16 16:11:43 -07:00
power Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
ps3
rapidio
regulator da903x: add regulator support for DA9030/DA9034 2008-10-13 21:51:57 +01:00
rtc rtc: rtc-ds1286 and rtc-m48t35 need <linux/io.h> 2008-10-16 11:32:38 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block 2008-10-17 09:29:55 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-17 09:00:23 -07:00
serial Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-16 11:25:32 -07:00
sh
sn
spi Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
staging staging: at76_usb wireless driver 2008-10-13 14:33:13 -07:00
tc
telephony telephony: remove CVS keywords 2008-10-16 11:21:45 -07:00
thermal
uio UIO: Fix mapping of logical and virtual memory 2008-10-16 09:24:54 -07:00
usb USB: OHCI: fix endless polling behavior 2008-10-17 14:41:04 -07:00
video Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
virtio
w1 w1: new driver. DS2431 chip 2008-10-16 11:21:51 -07:00
watchdog Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
xen
zorro
Kconfig
Makefile