Re: [PATCH] mfd: altera-sysmgr: enable raw spinlock feature for preempt-rt kernel

From: Arnd Bergmann
Date: Tue Nov 16 2021 - 07:04:58 EST


On Tue, Nov 16, 2021 at 11:54 AM Meng Li <Meng.Li@xxxxxxxxxxxxx> wrote:
> diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c
> index 5d3715a28b28..27271cec5d53 100644
> --- a/drivers/mfd/altera-sysmgr.c
> +++ b/drivers/mfd/altera-sysmgr.c
> @@ -83,6 +83,9 @@ static struct regmap_config altr_sysmgr_regmap_cfg = {
> .fast_io = true,
> .use_single_read = true,
> .use_single_write = true,
> +#ifdef CONFIG_PREEMPT_RT
> + .use_raw_spinlock = true,
> +#endif

I think you should remove the #ifdef here: if PREEMPT_RT is disabled, the flag
has no effect because spinlock behaves the same way as raw_spinlock. If
anything else starts requiring the use of raw spinlocks, then we probably
want the flag to be set here as well.

Arnd