Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp538183pxv; Thu, 1 Jul 2021 04:03:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu8R224Gufk6zxj8goK7Q2MDyqchmcQrh3i7zd3WFj7ON5gzDH+BAHWRM0VlnqrY8xACAV X-Received: by 2002:aa7:d9c9:: with SMTP id v9mr4516794eds.42.1625137384573; Thu, 01 Jul 2021 04:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625137384; cv=none; d=google.com; s=arc-20160816; b=nKIIioazm6nrSgh/2WrvsoIi2RxSmgs3gPlpkgtUFof8mJGYAJLLkSVcg08Y/g2mlA TZadFBYVFD6LzVoGNeYmtwowCaWZwBpYqDPvEpOLGSs4EdSg3hEn7MoR1lGXG1Iwm0GG nHfRMXkySFXIRAgdI0Sg62bu+9oNXqXzY57GsPzGKHUWgRX/g4Rk34NuOESDB652Tj83 k2f1RWvvwAGMyMfVtU7yEPKjA4F2ZB/E5uH15dSn3I4ket2RxZBGhhfuiGSlAeIehyCk VOdn0f6TQtE+QXrI6Rfl3R/agRSMlsUhdJfvbyjTvBhgPpKSZppoJAgzGzgOuS9EJWmD yB7Q== 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=gBcqfbQyGbalbM7RTbeF9RMSGdAQoJ1lIsL3jRNxqaI=; b=rWM4AoVWggqTAv/paH1IenvZdXEXidWnsxL9hwnv3Loz5XywoKCOo0fjLctde6igKz YiOG3yAzwP4pTsESExfMIB7Yq1oITrY+9/mhkBP8EXm0sk7LJwfke0DDTqz58lJD91IS F/4yZWcCqXNZ+y1Mtl7kUoazlF3BQLtY0JHQ5D7UgPWn3cqzq1uygnPleVidsIMqv6TU c7TdeVDUROX+HK6APylTIusacf5rAT/ta7n1ntuYKi+RlhEUaH0zw7e3WEGah/GwH2u3 yef8qU2PL5bwP88eP+y7hkgvUra74tCM7hpSZqTQlLIwCvVl4gKAPRhS6/E7Cs3UySMZ 0hZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+bBi1Z+; 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 nd17si5546398ejc.732.2021.07.01.04.02.37; Thu, 01 Jul 2021 04:03:04 -0700 (PDT) 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=h+bBi1Z+; 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 S236086AbhGALDz (ORCPT + 99 others); Thu, 1 Jul 2021 07:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235923AbhGALDx (ORCPT ); Thu, 1 Jul 2021 07:03:53 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD497C061756 for ; Thu, 1 Jul 2021 04:01:22 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id v139so5550067qkb.9 for ; Thu, 01 Jul 2021 04:01:22 -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=gBcqfbQyGbalbM7RTbeF9RMSGdAQoJ1lIsL3jRNxqaI=; b=h+bBi1Z+K3JQjRKZxX6GR7cR1+Ci8wd0SWZ/sVkN955M/cPih7hXazxPaYmI34EJrU b+2p7b6H7XV28/f9RZ105XArCVNuMIm9875s62cbR9KGprt/YhzsjUcjCBYqsfOjT5WC K7WVg3el8iSd0uhPa5eJ3pJ8igFqGS5QEEgMvklTFxvXnDZ7uRmDL1ssNo+Qfm0DqnTG q+Q0WfcjZWf/EHic9K3SyUDxKuqdf7Gp02WPsGugxGWBiWnOIlfKhoKjhmPNnV+Lpv3y QvSxTJ5JzpLa8IBHdBoKn8WaNgDyWg6mkXEs7Ek/QN/goZ1l7JMweBYa6xMRcqZnGY0i z7fQ== 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=gBcqfbQyGbalbM7RTbeF9RMSGdAQoJ1lIsL3jRNxqaI=; b=g+rLMQl/XeQiP1B+e/UNlg8n4cqlCdL7DjouciPqPtbRfNhYUgspReBk/pK4sancNB bCPpjlmRmRddlLggEf7VlCi7FVxeh0+p7FnQUFQlR4/RQJr37kwdVPtpnQTwimyPp/AC 2xY9ej8LUokTBue44XWxQ4dQja0Y5yarr4W562+rMqwFfy7rJEuZidPXDh03tCloRQKW w9oGv8rRLQ1s3Ze1s+H++Mg94/jbSrfKwQMqfH+XZRVBcw347xYpM4TPwmjI+f4Ld2xP 4jhetnbSLkSl4woLtniWmU2XEXriYPo9jmGg+JebNIsHBOtYW2SCC042p87Ek2zKozv0 qJbQ== X-Gm-Message-State: AOAM532iiPS7giy/IXok/JbHoBolEWL2cDCPjiKHsF/5XjzBq0eq9xrI AMfkFmnG+tj8S1ea5acnwfjt/5JnzFGpNbCVXlg8fA== X-Received: by 2002:a05:620a:6d5:: with SMTP id 21mr25370007qky.138.1625137281976; Thu, 01 Jul 2021 04:01:21 -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: Dmitry Baryshkov Date: Thu, 1 Jul 2021 14:01:10 +0300 Message-ID: Subject: Re: [PATCH 2/2] PM: domain: use per-genpd lockdep class To: Ulf Hansson 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: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. > > > > > 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/ -- With best wishes Dmitry