diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:32 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:37 +0200 | 
| commit | 7961386fe9596e6bf03d09948a73c5df9653325b (patch) | |
| tree | 60fa2586a0d340ef8f7473956eef17430d8250c7 /drivers/usb/wusbcore/devconnect.c | |
| parent | aa47b7e0f89b9998dad4d1667447e8cb7703ff4e (diff) | |
| parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
| download | olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.tar.xz olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.zip  | |
Merge commit 'v2.6.30-rc5' into sched/core
Merge reason: sched/core was on .30-rc1 before, update to latest fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/usb/wusbcore/devconnect.c')
| -rw-r--r-- | drivers/usb/wusbcore/devconnect.c | 21 | 
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index 386eaa22d21..4ac4300a3f9 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c @@ -267,6 +267,8 @@ static void wusbhc_devconnect_acked_work(struct work_struct *work)  	mutex_lock(&wusbhc->mutex);  	wusbhc_devconnect_acked(wusbhc, wusb_dev);  	mutex_unlock(&wusbhc->mutex); + +	wusb_dev_put(wusb_dev);  }  /* @@ -396,7 +398,8 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc,  	/* After a device disconnects, change the GTK (see [WUSB]  	 * section 6.2.11.2). */ -	wusbhc_gtk_rekey(wusbhc); +	if (wusbhc->active) +		wusbhc_gtk_rekey(wusbhc);  	/* The Wireless USB part has forgotten about the device already; now  	 * khubd's timer will pick up the disconnection and remove the USB @@ -1084,15 +1087,21 @@ error_mmcie_set:   * wusbhc_devconnect_stop - stop managing connected devices   * @wusbhc: the WUSB HC   * - * Removes the Host Info IE and stops the keep alives. - * - * FIXME: should this disconnect all devices? + * Disconnects any devices still connected, stops the keep alives and + * removes the Host Info IE.   */  void wusbhc_devconnect_stop(struct wusbhc *wusbhc)  { -	cancel_delayed_work_sync(&wusbhc->keep_alive_timer); -	WARN_ON(!list_empty(&wusbhc->cack_list)); +	int i; +	mutex_lock(&wusbhc->mutex); +	for (i = 0; i < wusbhc->ports_max; i++) { +		if (wusbhc->port[i].wusb_dev) +			__wusbhc_dev_disconnect(wusbhc, &wusbhc->port[i]); +	} +	mutex_unlock(&wusbhc->mutex); + +	cancel_delayed_work_sync(&wusbhc->keep_alive_timer);  	wusbhc_mmcie_rm(wusbhc, &wusbhc->wuie_host_info->hdr);  	kfree(wusbhc->wuie_host_info);  	wusbhc->wuie_host_info = NULL;  |