All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "jinkun.hong" <jinkun.hong@rock-chips.com>
Cc: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org,
	Russell King <linux@arm.linux.org.uk>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Grant Likely <grant.likely@linaro.org>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, dianders@chromium.org,
	Heiko Stuebner <heiko@sntech.de>,
	linux-rockchip@lists.infradead.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Jack Dai <jack.dai@rock-chips.com>
Subject: Re: [PATCH v7 1/3] power-domain: add power domain drivers for Rockchip platform
Date: Mon, 27 Oct 2014 16:39:04 -0700	[thread overview]
Message-ID: <20141027233904.GD7594@dtor-ws> (raw)
In-Reply-To: <20141024164431.GE19933@dtor-ws>

On Fri, Oct 24, 2014 at 09:44:31AM -0700, Dmitry Torokhov wrote:
> Hi Jinkun,
> 
> On Fri, Oct 24, 2014 at 12:29:19AM -0700, jinkun.hong wrote:
> > +static int rockchip_pd_power(struct rockchip_domain *pd, bool power_on)
> > +{
> > +	int ret = 0;
> > +	struct rockchip_dev_entry *de;
> > +
> > +	mutex_lock(&pd->dev_lock);
> > +	/* no clk, set power domain will fail */
> > +	if (list_empty(&pd->dev_list)) {
> > +		pr_err("%s: no devices in %s power domain\n", __func__,
> > +			pd->base.name);
> > +		goto out;
> > +	}
> > +
> > +	list_for_each_entry(de, &pd->dev_list, node) {
> > +		pm_clk_resume(de->dev);
> > +	}
> > +
> > +	ret = rockchip_pmu_set_power_domain(pd, power_on);
> > +
> > +	list_for_each_entry(de, &pd->dev_list, node) {
> > +		pm_clk_suspend(de->dev);
> > +	}
> > +out:
> > +	mutex_unlock(&pd->dev_lock);
> > +	return ret;
> > +}
> 
> For my education, could you please tell me why we need to enable all
> clocks of all devices in a power domain when we are talking to the PMU
> and then turn them immediately off? Would not we want to enable clocks
> in start()) callbacks, like Ulf mentioned?

Jinkun, any update on this question?

Thanks.

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 1/3] power-domain: add power domain drivers for Rockchip platform
Date: Mon, 27 Oct 2014 16:39:04 -0700	[thread overview]
Message-ID: <20141027233904.GD7594@dtor-ws> (raw)
In-Reply-To: <20141024164431.GE19933@dtor-ws>

On Fri, Oct 24, 2014 at 09:44:31AM -0700, Dmitry Torokhov wrote:
> Hi Jinkun,
> 
> On Fri, Oct 24, 2014 at 12:29:19AM -0700, jinkun.hong wrote:
> > +static int rockchip_pd_power(struct rockchip_domain *pd, bool power_on)
> > +{
> > +	int ret = 0;
> > +	struct rockchip_dev_entry *de;
> > +
> > +	mutex_lock(&pd->dev_lock);
> > +	/* no clk, set power domain will fail */
> > +	if (list_empty(&pd->dev_list)) {
> > +		pr_err("%s: no devices in %s power domain\n", __func__,
> > +			pd->base.name);
> > +		goto out;
> > +	}
> > +
> > +	list_for_each_entry(de, &pd->dev_list, node) {
> > +		pm_clk_resume(de->dev);
> > +	}
> > +
> > +	ret = rockchip_pmu_set_power_domain(pd, power_on);
> > +
> > +	list_for_each_entry(de, &pd->dev_list, node) {
> > +		pm_clk_suspend(de->dev);
> > +	}
> > +out:
> > +	mutex_unlock(&pd->dev_lock);
> > +	return ret;
> > +}
> 
> For my education, could you please tell me why we need to enable all
> clocks of all devices in a power domain when we are talking to the PMU
> and then turn them immediately off? Would not we want to enable clocks
> in start()) callbacks, like Ulf mentioned?

Jinkun, any update on this question?

Thanks.

-- 
Dmitry

  reply	other threads:[~2014-10-27 23:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24  7:29 [PATCH v7 0/3] ARM: rk3288 : Add PM Domain support jinkun.hong
2014-10-24  7:29 ` jinkun.hong
2014-10-24  7:29 ` [PATCH v7 1/3] power-domain: add power domain drivers for Rockchip platform jinkun.hong
2014-10-24  7:29   ` jinkun.hong
2014-10-24 16:44   ` Dmitry Torokhov
2014-10-24 16:44     ` Dmitry Torokhov
2014-10-27 23:39     ` Dmitry Torokhov [this message]
2014-10-27 23:39       ` Dmitry Torokhov
2014-10-29  1:00       ` Hong jinkun
2014-10-29  1:00         ` Hong jinkun
2014-10-29 10:26         ` Eddie Cai(蔡枫)
2014-10-24  7:29 ` [PATCH v7 2/3] dt-bindings: add document of Rockchip power domain jinkun.hong
2014-10-24  7:29   ` jinkun.hong
2014-10-24  7:29 ` [PATCH v7 3/3] ARM: dts: add rk3288 power-domain node jinkun.hong
2014-10-24  7:29   ` jinkun.hong
2014-10-31 18:03 ` [PATCH v7 0/3] ARM: rk3288 : Add PM Domain support Doug Anderson
2014-10-31 18:03   ` Doug Anderson
2014-10-31 18:03   ` Doug Anderson
2014-10-31 18:32   ` Dmitry Torokhov
2014-10-31 18:32     ` Dmitry Torokhov
2014-10-31 18:32     ` Dmitry Torokhov
2014-11-03 15:41     ` Kever Yang

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=20141027233904.GD7594@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jack.dai@rock-chips.com \
    --cc=jinkun.hong@rock-chips.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.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: 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.