Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1779893pxb; Thu, 28 Oct 2021 09:53:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFHt/YheSyAnyZc6s8oOa8N00v29MGn1Xva9Z6nwIwdBlZ68n/3853O+wFrrxQ4y7Uzhco X-Received: by 2002:a63:b349:: with SMTP id x9mr4028095pgt.139.1635439994169; Thu, 28 Oct 2021 09:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635439994; cv=none; d=google.com; s=arc-20160816; b=klI0OxXZYvo6frwGs7eIdi4JNhmlG5cOGwT0EewfOWvLFyR3XXE+ZyIvlmVXZNkCW3 6eQRW97YkjLirePmwXF+gMe7rqgwLHCIB+4z6qCGv2CE1zUOhrKpM0kL2VLH46eEbMIg 70yNa3bXQ+Ug9/FnZQ9b6EM6mZQYi8e3VB497Ao0+ZCnGhyl6wKze4dQiB8AI2zS9VWL ZLkE5ARP43sOrj/vy/YP+cK4vwkCA+dhgbWG3WFMaJSsht2oOiSlRZzqQCqmlVGHW2/g JbhFibYIbEyJoAct8/MKjfU35hqgOp+STkLBTTxD1lqff+4pLiB8uZx9kbRQmOWJPqFq pDKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vdcieApq76aVwV7YeMbL8svFqnVx22XOBF/ZRhqhdrw=; b=ltpTaPIc/eKQze0KCJEP0VMUVl18VXglf4fTyPrHgg24x3QaogjSwWsgGfqLw++oc9 tFALwqhKwTbX/o2J/aeSa0cDj/NIcWjIfgndaDEpW93RAbBzM8CKSqzAiaBBZG/4/1ov teMAJUQn+FZttlxGJ/zjGZM53yxGqVNocZBlfmXYHIVuQomMFYELEYprSOQMR0o2LV7J WUHZdhoN9G5jozTHRo06iTOmz6qkeCWJD+1JQC3MW3IEw/zF/48+7s/OV/LBXKyxEnks d1GaVL3W4OY+iQyJ3ae++bsrgctTOcdZ5JY51ne5BbqMcfJ9MU+O7AfOPFhXC/HY8Ah7 fJRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VmAzlfQV; 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 z13si5078386pfe.153.2021.10.28.09.52.59; Thu, 28 Oct 2021 09:53:14 -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=VmAzlfQV; 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 S230506AbhJ1QyB (ORCPT + 99 others); Thu, 28 Oct 2021 12:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbhJ1Qxx (ORCPT ); Thu, 28 Oct 2021 12:53:53 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5424FC061570 for ; Thu, 28 Oct 2021 09:51:25 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id n11so1032640oig.6 for ; Thu, 28 Oct 2021 09:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vdcieApq76aVwV7YeMbL8svFqnVx22XOBF/ZRhqhdrw=; b=VmAzlfQViSU8L2QzalW4BxxyO3g0UOqJWS98/kME2IOfJlFAK1uyLIMYdqNHwB4J3Q tk/T4YqeIUhBk14pYTxaqxaYliGAPfRs4B7iKO3BWERKdjJzRSY/wdOSk/rZBF6ZPKed QiN+Lqj3HC74T4frOj4auTGqAafFJ4KVxg445qaLRQkDIW8MEQ1qREhUkO0c+llAqgK9 0uNIvg1RAiBhIvvnVWcDKMrrG54qz3etlmFfWRquIwUpyACrGtpXgw7LdJc93XksOYtx XW2t8kOKZLhJQ81wjMAvsheSde6OVDVyEhSjeXPKh3gRV0YmSwbv1fMqZqXbebUu54ZS rvfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vdcieApq76aVwV7YeMbL8svFqnVx22XOBF/ZRhqhdrw=; b=gqgq73AKxHDcCYIbtbQZJ1xlB6/5mTM9qjyrbEx25k4TfJZ8ZssldWfvycGpVgxscD 6cdq9XA4oiXJCTG0hC2O+/y8Ub/J6Z47jf+IMRyIQ8yMWCLgPA/neU59PFrp3HnL98Og ap5tphGcUu7dj/tPTkUkZJ4USFUr1tJo2Pnglqh6zfcx/gBuygHJRYfeXm7sXscX7nlp 4LyKS8c/RmltFEq3Ix3wvIifwn9SS2sAsPmTiUOzM6NUQ7poYGq1XVp1qau8JPvoo7wE 2gjAmQaHmpkO0/BgyQsUWQMT4UMugUfBOKuBC3uclFDtkZY3K8yRuLBercpgbK/KZIVH mmZg== X-Gm-Message-State: AOAM533eGxlKVEy2Z5CDJd2HrWbO9LKWhdDTGyKT05AuNWo1S3W4TGKA xcO4tRUescIfG5rmcDaPfN7ivw== X-Received: by 2002:a05:6808:171c:: with SMTP id bc28mr9424798oib.18.1635439884570; Thu, 28 Oct 2021 09:51:24 -0700 (PDT) Received: from ripper (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id q15sm1178672otm.15.2021.10.28.09.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:51:24 -0700 (PDT) Date: Thu, 28 Oct 2021 09:53:14 -0700 From: Bjorn Andersson To: Rajendra Nayak Cc: Ulf Hansson , Stephen Boyd , Viresh Kumar , Sandeep Maheswaram , Rob Herring , Andy Gross , Greg Kroah-Hartman , Felipe Balbi , Doug Anderson , Matthias Kaehlcke , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, quic_pkondeti@quicinc.com, quic_ppratap@quicinc.com Subject: Re: [PATCH v2 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28 Oct 03:46 PDT 2021, Rajendra Nayak wrote: > > On 10/28/2021 4:05 PM, Ulf Hansson wrote: > > [...] > > > > > > > > Got it. So in this case we could have the various display components > > > > > > that are in the mdss gdsc domain set their frequency via OPP and then > > > > > > have that translate to a level in CX or MMCX. How do we parent the power > > > > > > domains outside of DT? I'm thinking that we'll need to do that if MMCX > > > > > > is parented by CX or something like that and the drivers for those two > > > > > > power domains are different. Is it basic string matching? > > > > > > > > > > In one way or another we need to invoke pm_genpd_add_subdomain() to link > > > > > the two power-domains (actually genpds) together, like what was done in > > > > > 3652265514f5 ("clk: qcom: gdsc: enable optional power domain support"). > > > > > > > > > > In the case of MMCX and CX, my impression of the documentation is that > > > > > they are independent - but if we need to express that CX is parent of > > > > > MMCX, they are both provided by rpmhpd which already supports this by > > > > > just specifying .parent on mmcx to point to cx. > > > > > > > > I was trying to follow the discussion, but it turned out to be a bit > > > > complicated to catch up and answer all things. In any case, let me > > > > just add a few overall comments, perhaps that can help to move things > > > > forward. > > > > > > > > First, one domain can have two parent domains. Both from DT and from > > > > genpd point of view, just to make this clear. > > > > > > > > Although, it certainly looks questionable to me, to hook up the USB > > > > device to two separate power domains, one to control power and one to > > > > control performance. Especially, if it's really the same piece of HW > > > > that is managing both things. > > > [].. > > > > Additionally, if it's correct to model > > > > the USB GDSC power domain as a child to the CX power domain from HW > > > > point of view, we should likely do that. > > > > > > I think this would still require a few things in genpd, since > > > CX and USB GDSC are power domains from different providers. > > > Perhaps a pm_genpd_add_subdomain_by_name()? > > > > > > > I think of_genpd_add_subdomain() should help to address this. No? > > We only describe the provider nodes in DT and not the individual power domains. > For instance GCC is the power domain provider which is in DT, and USB GDSC is one > of the many power domains it supports, similarly RPMHPD is the provider node in > DT and CX is one of the many power domains it supports. > So we would need some non-DT way of hooking up power domains from two different > providers as parent/child. > See 266e5cf39a0f ("arm64: dts: qcom: sm8250: remove mmcx regulator") and 3652265514f5 ("clk: qcom: gdsc: enable optional power domain support") MMCX is declared as power-domain for the dispcc (which is correct in itself) and the gdsc code will register GDSCs as subdomains of the same power-domain. To ensure this code path is invoked the clock driver itself needed this 6158b94ec807 ("clk: qcom: dispcc-sm8250: use runtime PM for the clock controller") So at least in theory, considering only USB the minimum would be to pm_runtime_enable() gcc-7280 and add power-domains = to the gcc node. The "problem" I described would be if there are GDSCs that are subdomains of MX - which I've seen hinted in some documentation. If so we should to specify both CX and MX as power-domains for &gcc and the gdsc implementation needs to be extended to allow us to select between the two. For this I believe a combination of genpd_dev_pm_attach_by_name() and of_genpd_add_subdomain() would do the trick. That is, if there actually are GDSCs exposed by gcc that are not subdomains of CX - otherwise none of this is needed. Regards, Bjorn