diff options
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 4af905e81ab0..21c45a2d0706 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -897,7 +897,7 @@ int rtas_offline_cpus_mask(cpumask_var_t cpus) | |||
897 | } | 897 | } |
898 | EXPORT_SYMBOL(rtas_offline_cpus_mask); | 898 | EXPORT_SYMBOL(rtas_offline_cpus_mask); |
899 | 899 | ||
900 | int rtas_ibm_suspend_me(struct rtas_args *args) | 900 | int rtas_ibm_suspend_me(u64 handle, int *vasi_return) |
901 | { | 901 | { |
902 | long state; | 902 | long state; |
903 | long rc; | 903 | long rc; |
@@ -911,8 +911,7 @@ int rtas_ibm_suspend_me(struct rtas_args *args) | |||
911 | return -ENOSYS; | 911 | return -ENOSYS; |
912 | 912 | ||
913 | /* Make sure the state is valid */ | 913 | /* Make sure the state is valid */ |
914 | rc = plpar_hcall(H_VASI_STATE, retbuf, | 914 | rc = plpar_hcall(H_VASI_STATE, retbuf, handle); |
915 | ((u64)args->args[0] << 32) | args->args[1]); | ||
916 | 915 | ||
917 | state = retbuf[0]; | 916 | state = retbuf[0]; |
918 | 917 | ||
@@ -920,12 +919,12 @@ int rtas_ibm_suspend_me(struct rtas_args *args) | |||
920 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc); | 919 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc); |
921 | return rc; | 920 | return rc; |
922 | } else if (state == H_VASI_ENABLED) { | 921 | } else if (state == H_VASI_ENABLED) { |
923 | args->args[args->nargs] = RTAS_NOT_SUSPENDABLE; | 922 | *vasi_return = RTAS_NOT_SUSPENDABLE; |
924 | return 0; | 923 | return 0; |
925 | } else if (state != H_VASI_SUSPENDING) { | 924 | } else if (state != H_VASI_SUSPENDING) { |
926 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned state %ld\n", | 925 | printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned state %ld\n", |
927 | state); | 926 | state); |
928 | args->args[args->nargs] = -1; | 927 | *vasi_return = -1; |
929 | return 0; | 928 | return 0; |
930 | } | 929 | } |
931 | 930 | ||
@@ -973,7 +972,7 @@ out: | |||
973 | return atomic_read(&data.error); | 972 | return atomic_read(&data.error); |
974 | } | 973 | } |
975 | #else /* CONFIG_PPC_PSERIES */ | 974 | #else /* CONFIG_PPC_PSERIES */ |
976 | int rtas_ibm_suspend_me(struct rtas_args *args) | 975 | int rtas_ibm_suspend_me(u64 handle, int *vasi_return) |
977 | { | 976 | { |
978 | return -ENOSYS; | 977 | return -ENOSYS; |
979 | } | 978 | } |
@@ -1053,7 +1052,16 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs) | |||
1053 | 1052 | ||
1054 | /* Need to handle ibm,suspend_me call specially */ | 1053 | /* Need to handle ibm,suspend_me call specially */ |
1055 | if (token == ibm_suspend_me_token) { | 1054 | if (token == ibm_suspend_me_token) { |
1056 | rc = rtas_ibm_suspend_me(&args); | 1055 | |
1056 | /* | ||
1057 | * rtas_ibm_suspend_me assumes args are in cpu endian, or at least the | ||
1058 | * hcall within it requires it. | ||
1059 | */ | ||
1060 | int vasi_rc = 0; | ||
1061 | u64 handle = ((u64)be32_to_cpu(args.args[0]) << 32) | ||
1062 | | be32_to_cpu(args.args[1]); | ||
1063 | rc = rtas_ibm_suspend_me(handle, &vasi_rc); | ||
1064 | args.rets[0] = cpu_to_be32(vasi_rc); | ||
1057 | if (rc) | 1065 | if (rc) |
1058 | return rc; | 1066 | return rc; |
1059 | goto copy_return; | 1067 | goto copy_return; |