Re: [linux-pm] driver power operations (was Re: suspend2 merge)



On Fri, 2007-04-27 at 17:20 +0200, Rafael J. Wysocki wrote:

I think we can use 'stages' and pass them as arguments to the functions.

In that case we can have two callbacks for the hibernation (I'd prefer to say
'hibernation' instead of 'suspend to disk' from now on), one 'quiesce' callback
and one 'activate' callback that can be called many times in one
snapshot/restore cycle with different arguments, for example:

But you're not proposing to add suspend/resume to this interface too, I
hope :)

quiesce(PREPARE) -- that may be needed for drivers that allocate much memory
before quiescing devices (if any)
...
quiesce(PRE_SNAPSHOT)
...
quiesce(PRE_SNAPSHOT_IRQ_OFF)
...
activate(POST_SNAPSHOT_IRQ_OFF)
...
activate(POST_SNAPSHOT)
...
activate(FINISH)

I'm still not sure I like having to switch on the argument for every
implementation. Is it really worth it?

johannes

Attachment: signature.asc
Description: This is a digitally signed message part



Relevant Pages

  • Re: 900af0d breaks some embedded suspend/resume
    ... they do this via the platform PM ops ... prepare callback, relying on the I2C driver being hooked into the ... 'late' suspend method, and hence being shut down _after_ the prepare ... platform to depend on a driver like this. ...
    (Linux-Kernel)
  • Re: [PATCH] PM: Introduce core framework for run-time PM of I/O devices
    ... is not there and it's going to be added in a separate patch. ... return 0 as callback return value. ... * @dev: Device to cancel the suspend request for. ...
    (Linux-Kernel)
  • [RFC] Add some hooks to generic suspend code
    ... While consolidating the powermac suspend to ram and suspend to disk ... I use that one to do some housekeeping that I want to do before the interrupts are ... Additionally, I shut interrupts down myself in that callback, ... off as well (and thus become responsible for re-enabling them). ...
    (Linux-Kernel)
  • Re: 900af0d breaks some embedded suspend/resume
    ... prepare callback, relying on the I2C driver being hooked into the ... 'late' suspend method, and hence being shut down _after_ the prepare ... platform to depend on a driver like this. ... and actively breaks some platforms. ...
    (Linux-Kernel)
  • Re: 900af0d breaks some embedded suspend/resume
    ... prepare callback, relying on the I2C driver being hooked into the ... 'late' suspend method, and hence being shut down _after_ the prepare ... and actively breaks some platforms. ...
    (Linux-Kernel)