[PATCH] Add rtas_set_indicator_fast() for RTAS call without extended delay
Nathan Lynch
ntl at pobox.com
Thu Jul 27 08:04:41 EST 2006
Haren Myneni wrote:
> diff -Naurp 2618-rc2.orig/arch/powerpc/kernel/rtas.c 2618-rc2/arch/powerpc/kernel/rtas.c
> --- 2618-rc2.orig/arch/powerpc/kernel/rtas.c 2006-07-25 19:34:11.000000000 -0700
> +++ 2618-rc2/arch/powerpc/kernel/rtas.c 2006-07-25 19:33:16.000000000 -0700
> @@ -569,6 +569,27 @@ int rtas_set_indicator(int indicator, in
> }
> EXPORT_SYMBOL(rtas_set_indicator);
>
> +/*
> + * Ignoring RTAS extended delay
> + */
> +int rtas_set_indicator_fast(int indicator, int index, int new_value)
> +{
> + int rc;
> + int token = rtas_token("set-indicator");
> +
> + if (token == RTAS_UNKNOWN_SERVICE)
> + return -ENOENT;
> +
> + rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
> +
> + WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));
> +
> + if (rc < 0)
> + return rtas_error_rc(rc);
> +
> + return rc;
> +}
> +
> void rtas_restart(char *cmd)
> {
> if (rtas_flash_term_hook)
> diff -Naurp 2618-rc2.orig/arch/powerpc/platforms/pseries/xics.c 2618-rc2/arch/powerpc/platforms/pseries/xics.c
> --- 2618-rc2.orig/arch/powerpc/platforms/pseries/xics.c 2006-07-25 19:34:41.000000000 -0700
> +++ 2618-rc2/arch/powerpc/platforms/pseries/xics.c 2006-07-25 19:33:36.000000000 -0700
> @@ -796,7 +796,7 @@ void xics_teardown_cpu(int secondary)
> * so leave the master cpu in the group.
> */
> if (secondary)
> - rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
> + rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
> (1UL << interrupt_server_size) - 1 -
> default_distrib_server, 0);
> }
> @@ -813,7 +813,7 @@ void xics_migrate_irqs_away(void)
> xics_set_cpu_priority(cpu, 0);
>
> /* remove ourselves from the global interrupt queue */
> - status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
> + status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
> (1UL << interrupt_server_size) - 1 - default_distrib_server, 0);
> WARN_ON(status < 0);
>
Looks fine to me from a quick look, but we need to use
rtas_set_indicator_fast in xics_setup_cpu as well (I think I neglected
to mention I saw the warning in the cpu up path, sorry).
More information about the Linuxppc-dev
mailing list