Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: move decision to ignore FREEZE events

This patch (as987) changes the way FREEZE and PRETHAW suspend events
are handled in usbcore. The decision about whether or not to ignore
them for non-root devices is pushed down into the USB-device driver,
instead of being made in the core code.

This is appropriate, since devices exported to a virtualized guest or
over a network may indeed need to handle these types of suspend, even
though normal devices don't.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
5ad4f71e 7477120e

+6 -8
+1 -8
drivers/usb/core/driver.c
··· 1088 1088 break; 1089 1089 } 1090 1090 } 1091 - if (status == 0) { 1092 - 1093 - /* Non-root devices don't need to do anything for FREEZE 1094 - * or PRETHAW. */ 1095 - if (udev->parent && (msg.event == PM_EVENT_FREEZE || 1096 - msg.event == PM_EVENT_PRETHAW)) 1097 - goto done; 1091 + if (status == 0) 1098 1092 status = usb_suspend_device(udev, msg); 1099 - } 1100 1093 1101 1094 /* If the suspend failed, resume interfaces that did get suspended */ 1102 1095 if (status != 0) {
+5
drivers/usb/core/generic.c
··· 206 206 */ 207 207 if (!udev->parent) 208 208 rc = hcd_bus_suspend(udev); 209 + 210 + /* Non-root devices don't need to do anything for FREEZE or PRETHAW */ 211 + else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW) 212 + rc = 0; 209 213 else 210 214 rc = usb_port_suspend(udev); 215 + 211 216 return rc; 212 217 } 213 218