Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3188653pxb; Tue, 12 Jan 2021 08:25:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeVGNE2xlP7ik2TImvorMUAzfeMbBUVveNqyYMjSuBQEswHe691/Rfq0mHelQETF9LqSEA X-Received: by 2002:a17:907:948d:: with SMTP id dm13mr3664943ejc.545.1610468711612; Tue, 12 Jan 2021 08:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610468711; cv=none; d=google.com; s=arc-20160816; b=ThDCbKR+1hgYVPy7WzwT1FpThsxR6evGTu+tmTnbt678fOxlKknaxVgrm6Ot7LW/Yt z5VghKo0Qy19Hzq7k1PpB41NKJM3ScfOSMiVCy/lAzloI/2W7l5OFmIQmvy0qK2UXFBP QS7EGEZSOYjgRS0Ojy7N8bhhAlZmGiroJySVKIJA+mnzqDvD9e8NfH/Jt7acnyB3NdFU YzJEBVrh+nM4SixhCoyz2aW5nuzTPqsjaf7IH4MduqBpVIRbx9u9PmwQFhSGSvsFFLlR sFdIAXdRh+WQ/HC/j8oDLB9ch6N4ZWcVqcU47LNu4gk27P5x3Ikt5R1i2Navb9KdaBPl 72PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rM6mWr7O8Oy7IkGQjWrrd4PjuMu2KQXpKSzChL6UR30=; b=jpEfshVXp0aN2z+nVB3Cq5NRlMdfcx2fLSDKCPaEcXtDIR6lJ2wBedWMgt8Z7OYpeL krLdwaJgmyJO4iEZptvp2Ho+sUM6RCxf0sIsuxQ/4Bf/iv2nSAhD5hos/+rdJ8K97G7f gSgN16uEuO+BClr/l3jJSq270YGy9/1pZouBSvAkodMT53+PeCRF9BiclsgrTF9rE+3o Ntzmph5eivTBT+0mtVgRkfSeanEhPZ5SIMuzGYr7WPAVs9FD0lm7I493hafuWYrSWlzF fWWDXV+YqiyjfHv+JrTR5/0NoJDzRp+gSBYgFV9C2+Tpk8xKYiDUpZemRFrRb01cKle/ XYJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rpICpfc8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si1154601edw.413.2021.01.12.08.24.47; Tue, 12 Jan 2021 08:25:11 -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=@gmail.com header.s=20161025 header.b=rpICpfc8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406386AbhALQXC (ORCPT + 99 others); Tue, 12 Jan 2021 11:23:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406371AbhALQXB (ORCPT ); Tue, 12 Jan 2021 11:23:01 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578C2C061575; Tue, 12 Jan 2021 08:22:21 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id f17so3428341ljg.12; Tue, 12 Jan 2021 08:22:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rM6mWr7O8Oy7IkGQjWrrd4PjuMu2KQXpKSzChL6UR30=; b=rpICpfc8idHvAZrSqf38wOEk86Ckf2Bkn7ZC3hWhbbTL+b0erAeVQAfloEg+OaSqIL 3egNeTKy22Ouq57RH1cvILPk+yDDCEh1aEWT9x4SH7g8cJRDdqcZx8LWfxrfMu5AfchJ EZ50iSPzDkQ1oGYez3VAzui3iNNUNo6/XVSh+XWGoL4NDpAiFpVnbLR41eL6JJi6j0ey SO61lItgbbgi3GCLA6ztO2C5MWubSDGmMGKTln5l9rU8txd9DrLx09RkkTxcd7gv4qx3 iN7lRMe+l6ThgzN72cOngDKrLwep8ns7SACTSXndmWr68FYb05gUgxqmuUEV5vRDsdYr DvyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rM6mWr7O8Oy7IkGQjWrrd4PjuMu2KQXpKSzChL6UR30=; b=O1nNGwXBLgnZMxL4c17Zrbimi88dUwnGuZE6Wq6K78ymJC9cEdaIhaBK7VDduxEvTW d9V1M0ZBXAaDzkb4FHn9TjUhWJJdxyA/YDfgI5QO5ffEd97GomJiNo9iOwSOarxcoJwq XNe1GN+AEECWe8TuLc0QThKMWZ/8Zinkdi00BTZVmbR7f9+zEbqg2yos1fXCxBtoR0Az iJUCrXqS90FLUIU6Vu48Z8dTmUDrMvAS5s4sYxWIoGbv6yFqR6nNCbD5gxfUQQbwpXa0 qNKIbaszo7zNAg0R1x/FGpjpjR4WUEriGuJxXacLJRdw6aHAsqZuiV27bQCKiyyBQJ0K b2Ig== X-Gm-Message-State: AOAM5320SSlDCIw7bHERqsWX+NAsO5AdLyONUZdPXkXI0itxZFNYYjLQ Eqfen7RhVqBy/6jgdsvE+3R/KZ8vo7Q= X-Received: by 2002:a2e:7806:: with SMTP id t6mr31408ljc.298.1610468539622; Tue, 12 Jan 2021 08:22:19 -0800 (PST) Received: from [192.168.2.145] (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.googlemail.com with ESMTPSA id n10sm403211lji.99.2021.01.12.08.22.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jan 2021 08:22:18 -0800 (PST) Subject: Re: [PATCH v2 29/48] soc/tegra: pmc: Link domains to the parent Core domain To: Ulf Hansson 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 References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-30-digetx@gmail.com> From: Dmitry Osipenko Message-ID: <9feb43dc-1303-4207-6bc9-a3202696acd2@gmail.com> Date: Tue, 12 Jan 2021 19:22:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 12.01.2021 16:30, Ulf Hansson пишет: > - 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. Alright