All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: alsa-devel@alsa-project.org
Cc: kuninori.morimoto.gx@renesas.com, broonie@kernel.org,
	lgirdwood@gmail.com, linux-sh@vger.kernel.org,
	magnus.damm@opensource.se, Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH] ASoC: rsnd: use fast_io for bus
Date: Fri, 28 Mar 2014 11:20:59 +0000	[thread overview]
Message-ID: <1396005659-14557-1-git-send-email-ben.dooks@codethink.co.uk> (raw)

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.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 sound/soc/sh/rcar/gen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 9094970..6468962 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,
-- 
1.9.0


             reply	other threads:[~2014-03-28 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 11:20 Ben Dooks [this message]
2014-03-29 10:03 ` [PATCH] ASoC: rsnd: use fast_io for bus Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396005659-14557-1-git-send-email-ben.dooks@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@opensource.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.