Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3064217pxb; Tue, 12 Jan 2021 05:35:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxW8tcJN8dnE4yhDOpBFKq8qkuHKKWzj/VFRrOpPH7hG2JVAT60YSJ0y2/fOnKnYmdcTea9 X-Received: by 2002:a05:6402:541:: with SMTP id i1mr3530030edx.289.1610458529976; Tue, 12 Jan 2021 05:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610458529; cv=none; d=google.com; s=arc-20160816; b=O3WreYDNFsfOFQ43DFP5riMIRNuPEiQyMDuapP7U5x4W5SWbX03CRXO6bWHxrqg56Q AfWqGOzmJ9kwvbrGbcc0kL4tgvObgsNn43V8coaQNhVKtY9dN1BTrZSqD6Lqf5qQEecz LSaTSA0TG+oJEIgsgxvysaH3xm7MSN6OLcOVBeeraJIDc5aoVncw39dMaKudOelRzHyj s2q5QDhTdGrxtYP5G1cbjNRiCxl1hLGTJUHluQ+KC93SwQR0pk6+X57B6QYK1lkhKssA ZiTnWtrfkfgC8MKjYqTE02U+DHD6e4/S15UdRimS+sSHamvFF0k96H0THULrhHDTNd8Q Gyug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r0RONQCsveuH12mcp5SO7WKQEzlPvyEoFcpr2U4wTVM=; b=RXepwmUb+Q7uGQ/HrGldh4Y3z4jZ2P1tZgUWV2FMqa2l3Cn+orKb9zDeusiXWZYy5O oLTrmibDGjxHGkaBUeQOix5ZgW4w3+XKeYOi1F92sJV71oU3a6IWoHaYfbckt2Mr793E 3RNg52kbE3pGyonJBD80GXhzmhaPBPmTNnEjXDbv6Bouu1mY75gisUNkPgfy9SkbVc1B N6JE5eZguIYw0tKV9pdq5Pa1wekpZApwtA3qjA7Qy212rKuGmX6QLs6UiG5Z/f+WgFSo EGGBt2ow81XNa+es8pqhHwCvwZm17BRjBrSX6euYT7BJ+/PlzVoYKD+h61V7bT5isas6 CGOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OkQPJCk8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si1327561edv.602.2021.01.12.05.35.04; Tue, 12 Jan 2021 05:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OkQPJCk8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732205AbhALNb5 (ORCPT + 99 others); Tue, 12 Jan 2021 08:31:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbhALNb4 (ORCPT ); Tue, 12 Jan 2021 08:31:56 -0500 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48B8C061575 for ; Tue, 12 Jan 2021 05:31:15 -0800 (PST) Received: by mail-vs1-xe36.google.com with SMTP id j140so1436097vsd.4 for ; Tue, 12 Jan 2021 05:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r0RONQCsveuH12mcp5SO7WKQEzlPvyEoFcpr2U4wTVM=; b=OkQPJCk8ioE3pFgIZYlWQDPW8ITJpfyjad5m44r7MYgwruK3cnZq6XTMJhKn6/AdLr 117lNPeDu1Bt7ZtXn2Z1q/N/h0mXOJo7Daod7/FWjueAr7y1qIxv/vqtoGCVEl7tbM1R vtK2AymwwMYNwc3cDPcAKnv7haOm9KYfeafvC5bO8zaXF9gScIh7S4msSn8qtjwpl4LM 6zOVVnaUMf5FXn+Y/PY7w0I9yve6AMG1od7pV9ALOWWdgqcwAEWClJJJQJbPBXRvq4ie TSj79arUA3SnSxZunuJFeZUZXbkcHtz5kjENaxA0MnL9FU0VVvWN2ShVRbDFYbocrDcE HnEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r0RONQCsveuH12mcp5SO7WKQEzlPvyEoFcpr2U4wTVM=; b=UZEsZlc1n2YftlE4eUmdxiUlUBAmDFGKALRN76mh7sKyLpGQ2grjZlusRU9UcfYPCG V9Ezj3ZoohyAMgwKn5iD9YehTIvWf8yGGf+Xd/9vixa7tfcLOFtzuk6u+MssDC752B2a VhwTaDYhr3RDsNkY8kb905VaZu5Cg4BlCwttL/KbZ0AdTAGvB/YFvHemxE1LzPSe3cLt ygrlxN6tRweZ3mzExdpJJ2HnEVQunJoMUtNJgxkhN+l1nNgNk1eU2f8mLoUILnuRO0zr RzzdPM92h8dKvr63hQPwTUFAQZ14HvIRx03fpfPgNjDGbKZGqtqWDnmi9jhxlVz653Qq JG1A== X-Gm-Message-State: AOAM533YPMkdAoeHnq+x7fCZxDnDrhRQ+Q8NbkkKB5Nkpsxlgwb71dxs x8ZI5zcNTOgaXgeTShEj0bCHHav0Ki1WpmZiyL6I0g== X-Received: by 2002:a67:e286:: with SMTP id g6mr3928269vsf.42.1610458275130; Tue, 12 Jan 2021 05:31:15 -0800 (PST) MIME-Version: 1.0 References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-30-digetx@gmail.com> In-Reply-To: <20201217180638.22748-30-digetx@gmail.com> From: Ulf Hansson Date: Tue, 12 Jan 2021 14:30:39 +0100 Message-ID: Subject: Re: [PATCH v2 29/48] soc/tegra: pmc: Link domains to the parent Core domain To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Rob Herring , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Linux Kernel Mailing List , linux-tegra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - trimmed cc-list On Thu, 17 Dec 2020 at 19:07, Dmitry Osipenko wrote: > > The Core domain is a parent of PMC power domains, hence PMC domains > should be set up as a sub-domains of the parent (Core) domain if > "power-domains" phandle presents in a device-tree node of PMC domain. > > This allows to propagate GENPD performance changes to the parent Core > domain if performance change is applied to PMC domain. > > Signed-off-by: Dmitry Osipenko > --- > drivers/soc/tegra/pmc.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c > index 4f96dc7745c4..1a659d1c06d7 100644 > --- a/drivers/soc/tegra/pmc.c > +++ b/drivers/soc/tegra/pmc.c > @@ -1236,6 +1236,7 @@ static int tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) > static int tegra_powergate_init(struct tegra_pmc *pmc, > struct device_node *parent) > { > + struct of_phandle_args child_args, parent_args; > struct device_node *np, *child; > int err = 0; > > @@ -1249,6 +1250,24 @@ static int tegra_powergate_init(struct tegra_pmc *pmc, > of_node_put(child); > break; > } > + > + if (of_parse_phandle_with_args(child, "power-domains", > + "#power-domain-cells", > + 0, &parent_args)) > + continue; > + > + child_args.np = child; > + child_args.args_count = 0; > + > + err = of_genpd_add_subdomain(&parent_args, &child_args); > + of_node_put(parent_args.np); > + if (err) { > + if (err == -ENOENT) > + err = -EPROBE_DEFER; Okay. So this special error treatment is needed because of_genpd_add_subdomain may return -ENOENT, in case the providers for the parent-domain and child-domain haven't been registered yet. I suggest we move this into of_genpd_add_subdomain() instead, thus letting it return -EPROBE_DEFER when there are parent/child nodes specified in DT, but the providers are lacking. > + > + of_node_put(child); > + break; > + } > } > > of_node_put(np); > -- > 2.29.2 > Kind regards Uffe