PPC64 error code cleanups for rtas wrappers
PATCH 1/1 PPC64 error code cleanups for rtas wrappers
This patch is from John Rose <[email protected]>
This patch changes the rtas wrapper functions in rtas.c to map RTAS failure codes to conventional error values. The goal is to make failure conditions obvious in the wrapper functions and in the caller code.
Signed-off-by John Rose <[email protected]>
Signed-off-by Paul Mackerras <[email protected]>
arch/ppc64/kernel/pSeries_smp.c renamed from arch/ppc64/kernel/pSeries_smp.c~01_rtas_rcs +1 -1
@@ -151,7 +151,7 @@ static unsigned int find_physical_cpu_toif (index) {int state;int rc =rtas_get_sensor (9003 , *index, &state); -if (rc !=0 || state !=1 ) +if (rc <0 || state !=1 )continue ; }
arch/ppc64/kernel/rtas.c renamed from arch/ppc64/kernel/rtas.c~01_rtas_rcs +48 -12
119 lines not on this page · raw message
arch/ppc64/kernel/rtasd.c renamed from arch/ppc64/kernel/rtasd.c~01_rtas_rcs +1 -1
@@ -347,7 +347,7 @@ static int enable_surveillance(int timeoif (error ==0 )return 0 ; -if (error ==RTAS_NO_SUCH_INDICATOR ) { +if (error == -EINVAL ) {printk (KERN_INFO "rtasd: surveillance not supported\n" );return 0 ; }
arch/ppc64/kernel/xics.c renamed from arch/ppc64/kernel/xics.c~01_rtas_rcs +1 -1
@@ -654,7 +654,7 @@ void xics_migrate_irqs_away(void)/* remove ourselves from the global interrupt queue */ status =rtas_set_indicator (GLOBAL_INTERRUPT_QUEUE , (1UL << interrupt_server_size) -1 - default_distrib_server,0 ); -WARN_ON (status !=0 ); +WARN_ON (status <0 );/* Allow IPIs again... */ ops->cppr_info (cpu,DEFAULT_PRIORITY );
include/asm-ppc64/rtas.h renamed from include/asm-ppc64/rtas.h~01_rtas_rcs +0 -3
@@ -24,12 +24,9 @@/* RTAS return status codes */ #define RTAS_BUSY -2/* RTAS Busy */ -#define RTAS_NO_SUCH_INDICATOR -3/* No such indicator implemented */ #define RTAS_EXTENDED_DELAY_MIN 9900#define RTAS_EXTENDED_DELAY_MAX 9905 -#define RTAS_UNKNOWN_OP -1099/* Unknown RTAS Token */ -/* * In general to call RTAS use rtas_token("string") to lookup * an RTAS token for the given string (e.g. "event-scan").