Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7108f284 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman
Browse files

USB: don't propagate FREEZE or PRETHAW suspends



This patch (as992) fixes a recently-added bug.  During a FREEZE or
PRETHAW suspend notification, non-root devices don't actually get
suspended.  So we shouldn't tell their parent hubs that they did.

(This code path used to be skipped over, until the FREEZE/PRETHAW test
got moved out of usb_suspend_both() into generic_suspend().)

Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 393e5511
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1112,7 +1112,12 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
			usb_hcd_flush_endpoint(udev, udev->ep_out[i]);
			usb_hcd_flush_endpoint(udev, udev->ep_in[i]);
		}
		if (parent)

		/* If this is just a FREEZE or a PRETHAW, udev might
		 * not really be suspended.  Only true suspends get
		 * propagated up the device tree.
		 */
		if (parent && udev->state == USB_STATE_SUSPENDED)
			usb_autosuspend_device(parent);
	}