[PATCH 2/4] powerpc/xive: fix hcall H_INT_RESET to support long busy delays

Michael Ellerman mpe at ellerman.id.au
Fri May 4 20:41:58 AEST 2018


Cédric Le Goater <clg at kaod.org> writes:

> diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
> index 091f1d0d0af1..7113f5d87952 100644
> --- a/arch/powerpc/sysdev/xive/spapr.c
> +++ b/arch/powerpc/sysdev/xive/spapr.c
> @@ -108,6 +109,52 @@ static void xive_irq_bitmap_free(int irq)
>  	}
>  }
>  
> +
> +/* Based on the similar routines in RTAS */
> +static unsigned int plpar_busy_delay_time(long rc)
> +{
> +	unsigned int ms = 0;
> +
> +	if (H_IS_LONG_BUSY(rc)) {
> +		ms = get_longbusy_msecs(rc);
> +	} else if (rc == H_BUSY) {
> +		ms = 10; /* seems appropriate for XIVE hcalls */
> +	}
> +
> +	return ms;
> +}
> +
> +static unsigned int plpar_busy_delay(int rc)
> +{
> +	unsigned int ms;
> +
> +	might_sleep();
> +	ms = plpar_busy_delay_time(rc);
> +	if (ms && need_resched())
> +		msleep(ms);

This is called from kexec shutdown isn't it?

In which case I don't think msleep() is a great idea.

We could be crashing for example.

An mdelay would be safer I think?

cheers


More information about the Linuxppc-dev mailing list