aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>2015-03-27 15:47:25 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-27 21:20:39 -0400
commitc03e73740d24fbe990291cd9ac2d6ae0d95b975f (patch)
tree685d741c017c657f419c85788bc4e217beac9a60 /arch/powerpc/platforms
parent52fd475042dc145284d05f86ceac66ef5ed6665c (diff)
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>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/mobility.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 03a428e87b14..38db1b9f2ac3 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -318,22 +318,19 @@ static ssize_t migrate_store(struct class *class, struct class_attribute *attr,
318{ 318{
319 u64 streamid; 319 u64 streamid;
320 int rc; 320 int rc;
321 int vasi_rc = 0;
322 321
323 rc = kstrtou64(buf, 0, &streamid); 322 rc = kstrtou64(buf, 0, &streamid);
324 if (rc) 323 if (rc)
325 return rc; 324 return rc;
326 325
327 do { 326 do {
328 rc = rtas_ibm_suspend_me(streamid, &vasi_rc); 327 rc = rtas_ibm_suspend_me(streamid);
329 if (!rc && vasi_rc == RTAS_NOT_SUSPENDABLE) 328 if (rc == -EAGAIN)
330 ssleep(1); 329 ssleep(1);
331 } while (!rc && vasi_rc == RTAS_NOT_SUSPENDABLE); 330 } while (rc == -EAGAIN);
332 331
333 if (rc) 332 if (rc)
334 return rc; 333 return rc;
335 if (vasi_rc)
336 return vasi_rc;
337 334
338 post_mobility_fixup(); 335 post_mobility_fixup();
339 return count; 336 return count;