Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbdI2NlR (ORCPT ); Fri, 29 Sep 2017 09:41:17 -0400 Received: from foss.arm.com ([217.140.101.70]:44098 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbdI2NlP (ORCPT ); Fri, 29 Sep 2017 09:41:15 -0400 Cc: Sudeep Holla , ALKML , LKML , DTML , Roy Franz , Harb Abdulhamid , Nishanth Menon , Arnd Bergmann , Loc Ho , Alexey Klimov , Ryan Harkin , Jassi Brar , Kevin Hilman Subject: Re: [PATCH v3 17/22] firmware: arm_scmi: add device power domain support using genpd To: Ulf Hansson References: <1506604306-20739-1-git-send-email-sudeep.holla@arm.com> <1506604306-20739-18-git-send-email-sudeep.holla@arm.com> From: Sudeep Holla Organization: ARM Message-ID: <68c18868-99c5-20e0-d65e-6ad1afdedde5@arm.com> Date: Fri, 29 Sep 2017 14:40:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1751 Lines: 47 On 28/09/17 22:18, Ulf Hansson wrote: > On 28 September 2017 at 15:11, Sudeep Holla wrote: >> This patch hooks up the support for device power domain provided by >> SCMI using the Linux generic power domain infrastructure. >> >> Cc: Kevin Hilman >> Cc: Ulf Hansson >> Signed-off-by: Sudeep Holla >> --- >> drivers/firmware/Kconfig | 13 +++ >> drivers/firmware/arm_scmi/Makefile | 1 + >> drivers/firmware/arm_scmi/scmi_pm_domain.c | 134 +++++++++++++++++++++++++++++ >> 3 files changed, 148 insertions(+) >> create mode 100644 drivers/firmware/arm_scmi/scmi_pm_domain.c >> [...] >> + for (i = 0; i < num_domains; i++, scmi_pd++) { >> + domains[i] = &scmi_pd->genpd; >> + >> + scmi_pd->domain = i; >> + scmi_pd->handle = handle; >> + scmi_pd->name = handle->power_ops->name_get(handle, i); >> + scmi_pd->genpd.name = scmi_pd->name; >> + scmi_pd->genpd.power_off = scmi_pd_power_off; >> + scmi_pd->genpd.power_on = scmi_pd_power_on; >> + >> + /* >> + * Treat all power domains as off at boot. >> + * >> + * The SCP firmware itself may have switched on some domains, >> + * but for reference counting purpose, keep it this way. >> + */ > > I think it would be better to give the correct information about the > state of the PM domain. Otherwise genpd may end up thinking a PM > domain is off, while in fact it's on - thus wasting power. > Agreed, I missed to notice that. I will fixup and send the update. -- Regards, Sudeep