From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98044C433DF for ; Tue, 23 Jun 2020 17:24:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 619E2206EB for ; Tue, 23 Jun 2020 17:24:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Msy2Q72m"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="mDDpcqTh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 619E2206EB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g9SDf64F5DgBplwEU/BF+U2L+C0wLEP0cGEZEcD0mrM=; b=Msy2Q72mH6AVlXDMgQtyWFydt HFJEz6+OfDgOZ4yYie/yugSQHnjy8aPpDIu449lQDOg6A7ZBT5flqme7L61UigxF9wAEL6b5hzkK/ xu5DlxW9ycwomP5yFoW1zspSNHIOyISK4EwpBCvxe//oB03L0AIpAi6g22uwXN4F5ZjO2ggeHvPJO uhvLG2NZvPZS7XN/Po1l2EkZTDNW7e7RASiifnWwNiJCioh1egVRE4r5edYZoY/e1q7Kw3hWzMfFC q2bYYFsSObx1bMMc21HH/A1P1+dtqqFkGQ+NAejKANlSF4J8p2ZYxJSKfavyRKyx9C7t2J17uV2NB lLzr2B76g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnmck-0008Kh-BP; Tue, 23 Jun 2020 17:22:18 +0000 Received: from mail29.static.mailgun.info ([104.130.122.29]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnmcf-0008JP-G4 for linux-arm-kernel@lists.infradead.org; Tue, 23 Jun 2020 17:22:16 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1592932935; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=x8Cxh62MOawA5bvEovUYlLnlKgrUeX79yYs3hO4HFMU=; b=mDDpcqTh39AAmRmxhluQWeFzdLPufBDgIaNb120zzUegMOqhccodHTXmQZQT1ObEjT7G+Hbo b7/+VLLkRRIQaTejKiBbJTlVhNT1k47vzpWP8yV8ysl56jegAUw1isbSzpnDx3zB36M3uu6G ix08JD7TbguFHR1QqiFB0GrteQo= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5ef23a366bebe35debba12dc (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 23 Jun 2020 17:21:58 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7ED5AC433CB; Tue, 23 Jun 2020 17:21:58 +0000 (UTC) Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ilina) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6329EC433C6; Tue, 23 Jun 2020 17:21:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6329EC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Tue, 23 Jun 2020 11:21:56 -0600 From: Lina Iyer To: Ulf Hansson Subject: Re: [PATCH 4/5] cpuidle: psci: Convert PM domain to platform driver Message-ID: <20200623172156.GA16960@codeaurora.org> References: <20200615152054.6819-1-ulf.hansson@linaro.org> <20200615152054.6819-5-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200615152054.6819-5-ulf.hansson@linaro.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Vincent Guittot , Benjamin Gaignard , Saravana Kannan , linux-pm@vger.kernel.org, Stephen Boyd , Daniel Lezcano , "Rafael J . Wysocki" , Bjorn Andersson , Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 15 2020 at 09:21 -0600, Ulf Hansson wrote: >To enable support for deferred probing and to allow implementation of the >->sync_state() callback from subsequent changes, let's convert into a >platform driver. > >Signed-off-by: Ulf Hansson Reviewed-by: Lina Iyer >--- > drivers/cpuidle/cpuidle-psci-domain.c | 45 +++++++++++++++++---------- > 1 file changed, 28 insertions(+), 17 deletions(-) > >diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c >index e48e578aaa7d..bf527d2bb4b6 100644 >--- a/drivers/cpuidle/cpuidle-psci-domain.c >+++ b/drivers/cpuidle/cpuidle-psci-domain.c >@@ -12,6 +12,7 @@ > #include > #include > #include >+#include > #include > #include > #include >@@ -42,8 +43,8 @@ static int psci_pd_power_off(struct generic_pm_domain *pd) > return 0; > } > >-static int __init psci_pd_parse_state_nodes(struct genpd_power_state *states, >- int state_count) >+static int psci_pd_parse_state_nodes(struct genpd_power_state *states, >+ int state_count) > { > int i, ret; > u32 psci_state, *psci_state_buf; >@@ -72,7 +73,7 @@ static int __init psci_pd_parse_state_nodes(struct genpd_power_state *states, > return ret; > } > >-static int __init psci_pd_parse_states(struct device_node *np, >+static int psci_pd_parse_states(struct device_node *np, > struct genpd_power_state **states, int *state_count) > { > int ret; >@@ -100,7 +101,7 @@ static void psci_pd_free_states(struct genpd_power_state *states, > kfree(states); > } > >-static int __init psci_pd_init(struct device_node *np) >+static int psci_pd_init(struct device_node *np) > { > struct generic_pm_domain *pd; > struct psci_pd_provider *pd_provider; >@@ -167,7 +168,7 @@ static int __init psci_pd_init(struct device_node *np) > return ret; > } > >-static void __init psci_pd_remove(void) >+static void psci_pd_remove(void) > { > struct psci_pd_provider *pd_provider, *it; > struct generic_pm_domain *genpd; >@@ -185,7 +186,7 @@ static void __init psci_pd_remove(void) > } > } > >-static int __init psci_pd_init_topology(struct device_node *np, bool add) >+static int psci_pd_init_topology(struct device_node *np, bool add) > { > struct device_node *node; > struct of_phandle_args child, parent; >@@ -211,24 +212,24 @@ static int __init psci_pd_init_topology(struct device_node *np, bool add) > return 0; > } > >-static int __init psci_pd_add_topology(struct device_node *np) >+static int psci_pd_add_topology(struct device_node *np) > { > return psci_pd_init_topology(np, true); > } > >-static void __init psci_pd_remove_topology(struct device_node *np) >+static void psci_pd_remove_topology(struct device_node *np) > { > psci_pd_init_topology(np, false); > } > >-static const struct of_device_id psci_of_match[] __initconst = { >+static const struct of_device_id psci_of_match[] = { > { .compatible = "arm,psci-1.0" }, > {} > }; > >-static int __init psci_idle_init_domains(void) >+static int psci_cpuidle_domain_probe(struct platform_device *pdev) > { >- struct device_node *np = of_find_matching_node(NULL, psci_of_match); >+ struct device_node *np = pdev->dev.of_node; > struct device_node *node; > int ret = 0, pd_count = 0; > >@@ -237,7 +238,7 @@ static int __init psci_idle_init_domains(void) > > /* Currently limit the hierarchical topology to be used in OSI mode. */ > if (!psci_has_osi_support()) >- goto out; >+ return 0; > > /* > * Parse child nodes for the "#power-domain-cells" property and >@@ -256,7 +257,7 @@ static int __init psci_idle_init_domains(void) > > /* Bail out if not using the hierarchical CPU topology. */ > if (!pd_count) >- goto out; >+ return 0; > > /* Link genpd masters/subdomains to model the CPU topology. */ > ret = psci_pd_add_topology(np); >@@ -271,9 +272,8 @@ static int __init psci_idle_init_domains(void) > goto remove_pd; > } > >- of_node_put(np); > pr_info("Initialized CPU PM domain topology\n"); >- return pd_count; >+ return 0; > > put_node: > of_node_put(node); >@@ -281,10 +281,21 @@ static int __init psci_idle_init_domains(void) > if (pd_count) > psci_pd_remove(); > pr_err("failed to create CPU PM domains ret=%d\n", ret); >-out: >- of_node_put(np); > return ret; > } >+ >+static struct platform_driver psci_cpuidle_domain_driver = { >+ .probe = psci_cpuidle_domain_probe, >+ .driver = { >+ .name = "psci-cpuidle-domain", >+ .of_match_table = psci_of_match, >+ }, >+}; >+ >+static int __init psci_idle_init_domains(void) >+{ >+ return platform_driver_register(&psci_cpuidle_domain_driver); >+} > subsys_initcall(psci_idle_init_domains); > > struct device *psci_dt_attach_cpu(int cpu) >-- >2.20.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel