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

USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set

This patch (as786) removes a redundant test and fixes a problem
involving repeated system sleeps when CONFIG_USB_SUSPEND is not set.
During the first wakeup, the root hub's dev.power.power_state.event
field doesn't get updated, causing it not to be suspended during the
second sleep transition.

This takes care of the issue raised by Rafael J. Wysocki and Mattia
Dongili.

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
592fbbe4 02c399ee

+6 -1
+6 -1
drivers/usb/core/driver.c
··· 1071 1071 PM_EVENT_ON) 1072 1072 status = -EHOSTUNREACH; 1073 1073 } 1074 - if (status == 0 && udev->state == USB_STATE_SUSPENDED) 1074 + if (status == 0) 1075 1075 status = resume_device(udev); 1076 1076 if (parent) 1077 1077 mutex_unlock(&parent->pm_mutex); 1078 + } else { 1079 + 1080 + /* Needed only for setting udev->dev.power.power_state.event 1081 + * and for possible debugging message. */ 1082 + status = resume_device(udev); 1078 1083 } 1079 1084 1080 1085 /* Now the parent won't suspend until we are finished */