From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Hansson Subject: Re: [RFC v11 1/3] PM / Domains: Support for multiple states Date: Wed, 10 Feb 2016 11:24:02 +0100 Message-ID: References: <1455023751-32521-1-git-send-email-ahaslam@baylibre.com> <1455023751-32521-2-git-send-email-ahaslam@baylibre.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-yw0-f169.google.com ([209.85.161.169]:33052 "EHLO mail-yw0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757386AbcBJKYD (ORCPT ); Wed, 10 Feb 2016 05:24:03 -0500 Received: by mail-yw0-f169.google.com with SMTP id u200so10767045ywf.0 for ; Wed, 10 Feb 2016 02:24:02 -0800 (PST) In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Axel Haslam Cc: Lina Iyer , Kevin Hilman , "linux-pm@vger.kernel.org" , Geert Uytterhoeven , Marc Titinger , "Rafael J. Wysocki" , Benoit Cousson , Axel Haslam , Jon Hunter + Jon >>>> > struct generic_pm_domain { >>>> > struct dev_pm_domain domain; /* PM domain operations */ >>>> > struct list_head gpd_list_node; /* Node in the global PM domains >>>> > list */ >>>> > @@ -66,6 +71,10 @@ struct generic_pm_domain { >>>> > void (*detach_dev)(struct generic_pm_domain *domain, >>>> > struct device *dev); >>>> > unsigned int flags; /* Bit field of configs for >>>> > genpd */ >>>> > + struct genpd_power_state *states; >> >> I suggest we change this to: >> >> struct genpd_power_state states[MAX_GENPD_STATES]; >> >> I don't know what value MAX_GENPD_STATES should have but perhaps 8 is >> good enough. In that way the number of supported states will be >> "static". It's not the nicest thing to do, but I can't figure out a >> better option. > > Ok understood, i had a doubt because in my first couple of series i was doing > that, but there was a suggestion form Geert to rather allocate the > states to save the unused memory. > Is it ok if i implement it with static struct for now to keep this > series small? >>From my point of view, yes. > > Otherwise, i will implement the error code return and checking from > pm_genpd_init. > You may try that, but it will for sure involve a lot more changes. Perhaps we should postpone that until the pm_genpd_remove() API has been merged, as it seems somewhat related. http://lists.infradead.org/pipermail/linux-arm-kernel/2016-February/404504.html Kind regards Uffe