powerpc/pseries: Simplify check for suspendability during suspend/migration
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Fri, 27 Mar 2015 19:47:25 +0000 (12:47 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 28 Mar 2015 01:20:39 +0000 (12:20 +1100)
commitc03e73740d24fbe990291cd9ac2d6ae0d95b975f
tree685d741c017c657f419c85788bc4e217beac9a60
parent52fd475042dc145284d05f86ceac66ef5ed6665c
powerpc/pseries: Simplify check for suspendability during suspend/migration

During suspend/migration operation we must wait for the VASI state reported
by the hypervisor to become Suspending prior to making the ibm,suspend-me
RTAS call. Calling routines to rtas_ibm_supend_me() pass a vasi_state variable
that exposes the VASI state to the caller. This is unnecessary as the caller
only really cares about the following three conditions; if there is an error
we should bailout, success indicating we have suspended and woken back up so
proceed to device tree update, or we are not suspendable yet so try calling
rtas_ibm_suspend_me again shortly.

This patch removes the extraneous vasi_state variable and simply uses the
return code to communicate how to proceed. We either succeed, fail, or get
-EAGAIN in which case we sleep for a second before trying to call
rtas_ibm_suspend_me again. The behaviour of ppc_rtas() remains the same,
but migrate_store() now returns the propogated error code on failure.
Previously -1 was returned from migrate_store() in the  failure case which
equates to -EPERM and was clearly wrong.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: Nathan Fontenont <nfont@linux.vnet.ibm.com>
Cc: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/rtas.h
arch/powerpc/kernel/rtas.c
arch/powerpc/platforms/pseries/mobility.c