devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com,
	grant.likely@secretlab.ca, kgene.kim@samsung.com,
	patches@linaro.org
Subject: Re: [PATCH 1/2] PM / Domains: Add OF support
Date: Wed, 28 Dec 2011 23:17:54 +0100	[thread overview]
Message-ID: <201112282317.54291.rjw@sisk.pl> (raw)
In-Reply-To: <CAJuYYwT4bW0mMeUb18_WacaybQZskPsiqm6wvfMZOMk3U8UO4w@mail.gmail.com>

On Wednesday, December 28, 2011, Thomas Abraham wrote:
> Hi Mark, Rafael,

Hi,

> On 27 December 2011 02:14, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday, December 26, 2011, Mark Brown wrote:
> >> On Mon, Dec 26, 2011 at 08:13:19PM +0100, Rafael J. Wysocki wrote:
> >> > On Monday, December 12, 2011, Thomas Abraham wrote:
> >>
> >> > > A device node pointer is added to generic pm domain structure to associate
> >> > > the domain with a node in the device tree.
> >>
> >> > That sounds fine except for one thing: PM domains are not devices, so adding
> >> > "device node" pointers to them is kind of confusing.  Perhaps there should be
> >> > something like struct dt_node, representing a more general device tree node?
> >>
> >> There's struct of_node which is exactly that, though practically
> >> speaking you need a device if you're going to bind automatically to
> >> something from the device tree in a sensible fashion and there is actual
> >> hardware under there so a device does make some sense.
> 
> In patch 2/2 of this series, the platform code looks for nodes in
> device tree that represent a power domain. When a power domain node is
> found, a generic power domain is instantiated with pm_genpd_init()
> using the information available from the node in device tree. There is
> no automatic binding required in this case. The power domain node does
> represent a hardware that manages the power domain.

Good.  So would it be possible to use struct of_node instead of
struct device_node in struct generic_pm_domain?

> >>
> >> This is in part compatibility with the existing Exynos code which uses
> >> devices to probe the domains for non-DT systems.
> >
> > Well, that's not a general case, though.
> >
> > It doesn't feel approporiate to use a "device node" pointer for something
> > that's not based on struct device, at least not a generic level, so I wonder
> > if there's a different way.
> 
> A device node pointer or of_node pointer is a simple pointer to a
> instance of a node in device tree. All nodes in a device tree need not
> represent a corresponding 'struct device'. A node in device tree can
> described a hardware feature such as a power domain supported in the
> hardware.

Sure.

> The addition of device tree support for generic power domains in this
> patchset is generic for all platforms. The platform code instantiates
> generic power domains from device tree with the of_node pointer
> assigned to 'struct generic_pm_domain'. Then, in
> __pm_genpd_add_device(), given a of_node pointer (to gen_pd), it is
> possible to find a matching power domain to select.

My point was that adding the struct device_node pointer to
struct generic_pm_domain didn't look good, because that structure didn't
represent a device in general.  While I understand that it may be regarded
as a "device object" on some platforms, there are platforms that don't
regard PM domains as devices.  For this reason (and only for this reason)
it appears to be more appropriate to use a more generic device tree node
type for struct generic_pm_domain.

Thanks,
Rafael

  reply	other threads:[~2011-12-28 22:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 15:46 [PATCH 0/2] ARM: Exynos: Adapt to generic power domain Thomas Abraham
2011-12-12 15:46 ` [PATCH 1/2] PM / Domains: Add OF support Thomas Abraham
2011-12-12 15:46   ` [PATCH 2/2] ARM: Exynos: Hook up power domains to generic power domain infrastructure Thomas Abraham
2011-12-26 19:06     ` Mark Brown
2011-12-27 22:16       ` Sylwester Nawrocki
2011-12-27 23:14     ` Sylwester Nawrocki
2011-12-28  5:25       ` Thomas Abraham
2011-12-28 11:09         ` Sylwester Nawrocki
2011-12-28 18:58     ` Sylwester Nawrocki
2012-01-02  2:14       ` Thomas Abraham
2012-01-02 22:19         ` Sylwester Nawrocki
     [not found]           ` <4F022D7D.3060802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-03  8:23             ` Thomas Abraham
2012-01-04  7:00               ` Grant Likely
2012-01-04  7:29                 ` Kukjin Kim
2011-12-26 11:29   ` [PATCH 1/2] PM / Domains: Add OF support Mark Brown
2011-12-26 19:13   ` Rafael J. Wysocki
2011-12-26 19:24     ` Mark Brown
2011-12-26 20:44       ` Rafael J. Wysocki
2011-12-28  5:10         ` Thomas Abraham
2011-12-28 22:17           ` Rafael J. Wysocki [this message]
2012-01-02  3:47             ` Thomas Abraham
2012-01-03 22:30               ` Rafael J. Wysocki
2012-01-05 15:42                 ` Thomas Abraham
2012-01-02  6:59     ` Grant Likely
2012-01-03 22:28       ` Rafael J. Wysocki

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=201112282317.54291.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=thomas.abraham@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 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).