[alsa-devel] [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jul 24 02:15:47 CEST 2014


Hi Laurent

> The hardware registers are accessed from atomic contexts (the
> rsnd_soc_dai_trigger function, for instance, is called with the PCM
> substream spinlock held). They thus can't be protected by a mutex.
> 
> Protect regmap register accesses with a spinlock instead of a mutex by
> setting the fast_io flag.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas at ideasonboard.com>
> ---
>  sound/soc/sh/rcar/gen.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> An even better solution might be to use regmap-mmio instead of a custom bus.
> Morimoto-san, is there anything that would prevent the driver from switching
> to regmap-mmio ?

I guess it is possilbe to use regmap-mmio.
I check it.

> 
> diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
> index 73ce4c9..ec9ac5e 100644
> --- a/sound/soc/sh/rcar/gen.c
> +++ b/sound/soc/sh/rcar/gen.c
> @@ -66,6 +66,7 @@ static int rsnd_regmap_read32(void *context,
>  }
>  
>  static struct regmap_bus rsnd_regmap_bus = {
> +	.fast_io			= true,
>  	.write				= rsnd_regmap_write32,
>  	.read				= rsnd_regmap_read32,
>  	.reg_format_endian_default	= REGMAP_ENDIAN_NATIVE,
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


More information about the Alsa-devel mailing list