All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@linaro.org>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: linux-pm@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Len Brown <len.brown@intel.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Tomasz Figa <t.figa@samsung.com>, Pavel Machek <pavel@ucw.cz>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	devicetree@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Kumar Gala <gal>
Subject: Re: [PATCH v2 01/11] base: power: Add generic OF-based power domain look-up
Date: Fri, 14 Mar 2014 16:07:05 -0700	[thread overview]
Message-ID: <7h38ikgz1i.fsf@paris.lan> (raw)
In-Reply-To: <1393862536-9842-2-git-send-email-tomasz.figa@gmail.com> (Tomasz Figa's message of "Mon, 3 Mar 2014 17:02:06 +0100")

Tomasz Figa <tomasz.figa@gmail.com> writes:

> This patch introduces generic code to perform power domain look-up using
> device tree and automatically bind devices to their power domains.
> Generic device tree binding is introduced to specify power domains of
> devices in their device tree nodes.
>
> Backwards compatibility with legacy Samsung-specific power domain
> bindings is provided, but for now the new code is not compiled when
> CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This
> will change as soon as Exynos power domain code gets converted to use
> the generic framework in further patch.
>
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>

Reviewed-by: Kevin Hilman <khilman@linaro.org>

The approach and binding both look good to me, other than a few minor
nits on comments and question on the locking below...

[...]

> @@ -2177,3 +2181,297 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
>  	list_add(&genpd->gpd_list_node, &gpd_list);
>  	mutex_unlock(&gpd_list_lock);
>  }
> +
> +#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
> +/*
> + * DEVICE TREE BASED POWER DOMAIN PROVIDERS

why all caps?

[...]

> +/* See of_genpd_get_from_provider(). */
> +static struct generic_pm_domain *__of_genpd_get_from_provider(
> +					struct of_phandle_args *genpdspec)
> +{
> +	struct of_genpd_provider *provider;
> +	struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
> +
> +	/* Check if we have such a provider in our array */

I think you want to take the mutex here...

> +	list_for_each_entry(provider, &of_genpd_providers, link) {
> +		if (provider->node == genpdspec->np)
> +			genpd = provider->xlate(genpdspec, provider->data);
> +		if (!IS_ERR(genpd))
> +			break;
> +	}

...and release it here, right?

[...]

> +/*
> + * DEVICE<->DOMAIN BINDING USING DEVICE TREE LOOK-UP

hmm, more yelling?


Otherwise, looks good to me.

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: khilman@linaro.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 01/11] base: power: Add generic OF-based power domain look-up
Date: Fri, 14 Mar 2014 16:07:05 -0700	[thread overview]
Message-ID: <7h38ikgz1i.fsf@paris.lan> (raw)
In-Reply-To: <1393862536-9842-2-git-send-email-tomasz.figa@gmail.com> (Tomasz Figa's message of "Mon, 3 Mar 2014 17:02:06 +0100")

Tomasz Figa <tomasz.figa@gmail.com> writes:

> This patch introduces generic code to perform power domain look-up using
> device tree and automatically bind devices to their power domains.
> Generic device tree binding is introduced to specify power domains of
> devices in their device tree nodes.
>
> Backwards compatibility with legacy Samsung-specific power domain
> bindings is provided, but for now the new code is not compiled when
> CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This
> will change as soon as Exynos power domain code gets converted to use
> the generic framework in further patch.
>
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>

Reviewed-by: Kevin Hilman <khilman@linaro.org>

The approach and binding both look good to me, other than a few minor
nits on comments and question on the locking below...

[...]

> @@ -2177,3 +2181,297 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
>  	list_add(&genpd->gpd_list_node, &gpd_list);
>  	mutex_unlock(&gpd_list_lock);
>  }
> +
> +#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
> +/*
> + * DEVICE TREE BASED POWER DOMAIN PROVIDERS

why all caps?

[...]

> +/* See of_genpd_get_from_provider(). */
> +static struct generic_pm_domain *__of_genpd_get_from_provider(
> +					struct of_phandle_args *genpdspec)
> +{
> +	struct of_genpd_provider *provider;
> +	struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
> +
> +	/* Check if we have such a provider in our array */

I think you want to take the mutex here...

> +	list_for_each_entry(provider, &of_genpd_providers, link) {
> +		if (provider->node == genpdspec->np)
> +			genpd = provider->xlate(genpdspec, provider->data);
> +		if (!IS_ERR(genpd))
> +			break;
> +	}

...and release it here, right?

[...]

> +/*
> + * DEVICE<->DOMAIN BINDING USING DEVICE TREE LOOK-UP

hmm, more yelling?


Otherwise, looks good to me.

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman@linaro.org>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: linux-pm@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Len Brown <len.brown@intel.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Tomasz Figa <t.figa@samsung.com>, Pavel Machek <pavel@ucw.cz>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	devicetree@vger.kernel.org, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Kumar Gala <galak@codeaurora.org>
Subject: Re: [PATCH v2 01/11] base: power: Add generic OF-based power domain look-up
Date: Fri, 14 Mar 2014 16:07:05 -0700	[thread overview]
Message-ID: <7h38ikgz1i.fsf@paris.lan> (raw)
In-Reply-To: <1393862536-9842-2-git-send-email-tomasz.figa@gmail.com> (Tomasz Figa's message of "Mon, 3 Mar 2014 17:02:06 +0100")

Tomasz Figa <tomasz.figa@gmail.com> writes:

> This patch introduces generic code to perform power domain look-up using
> device tree and automatically bind devices to their power domains.
> Generic device tree binding is introduced to specify power domains of
> devices in their device tree nodes.
>
> Backwards compatibility with legacy Samsung-specific power domain
> bindings is provided, but for now the new code is not compiled when
> CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This
> will change as soon as Exynos power domain code gets converted to use
> the generic framework in further patch.
>
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>

Reviewed-by: Kevin Hilman <khilman@linaro.org>

The approach and binding both look good to me, other than a few minor
nits on comments and question on the locking below...

[...]

> @@ -2177,3 +2181,297 @@ void pm_genpd_init(struct generic_pm_domain *genpd,
>  	list_add(&genpd->gpd_list_node, &gpd_list);
>  	mutex_unlock(&gpd_list_lock);
>  }
> +
> +#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
> +/*
> + * DEVICE TREE BASED POWER DOMAIN PROVIDERS

why all caps?

[...]

> +/* See of_genpd_get_from_provider(). */
> +static struct generic_pm_domain *__of_genpd_get_from_provider(
> +					struct of_phandle_args *genpdspec)
> +{
> +	struct of_genpd_provider *provider;
> +	struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER);
> +
> +	/* Check if we have such a provider in our array */

I think you want to take the mutex here...

> +	list_for_each_entry(provider, &of_genpd_providers, link) {
> +		if (provider->node == genpdspec->np)
> +			genpd = provider->xlate(genpdspec, provider->data);
> +		if (!IS_ERR(genpd))
> +			break;
> +	}

...and release it here, right?

[...]

> +/*
> + * DEVICE<->DOMAIN BINDING USING DEVICE TREE LOOK-UP

hmm, more yelling?


Otherwise, looks good to me.

Kevin

  parent reply	other threads:[~2014-03-14 23:07 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 16:02 [PATCH v2 00/11] Generic Device Tree based power domain look-up Tomasz Figa
2014-03-03 16:02 ` Tomasz Figa
2014-03-03 16:02 ` Tomasz Figa
2014-03-03 16:02 ` [PATCH v2 01/11] base: power: Add generic OF-based " Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-04 18:23   ` Stephen Boyd
2014-03-04 18:23     ` Stephen Boyd
2014-03-05 11:53     ` Tomasz Figa
2014-03-05 11:53       ` Tomasz Figa
2014-03-05  4:24   ` Mark Brown
2014-03-05  4:24     ` Mark Brown
2014-03-05  6:41   ` Rob Herring
2014-03-05  6:41     ` Rob Herring
2014-03-05  7:19   ` Ulf Hansson
2014-03-05  7:19     ` Ulf Hansson
2014-03-05  7:19     ` Ulf Hansson
2014-03-05 11:47     ` Tomasz Figa
2014-03-05 11:47       ` Tomasz Figa
2014-03-05 11:47       ` Tomasz Figa
2014-03-05 12:44       ` Tomasz Figa
2014-03-05 12:44         ` Tomasz Figa
2014-03-05 12:44         ` Tomasz Figa
2014-03-05 18:37   ` Lorenzo Pieralisi
2014-03-05 18:37     ` Lorenzo Pieralisi
2014-03-14 23:07   ` Kevin Hilman [this message]
2014-03-14 23:07     ` Kevin Hilman
2014-03-14 23:07     ` Kevin Hilman
2014-03-19 23:13   ` Sören Brinkmann
2014-03-19 23:13     ` Sören Brinkmann
2014-03-19 23:13     ` Sören Brinkmann
2014-03-19 23:16     ` Tomasz Figa
2014-03-19 23:16       ` Tomasz Figa
2014-03-19 23:16       ` Tomasz Figa
2014-04-03 12:16   ` Ulf Hansson
2014-04-03 12:16     ` Ulf Hansson
2014-04-03 12:16     ` Ulf Hansson
     [not found]     ` <CAPDyKFoxTAHyX7SQAMsvt=OttHs22oMSB8XrRUDDJ06qO0Fc2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-03 12:30       ` Tomasz Figa
2014-04-03 12:30         ` Tomasz Figa
2014-04-03 12:30         ` Tomasz Figa
2014-04-03 13:32         ` Ulf Hansson
2014-04-03 13:32           ` Ulf Hansson
2014-04-03 13:32           ` Ulf Hansson
2014-03-03 16:02 ` [PATCH v2 02/11] drivercore: Bind/unbind power domain on probe/remove Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-04 18:29   ` Stephen Boyd
2014-03-04 18:29     ` Stephen Boyd
2014-03-04 19:17   ` Philipp Zabel
2014-03-04 19:17     ` Philipp Zabel
2014-03-04 19:17     ` Philipp Zabel
2014-03-05  4:26   ` Mark Brown
2014-03-05  4:26     ` Mark Brown
2014-03-05  7:22   ` Ulf Hansson
2014-03-05  7:22     ` Ulf Hansson
2014-03-05  7:22     ` Ulf Hansson
2014-03-03 16:02 ` [PATCH v2 03/11] ARM: exynos: Move to generic power domain bindings Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-05 16:15   ` Bartlomiej Zolnierkiewicz
2014-03-05 16:15     ` Bartlomiej Zolnierkiewicz
2014-03-05 16:20     ` Tomasz Figa
2014-03-05 16:20       ` Tomasz Figa
2014-03-07 13:04       ` Bartlomiej Zolnierkiewicz
2014-03-07 13:04         ` Bartlomiej Zolnierkiewicz
2014-03-03 16:02 ` [PATCH v2 04/11] ARM: s3c64xx: pm: Use name field of generic_pm_domain Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-05  4:28   ` Mark Brown
2014-03-05  4:28     ` Mark Brown
2014-03-03 16:02 ` [PATCH v2 05/11] ARM: s3c64xx: pm: Add always_on field to s3c64xx_pm_domain struct Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-05  4:28   ` Mark Brown
2014-03-05  4:28     ` Mark Brown
2014-03-03 16:02 ` [PATCH v2 06/11] ARM: s3c64xx: pm: Add pwr_stat bit for domain G Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-05  4:28   ` Mark Brown
2014-03-05  4:28     ` Mark Brown
2014-03-03 16:02 ` [PATCH v2 07/11] ARM: s3c64xx: pm: Add device tree based power domain instantiation Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
     [not found]   ` <1393862536-9842-8-git-send-email-tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-05  4:29     ` Mark Brown
2014-03-05  4:29       ` Mark Brown
2014-03-05  4:29       ` Mark Brown
2014-03-03 16:02 ` [PATCH v2 08/11] ARM: s3c64xx: dt: Enable SoC-level power management Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
     [not found]   ` <1393862536-9842-9-git-send-email-tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-05  4:30     ` Mark Brown
2014-03-05  4:30       ` Mark Brown
2014-03-05  4:30       ` Mark Brown
     [not found] ` <1393862536-9842-1-git-send-email-tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-03 16:02   ` [PATCH v2 09/11] ARM: dts: s3c64xx: Add nodes for power domains Tomasz Figa
2014-03-03 16:02     ` Tomasz Figa
2014-03-03 16:02     ` Tomasz Figa
2014-03-05  4:31     ` Mark Brown
2014-03-05  4:31       ` Mark Brown
2014-03-03 16:02 ` [PATCH v2 10/11] ARM: dts: s3c64xx: Add node for display controller Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02 ` [PATCH v2 11/11] ARM: dts: s3c6410-mini6410: Add support for LCD screen Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa
2014-03-03 16:02   ` Tomasz Figa

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=7h38ikgz1i.fsf@paris.lan \
    --to=khilman@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kgene.kim@samsung.com \
    --cc=len.brown@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=pawel.moll@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=swarren@wwwdotorg.org \
    --cc=t.figa@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --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.