Thread (1 message) 1 message, 1 author, 2008-01-06

Re: [RFC][PATCH 1/7] Suspend: Introduce open() and close() callbacks

From: David Brownell <hidden>
Date: 2008-01-06 00:31:18

On Saturday 05 January 2008, Rafael J. Wysocki wrote:
+ * @open: Initialise a transition to given system sleep state.
+ *     @open() is executed right prior to suspending devices.  The information
+ *     conveyed to the platform code by @open() should be disregarded by it as
+ *     soon as @close() is executed.  If @open() fails (ie. returns nonzero),
  *     @prepare(), @enter() and @finish() will not be called by the PM core.
  *     This callback is optional.  However, if it is implemented, the argument
  *     passed to @enter() is meaningless and should be ignored.
                                ^^^^^^^^^^^
Surely this should say "redundant", not "meaningless"?   

+ * @close: Called by the PM core right after resuming devices, to indicate to
+ *     the platform that the system has returned to the working state.
Or the state transition has aborted ...
+ *     This callback is optional, but should be implemented by the platforms
+ *     that implement @open().
"..., but platforms which implement @open() should also provide a @close()
which cleans up transitions which aborted before @enter()."

Otherwise it seems rather unclear why this exists, since all platforms know
that things are "normal" as soon as enter() gets back from its transition.
(What can I say ... I like to see things be clear!)  Yes, systems may do more
than that when it gets this call; but the minimum involves just that cleanup.

- Dave
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help