diff options
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 13496f319855..fd15e3e3bb33 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -593,9 +593,31 @@ out: | |||
593 | static int rtas_ibm_suspend_me(struct rtas_args *args) | 593 | static int rtas_ibm_suspend_me(struct rtas_args *args) |
594 | { | 594 | { |
595 | int i; | 595 | int i; |
596 | long state; | ||
597 | long rc; | ||
598 | unsigned long dummy; | ||
596 | 599 | ||
597 | struct rtas_suspend_me_data data; | 600 | struct rtas_suspend_me_data data; |
598 | 601 | ||
602 | /* Make sure the state is valid */ | ||
603 | rc = plpar_hcall(H_VASI_STATE, | ||
604 | ((u64)args->args[0] << 32) | args->args[1], | ||
605 | 0, 0, 0, | ||
606 | &state, &dummy, &dummy); | ||
607 | |||
608 | if (rc) { | ||
609 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc); | ||
610 | return rc; | ||
611 | } else if (state == H_VASI_ENABLED) { | ||
612 | args->args[args->nargs] = RTAS_NOT_SUSPENDABLE; | ||
613 | return 0; | ||
614 | } else if (state != H_VASI_SUSPENDING) { | ||
615 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned state %ld\n", | ||
616 | state); | ||
617 | args->args[args->nargs] = -1; | ||
618 | return 0; | ||
619 | } | ||
620 | |||
599 | data.waiting = 1; | 621 | data.waiting = 1; |
600 | data.args = args; | 622 | data.args = args; |
601 | 623 | ||