Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1484216

Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array

From Ulf Hansson <ulf.hansson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array
Date 2016-09-15 16:20 +0200
Message-ID <shFGa-85o-13@gated-at.bofh.it> (permalink)
References <shCIh-6e0-17@gated-at.bofh.it> <shDEn-6P5-77@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 15 September 2016 at 14:05, Tomeu Vizoso <tomeu.vizoso@collabora.com> wrote:
> In platforms such as Rockchip's, the array of domains isn't always
> filled without holes, as which domains are present depend on the
> particular SoC revision.
>
> By allowing holes to be in the array, such SoCs can still use a single
> set of constants to index the array of power domains.
>
> Fixes: 0159ec670763 ("PM / Domains: Verify the PM domain is present when adding a provider")
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Cc: Jon Hunter <jonathanh@nvidia.com>
> Cc: Heiko Stuebner <heiko@sntech.de>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

>
> ---
>
> v2: Also skip holes in the error path.
> ---
>  drivers/base/power/domain.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index b0cf46dcae73..83ae3d7d3fdd 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1581,6 +1581,8 @@ int of_genpd_add_provider_onecell(struct device_node *np,
>         mutex_lock(&gpd_list_lock);
>
>         for (i = 0; i < data->num_domains; i++) {
> +               if (!data->domains[i])
> +                       continue;
>                 if (!pm_genpd_present(data->domains[i]))
>                         goto error;
>
> @@ -1598,6 +1600,8 @@ int of_genpd_add_provider_onecell(struct device_node *np,
>
>  error:
>         while (i--) {
> +               if (!data->domains[i])
> +                       continue;
>                 data->domains[i]->provider = NULL;
>                 data->domains[i]->has_provider = false;
>         }
> --
> 2.7.4
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] PM / Domains: Allow holes in genpd_data.domains array Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2016-09-15 13:00 +0200
  Re: [PATCH] PM / Domains: Allow holes in genpd_data.domains array Jon Hunter <jonathanh@nvidia.com> - 2016-09-15 13:10 +0200
    [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array Tomeu Vizoso <tomeu.vizoso@collabora.com> - 2016-09-15 14:10 +0200
      Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array Jon Hunter <jonathanh@nvidia.com> - 2016-09-15 15:30 +0200
      Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array Ulf Hansson <ulf.hansson@linaro.org> - 2016-09-15 16:20 +0200
      Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array Heiko Stübner <heiko@sntech.de> - 2016-09-16 00:10 +0200
      Re: [PATCH v2] PM / Domains: Allow holes in genpd_data.domains array Kevin Hilman <khilman@baylibre.com> - 2016-09-16 18:20 +0200

csiph-web