Skip to contentSkip to conversation

ASoC: rsnd: use fast_io for bus

PATCH Applied Ben Dooks 2 participants 2 messages Mar 28, 2014 – Mar 29, 2014

Subsystems (4)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 ASoC: rsnd: use fast_io for bus

The rcar sound driver uses regmap to access registers in various parts of the block and uses regmap to manage mappings. The regmap is created without fast_io set, which means it locks with a mutex rather than a lighter-spinlock.

The use of the mutex lock causes issues when the IRQ handler is entered as the code needs to read/write register values and thus with lock debugging enabled the system outputs a number of warnings such as:

BUG: sleeping function called from invalid context at rnel/locking/mutex.c:616

The rcar registers are all connected via APB bus and thus not that slow to access. The fix is to set the fast_io in the code so that regmap creates the regmap structures using the faster spinlock functions.

---
 sound/soc/sh/rcar/gen.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/sh/rcar/gen.c +1 -0
index 9094970..6468962 100644
@@ -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,
Signature · 1 line
1.9.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Ben Dooks

The rcar sound driver uses regmap to access registers in various parts of the block and uses regmap to manage mappings. The regmap is created without fast_io set, which means it locks with a mutex rather than a lighter-spinlock.

Applied, thanks.