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

Commit 9be427ef authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping"



This reverts commit e3345db8, which
broke system resume for a large class of devices.

Devices that after having been reset during resume need to be rebound
due to a missing reset_resume callback, are now left in a suspended
state. This specifically broke resume of common USB-serial devices,
which are now unusable after system suspend (until disconnected and
reconnected) when USB persist is enabled.

During resume, usb_resume_interface will set the needs_binding flag for
such interfaces, but unlike system resume, run-time resume does not
honour it.

Cc: stable <stable@vger.kernel.org>	# 4.5
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 550af790
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -249,18 +249,12 @@ static int usb_port_runtime_suspend(struct device *dev)


	return retval;
	return retval;
}
}

static int usb_port_prepare(struct device *dev)
{
	return 1;
}
#endif
#endif


static const struct dev_pm_ops usb_port_pm_ops = {
static const struct dev_pm_ops usb_port_pm_ops = {
#ifdef CONFIG_PM
#ifdef CONFIG_PM
	.runtime_suspend =	usb_port_runtime_suspend,
	.runtime_suspend =	usb_port_runtime_suspend,
	.runtime_resume =	usb_port_runtime_resume,
	.runtime_resume =	usb_port_runtime_resume,
	.prepare =		usb_port_prepare,
#endif
#endif
};
};


+1 −7
Original line number Original line Diff line number Diff line
@@ -312,13 +312,7 @@ static int usb_dev_uevent(struct device *dev, struct kobj_uevent_env *env)


static int usb_dev_prepare(struct device *dev)
static int usb_dev_prepare(struct device *dev)
{
{
	struct usb_device *udev = to_usb_device(dev);
	return 0;		/* Implement eventually? */

	/* Return 0 if the current wakeup setting is wrong, otherwise 1 */
	if (udev->do_remote_wakeup != device_may_wakeup(dev))
		return 0;

	return 1;
}
}


static void usb_dev_complete(struct device *dev)
static void usb_dev_complete(struct device *dev)