summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern2008-07-01 16:45:51 +0200
committerGreg Kroah-Hartman2008-07-04 03:20:37 +0200
commit1236edf1c70107a0d31b3fba0b2a8783615d0d24 (patch)
treede2ac86085d7040b1ad11642d4b26167bbf53c12
parentUSB: fix interrupt disabling for HCDs with shared interrupt handlers (diff)
downloadkernel-qcow2-linux-1236edf1c70107a0d31b3fba0b2a8783615d0d24.tar.gz
kernel-qcow2-linux-1236edf1c70107a0d31b3fba0b2a8783615d0d24.tar.xz
kernel-qcow2-linux-1236edf1c70107a0d31b3fba0b2a8783615d0d24.zip
USB: don't lose disconnections during suspend
This patch (as1111) fixes a bug in the hub driver. When a hub resumes, disconnections that occurred while the hub was suspended are lost. A completely different fix for this problem has already been accepted for 2.6.27; however the problem still needs to be handled in 2.6.26. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/hub.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 94789be54ca3..512d2d57d41e 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -713,18 +713,11 @@ static void hub_restart(struct usb_hub *hub, int type)
}
/* Was the power session lost while we were suspended? */
- switch (type) {
- case HUB_RESET_RESUME:
- portstatus = 0;
- portchange = USB_PORT_STAT_C_CONNECTION;
- break;
+ status = hub_port_status(hub, port1, &portstatus, &portchange);
- case HUB_RESET:
- case HUB_RESUME:
- status = hub_port_status(hub, port1,
- &portstatus, &portchange);
- break;
- }
+ /* If the device is gone, khubd will handle it later */
+ if (status == 0 && !(portstatus & USB_PORT_STAT_CONNECTION))
+ continue;
/* For "USB_PERSIST"-enabled children we must
* mark the child device for reset-resume and