linux/drivers/staging
Max Vozeler 584c5b7cf0 staging: usbip: Process event flags without delay
The way the event handler works can cause it to delay
events until eventual wakeup for another event.

For example, on device detach (vhci):

 - Write to sysfs detach file
    -> usbip_event_add(VDEV_EVENT_DOWN)
      -> wakeup()

#define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET).

 - Event thread wakes up and passes the event to
   event_handler() to process.

 - It processes and clears the USBIP_EH_SHUTDOWN
   flag then returns.

 - The outer event loop (event_handler_loop()) calls
   wait_event_interruptible().

The processing of the second flag which is part of
VDEV_EVENT_DOWN (USBIP_EH_RESET) did not happen yet.
It is delayed until the next event.

This means the ->reset callback may not happen for
a long time (if ever), leaving the usbip port in a
weird state which prevents its reuse.

This patch changes the handler to process all flags
before waiting for another wakeup.

I have verified this change to fix a problem which
prevented reattach of a usbip device. It also helps
for socket errors which missed the RESET as well.

The delayed event processing also affects the stub
side of usbip and the error handling there.

Signed-off-by: Max Vozeler <mvz@vozeler.com>
Reported-by: Marco Lancione <marco@optikam.com>
Tested-by: Luc Jalbert <ljalbert@optikam.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21 11:00:22 -07:00
..
adis16255 staging: adis16255: fix sysfs leak 2010-08-31 14:51:53 -07:00
asus_oled Staging: asus_oled: asus_oled.c: Checkpatch cleanup 2010-05-11 11:35:30 -07:00
ath6kl staging: ath6kl: Fixing a race condition during initialization 2010-09-20 17:02:02 -07:00
batman-adv Staging: batman-adv: Introduce update_primary_addr to update mac address 2010-09-20 16:29:51 -07:00
bcm staging: Use static const char * const where possible 2010-09-16 13:02:37 -07:00
brcm80211 staging: brcm80211: add fullmac driver 2010-09-21 10:29:31 -07:00
comedi Staging: comedi: fix printk() coding style issue in adl_pci9111.c 2010-09-20 17:01:24 -07:00
crystalhd staging: crystalhd: fix signed bug 2010-09-16 12:37:34 -07:00
cx25821 Staging: cx25821: clenup warnings found by checkpatch.pl tool in cx25821-audio-upstream.c and cx25821-audio.h. 2010-08-31 15:05:12 -07:00
cxt1e1 staging: cxt1e1: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:56 -07:00
dream staging: Bulk convert the semaphore mess 2010-09-07 19:31:32 -07:00
dt3155v4l Staging: dt3155v4l: correcting a pointer mismatch bug and cleanups 2010-06-18 16:50:04 -07:00
easycap staging: Pushdown bkl to easycap ioctl handlers 2010-08-09 03:28:40 +02:00
echo staging: trivial: fix typo "seperate" 2010-05-14 13:16:10 -07:00
et131x staging/trivial: fix typos concerning "initiali[zs]e" 2010-09-04 21:23:26 -07:00
frontier staging/trivial: fix typos concerning "initiali[zs]e" 2010-09-04 21:23:26 -07:00
go7007 i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
hv staging: hv: Remove camel cases of vmbus packet buffer structures 2010-09-20 16:22:40 -07:00
iio staging: iio: sysfs abi documentation. Add _type and _index attrs 2010-09-21 10:34:44 -07:00
keucr staging: keucr: check kmalloc() return value 2010-09-20 17:03:41 -07:00
line6 Staging: line6: workaround for null pointer bug 2010-09-20 17:04:35 -07:00
lirc staging: lirc: Remove unnecessary casts of private_data 2010-09-05 00:35:37 -07:00
memrar Staging: Merge staging-next into Linus's tree 2010-08-05 14:18:03 -07:00
mrst-touchscreen staging/trivial: fix typos concerning "initiali[zs]e" 2010-09-04 21:23:26 -07:00
msm staging: msm: Remove pr_<level> uses of KERN_<level> 2010-09-16 12:37:36 -07:00
octeon staging: octeon: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:57 -07:00
otus staging: otus: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:56 -07:00
panel staging: panel: fix error path 2010-08-02 18:23:45 -07:00
phison Staging: phison: depends on ATA_BMDMA 2010-06-04 13:38:57 -07:00
pohmelfs staging: Drop unnecessary null test 2010-08-31 11:13:15 -07:00
quatech_usb2 staging/trivial: fix typos concerning "initiali[zs]e" 2010-09-04 21:23:26 -07:00
quickstart Staging: quickstart: acpi_status is unsigned 2010-08-31 14:48:09 -07:00
rt2860 staging: rt2860: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:55 -07:00
rt2870 staging: rt2870: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:56 -07:00
rtl8187se Staging: rtl8187se: r8185b_init: fixed a lot of checkpatch.pl issues 2010-09-21 10:49:32 -07:00
rtl8192e staging: rtl8192e: Clean up rtl8192_hard_start_xmit() 2010-09-21 10:57:01 -07:00
rtl8192u staging: rtl8192u: improve error path 2010-09-05 16:59:50 -07:00
rtl8712 staging: rtl8712: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:56 -07:00
samsung-laptop backlight: Allow properties to be passed at registration 2010-03-16 19:47:54 +00:00
sbe-2t3e3 Staging: Add SBE 2T3E3 WAN driver 2010-08-30 17:36:50 -07:00
serqt_usb2 Staging: serqt_usb2: fix space coding style issue in serqt_usb2.c 2010-05-11 11:35:54 -07:00
slicoss Staging: slicoss: Remove explicit arch dependencies 2010-08-31 11:52:28 -07:00
sm7xx staging: sm7xx: call disable_pci_device() if pci_probe() failed 2010-08-31 14:48:09 -07:00
solo6x10 staging: solo6010: fix signess bug 2010-09-16 12:37:33 -07:00
spectra staging: spectra: off by one 2010-09-20 17:03:41 -07:00
ti-st staging: ti-st: mv headers to ti_wilink_st 2010-09-20 17:02:54 -07:00
tidspbridge staging: tidspbridge: check return code of get_user 2010-09-05 16:59:50 -07:00
tm6000 staging: tm6000: fix memory leak 2010-08-31 14:51:52 -07:00
udlfb staging: udlfb: fix checkpatch and style 2010-09-05 19:46:14 -07:00
usbip staging: usbip: Process event flags without delay 2010-09-21 11:00:22 -07:00
vme staging: Bulk convert the semaphore mess 2010-09-07 19:31:32 -07:00
vt6655 Staging: vt6655: remove unused update_BssList definition 2010-09-20 17:01:24 -07:00
vt6656 Staging: vt665x: remove unused DEF definition 2010-09-16 13:02:36 -07:00
westbridge staging: west bridge: pnand hal fixes 2010-09-14 16:52:47 -07:00
winbond staging: winbond: mds.c: Fixed all checkpatch's errors 2010-09-21 10:48:17 -07:00
wlags49_h2 staging: wlags49_h2: '&pointer[0]' to 'pointer' fix 2010-09-20 16:10:55 -07:00
wlags49_h25 Staging: wlags49_h2, wlags49_h25: fixed Kconfig dependencies 2010-06-04 13:38:57 -07:00
wlan-ng staging/trivial: fix typos concerning "initiali[zs]e" 2010-09-04 21:23:26 -07:00
xgifb staging: xgifb: Removes unnecesary log 2010-09-08 02:07:12 -07:00
zram Staging: zram: Update zram documentation 2010-08-31 15:36:36 -07:00
Kconfig Staging: Add initial release of brcm80211 - Broadcom 802.11n wireless LAN driver. 2010-09-08 23:09:11 -07:00
Makefile Staging: fix Makefile so broadcom driver will actually build. 2010-09-08 23:14:18 -07:00
staging.c