Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1047499pxb; Tue, 26 Oct 2021 01:44:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytOqsm3LmQIX5ppXDZfd87RjF90ZEhUSA02V0Ue4mrtBrrrA7qQ7hWKQCzeDbHE0oPYBsj X-Received: by 2002:a17:90b:4b48:: with SMTP id mi8mr7888618pjb.94.1635237874260; Tue, 26 Oct 2021 01:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635237874; cv=none; d=google.com; s=arc-20160816; b=pBvNz0qv8KnSQglQnTalG/d6ByBUdvKkZwrbiGm011U4QiS9+I/lGCLyEmVSssYQzv x7S/cYWXF6P/hFW0ZVVeo/0NvpCiu2M8hAtvSaZdIc+ckxHWb8YkJtOEF9fsfYddeEOA GnF2J/3RMQci+wrqksrGdWvUORiXP5qbLXWHI2SRIY2QW+lGyNCT068Bq9tVe84SiW8c J+3bsUX2dWxlnQkV+VkACkk0gyhQBNvbmsF3gMw0FtfMToPiw9UpNZthKdN/T5IHEs06 REeyAFtUn7odnwY6kNYGnQaGEQnSuCow+v8LBjZ1uxsRlNmi9kNjgJBARHXcnqrtBAh6 lfHg== 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=fNJEWmbc5F3iZTFtMpvuRuP6v2KdIvW972u1Kqe/0GM=; b=kF3C7pyizXH23Ug1qiMJ6SxAPyyQUmhw4rRQEhWjEfSgnTTThCSxduUhDrgWyjaEuv sI2+cTd7Zz+2yxZRtYAvk6cpagzibLuSVOMcnPSm8+3sv4EiNc5Oflf+UanQK9zSpaea fjeXNpvC4OWk8eo3rTX/bFUH0xNJ36m2x2/3oqoqIXzhZ5QDaUZv0IhgpirDe1NzeFXv qRrhywKa6ShEK5KW8vt2OHVJhpdWYUVSKjxpLWlZs5VK2CE5BAPv7JUjYb4DZVLXaGb9 gF3YEgUBcclTRKCKi7PrwjjrJzzqKnwoeqIFZal8Tf34/9RiG+gm+DqwbMTGsv3oSe26 rCpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hLA76FBA; 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 r12si5158129pgv.21.2021.10.26.01.44.09; Tue, 26 Oct 2021 01:44:34 -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=hLA76FBA; 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 S234460AbhJZCsz (ORCPT + 99 others); Mon, 25 Oct 2021 22:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhJZCst (ORCPT ); Mon, 25 Oct 2021 22:48:49 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB99C061745 for ; Mon, 25 Oct 2021 19:46:26 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id l10-20020a056830154a00b00552b74d629aso17741576otp.5 for ; Mon, 25 Oct 2021 19:46:26 -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=fNJEWmbc5F3iZTFtMpvuRuP6v2KdIvW972u1Kqe/0GM=; b=hLA76FBAWKCorHaVgR34RZkpRLv4fqLHBF4RTe+TqR3UxiFAlEx8aRJXKHOq67tZTe ep7GMAc3Qviokz3G3gpvTy3OgWAqkJ4ZpvafVJLQ8abzHFztYsWYFIHNHAaQ8ODzB4Ze nkI69DUHB+NZjAAYbKGdnGpiCFFUOWp/k5+dhyjfJi1sSrAZbj4m2dFC97SLu4HUI6/0 4oU6JMtnH+o7KaJWMbijAcmWYUt2eDLCFRyATQkfUIqbtzHFv9ZsQe0cdJNahtUdFap0 iemEXRRz1F6QEdFA3uKbUiwKdVLDRpe7c2xJoS0P0SDCdcNKuO0iT9KgIpymazWOXFXM 5oqg== 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=fNJEWmbc5F3iZTFtMpvuRuP6v2KdIvW972u1Kqe/0GM=; b=kUB+OV72GDWimpc8v8qm/8QVzhTALSxg/kAAFr38gjdGJNppXwB+30wOx++4cIpzZN hvRpfGmJf3NXFBpBxpr+n2QwVlZOMUo2JPY7GQwsmNaq6VdjyEk9mP/HW5I5Wgayf01z dErBtZHPLXvLikYVYfbSXpPB0iB3EtxkS4kpx2Buw2ltpQz7Ya7/Ansv1Ah4Ujwmq8/x sHwIrPvud9KgXSAMHeE93f5TJ4WDTXB69QrFey2iz19ORa93P8rptYqS30ZSJMJ1hRsY k3WNO/N+kJVBRmndWJsb7rQfSWhDHClcHmx+XexqWufl2vJ0RqYEXlmEoCfYbKpEOvfr qHUA== X-Gm-Message-State: AOAM530ko6VuwQw55Pyo+laZOZF5FAjgPenIgDDkHw9Rr4XflWJG8opY 9ChyiIASc41NN4aWy6OJLgJKcQ== X-Received: by 2002:a9d:611b:: with SMTP id i27mr16648120otj.323.1635216385800; Mon, 25 Oct 2021 19:46:25 -0700 (PDT) Received: from ripper ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w28sm3469138ooc.3.2021.10.25.19.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 19:46:25 -0700 (PDT) Date: Mon, 25 Oct 2021 19:48:02 -0700 From: Bjorn Andersson To: Stephen Boyd Cc: Ulf Hansson , 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: <1635152851-23660-1-git-send-email-quic_c_sanm@quicinc.com> <1635152851-23660-2-git-send-email-quic_c_sanm@quicinc.com> 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 Mon 25 Oct 15:41 PDT 2021, Stephen Boyd wrote: > Quoting Bjorn Andersson (2021-10-25 14:43:23) > > On Mon 25 Oct 13:17 PDT 2021, Stephen Boyd wrote: > > > > > Quoting Bjorn Andersson (2021-10-25 12:10:35) > > > > On Mon 25 Oct 02:07 PDT 2021, Sandeep Maheswaram wrote: > > > > > > > > > Add multi pd bindings to set performance state for cx domain > > > > > to maintain minimum corner voltage for USB clocks. > > > > > > > > > > Signed-off-by: Sandeep Maheswaram > > > > > --- > > > > > v2: > > > > > Make cx domain mandatory. > > > > > > > > > > Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 8 +++++++- > > > > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > > > > > index 2bdaba0..fd595a8 100644 > > > > > --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > > > > > +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > > > > > @@ -42,7 +42,13 @@ properties: > > > > > > > > > > power-domains: > > > > > description: specifies a phandle to PM domain provider node > > > > > - maxItems: 1 > > > > > + minItems: 2 > > > > > + items: > > > > > + - description: cx power domain > > > > > + - description: USB gdsc power domain > > > > > + > > > > > + required-opps: > > > > > + description: specifies the performance state to power domain > > > > > > > > I'm still worried about the fact that we can't just rely on the USB GDSC > > > > being a subdomin of CX in order to just "turn on" CX. > > > > > > > > Afaict accepting this path forward means that for any device that sits > > > > in a GDSC power domain we will have to replicate this series for the > > > > related driver. > > > > > > > > > > I suspect the problem is that it's not just "turn on" but wanting to > > > turn it on and then set the performance state to some value based on the > > > clk frequency. > > > > I don't see an opp-table involved, just the required-opps for the > > purpose of turning CX on a little bit more. Perhaps I'm missing > > something here though. > > Indeed. There's only one clk frequency for USB so only one performance > state/required-opps is used. In general that isn't the case and so we'll > eventually need to map some GDSC on/off state to the clk frequency of > whatever clk domain is associated with CX for a device. > Makes sense, just because we don't use opp-tables to scale the frequency and performance_state, the issue remains the same. > > > > > Maybe the simplest version of that could be supported > > > somehow by having dev_pm_opp_set_rate() figure out that the 'level' > > > applies to the parent power domain instead of the child one? > > > > Having the performance_state request cascade up through the GDSC sounds > > like a nice solution; I've not looked at the code to see if this is > > feasible though. > > When the binding was introduced I recall we punted on the parent child > conversion stuff. One problem at a time. There's also the possibility > for a power domain to be parented by multiple power domains so > translation tables need to account for that. > But for this case - and below display case - the subdomain (the device's power-domain) is just a dumb gate. So there is no translation, the given performance_state applies to the parent. Or perhaps such implicitness will come back and bite us? I don't think we allow a power-domain to be a subdomain of two power-domains - and again it's not applicable to USB or display afaict. > > > > > Or we may need to make another part of the OPP binding to indicate the > > > relationship between the power domain and the OPP and the parent of > > > the power domain. > > > > I suspect this would be useful if a power-domain provider needs to > > translate a performance_state into a different supply-performance_state. > > Not sure if we have such case currently; these examples are all an > > adjustable power-domain with "gating" subdomains. > > Even for this case, we should be able to have the GDSC map the on state > to some performance state in the parent domain. Maybe we need to add > some code to the gdsc.c file to set a performance state on the parent > domain when it is turned on. I'm not sure where the value for that perf > state comes from. I guess we can hardcode it in the driver for now and > if it needs to be multiple values based on the clk frequency we can push > it out to an OPP table or something like that. > For the GDSC I believe we only have 1:1 mapping, so implementing set_performance_state to just pass that on to the parent might do the trick (although I haven't thought this through). Conceptually I guess this would be like calling clk_set_rate() on a clock gate, relying on it being propagated upwards. The problem here is that the performance_state is just a "random" integer without a well defined unit. The one case where I believe we talked about having different mapping between the performance_state levels was in the relationship between CX and MX. But I don't think we ever did anything about that... > > > > > > PS. I think we have the same problem in the display subsystem, the > > sub-blocks are powered by MDSS_GDSC, which is a subdomain of MMCX. We > > trust the parent mdss node to keep the GDSC powered and specify MMCX as > > the power-domain for the children, so that we can affect their levels by > > respective opp-table. > > > > Yes, a GDSC is really a gate on a parent power domain like CX or MMCX, > etc. Is the display subsystem an example of different clk frequencies > wanting to change the perf state of CX? If so it's a good place to work > out the translation scheme for devices that aren't listing the CX power > domain in DT. Yes, the various display components sits in MDSS_GDSC but the opp-tables needs to change the performance_state of MDSS_GDSC->parent (i.e. CX or MMCX, depending on platform). As I said, today we hack this by trusting that the base drm/msm driver will keep MDSS_GDSC on and listing MMCX (or CX) as power-domain for each of these components. So if we solve this, then that seems to directly map to the static case for USB as well. Regards, Bjorn