From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: alsa-devel@alsa-project.org, linux-sh@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex Date: Thu, 24 Jul 2014 00:15:47 +0000 [thread overview] Message-ID: <87y4vja9xq.wl%kuninori.morimoto.gx@renesas.com> (raw) In-Reply-To: <1406150366-10169-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> 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@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@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
WARNING: multiple messages have this Message-ID (diff)
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: alsa-devel@alsa-project.org, linux-sh@vger.kernel.org Subject: Re: [alsa-devel] [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex Date: Wed, 23 Jul 2014 17:15:47 -0700 (PDT) [thread overview] Message-ID: <87y4vja9xq.wl%kuninori.morimoto.gx@renesas.com> (raw) In-Reply-To: <1406150366-10169-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> 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@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@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2014-07-24 0:15 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-23 21:19 [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex Laurent Pinchart 2014-07-23 21:19 ` Laurent Pinchart 2014-07-24 0:15 ` Kuninori Morimoto [this message] 2014-07-24 0:15 ` [alsa-devel] " Kuninori Morimoto 2014-07-24 2:16 ` Kuninori Morimoto 2014-07-24 2:16 ` Kuninori Morimoto 2014-07-28 5:59 ` Lars-Peter Clausen 2014-07-28 5:59 ` Lars-Peter Clausen 2014-07-28 7:40 ` Kuninori Morimoto 2014-07-28 7:40 ` Kuninori Morimoto 2014-07-28 8:03 ` Lars-Peter Clausen 2014-07-28 8:03 ` Lars-Peter Clausen 2014-07-28 8:33 ` Kuninori Morimoto 2014-07-28 8:33 ` Kuninori Morimoto 2014-07-27 10:36 ` Ben Dooks 2014-07-27 10:36 ` Ben Dooks
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=87y4vja9xq.wl%kuninori.morimoto.gx@renesas.com \ --to=kuninori.morimoto.gx@renesas.com \ --cc=alsa-devel@alsa-project.org \ --cc=laurent.pinchart+renesas@ideasonboard.com \ --cc=linux-sh@vger.kernel.org \ /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: linkBe 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.