From patchwork Fri May 18 10:31:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136279 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056519lji; Fri, 18 May 2018 03:31:48 -0700 (PDT) X-Received: by 2002:a2e:2283:: with SMTP id i125-v6mr5612982lji.47.1526639508744; Fri, 18 May 2018 03:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639508; cv=none; d=google.com; s=arc-20160816; b=Xf/DwN3uM20h3U+hn1dsPrghCAg+y9u+X2lcuFBQi4pA81aJU1tUxCpkir5t+u+gQH Ww14T9hhFSob71+IuWZqQULZaClyiClFPlB2LGcCiaTl690ag8p6+EYyV9WTnDw/zud1 5xLDccw5Bt9lWA9TS36XsXc31rZIZ/HKaFu48XODyZrbt+biM2HuW0+LempKHaYCM0pB Tc8LWJxlhEBY5tcXMsCQ2sO1jA6BkIj+3XrG7aOSAgT9CG8boz3Ltxm0/D5SgbBF9jl5 fWDaZ+ry5RelD9tvy3afN4lsiOMm4aOpuyphKVk1zJJd7XwCH5uI58K8iSFkQDIiWx6Q MgHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=RPhKlg5dvZpNzCvJuZWRD2r+4coRtPy1rCugMyAhTzk=; b=ubaWehlCek5FNWTfV42GLh3REmMbfqDG/a7YrdlYazlOVjwtl0NF3zamztiU9xF2Y2 xl1RNx2li4joUaRQQWyBs0ewBY8wtVfl0awgxhXSeS2rDpulqypOeRRxJlF0u3PzjnRa vkQqaXeBrbc++4dXNyfTaRU8JHEm5dqKq9yH97dp1gzCsZ2+idtUeA5xfWUW2m/LDnZX R51ANfs0JLk7Qlvatjmx5HqfYtROroDaG2fhokmjF6Wc/+lbsXxMhTm91Fy1I6tIfyw8 VmWA4euQ6nFqVqQ5PBEdTjHTOZhlvlmcQ6EIBjKvD3gAY7l0VeKdNGbL7nDXg+RgM0L4 1mwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PsO2ofpj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u8-v6sor1744516ljg.101.2018.05.18.03.31.48 for (Google Transport Security); Fri, 18 May 2018 03:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PsO2ofpj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RPhKlg5dvZpNzCvJuZWRD2r+4coRtPy1rCugMyAhTzk=; b=PsO2ofpjBYwRdxZ4mbNfW3jvo4qW66HdVRL1oy5hkczANz5wED/fh4nygCXznJDCVB gXTIj1v3XJGCy6bfvilz4jjO7heoLOis7WWlOG4MbNrVpZjwZqxcsxFvVmJEHGzrZGHG ImHFI2D4yiStK+g8m2PHzqEuzhbM1geaq4thY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RPhKlg5dvZpNzCvJuZWRD2r+4coRtPy1rCugMyAhTzk=; b=dCW8xBzVqB0FQlvyjG8cWAvYHjkaMCleq4GfYZNk9BbslS4Tlv2WrSzzF3DPjHcA2F Gl9n/QtftQhek2T7MTHpHWMniPSQ6NPs5Ac9Q+WFfu/1MzzjTyRi2BI+bW/PH5b4NmQn SMNGOAplIjvlNA6KzKv9FcFMYUwyslOQ1dSbaj5XX1M/eutJD4KYo0iOMI0eKBBrCUr3 2GWHRFix3dYzR49SQQnUy0meLc0vTbZLsYyFZ5eKbOHVgdxNO4vPMdfXrypnIoNsFbYI cV/qLXMIlo1zMc/Y/Azf93EHigkcjB2wBYzAR1vJ9N/W7WQI6F4ZxFOndOdzFVESU8sO aUGA== X-Gm-Message-State: ALKqPwdIB4ba8ulSGd+caQqHjUO3982itSrAXLZLMyWPfzVR33US1QrO 3AE1DpsyUWRAw4XuW7GIvAtBc/8l X-Google-Smtp-Source: AB8JxZr2hIzXfxG7I9BP9a8HDr3UDRB+UeMrabZpIjsCL9BeUCmjLFKw73Tl8Kv+ZETL48PRIrtilQ== X-Received: by 2002:a2e:9f56:: with SMTP id v22-v6mr5253112ljk.42.1526639508531; Fri, 18 May 2018 03:31:48 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:47 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 1/9] PM / Domains: Drop extern declarations of functions in pm_domain.h Date: Fri, 18 May 2018 12:31:22 +0200 Message-Id: <1526639490-12167-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> Using "extern" to declare a function in a public header file is somewhat pointless, but also doesn't hurt. However, to make all the function declarations in pm_domain.h to be consistent, let's drop the use of "extern". Signed-off-by: Ulf Hansson --- include/linux/pm_domain.h | 51 +++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) -- 2.7.4 diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 4e57640..c847e9a 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -143,21 +143,17 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) return to_gpd_data(dev->power.subsys_data->domain_data); } -extern int __pm_genpd_add_device(struct generic_pm_domain *genpd, - struct device *dev, - struct gpd_timing_data *td); - -extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, - struct device *dev); -extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, - struct generic_pm_domain *new_subdomain); -extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, - struct generic_pm_domain *target); -extern int pm_genpd_init(struct generic_pm_domain *genpd, - struct dev_power_governor *gov, bool is_off); -extern int pm_genpd_remove(struct generic_pm_domain *genpd); -extern int dev_pm_genpd_set_performance_state(struct device *dev, - unsigned int state); +int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, + struct gpd_timing_data *td); +int pm_genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev); +int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, + struct generic_pm_domain *new_subdomain); +int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, + struct generic_pm_domain *target); +int pm_genpd_init(struct generic_pm_domain *genpd, + struct dev_power_governor *gov, bool is_off); +int pm_genpd_remove(struct generic_pm_domain *genpd); +int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state); extern struct dev_power_governor simple_qos_governor; extern struct dev_power_governor pm_domain_always_on_gov; @@ -215,8 +211,8 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, } #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP -extern void pm_genpd_syscore_poweroff(struct device *dev); -extern void pm_genpd_syscore_poweron(struct device *dev); +void pm_genpd_syscore_poweroff(struct device *dev); +void pm_genpd_syscore_poweron(struct device *dev); #else static inline void pm_genpd_syscore_poweroff(struct device *dev) {} static inline void pm_genpd_syscore_poweron(struct device *dev) {} @@ -240,14 +236,13 @@ int of_genpd_add_provider_simple(struct device_node *np, int of_genpd_add_provider_onecell(struct device_node *np, struct genpd_onecell_data *data); void of_genpd_del_provider(struct device_node *np); -extern int of_genpd_add_device(struct of_phandle_args *args, - struct device *dev); -extern int of_genpd_add_subdomain(struct of_phandle_args *parent, - struct of_phandle_args *new_subdomain); -extern struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); -extern int of_genpd_parse_idle_states(struct device_node *dn, - struct genpd_power_state **states, int *n); -extern unsigned int of_genpd_opp_to_performance_state(struct device *dev, +int of_genpd_add_device(struct of_phandle_args *args, struct device *dev); +int of_genpd_add_subdomain(struct of_phandle_args *parent, + struct of_phandle_args *new_subdomain); +struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); +int of_genpd_parse_idle_states(struct device_node *dn, + struct genpd_power_state **states, int *n); +unsigned int of_genpd_opp_to_performance_state(struct device *dev, struct device_node *opp_node); int genpd_dev_pm_attach(struct device *dev); @@ -304,9 +299,9 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */ #ifdef CONFIG_PM -extern int dev_pm_domain_attach(struct device *dev, bool power_on); -extern void dev_pm_domain_detach(struct device *dev, bool power_off); -extern void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); +int dev_pm_domain_attach(struct device *dev, bool power_on); +void dev_pm_domain_detach(struct device *dev, bool power_off); +void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); #else static inline int dev_pm_domain_attach(struct device *dev, bool power_on) { From patchwork Fri May 18 10:31:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136280 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056549lji; Fri, 18 May 2018 03:31:50 -0700 (PDT) X-Received: by 2002:a19:27c2:: with SMTP id n185-v6mr20059999lfn.25.1526639510051; Fri, 18 May 2018 03:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639510; cv=none; d=google.com; s=arc-20160816; b=gn2z2Dfyuio3aj9A7+4XGuUbKAgyI3aXLZ6/zj0A7LUEkEddz+ju1WLE4LzcHxEPPE XBkDNlPEZwtQVq+n2+g7mAbEjce4bwNRcyq0nKs0Yhvm2rsbVVj6Q5MXKrnE88ZK8gD/ DoUZAGnLISaEUHFB25U5hpdVU0CEkYjagdsdTMUTnO7nPeTqTKUCreRo9iZIkMliG/0p /iDLbKtcyeneUJvDuLalCzT1o3ZWMiZokgX40qgiL1I/9EtXpIuTlmNux6izZd44q5iR HIKgmicXDl5CyKFLtw6HUQMw5w/ydq1Ih2/zE1OYYhpCwVYh1aoYBfgkZ/2q5E2v8Zdv 2eyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=tR0PqVnyqpAIqwNNOSqwkpFdimOYd4PJO2b808P7gkQ=; b=sWJF0iDEdaedT2BctLfgevS7oeE5As+iJUzKgseUDU+g04UwejwuJEBvGyEflAFSXF lp0mxEmM+TwEMreoFJnYZ7C1v0ZGq6coQbyyLuVVfgPUrn5mQfu7ORZ6Or9P6+nTTZr5 snj5og2AqGkiD2RM9r74F7JRbW0tdNfeQpYp42zP5PnbjPXe5fPhIJgQAi385+13CUTL /hXLUPEXgIVfw0rqmejsB1dd72g30YG6bw6I5yw/WOSeItF2pA5Tr956YFluVbGCr3b+ A7lUTY8ntthPtt1Jx94fFbn78fcOVal1HgtVWmaxH+0VQSUGrSWka7jgTcJWbl8JmcBh MX9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LCBFqQ9u; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k3-v6sor1660459ljg.14.2018.05.18.03.31.50 for (Google Transport Security); Fri, 18 May 2018 03:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LCBFqQ9u; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tR0PqVnyqpAIqwNNOSqwkpFdimOYd4PJO2b808P7gkQ=; b=LCBFqQ9uL7zZ7tojJ9j4HjEgPfSroxwirJNmmwZ/8UXKLxJvGImZuUZe3VZdYwaizx Zp+V+zgQR66pIvvKmXtUriWDzs1UC5/QjaVJjpeFWYt3UNd+HneZ7N01piHHflW4q76y cXjctC1TLCyKFXbraEN902WQHHbM2AFJ/DibU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tR0PqVnyqpAIqwNNOSqwkpFdimOYd4PJO2b808P7gkQ=; b=L32+yIQ+YYlgb1oSvLKzKPlGDmwBtu8QNmq8QUHDUNnFgNVVDz8CDdH2Hx4v2uYPMA /s4bRCYHjnGMs9v2SA1o8OMs0cg9UQy0nyJUFMfxLUhcm0M/PIypCiRwcO8+cvJsVQKd NPUl+dRfaQFmmQBrUeAzZyf9JsZaAE99UWxdDMvr9Sx4jY+Dc0ZRhOHJbRlik2v6aJ04 nlHmRIGaQk6mDNf7j3rvsZVioBB1FaYgxThimpOT6RpD5SGkpCA3r7fmHxcQ+P8PyGyj onS1hd9BthVjVyqZ+W/PV+zYk4TjeEXvfWQz87e+M5OGK7uRQk9t168DpxiEDJv8yMfR h9fQ== X-Gm-Message-State: ALKqPwfZ8ulzA108oLKT/ZT6Ycj5h/4vzEtXPQ4fnaPG/xrD2lb48f7x Vb/6CTqHY93Nr+XPbjm2e22jbYUW X-Google-Smtp-Source: AB8JxZrBvFRNg3Bh/JNsQLtIhPmiYn7cpO3FRnyTqs5tj2c5eZHv2zm6Qe64JwBRGHy380U6qOwofw== X-Received: by 2002:a2e:97d6:: with SMTP id m22-v6mr5601140ljj.102.1526639509845; Fri, 18 May 2018 03:31:49 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:49 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 2/9] PM / Domains: Drop __pm_genpd_add_device() Date: Fri, 18 May 2018 12:31:23 +0200 Message-Id: <1526639490-12167-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> There are still a few non-DT existing users of genpd, however neither of them uses __pm_genpd_add_device(), hence let's drop it. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 10 ++++------ include/linux/pm_domain.h | 14 +++----------- 2 files changed, 7 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index da6c886..d58aee3 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1414,23 +1414,21 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, } /** - * __pm_genpd_add_device - Add a device to an I/O PM domain. + * pm_genpd_add_device - Add a device to an I/O PM domain. * @genpd: PM domain to add the device to. * @dev: Device to be added. - * @td: Set of PM QoS timing parameters to attach to the device. */ -int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, - struct gpd_timing_data *td) +int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev) { int ret; mutex_lock(&gpd_list_lock); - ret = genpd_add_device(genpd, dev, td); + ret = genpd_add_device(genpd, dev, NULL); mutex_unlock(&gpd_list_lock); return ret; } -EXPORT_SYMBOL_GPL(__pm_genpd_add_device); +EXPORT_SYMBOL_GPL(pm_genpd_add_device); static int genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev) diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index c847e9a..79888fb 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -143,8 +143,7 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) return to_gpd_data(dev->power.subsys_data->domain_data); } -int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, - struct gpd_timing_data *td); +int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev); int pm_genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev); int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, struct generic_pm_domain *new_subdomain); @@ -163,9 +162,8 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) { return ERR_PTR(-ENOSYS); } -static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd, - struct device *dev, - struct gpd_timing_data *td) +static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, + struct device *dev) { return -ENOSYS; } @@ -204,12 +202,6 @@ static inline int dev_pm_genpd_set_performance_state(struct device *dev, #define pm_domain_always_on_gov (*(struct dev_power_governor *)(NULL)) #endif -static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, - struct device *dev) -{ - return __pm_genpd_add_device(genpd, dev, NULL); -} - #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP void pm_genpd_syscore_poweroff(struct device *dev); void pm_genpd_syscore_poweron(struct device *dev); From patchwork Fri May 18 10:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136281 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056585lji; Fri, 18 May 2018 03:31:51 -0700 (PDT) X-Received: by 2002:a19:a70f:: with SMTP id q15-v6mr10060839lfe.39.1526639511742; Fri, 18 May 2018 03:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639511; cv=none; d=google.com; s=arc-20160816; b=C7/BsTKINmkTG5bNnnZJ169xmGkJizFXrOK7rYm5T4UkK6aM05otFTcTDVrkAMmhMx KvJwcMOIc4A0my/CO9GjVqmhr/tA20lr2hYcdaTmQNJ44v9Dxk+Kc9RhWAvAJhooJTFD ejUXORLrpj0t6tqVhmMQAKtt2n4tYs2YXLxGGBdYJ4O64Bz30ZCMfBY5i4UsVLSl0KEy wkpU7soujwqxS9JQo9Kk/Xb9BTUfNhn+iAiuGNaHL7B6y5UUlUl9fE5goRQopM81VYiE Hp3hBlJxUFdQPBIfvM4xibjEncuzyN86TZ/qNxHClhqgqZEz3HCxHX/busby3acm2WWA L8ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=vTKjE7wqBVDuFrSchNhhGH0OxNwCnuTnKufmUHAm4IwaoSenKsGMg3HdpPFmOlL6Lf 5zAo/0JeAUm3hi+EbBTluRAFmd8wVVT6MRnkJzZbgDIym7d3WjtoyKMp/HClOeaQG/Ex UXlpYLESw7kA9bq4j7WbEKauP4o9lf3rzvsSvTJUiJqS3v8lKGWdLDOMQ2a0gne2yh6l xjD/IotHj2U62929ibfRjDYNM0x3cT35Nd5TNvbX+C+EIyFneszX9v2uV/P8laJqweAH 7aFq6h1yAoYZriY2sIMsynuXbwi06EeNy7Txv7Z8FH+HkZAhnkACTQhY/86oDZyUQERg ibXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+B602X/; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y22-v6sor2006025lfb.88.2018.05.18.03.31.51 for (Google Transport Security); Fri, 18 May 2018 03:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S+B602X/; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=S+B602X/KlaCWP6uFlXFWrmH7FqhohWe3/D8x92HusdtLldYaRE5dNHWk6+tDLjw5C oYLPx+Xo29TLaZl3/QXuTkXBywtGOLhZMRhcGM7MgV1IhMqKuTmDVFtRCpmG/jUeV1Q9 I262o1K0k4KxyM0u1qXUJLFjbbC03HiUS2hC4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mrlhryGd1zUtOvLg/ngqC5LqE3Y8XGBVqRFwggWHaTs=; b=RvbKzr1exqSkphgMUkAayFINOvUNkqkySDAowUpWXxJbYDCR2kVmf4GWLRJkqtmvkk tFJHxcgWdGue8UBeCKTa8KLeh8A2gSycXnl2diMeecpcUp4UtM92EPMZVJRNh5XL4pIW U6dX2Jg1GLl8O1BoWSqUHn2q0p2HzzeC9BluTrZWlCaryN52QPSQYGf3DXVMjAgvibVC 6zEj7GJ8p8foXug92mNaPjcvV6mFYSgO/WSii8OoMu7O2cqb3JLoG26H2e7xTeV5jwKB zZLAobvBteVtgB+OLK0RmqhR2MvYOB+f66ZyHIjue570Koz9IEQ1sG+lmdjcAbB6sSQZ 9APQ== X-Gm-Message-State: ALKqPwd+YOg02GMXClOCOILu5GMxOmAxR5tEeUGMLMX9N0wUWcTvcI7+ wJJYfKRJYn9kP8inx4AjiazhzZ6S X-Google-Smtp-Source: AB8JxZoSU9iG6mBQQ90xm13k33Urc/Ocnxvp2NGBAuipMgL7V/kLR5ZV9/9m953bZZMGjTSF1DXxZQ== X-Received: by 2002:a19:e99b:: with SMTP id j27-v6mr19990694lfk.93.1526639511483; Fri, 18 May 2018 03:31:51 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:50 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Alex Deucher , =?utf-8?q?Christian_K=C3=B6?= =?utf-8?q?nig?= , David Zhou Subject: [PATCH 3/9] PM / Domains: Drop genpd as in-param for pm_genpd_remove_device() Date: Fri, 18 May 2018 12:31:24 +0200 Message-Id: <1526639490-12167-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> MIME-Version: 1.0 There is no need to pass a genpd struct to pm_genpd_remove_device(), as we already have the information about the PM domain (genpd) through the device structure. Additionally, we don't allow to remove a PM domain from a device, other than the one it may have assigned to it, so really it does not make sense to have a separate in-param for it. For these reason, drop it and update the current only call to pm_genpd_remove_device() from amdgpu_acp. Cc: Alex Deucher Cc: Christian König Cc: David (ChunMing) Zhou Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 +- include/linux/pm_domain.h | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d58aee3..f08fa15 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1475,13 +1475,13 @@ static int genpd_remove_device(struct generic_pm_domain *genpd, /** * pm_genpd_remove_device - Remove a device from an I/O PM domain. - * @genpd: PM domain to remove the device from. * @dev: Device to be removed. */ -int pm_genpd_remove_device(struct generic_pm_domain *genpd, - struct device *dev) +int pm_genpd_remove_device(struct device *dev) { - if (!genpd || genpd != genpd_lookup_dev(dev)) + struct generic_pm_domain *genpd = genpd_lookup_dev(dev); + + if (!genpd) return -EINVAL; return genpd_remove_device(genpd, dev); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index a29362f..1255804 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -513,7 +513,7 @@ static int acp_hw_fini(void *handle) if (adev->acp.acp_genpd) { for (i = 0; i < ACP_DEVS ; i++) { dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); - ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev); + ret = pm_genpd_remove_device(dev); /* If removal fails, dont giveup and try rest */ if (ret) dev_err(dev, "remove dev from genpd failed\n"); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 79888fb..42e0d64 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -144,7 +144,7 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) } int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev); -int pm_genpd_remove_device(struct generic_pm_domain *genpd, struct device *dev); +int pm_genpd_remove_device(struct device *dev); int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, struct generic_pm_domain *new_subdomain); int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, @@ -167,8 +167,7 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, { return -ENOSYS; } -static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, - struct device *dev) +static inline int pm_genpd_remove_device(struct device *dev) { return -ENOSYS; } From patchwork Fri May 18 10:31:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136282 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056618lji; Fri, 18 May 2018 03:31:53 -0700 (PDT) X-Received: by 2002:a2e:954b:: with SMTP id t11-v6mr5650363ljh.138.1526639512993; Fri, 18 May 2018 03:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639512; cv=none; d=google.com; s=arc-20160816; b=jL3SVVoMMZGtFu067MfvvsflhUhpb/Zc+9xknVV+yFWqqvYOSstffUBvn0S7ODPDGh cfl11Qaecl1w18fswaqPYZ43Onr3taYCj9bzAw7fSOyGvk+kAROMgHLhC3pwNNsbl7c4 Vj+8C+vn5eIWAWKDjH+QhFkR9PUVPSSLRnxDKzR8S6A1gUKUXPJFwSiI8mr4eYa0Bj8r Wql8p4aBj41laG8VcllwNO3k/QKa5rVvJs9/D6AyMqauUJxdZKawxNdScEaZeKMY0Urs mo3BJJz1VylezC+d8gTc7gNZ6glBTJjVYL7dnknr3Xyg5aH4jyVD88GYyDuqblpJ2eFU 4tVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=AO4Qa5M//3zUMqNYe4J+qW+VkFpbLbZ8jACmAJcz7Ao=; b=m8tBPCLUmrIcYaQ+WaQPAfxIS3WnBCcvhmcZWc5GCclvx8Li7f7Z+3kdvBgk6tI7vv NnqZS6azB4HHZJ/Mua/wAYqHF7ZxqxLmXmaeHIFidTbZ1NM43N2CpWYzkevl5KzYsK0w vQV2oz1CJGyh9qtTf6lMumzCN2I/myyykh0OLTXbk+fOFHwJqS5GJebx+IXt8PudEJBf xRGX4s0+9AijwxvkYD3e2i/Jfx0B4jkFTZIUj6Jm+acA7o1JzWG11HwMUVO+TxkirguS EOC2VYqyMCDRIuJ82o8wLEVv5ec1Str03Tg43qxbJFPBP7vUnLPF8G4s/es/quMjFoGb 3X5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QhH30i3S; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d188-v6sor218950lfg.45.2018.05.18.03.31.52 for (Google Transport Security); Fri, 18 May 2018 03:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QhH30i3S; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AO4Qa5M//3zUMqNYe4J+qW+VkFpbLbZ8jACmAJcz7Ao=; b=QhH30i3SOCfTPWugwTRcLUG4jGu3LrakT+Ht5Tl6Iu/NIoOsmY+Ez7M6cvPp2fTNUX xIQ2xUfZHF/gTxY5lrsw3WWdC6X0AiO5XobD6ucPlCogJAEc0X9naah89eBONQ4Ii7Jb CPuWUDz7ufjuIFJvrSjguJMus08rbIrkKca0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AO4Qa5M//3zUMqNYe4J+qW+VkFpbLbZ8jACmAJcz7Ao=; b=p5Z83fdxaGuri7u0+H27ELNyoxKDcqXNV06hQVa60ZzCwNyDbeBf9pZDyacVCmsy+/ tDSw8u/N7k+hAQtdJn41YTJQY6wDp4JrM8tQOFTvvv8GwmGxNdWQ6XybLsL/n1Hn1ySF 6PHET4VB4X5N/hwOHuAOL46VE9Psqnl2dD2ewNmI/ytikGaPPHd62AvWuQA2oVJ2KrB+ 1Z7wO5xMrDhFnkyiio12ZDvqLU1CibdmByLm6DlRlYGgxb4uHvRd8w943BXozvN16Izv FqZ9bvBd8W9Whmg9D+/BvGA40FDcTNmdl+xiuTh59WPo+4aZDMzMP923hFXxKqgpjfGA ywJw== X-Gm-Message-State: ALKqPwecSmCl3N50tuyKOzKnfklGZcsS9NBia2ApYL7t2pQp1+0woor8 nemqWe+X/J/G6x/76Lxn0sWSK2v3 X-Google-Smtp-Source: AB8JxZoAvL2q68KhQPs7hD56Svq93grsBsKVTW6zSin50UT48+5IZqw15RiJjN6ZpZkrhdZgAzn7sg== X-Received: by 2002:a19:d763:: with SMTP id o96-v6mr19825161lfg.89.1526639512770; Fri, 18 May 2018 03:31:52 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:52 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 4/9] PM / Domains: Drop unused parameter in genpd_allocate_dev_data() Date: Fri, 18 May 2018 12:31:25 +0200 Message-Id: <1526639490-12167-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> The in-parameter struct generic_pm_domain *genpd to genpd_allocate_dev_data() is unused, so let's drop it. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index f08fa15..050ce07 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1316,7 +1316,6 @@ EXPORT_SYMBOL_GPL(pm_genpd_syscore_poweron); #endif /* CONFIG_PM_SLEEP */ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, - struct generic_pm_domain *genpd, struct gpd_timing_data *td) { struct generic_pm_domain_data *gpd_data; @@ -1385,7 +1384,7 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(dev)) return -EINVAL; - gpd_data = genpd_alloc_dev_data(dev, genpd, td); + gpd_data = genpd_alloc_dev_data(dev, td); if (IS_ERR(gpd_data)) return PTR_ERR(gpd_data); From patchwork Fri May 18 10:31:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136283 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056635lji; Fri, 18 May 2018 03:31:54 -0700 (PDT) X-Received: by 2002:a2e:8794:: with SMTP id n20-v6mr5585248lji.38.1526639514369; Fri, 18 May 2018 03:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639514; cv=none; d=google.com; s=arc-20160816; b=RKjQcbg0P5pvD6fKPs+XQVWfEIszwRxZF6DXSRGJobW9TmaiDjxcFtkEc/AZevS+uh Dv2nweySzcB8/K/n7h30GWauDnza+zWmWKNmH5qhv4NX8IAJTMdDRrFEMGOML1rRMkY0 aRrGo0mEsRaiWr/ruozPpJmSqiTQNTfDtLbyozhddgV1PfFpVsn6ka6vjota6NSCXC9Y loDHCM/TMZpoPhLh7HtrBqQK5CCPf2KB6FU7bnK3pJO8YaFifVCINF+USKJu5u0ttqoR ndAJxf+s0E3Gs+nrhdDlFK0I2enqxLxXPKV81cTiLhhL4lle4zukehkv+S9wBAQTg9sO CJBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=SVjBUAD346aCNJoRL9NhmrACmsm4gOdU4wLskwp7B4Q=; b=nvqMX1EZAd4ZXqn+LozBYEqNLkbOGhr02aYyeFjN1KlJPjgsWUPRBKP2ICjWzaBU22 LahIXOOyh6kfvz2sTMK/nqOlqLHWjzwudx9UuD3O+aVj9gScCE6ZMTq7aB0ABDDO9yTr 52t25ZBhSBrU6c7daOupJSX/zZD6IWKI8iHMCimsWUSJCUTJLslJXcMAOecBOaSWNt6j IDxS8P4G+BAwf0lCAYlZkSEVKAEVGKTvRNGsIfBTmxvuec4FA5Gwx1k0qd91EYzXBNMw x5TEs+y1YtfotSiFGAgoD1JvdEu4E475uqpG8Rf5PyM6z/Mz00UOFfbfZ3UxcQieVeCY /j0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aS1+0njr; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o2-v6sor1948652lfg.58.2018.05.18.03.31.54 for (Google Transport Security); Fri, 18 May 2018 03:31:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aS1+0njr; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SVjBUAD346aCNJoRL9NhmrACmsm4gOdU4wLskwp7B4Q=; b=aS1+0njrQYgYF6HuGy79UcjoA4O7XOlS7mbORzzyWjWKy+R0+FKk/eP59UjDqN2SI1 pILFYSSfDa3562021cObIbp81BE+cN3jb+XRc+I0ADSVUmwLfW1jz034u4bkirRl7k/U YMM4SvC4y4g0cLWaMNk5EveBU4L/nN6vkrrEQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SVjBUAD346aCNJoRL9NhmrACmsm4gOdU4wLskwp7B4Q=; b=N48d4TBJJsVEI0KnsCL655DzsTdAttkxcAczbqY88VvQtxPC4OkY9atNNcPpFqgUR5 oSakfu5GSNvbEJW0V/rMjGLOqzEzZM0GFHsoGKqTbiY6GEu0nzS8LcwAeHWNC9ardcqV CLdQe24AqxmhtrkWT6/Bof6WuzMrhOO3D7lEqCT0EPc0DohmochFw7UJArd/DrUYfuyV CnE3bI5NYq3/E6rN+hAZLTIyLsbnwEIp0r5EKfo3g8vzpAsn8eZLAWiryEsMa9ZCWJr8 4tToUtmPHxMFU97BXotzIpe/NwLwMHuT1dzp8Rega3VWFGIcqu87r43aSR1MZdePKad5 vNEw== X-Gm-Message-State: ALKqPweWkcyU5XHn+zQGemXs4Zy3b7FjVokiMltG8Lg7FxDr2PTT43j4 p0tfQ2yINWqSljCMPTQb0iHVN/hl X-Google-Smtp-Source: AB8JxZpQtY/3mk2mu2NoKbovx7CxdsdaBwJLVXwKQnQEVUBi57Jtmko0CQE781wg3SUvya9Yvn69tw== X-Received: by 2002:a19:df55:: with SMTP id q21-v6mr766042lfj.56.1526639514100; Fri, 18 May 2018 03:31:54 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:53 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 5/9] PM / Domains: dt: Allow power-domain property to be a list of phandles Date: Fri, 18 May 2018 12:31:26 +0200 Message-Id: <1526639490-12167-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> To be able to describe topologies where devices are partitioned across multiple power domains, let's extend the power-domain property to allow being a list of phandles. Cc: Rob Herring Cc: devicetree@vger.kernel.org Suggested-by: Jon Hunter Signed-off-by: Ulf Hansson --- .../devicetree/bindings/power/power_domain.txt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt index 4733f76..b27ae7f 100644 --- a/Documentation/devicetree/bindings/power/power_domain.txt +++ b/Documentation/devicetree/bindings/power/power_domain.txt @@ -111,8 +111,9 @@ Example 3: ==PM domain consumers== Required properties: - - power-domains : A phandle and PM domain specifier as defined by bindings of - the power controller specified by phandle. + - power-domains : A phandle and PM domain specifier, or a list of phandles, as + defined by bindings of the power controller specified by + phandle. Example: @@ -122,9 +123,16 @@ Example: power-domains = <&power 0>; }; -The node above defines a typical PM domain consumer device, which is located -inside a PM domain with index 0 of a power controller represented by a node -with the label "power". + leaky-device@12350000 { + compatible = "foo,i-leak-current"; + reg = <0x12350000 0x1000>; + power-domains = <&power0 0>, <&power1 0> ; + }; + +The first example above defines a typical PM domain consumer device, which is +located inside a PM domain with index 0 of a power controller represented by a +node with the label "power". In the second example the consumer device are +partitioned across two PM domains. Optional properties: - required-opps: This contains phandle to an OPP node in another device's OPP From patchwork Fri May 18 10:31:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136284 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056651lji; Fri, 18 May 2018 03:31:55 -0700 (PDT) X-Received: by 2002:a2e:59d4:: with SMTP id g81-v6mr5713707ljf.4.1526639515735; Fri, 18 May 2018 03:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639515; cv=none; d=google.com; s=arc-20160816; b=Fn1qLUXGEP5+cYW0VUeWyR29js94F2MCC299rKWTotasca81ddNQuyZfOOUoGKFhHd LcvO4ZSb4rACmpvp+8Vx2o+kqDT/v3tztEU+IUzSqIwY+ps0hs9KOlpFDVVT1W+JoGvf u7Kq0foKWZkANnVlKDodyuez8gD/3cwdNuxrUnGOynQRk3JtzN+5VoOO74LCVbSeoXGX pksLjMYHgRZYs/XBDDFfhFwTUoRnKDYhXrx1SbeSJSx99se9kXBiGD6sSBfw/+6QEu6g XwBymCQgeQcmI/y7wJeYri4m55onPO9HjSy8byS14hgd9dZPxGtoUNc9/66i9L5a2OSi M2JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=vOMTRNhtUSt3+UjyP2nlZZlBgPAv7fyJ4Yo7WaId5rQ=; b=0v2KO8WE49sY9M5rH7Gyehd4rHpJYKq7kDCVOXLj63h+X9PJrVH0XhKplhyrCwKA/A Ih/I/SL416rLzkrJHKMQKYRqUx0lzPSiJ1WRFeB3iX1MDZrFKBQd7A1YU3cmRva0YsWp OG+xpGqq+szgQWKyGqICeV19Uhimfpluv9f4OL4Y1pXQbmEEKwOV6MGdt7aIWxZmTRgD S7t+GvtVn0NWYI3tJUrbT9kYKVekuk5EguJLFMFfmo8LrzKWXrKDLCb0MbvyFioVyjxx t3Oem7YyB1Vvi2I+Eq3YqeU2PRlAjUy7+Djx749ekQffiMwmZ0t5JAPhiPw+EOWrLLz8 BUvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X6z3qWhc; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x22-v6sor181539lfi.12.2018.05.18.03.31.55 for (Google Transport Security); Fri, 18 May 2018 03:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X6z3qWhc; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vOMTRNhtUSt3+UjyP2nlZZlBgPAv7fyJ4Yo7WaId5rQ=; b=X6z3qWhcSmJF+BSaodWX2IwnI3TRkHuarLbkzzirLp3//Dl9XxFE83X3QsOzt9yZiz peNtDxrr+dFdYbrd52h8rF6rGrmfWaXRfHz9e6gtDAcqJydGFysqeKxKvgXUqy+YJxws 3OyVD6b3NAZTLYqc4ooYxqkk6oH/d6/l7r/QY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vOMTRNhtUSt3+UjyP2nlZZlBgPAv7fyJ4Yo7WaId5rQ=; b=ItV9MezTieACJd+px5mrOA19dbDq+rLw5Vg2Uboxopu1vTy/nQOVJpRmx49BE4eSNw 8lSetY3OGkFSbSxkBmjYmrlKnRN0ZY9EvEVEMhxhkHWO3jJmuAJoZvnrFpNQF/8JQuAo 3ebOqiaWDk6EViqF6Jo6Es38iJojzcM2GzGR/ItSxy2MPAmObDlmMQAdPZoaKDrNjBGx GWrsm8QqegXDbQdewkH0UvNItSQI0Q26YhNxdJTC0/TGc83Rp0U0HcewMKLL/I4IZk0t z6uDv2VpB34DIR2IQDjG7S4VnMn3PXIp6TZ62gbX2/XD6O+KNXWLn+x1Y4Vkq4t2sJD9 Nj8Q== X-Gm-Message-State: ALKqPweOrKu+x3ZB/rKSax0Suw/BM1C+rQPj3Dga6buNVmOY7k8a912T 5FI7i299EgBXp26JSSP2CcBbKd4y X-Google-Smtp-Source: AB8JxZoDjYfqlw1Mw1sfEZLrtPeCkPK3p/6U38zWopdmXmNDtTS+kkQ9UAI7Jk8m+uL+2pifybjtUA== X-Received: by 2002:a19:17e9:: with SMTP id 102-v6mr13768283lfx.19.1526639515471; Fri, 18 May 2018 03:31:55 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:54 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains Date: Fri, 18 May 2018 12:31:27 +0200 Message-Id: <1526639490-12167-7-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> The power-domain DT property may now contain a list of phandles, which represents that a device are partitioned across multiple PM domains. This leads to a new situation in genpd_dev_pm_attach(), as only one PM domain can be attached per device. To remain things simple for the most common configuration, when a single PM domain is used, let's treat the multiple PM domain case as being specific. In other words, let's change genpd_dev_pm_attach() to check for multiple PM domains and prevent it from attach any PM domain for this case. Instead, leave this to be managed separately, from following changes to genpd. Cc: Rob Herring Cc: devicetree@vger.kernel.org Suggested-by: Jon Hunter Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 050ce07..4597e1c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2229,10 +2229,10 @@ static void genpd_dev_pm_sync(struct device *dev) * attaches the device to retrieved pm_domain ops. * * Returns 1 on successfully attached PM domain, 0 when the device don't need a - * PM domain or a negative error code in case of failures. Note that if a - * power-domain exists for the device, but it cannot be found or turned on, - * then return -EPROBE_DEFER to ensure that the device is not probed and to - * re-try again later. + * PM domain or when multiple power-domains exists for it, else a negative error + * code. Note that if a power-domain exists for the device, but it cannot be + * found or turned on, then return -EPROBE_DEFER to ensure that the device is + * not probed and to re-try again later. */ int genpd_dev_pm_attach(struct device *dev) { @@ -2243,10 +2243,18 @@ int genpd_dev_pm_attach(struct device *dev) if (!dev->of_node) return 0; + /* + * Devices with multiple PM domains must be attached separately, as we + * can only attach one PM domain per device. + */ + if (of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells") != 1) + return 0; + ret = of_parse_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells", 0, &pd_args); if (ret < 0) - return 0; + return ret; mutex_lock(&gpd_list_lock); pd = genpd_get_from_provider(&pd_args); From patchwork Fri May 18 10:31:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136285 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056692lji; Fri, 18 May 2018 03:31:57 -0700 (PDT) X-Received: by 2002:a2e:9c90:: with SMTP id x16-v6mr5333475lji.13.1526639517068; Fri, 18 May 2018 03:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639517; cv=none; d=google.com; s=arc-20160816; b=KmZYMSmSiaaCYKBOCFa4mQBR7/PCAfDVi/zxJaALZxwTziAyUXQCjeAV3k891htD7x P/f4jP8T6L6oPsv6MQamevzQzY0jA1Qq0W6IrvVt9I3VQXPHUIGgsYcMyhaDgiaDMOUs ZG8+3MeIlOptU92BD5gguU0mrvtgRpMbwAgdm3CO4GyZdvYp4I2/C1LGH98WfFmtotZd pCnln9KthlFAornWVzkl+WR3loG+FHMTZK4pCpPV8/Fa3fvzXisYCFvc/uaahyHOSBrv guBZKsmGDeO2MDHJ/3HV//fwEPHUMt0MIyWW0PBxfI2T4WrX68PSn0cd2IF/TbGVDiSq CtjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=sU8YoiDnS9KwTX3yb8JNQw8Hu2BQlzK2ChcOcpzCzno=; b=pIL9ciMVaimujcipLy1RkzvdspMRMQHQsgB8zISXYh3vA9uDrnwY1nPgcNdCssPwkM d3bp7F1Pqxee3WJuO+8Hxi3+U5GwtXCOkFTdAJjQtCnjw6zy9wXMmCaqEaebA8/mItVU aMMpxrMc5hFeHgxMKJSB/qtpEwIliVtUHs1Nn87wxnYU4Ei5fEp3DoJAtlTuK1/Ot5F0 Mz2Q1tmPj36Y+vfpjv98emg5Kz2EGlkdCZZzfrT+O35lpdeCguFs0FBSJ5KRFKZtLfyb r7LAQZaOXan3womJqBqP99hMvauSrxNXaCyq+GpFmVexph1azq3fXbDzrtRnSBv6eZgI 7gow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OuwhZT3r; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p23-v6sor1770480lji.3.2018.05.18.03.31.57 for (Google Transport Security); Fri, 18 May 2018 03:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OuwhZT3r; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sU8YoiDnS9KwTX3yb8JNQw8Hu2BQlzK2ChcOcpzCzno=; b=OuwhZT3re7bOZzUyx1ZCKemt3sE86/MtuzIsxvjP2qcsOl7FYo1gFL82H8qsU20Sh9 /655EcFClraw10GEeLB/WMdCKbKBF4gF7pB6b6fBy5DbR8mP1R1kcQPNfmpZq5eXQ9mv 0/+PKS9QyhZ4CCnWMMXHBsZbX/pKvv4+3EQZc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sU8YoiDnS9KwTX3yb8JNQw8Hu2BQlzK2ChcOcpzCzno=; b=rxEpvAP8ZG6oWkG+PNE7EaUMRgIP4QX3at+4b+OoKXPLS5K23EeLG9aB+D0RzwPcX+ g46i4X3m1zM22nncm0V/0t/MtCvJUbSytU1u9qlGkHl75grjuozXfrlPiSRGeaWlihhc /mFzqlWfF3HGLG81caKKaRQbLTtEsih3rtlbkyGUNwGPDqwK//G5sPbXcaK2Lg2QYxdS uwSCC4rKHGqFWuioa8wmeci/G+mOjiftEEwDpHrRyipIk5Poft2rwthbptiTLm8pK8xu bKUS/VyhXtGtnVwdxuVrXdbePqx+pe1iteAaZ2XYX9/DmJpS76dgadiLWO4srw+/PcWM QRZw== X-Gm-Message-State: ALKqPwet0F96t06kkfzOdF4I6OjyNk7H/J+0B1ZSWuXGjAJWvYErU+mj xfZE6/eUtAEPSL8Uy35duXzi8zZy X-Google-Smtp-Source: AB8JxZog55BJ5wlqBKzzx6/qzmykM0WVtUMCUbPNJ3dKVeDfFA03E89utYZkZf18WbLt9/JtdUezVg== X-Received: by 2002:a2e:4d5d:: with SMTP id a90-v6mr5576174ljb.86.1526639516836; Fri, 18 May 2018 03:31:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:56 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 7/9] PM / Domains: Split genpd_dev_pm_attach() Date: Fri, 18 May 2018 12:31:28 +0200 Message-Id: <1526639490-12167-8-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> To extend genpd to deal with allowing multiple PM domains per device, some of the code in genpd_dev_pm_attach() can be re-used. Let's prepare for this by moving some of the code into a sub-function. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 60 +++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 4597e1c..d538640 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2221,38 +2221,15 @@ static void genpd_dev_pm_sync(struct device *dev) genpd_queue_power_off_work(pd); } -/** - * genpd_dev_pm_attach - Attach a device to its PM domain using DT. - * @dev: Device to attach. - * - * Parse device's OF node to find a PM domain specifier. If such is found, - * attaches the device to retrieved pm_domain ops. - * - * Returns 1 on successfully attached PM domain, 0 when the device don't need a - * PM domain or when multiple power-domains exists for it, else a negative error - * code. Note that if a power-domain exists for the device, but it cannot be - * found or turned on, then return -EPROBE_DEFER to ensure that the device is - * not probed and to re-try again later. - */ -int genpd_dev_pm_attach(struct device *dev) +static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, + unsigned int index) { struct of_phandle_args pd_args; struct generic_pm_domain *pd; int ret; - if (!dev->of_node) - return 0; - - /* - * Devices with multiple PM domains must be attached separately, as we - * can only attach one PM domain per device. - */ - if (of_count_phandle_with_args(dev->of_node, "power-domains", - "#power-domain-cells") != 1) - return 0; - - ret = of_parse_phandle_with_args(dev->of_node, "power-domains", - "#power-domain-cells", 0, &pd_args); + ret = of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", index, &pd_args); if (ret < 0) return ret; @@ -2290,6 +2267,35 @@ int genpd_dev_pm_attach(struct device *dev) return ret ? -EPROBE_DEFER : 1; } + +/** + * genpd_dev_pm_attach - Attach a device to its PM domain using DT. + * @dev: Device to attach. + * + * Parse device's OF node to find a PM domain specifier. If such is found, + * attaches the device to retrieved pm_domain ops. + * + * Returns 1 on successfully attached PM domain, 0 when the device don't need a + * PM domain or when multiple power-domains exists for it, else a negative error + * code. Note that if a power-domain exists for the device, but it cannot be + * found or turned on, then return -EPROBE_DEFER to ensure that the device is + * not probed and to re-try again later. + */ +int genpd_dev_pm_attach(struct device *dev) +{ + if (!dev->of_node) + return 0; + + /* + * Devices with multiple PM domains must be attached separately, as we + * can only attach one PM domain per device. + */ + if (of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells") != 1) + return 0; + + return __genpd_dev_pm_attach(dev, dev->of_node, 0); +} EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); static const struct of_device_id idle_state_match[] = { From patchwork Fri May 18 10:31:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136286 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056715lji; Fri, 18 May 2018 03:31:58 -0700 (PDT) X-Received: by 2002:a19:7007:: with SMTP id h7-v6mr19653451lfc.123.1526639518466; Fri, 18 May 2018 03:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639518; cv=none; d=google.com; s=arc-20160816; b=SV/sD0yChWPdPu4G0iWJrui8Gk3glPj4tKAVihgWBddcl2VZhPP8EOdIXqJu/Xx6UF GoZ6aNp0vXS5Pvmr7cAFur0JMsf5S7INsZ8SwHpb60zyPzYJaMCi3DrtfGVY6BN7Tolz F3pPylz4LReVS6p953LocrxyvsOyY+6P2SshP1J9U5BSf3pOv4MeL9P452WB6mcdqzU/ pV6MW731lRRzEqnV7qRZaP2gMAtOGqLumkHxtn99VtotlcDiE4Usm+54PQJ/Gwf1JLKI ZaESgRdbj/Agtekq3RXnPzXQ/SKzgtVL1eVVBrLzHHVm8g6xGtOV4+/DN6b5wXqMG6Qj hVSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Xufj7MGpsD5staIyz3w3w6bZYYrOOfrLdPdsC/ARxQ8=; b=YdmyBYOgBOiyvk9O74Ni0j8c4t8bVtPcS7MeLmn/WCv6Pf+AXY1IenjDvg9AiC5ESa 3ULN2o/Q4VqLrA7HMAblFDu1Sd9D5j3HrJnaNK/3g9MNrs6AJDil9btu37i+yjqVLGvg h9gn4S+JlLDsyuJIbeRAoUlDRDebGTVdt9LxyrUgBfQCyVJeaTkCBOs/oNgvq6gwdriR E3qib8/hpKS+yotAfVySSCn6Ntabd2dPpA+pmSkA9Sl0hCuG4B8KMiqxn5j4qZSEQuIv g2qiKjlcYAmJuldlNCLw+pjEFJ7B+LZowSXvT4V/HCcUc1IYTc6GnLx4A083mUZnSx7J rPCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XfaL9NAc; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g3-v6sor1735440lje.107.2018.05.18.03.31.58 for (Google Transport Security); Fri, 18 May 2018 03:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XfaL9NAc; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xufj7MGpsD5staIyz3w3w6bZYYrOOfrLdPdsC/ARxQ8=; b=XfaL9NAcTTyxaFgCw1yf13SBWWlnK1Cm3QMV9BnJtI4NPTzxh0RhZhh8p80eKuOmAX ivYNRwLmbV0nPeXdckjpqbbZp4x0N1kPRsnfO3ww1EPh40hR33i8JVOVtrrBDHFhwoTy wpJjVPvTEs5X71FKQa34Hq5MJ23NnoPXLvtyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xufj7MGpsD5staIyz3w3w6bZYYrOOfrLdPdsC/ARxQ8=; b=rd4Ze/eQ/U1nBNsgQ4YGr8UtWFlDTDbgu56uLfxFUbkKJMQVVHjCys7V6v8t05X8Lg YTZwoyQBzH5TqrKVf16VZnZP37Si2tJTO3ND7OhYkhU6fSfAWDgG3Nol5nrYZiCiZvbI HPdNIBYUvjhLlz5gtlePqHX/CMUKaJNnh/4rdVqRIGh4+sABmRub4MRuk1mbrKmmd/CW SsUqVbM/w9Em7j+tAz7cUg0nwGDeJma4hBrrIhw60jN2TX7VWtwwrlgPL/jZjXtDe264 PMRu+tBbJFHKkaBVGryYWu9YihvLE6qENR/YPVsLahi9AmM07XByYwrLCJXsOjjtFPrZ YPjw== X-Gm-Message-State: ALKqPwfpTxDzJZK5aVEaJsARgzmPpF974ky1cytNQ75Kgi/lxpM84bBM nyosIgpx6b21CRXA+0f3PXqp4lQL X-Google-Smtp-Source: AB8JxZq7mpM973JWrWfZxrFD1GsHz4vCBEQ6o2rdyZ/tLmF2MV4ZidskyfEYzlHs0uv7qZ2Ai2/B8Q== X-Received: by 2002:a2e:83d7:: with SMTP id s23-v6mr5316082ljh.34.1526639518196; Fri, 18 May 2018 03:31:58 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:57 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 8/9] PM / Domains: Add support for multi PM domains per device to genpd Date: Fri, 18 May 2018 12:31:29 +0200 Message-Id: <1526639490-12167-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> To support devices being partitioned across multiple PM domains, let's start by extending genpd to cope with these configurations. More precisely, add a new exported function, genpd_dev_pm_attach_by_id(), similar to genpd_dev_pm_attach(), but the new function also allows the caller to provide an index to what PM domain it wants to attach. Furthermore, let genpd register a new virtual struct device via calling device_register() and attach it to the corresponding PM domain, which is looked up via calling the existing genpd OF functions. Note that the new device is needed, because only one PM domain can be attached per device. At successful attachment, genpd_dev_pm_attach_by_id() returns the new device, allowing the caller to operate on it to deal with power management. To deal with detaching of a PM domain for multiple PM domain case, we can still re-use the existing genpd_dev_pm_detach() function, although we need to extend it to cover cleanup of the earlier registered device, via calling device_unregister(). An important note, genpd_dev_pm_attach_by_id() shall only be called by the driver core / PM core, similar to how genpd_dev_pm_attach() is used. Following changes deploys this. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 79 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/pm_domain.h | 8 +++++ 2 files changed, 87 insertions(+) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d538640..ffeb6ea 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2171,6 +2171,15 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) } EXPORT_SYMBOL_GPL(of_genpd_remove_last); +static void genpd_release_dev(struct device *dev) +{ + kfree(dev); +} + +static struct bus_type genpd_bus_type = { + .name = "genpd", +}; + /** * genpd_dev_pm_detach - Detach a device from its PM domain. * @dev: Device to detach. @@ -2208,6 +2217,10 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off) /* Check if PM domain can be powered off after removing this device. */ genpd_queue_power_off_work(pd); + + /* Unregister the device if it was created by genpd. */ + if (dev->bus == &genpd_bus_type) + device_unregister(dev); } static void genpd_dev_pm_sync(struct device *dev) @@ -2298,6 +2311,66 @@ int genpd_dev_pm_attach(struct device *dev) } EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); +/** + * genpd_dev_pm_attach_by_id() - Attach a device to one of its PM domain. + * @dev: Device to attach. + * @index: The index of the PM domain. + * + * Parse device's OF node to find a PM domain specifier at the provided @index. + * If such is found, allocates a new device and attaches it to retrieved + * pm_domain ops. + * + * Returns the allocated device if successfully attached PM domain, NULL when + * the device don't need a PM domain or have a single PM domain, else PTR_ERR() + * in case of failures. Note that if a power-domain exists for the device, but + * cannot be found or turned on, then return PTR_ERR(-EPROBE_DEFER) to ensure + * that the device is not probed and to re-try again later. + */ +struct device *genpd_dev_pm_attach_by_id(struct device *dev, + unsigned int index) +{ + struct device *genpd_dev; + int num_domains; + int ret; + + if (!dev->of_node) + return NULL; + + /* Deal only with devices using multiple PM domains. */ + num_domains = of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells"); + if (num_domains < 2 || index >= num_domains) + return NULL; + + /* Allocate and register device on the genpd bus. */ + genpd_dev = kzalloc(sizeof(*genpd_dev), GFP_KERNEL); + if (!genpd_dev) + return ERR_PTR(-ENOMEM); + + dev_set_name(genpd_dev, "genpd:%u:%s", index, dev_name(dev)); + genpd_dev->bus = &genpd_bus_type; + genpd_dev->release = genpd_release_dev; + + ret = device_register(genpd_dev); + if (ret) { + kfree(genpd_dev); + return ERR_PTR(ret); + } + + /* Try to attach the device to the PM domain at the specified index. */ + ret = __genpd_dev_pm_attach(genpd_dev, dev->of_node, index); + if (ret < 1) { + device_unregister(genpd_dev); + return ret ? ERR_PTR(ret) : NULL; + } + + pm_runtime_set_active(genpd_dev); + pm_runtime_enable(genpd_dev); + + return genpd_dev; +} +EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id); + static const struct of_device_id idle_state_match[] = { { .compatible = "domain-idle-state", }, { } @@ -2456,6 +2529,12 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, } EXPORT_SYMBOL_GPL(of_genpd_opp_to_performance_state); +static int __init genpd_bus_init(void) +{ + return bus_register(&genpd_bus_type); +} +core_initcall(genpd_bus_init); + #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */ diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 42e0d64..82458e8 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -237,6 +237,8 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, struct device_node *opp_node); int genpd_dev_pm_attach(struct device *dev); +struct device *genpd_dev_pm_attach_by_id(struct device *dev, + unsigned int index); #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ static inline int of_genpd_add_provider_simple(struct device_node *np, struct generic_pm_domain *genpd) @@ -282,6 +284,12 @@ static inline int genpd_dev_pm_attach(struct device *dev) return 0; } +static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev, + unsigned int index) +{ + return NULL; +} + static inline struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) { From patchwork Fri May 18 10:31:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 136287 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1056748lji; Fri, 18 May 2018 03:31:59 -0700 (PDT) X-Received: by 2002:a19:4310:: with SMTP id q16-v6mr5021601lfa.74.1526639519721; Fri, 18 May 2018 03:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526639519; cv=none; d=google.com; s=arc-20160816; b=liVcWabbNrVSFb8IzkhRVnDqqm9it3YBAYIIdu7YbiXLA/xbKrqG8iG8aU9JU5K9xp fr3zYIX9ksek/VA1ps6W7ugDyemjYYN8ovH3CrELVSIfE615frXBQ0fdF5X6xsO+WcvB 80aG4PoX4V3v67t2+KzxSfEw3+mdXaltmzEP9GIruykPyk4rj3htaMmgm/Pzv7efIOz3 v/U7bBgu0gKQpCV839JnXDPp4F2+EopqZuhsuAl569xKTL6SU8OCDZAQ9jt4MyJQXd8t iTcblCdbs3F3B4y1cQEXAx3JnCoZ6h365oyZN9CibZgJ5NTto6n2xjq07kIjV6K8sRJ8 cqqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ZcMqktTgVrlFyixB7rDxIq6FvIIB/LXvMKcWVjQol/I=; b=chEzVheFUO4jI4xEQ/E/qB1Eos8UWfTnFfgfYJtl+RevBGEvbanYCOOfmfH39xk8FA pI4DYBZ0PR6HnrRQIpd7rnnRuVKBSsJgjQxQ1eHgFkntLoTh8P1RPcOcQA3jElBC2VWg FqKtrReTVJcmTTOAQwzjXbEfsMPDR4GGQGncWbK7sGvdQW3aAIE5/dOwfnM763Oo6iKp FMLM5ZDmgfPqzrzBZhACEi8j/w5xDZ5DtDUi8/PPzE+VpeZokV/0VPKdqPUqIYDGbSDN mVrB2deOOkrcQf6xPjviuYGUYm9ChpwwKgLkLvmPx1QTRb0zTwyuq9Ng4alplPAEeqcG g2VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kxVJatCT; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d67-v6sor1747364ljd.97.2018.05.18.03.31.59 for (Google Transport Security); Fri, 18 May 2018 03:31:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kxVJatCT; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZcMqktTgVrlFyixB7rDxIq6FvIIB/LXvMKcWVjQol/I=; b=kxVJatCTSOTh6Lqrzf13A9ATud2vAtbdxmpWBmHDU+gZilYcWS6t3W00VFtGFU8MhJ 5if4Hj6N8ZvupxeajqUt0/yT+yo09zUveZc8pxSdi/Yf9oYpcf6QOrCLb1sCedEkGzZF RZMebIvCf3WyaYEqg6vw0G7NPwYV8bqgy1qK4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZcMqktTgVrlFyixB7rDxIq6FvIIB/LXvMKcWVjQol/I=; b=oNLs8FHGR4FAKm4Sl4bX6OcE9qLwEftxuzwXT9wjUpEDZR9Fzsz5FtU61L0T1bp/sM V0u0sjnDEm6hEz7TQWFZCV+o0GbTRR4HtdfROuX6uF/QE+JzjaRGoI4xYa03cJ/SA0TT /xgc3IiqHLfynKsEIYKQT6OUQweFp7N+xUe8Lc41TDdpIc39Unat6rTb2jiFZ2hOYXI9 3LKixAflimLP/KIQz+vrJTCB3IFt25tpfgkd3b7nxwl8KMTgpwhi0lqjIiPqpQGcjAHT 3L2xP722rE/gzNmQC848sxvU4hJ9LaJr97/BC2n41ymxu06uzqw+BK2V6BgbVT9LyY77 KHwQ== X-Gm-Message-State: ALKqPwexMgAWELk9TYKtOU0EwJwIn9EAVb5tgg1Fkcg8G9WCA6XzbCng oQbhvzvTCH04MuzOyHVyV3LAYe/1 X-Google-Smtp-Source: AB8JxZon1aIya6jSBJzU5mKTem807xN1/o7m1G6xeqQKKjiIDloQLl2HRjnxC44xXsTrdBKzbIT0GA== X-Received: by 2002:a2e:2402:: with SMTP id k2-v6mr5751500ljk.20.1526639519449; Fri, 18 May 2018 03:31:59 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u14-v6sm393447lfk.55.2018.05.18.03.31.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 03:31:58 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 9/9] PM / Domains: Add dev_pm_domain_attach_by_id() to manage multi PM domains Date: Fri, 18 May 2018 12:31:30 +0200 Message-Id: <1526639490-12167-10-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> The existing dev_pm_domain_attach() function, allows a single PM domain to be attached per device. To be able to support devices that are partitioned across multiple PM domains, let's introduce a new interface, dev_pm_domain_attach_by_id(). The dev_pm_domain_attach_by_id() returns a new allocated struct device with the corresponding attached PM domain. This enables for example a driver to operate on the new device from a power management point of view. The driver may then also benefit from using the received device, to set up so called device-links towards its original device. Depending on the situation, these links may then be dynamically changed. The new interface is typically called by drivers during their probe phase, in case they manages devices which uses multiple PM domains. If that is the case, the driver also becomes responsible of managing the detaching of the PM domains, which typically should be done at the remove phase. Detaching is done by calling the existing dev_pm_domain_detach() function and for each of the received devices from dev_pm_domain_attach_by_id(). Note, currently its only genpd that supports multiple PM domains per device, but dev_pm_domain_attach_by_id() can easily by extended to cover other PM domain types, if/when needed. Signed-off-by: Ulf Hansson --- drivers/base/power/common.c | 33 ++++++++++++++++++++++++++++++++- include/linux/pm_domain.h | 7 +++++++ 2 files changed, 39 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index 7ae62b6..d3db974 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -117,13 +117,44 @@ int dev_pm_domain_attach(struct device *dev, bool power_on) EXPORT_SYMBOL_GPL(dev_pm_domain_attach); /** + * dev_pm_domain_attach_by_id - Attach a device to one of its PM domains. + * @index: The index of the PM domain. + * @dev: Device to attach. + * + * As @dev may only be attached to a single PM domain, the backend PM domain + * provider should create a virtual device to attach instead. As attachment + * succeeds, the ->detach() callback in the struct dev_pm_domain should be + * assigned by the corresponding backend attach function. + * + * This function should typically be invoked from drivers during probe phase. + * Especially for those that manages devices which requires power management + * through more than one PM domain. + * + * Callers must ensure proper synchronization of this function with power + * management callbacks. + * + * Returns the virtual attached device in case successfully attached PM domain, + * NULL in case @dev don't need a PM domain, else a PTR_ERR(). + */ +struct device *dev_pm_domain_attach_by_id(struct device *dev, + unsigned int index) +{ + if (dev->pm_domain) + return NULL; + + return genpd_dev_pm_attach_by_id(dev, index); +} +EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id); + +/** * dev_pm_domain_detach - Detach a device from its PM domain. * @dev: Device to detach. * @power_off: Used to indicate whether we should power off the device. * * This functions will reverse the actions from dev_pm_domain_attach() and thus * try to detach the @dev from its PM domain. Typically it should be invoked - * from subsystem level code during the remove phase. + * during the remove phase, either from subsystem level code or from drivers in + * case attaching was done through dev_pm_domain_attach_by_id. * * Callers must ensure proper synchronization of this function with power * management callbacks. diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 82458e8..493ce67 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -299,6 +299,8 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) #ifdef CONFIG_PM int dev_pm_domain_attach(struct device *dev, bool power_on); +struct device *dev_pm_domain_attach_by_id(struct device *dev, + unsigned int index); void dev_pm_domain_detach(struct device *dev, bool power_off); void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); #else @@ -306,6 +308,11 @@ static inline int dev_pm_domain_attach(struct device *dev, bool power_on) { return 0; } +static inline struct device *dev_pm_domain_attach_by_id(struct device *dev, + unsigned int index); +{ + return NULL; +} static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {} static inline void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd) {}