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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 55AF0C11F69 for ; Thu, 1 Jul 2021 15:14:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A06C613E3 for ; Thu, 1 Jul 2021 15:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233301AbhGAPRS (ORCPT ); Thu, 1 Jul 2021 11:17:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbhGAPRR (ORCPT ); Thu, 1 Jul 2021 11:17:17 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9201CC061764 for ; Thu, 1 Jul 2021 08:14:46 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id k8so8962834lja.4 for ; Thu, 01 Jul 2021 08:14:46 -0700 (PDT) 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=q7SjopVfMaoe2w1JGzt6b1vmcs3L6pEjOQkXiBAboM4=; b=jARjQAjpT1Pteq9LIloPJ12XXwl3ru2QtvI5Xyczm8P1DnqizCjMAl6CGFsaVZSQXW UH4Hu60KYVYF33Hpi9nO6zdgMaS+2YIGUXKBSPFlxAdHDHMhRuR4rzAD4t/vYAhqfwhf UuK0ki44hCoY3jV9pO5abEx/wbgBBDgqCPPKi4atuI3TRAuzGOsLwAaKRUd77/2Pcred YVpKBTYxixUj/pefHVMp8kWpL0P4HpitZPWHiGgF1LhzQjm07sbXNVX6+8HvXimBvaEG iEPQ4+NHYEmpPXAdTc1NIJ5fflduLSi3PXyvmNoIBxgKI6+557v4NSvF/kNgoR/siOvB ZHOA== 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=q7SjopVfMaoe2w1JGzt6b1vmcs3L6pEjOQkXiBAboM4=; b=VqvG+Zw7e1S/qZPBEybFRZrxAbrlAFVIQhoLFqlG115Pf5rgCLdlJWHTNajUKfMnwA SS6v26b/zG1DAzhMW8bEhu69EOAAo87sAQnGuWtRBzzEG65UG2n+vxjyyyiUvIeTTTxk s4LIWOxF6GH9ilQqo0NP1eLV+0FTRc0NfS1tPJAuxWP96+EhrESdkK3w6fdavvOR8dLE ek3sgatIzJ1sV3J6JhDMVoYxexfEpC2kJ7dAV227GzhTWY6Klmgzqv5ym2Ypm3sTGaZl Mn2PMm9BWHu4/Afq7hljTf4zU8pNuQYBz1p8or7laH6RgGcKJxl86PyAs1w6z/5kfD61 8b1w== X-Gm-Message-State: AOAM531q/RHMMRGEg8fZmb712liANnjqdmA3DqqsShamiZgys7+IU7cN YkdaFPuhkirkTYS9gWfWFbfEPsv+RaeXyUdAeXmlHw== X-Google-Smtp-Source: ABdhPJxC4w3fPVooBAMn4WWUnwrS5E6in2N7SPbQK1SBNtse+qOq2rotFBO6pLxfWd1Qv0cPwWy3J+dvg9FTY5HP/+4= X-Received: by 2002:a2e:b4ce:: with SMTP id r14mr70353ljm.76.1625152484773; Thu, 01 Jul 2021 08:14:44 -0700 (PDT) MIME-Version: 1.0 References: <20210611101540.3379937-1-dmitry.baryshkov@linaro.org> <20210611101540.3379937-3-dmitry.baryshkov@linaro.org> In-Reply-To: From: Ulf Hansson Date: Thu, 1 Jul 2021 17:14:07 +0200 Message-ID: Subject: Re: [PATCH 2/2] PM: domain: use per-genpd lockdep class To: Dmitry Baryshkov Cc: Bjorn Andersson , Mark Brown , Stephen Boyd , "Rafael J. Wysocki" , Kevin Hilman , Greg Kroah-Hartman , Linux PM , Linux Kernel Mailing List , Rajendra Nayak Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Jul 2021 at 13:01, Dmitry Baryshkov wrote: > > On Thu, 1 Jul 2021 at 13:07, Ulf Hansson wrote: > > > > On Tue, 29 Jun 2021 at 17:09, Bjorn Andersson > > wrote: > > > > > > On Mon 28 Jun 14:55 CDT 2021, Dmitry Baryshkov wrote: > > > > > > > Hi, > > > > > > > > On 17/06/2021 12:07, Ulf Hansson wrote: > > > > > + Rajendra > > > > > > > > > > On Tue, 15 Jun 2021 at 17:55, Bjorn Andersson > > > > > wrote: > > > [..] > > > > > > But I am unable to find a way for the gdsc driver to get hold of the > > > > > > struct generic_pm_domain of the resources exposed by the rpmhpd driver. > > > > > > > > > > You don't need a handle to the struct generic_pm_domain, to assign a > > > > > parent/child domain. Instead you can use of_genpd_add_subdomain(), > > > > > which takes two "struct of_phandle_args*" corresponding to the > > > > > parent/child device nodes of the genpd providers and then let genpd > > > > > internally do the look up. > > > > > > > [..] > > > > > > > > I think I'd need this function anyway for the gdsc code. During gdsc_init() > > > > we check gdsc status and this requires register access (and thus powering on > > > > the parent domain) before the gdsc is registered itself as a power domain. > > > > > > > > > > But this is a register access in the dispcc block, which is the context > > > that our gdsc_init() operates. So describing that MMCX is the > > > power-domain for dispcc should ensure that the power-domain is enabled. > > > > Right. > > > > As a note, when we assign a child domain to a parent domain, via > > of_genpd_add_subdomain() for example - and the child domain has been > > powered on, this requires the parent domain to be turned on as well. > > Most probably we should also teach genpd code to call pm_runtime > functions on respective devices when the genpd is powered on or off. > For now I had to do this manually. No, that's not the way it works or should work for that matter. It's the runtime PM status of the devices that are attached to a genpd, that controls whether a genpd should be powered on/off. Additionally, if there is a child domain powered on, then its parent needs to be powered on too and so forth. > > > > > > > > > We do however need to make sure that dispcc doesn't hog its > > > power-domain, and that any register accesses in runtime is done with the > > > parenting power-domain enabled. E.g. the clock framework wraps all > > > operations in pm_runtime_get/put(), but I don't see anything in the > > > gnepd code for this. > > > > > > > > > And for gcc I'm worried that we might have some GDSCs that are parented > > > by CX and some by MX, but I do still think that the register accesses > > > are only related to one of these. > > > > > > But this seems like a continuation of the special case in dispcc, so I > > > think we should be able to focus on getting that right before we attempt > > > the general case (and I don't know if we have a need for this today). > > > > > > Regards, > > > Bjorn > > > > Unfortunately, I didn't understand all the above things. > > > > In any case, please tell me if there is anything else that blocks you > > from moving forward with the power domain conversion? I am happy to > > help. > > Patch series was submitted: > https://lore.kernel.org/linux-arm-msm/20210630133149.3204290-1-dmitry.baryshkov@linaro.org/ Okay, I will have a look over there. Thanks! Kind regards Uffe