linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Shengjiu Wang <shengjiu.wang@freescale.com>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, tiwai@suse.de,
	Li.Xiubo@freescale.com, timur@tabi.org, perex@perex.cz,
	broonie@kernel.org, mpa@pengutronix.de,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module
Date: Wed, 10 Sep 2014 10:42:04 -0700	[thread overview]
Message-ID: <20140910174204.GA4628@Asurada> (raw)
In-Reply-To: <20140910081251.GA14662@audiosh1>

On Wed, Sep 10, 2014 at 04:12:53PM +0800, Shengjiu Wang wrote:
> > Then we can get a patch like:
> > open() {
> > +	clk_prepare_enable();
> > 	....
> > }
> > 
> > close() {
> > 	....
> > +	clk_disable_unprepare()
> > }

> what is the open() and close()? do you mean the fsl_ssi_startup()
> and fsl_ssi_shutdown()?

Yea.

> > probe() {
> > 	clk_get();
> > 	clk_prepare_enable();
> > 	....
> > 	if (xxx)
> > -		goto err_xx;
> > +		return ret;
> > 	....
> > +	clk_disable_unprepare();
> > 	return 0;
> > -err_xx:
> > -	clk_disable_unprepare()
> > }

> If this probe() is fsl_ssi_imx_probe(), I think no need to add
> clk_prepare_enable() or clk_disable_unprepare(), seems there is no 
> registers accessing in this probe.

This is trying to be safe, especially for such a driver being used
by multiple platforms. You can omit this as long as the patch can
pass the test on old imx, PowerPC, and AC97 platforms.

>

And another risk just came to my mind is that there would be a
possibility that a machine driver would call set_dai_fmt() early,
after SSI's probe() and before SSI's startup(), if the machine
driver contains dai_fmt assignment in its probe(). Then, without
regmap_mmio_clk(), it'll be tough for us over here because we may
also need to add clock enable/disable for set_dai_fmt/set_sysclk(),
even if there might be still tiny risk that we missed something.

Then there could be a selfish approach to circumvent it is to use
regmap_mmio_clk() with "ipg" at the beginning and call regmap_mmio()
without "ipg" if getting a failed return value from regmap_mmio_clk,
and meanwhile to keep the clock always enabled for the regmap_mmio()
case just like what the current driver is doing. This may result
those non-ipg-clk platforms can't benefit from this refinement
unless they update their DT bindings -- use "ipg" for core clock
This might be the safest and simplest way for us, I'm not sure
everyone would be comfortable with this idea though.

Best regards,
Nicolin

  reply	other threads:[~2014-09-10 17:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  9:18 [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module Shengjiu Wang
2014-09-09  9:49 ` [alsa-devel] " Markus Pargmann
2014-09-09  9:55 ` Li.Xiubo
2014-09-09 11:27 ` Mark Brown
2014-09-09 18:03   ` Nicolin Chen
2014-09-09 18:15     ` Mark Brown
2014-09-09 18:41       ` Nicolin Chen
2014-09-09 13:17 ` Timur Tabi
2014-09-09 15:21   ` Mark Brown
2014-09-09 15:24     ` Timur Tabi
2014-09-09 18:38 ` Nicolin Chen
2014-09-09 19:37   ` Timur Tabi
2014-09-09 19:59     ` Nicolin Chen
2014-09-09 20:03       ` Timur Tabi
2014-09-09 20:27         ` Nicolin Chen
2014-09-09 20:37           ` Timur Tabi
2014-09-09 21:09             ` Nicolin Chen
2014-09-10 10:01       ` Shengjiu Wang
2014-09-10  6:21   ` Markus Pargmann
2014-09-10  6:42     ` [alsa-devel] " Nicolin Chen
2014-09-10 10:30     ` Shengjiu Wang
2014-09-10 10:53       ` Markus Pargmann
2014-09-10  8:12   ` Shengjiu Wang
2014-09-10 17:42     ` Nicolin Chen [this message]
2014-09-11  6:36       ` Markus Pargmann
2014-09-11  7:07         ` Shengjiu Wang

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=20140910174204.GA4628@Asurada \
    --to=nicoleotsuka@gmail.com \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpa@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@freescale.com \
    --cc=timur@tabi.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).