[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0804021104190.6272-100000@iolanthe.rowland.org>
Date: Wed, 2 Apr 2008 11:13:11 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Oliver Neukum <oliver@...kum.org>
cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Nigel Cunningham <ncunningham@...a.org.au>,
pm list <linux-pm@...ts.linux-foundation.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Greg KH <greg@...ah.com>, Len Brown <lenb@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Alexey Starikovskiy <astarikovskiy@...e.de>,
David Brownell <david-b@...bell.net>,
Pavel Machek <pavel@....cz>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [RFC][PATCH] PM: Introduce new top level suspend and hibernation
callbacks (rev. 6)
On Wed, 2 Apr 2008, Oliver Neukum wrote:
> We need to do something about devices that don't want to be resumed.
> There's code like this:
>
>
> static int usb_resume(struct device *dev)
> {
> struct usb_device *udev;
>
> if (!is_usb_device(dev)) /* Ignore PM for interfaces */
> return 0;
> udev = to_usb_device(dev);
>
> /* If udev->skip_sys_resume is set then udev was already suspended
> * when the system suspend started, so we don't want to resume
> * udev during this system wakeup. However a reset-resume counts
> * as a wakeup event, so allow a reset-resume to occur if remote
> * wakeup is enabled. */
> if (udev->skip_sys_resume) {
> if (!(udev->reset_resume && udev->do_remote_wakeup))
> return -EHOSTUNREACH;
> }
> return usb_external_resume_device(udev);
> }
>
> Do we want to keep this in the subsystems?
Basically yes. Subsystems and drivers are allowed to keep devices
suspended if they were suspended before the system went to sleep.
Remember, the purpose of the resume method is to let drivers know that
the system is now awake, not to force them to put their devices into a
high-power state.
But under these circumstances we don't want to return an error code,
since nothing really went wrong in the method. So the -EHOSTUNREACH
should be changed to 0.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists