From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42FDF39FCC4 for ; Tue, 24 Mar 2026 03:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774323279; cv=none; b=fNJ1NZesWChy0Y56MuHgDvTRrbSvMPdejm2LJ2vRrW9pc78dYscgTbFHkdJpjBLN8dz0uSIcutkF/JNfF1Qi09DWkUeSyhe66AB91BROKVsobNQ6DhdGSyh9GtBkONhecdiQe9MGNUe3RkzbqeUvugBz5JKnpxEIPQRzPhBmXxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774323279; c=relaxed/simple; bh=JaEgEOwjmp4nnNNKZw+Gej39KXI5sl7inIVgQtr9HnM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dou8ayOywZZS8zB6kmmVgm2dasy1LAR0lFmucmdZlcWxWGN1wYRcx7K+fBL3kTEuPI5MilWBRoUMhcR0BQr4p1J6tp216HaLm1NTZpQ3QZeREV2dOWjrKr1kZ1xl0QN6OzAPuEvbkaHtzYCPBxOuI9vtgDLmlw222Wb9IR/Lpt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DGgpZ7fE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WCwQ1c5v; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DGgpZ7fE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WCwQ1c5v" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62O3XUWR3817811 for ; Tue, 24 Mar 2026 03:34:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=whDI1GA1rv1vXsO+5RObRJvS XkoZkTiE/QS5vJICZzU=; b=DGgpZ7fEBkrigK8ukyNqmZjHmiTLRoeC4J1qtET8 rMb+8PpJ8QN/Nq915CwIflEdFRLZf1j4XgRSNrbxJQIvQjAGY7rvNDhp/4VpWHAN pbOqpQW+1M020z/B8nIZbQG+UvtX6EPFmtXHL+t40IdXTGWDvcFitSJnxV2KXrnB /wRhTaiADe8PrSBQN36tDVIZAX8xCVa/ut6BMYU6nswgHPOgv+bZ2/vT3+9AzwTN FSAJfH6CJYj7Ez1OB/BTrUtYcaYky59Td6Qfk2xzQ0cdd6T2jkhDyEcaqyRsJI2K ObEsKP0kby9OKSOfEfvCkEw2PYDX4fsDq7Q4L7vwucvsag== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d355w2xjk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 24 Mar 2026 03:34:35 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-12737f276a2so797631c88.1 for ; Mon, 23 Mar 2026 20:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774323275; x=1774928075; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=whDI1GA1rv1vXsO+5RObRJvSXkoZkTiE/QS5vJICZzU=; b=WCwQ1c5v/gHP9uT8q5sYoR1g0JarzpF5o1fmmrIGppOWP/ncAZKQWUMPpZaMycCpsU knqh02pLTyPjO+S09djui1kYb5dpgIP6isvHrMN8Y73zKQ75hg5n/FamrMKHnlSQaedN +wrbT/eeIuEO+CIyQ5XCr8utqH9RiLvKOuHlctw64BKXbOTlceomWrm1k/mubo937ZB1 CTP5DoUfEOMWFR+ai8k5NKF5ixYpAtjMHQUO/ungR99CBgYlm2BCj45qHTdyo3fp6P80 OI+NfB28rNbRcBVZrLs4KA0VVMC3pDGrj3+A/GbVz5T1C3JLcwJzdlgh6uKpgiDuaK/T 7dLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774323275; x=1774928075; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=whDI1GA1rv1vXsO+5RObRJvSXkoZkTiE/QS5vJICZzU=; b=UK+E5TpO0pBIpkFSaNF8Uot0yE3H3KjWPXeRGIcLNtT8MKU0jkGZesXxFVju30Mkme 71O9aAXQwcGm32e4UtWHk9m5Dbp9IniX7vvvII7fn8J2ujtbCiJhgSF0MAUn3Bve3ca0 Rf0+fWkmQu3hTP8s1vi3R3Dk8qfepBYVx1tS4wkBHjkdVKrtznPLGLtjT3SBNOtd08gI gaNL7PovckuxdLpughVwLIm/yuWwWRbuvlVPdgXBmD8ucSuWdLZ+jkuGHQbAfUZPOkzM L+EcQ5FndyaABvBOss5Wo1si1ngQdo0VUDbEHK2gZv8oxXvtsiKkiUBAcVmyRPZnEWI2 y5QA== X-Forwarded-Encrypted: i=1; AJvYcCXtEpA6Yng8WLxYn0hHe9Vgj72cOlKoiWRttC7jPt3mBwwb7bbL0v4D5YHed1nm9iXz//0aAu0wIsc0gW0=@vger.kernel.org X-Gm-Message-State: AOJu0YxTIme1YKqN81Pd31/9Ur/FDE728d3xj8KkSrE9IVIE3frX/yyG 56D5mLmpxDV/idhjH5J4SsjxnSIYXQARcptzWfx8abDkSV30UBKnZwF9RuVhcJAX93jrs97lP/m ydevAPKO8VJgdu1vk0MYAVYTuX1rxHjVIB1vhwk/8yqwY+uopTmbcfMwG3Z7t1ctKYvY= X-Gm-Gg: ATEYQzyEd/MPXMDa0lZvZC3zRfD1CBrtCzMXzOAE0FYaEblj+/MfdGp4gMS5R7NJ0xe CSPxRkx6/k8yt4EqHQjMLVDOa8nrqC7LTHNjhu0lFwIPPFzzXmr5QwQ5wIT2Mee5x2sBwvQ2FRY KapPEK7R1F0O1Y3rYHDsuJbLzM7hopPYc0UwII9NFV0xR8iqJ4tR4wMwQyGk8bk2a7nvlXfrysj pOzVtNtqYbGsd7nlpv4XYLesM22VLCDb52pZFPBmZfpBPet4nqGhktsUXR0TDO2//29pWuFhrJn C6qgwVgnGQtjCKKjtN0cKvPFNZY7SifsMjSV3J4v1OtOmZzD9QiZupAdXQmR5sI37ChJij0b9ug PLZVfNhlToyOuFsJ8K5IpsT95opo6BEgZsk0NWa188AzfkNJAG0GFDKS6Bil7wgj7cFdRK3dcDr U= X-Received: by 2002:a05:7022:ef09:b0:129:fe5:117e with SMTP id a92af1059eb24-12a726a2f31mr6177644c88.26.1774323274668; Mon, 23 Mar 2026 20:34:34 -0700 (PDT) X-Received: by 2002:a05:7022:ef09:b0:129:fe5:117e with SMTP id a92af1059eb24-12a726a2f31mr6177629c88.26.1774323274016; Mon, 23 Mar 2026 20:34:34 -0700 (PDT) Received: from hu-mdtipton-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12a733fe80esm13039261c88.7.2026.03.23.20.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 20:34:33 -0700 (PDT) Date: Mon, 23 Mar 2026 20:34:31 -0700 From: Mike Tipton To: Luca Weiss Cc: Georgi Djakov , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 3/5] clk: qcom: gdsc: Support enabling interconnect path for power domain Message-ID: References: <20260116-milos-camcc-icc-v1-0-400b7fcd156a@fairphone.com> <20260116-milos-camcc-icc-v1-3-400b7fcd156a@fairphone.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260116-milos-camcc-icc-v1-3-400b7fcd156a@fairphone.com> X-Authority-Analysis: v=2.4 cv=fq7RpV4f c=1 sm=1 tr=0 ts=69c2064c cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=kj9zAlcOel0A:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=6H0WHjuAAAAA:8 a=PAalmAW71AuKxujjx8AA:9 a=CjuIK1q_8ugA:10 a=Fk4IpSoW4aLDllm1B1p-:22 a=Soq9LBFxuPC4vsCAQt-j:22 X-Proofpoint-ORIG-GUID: DynX-JSZOU0SzrKgFASLChgimvWiwYoK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI0MDAyNyBTYWx0ZWRfX+r8fN+HQSNXt nL+7VcJ5sHp8UNs5fL91Ni14tWxBWhlIvgELCGMlBF3D2kghjIVCW5nb0wuvEVb9N9UsaPkZlex DP4rrHkxe63mXMCC65h8XCzrgaAe7Lf2LhV6wum8eJ+Vn0yCpW47+ERkYwJ+dRXxwOrZRUZtgNm UrdegArJo2hSSYqBhx+EdxBuPA+00ZRSmNYSSU9y3xv2wfggXjp1VhDBLxUUwfFsE1ZP7G6YrYK fIubKaWKAVlmihfNHlAH06m5TPFTI1FHGwpjFO/XE965TORCKgk7o7DdmnlwBZi11ze9vpHV3O6 xsSeVmnIWDEHRVe82wumi5qV9s+HjYFrxs0qh5fJCowekvP+jK3XYlqYoW/gy4TMbmw8mQ7hIav b2YQ6LmEN8A1/4DZ3xjLUk7XpIJqNn9XnDOIEwDgzwQbGCh0HCfeux9cGZJLX2t7NpNJwgwBi4D 2g8fu422kkdsimoY3Gg== X-Proofpoint-GUID: DynX-JSZOU0SzrKgFASLChgimvWiwYoK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_01,2026-03-23_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 adultscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603240027 On Fri, Jan 16, 2026 at 02:17:22PM +0100, Luca Weiss wrote: > On newer SoCs like Milos the CAMSS_TOP_GDSC power domains requires the > enablement of the multimedia NoC, otherwise the GDSC will be stuck on > 'off'. As mentioned in another email, the dependency should actually be in the other direction. Where MMNOC gets stuck turning off if CAM_TOP_GDSC is still on. > > Add support for getting an interconnect path as specified in the SoC > clock driver, and enabling/disabling that interconnect path when the > GDSC is being enabled/disabled. > > Signed-off-by: Luca Weiss > --- > icc_enable()/icc_disable() seems like a nice API but doesn't work > without setting the bandwidth first, so it's not very useful for this > driver, at least I couldn't figure out how to use it correctly. Agreed. In cases where a driver only needs simple zero or non-zero votes, then icc_enable()/icc_disable() don't really help vs. just using icc_set_bw(). > --- > drivers/clk/qcom/gdsc.c | 19 +++++++++++++++++++ > drivers/clk/qcom/gdsc.h | 5 +++++ > 2 files changed, 24 insertions(+) > > diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c > index 7deabf8400cf..ff1acaa3e008 100644 > --- a/drivers/clk/qcom/gdsc.c > +++ b/drivers/clk/qcom/gdsc.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -261,6 +262,8 @@ static int gdsc_enable(struct generic_pm_domain *domain) > struct gdsc *sc = domain_to_gdsc(domain); > int ret; > > + icc_set_bw(sc->icc_path, 1, 1); Need to handle the error. If the BW request fails, then we shouldn't proceed to enable the GDSC. Additionally, setting BW here doesn't handle the case where the GDSC is enabled as part of gdsc_init(). If we move the icc_set_bw() calls into gdsc_toggle_logic(), then we don't have to care about how many places could ultimately enable or disable it. Since it's a fundamental HW dependency, then placing the BW votes in the common place where we actually toggle the GDSC on/off seems to make the most sense. > + > if (sc->pwrsts == PWRSTS_ON) > return gdsc_deassert_reset(sc); > > @@ -360,6 +363,8 @@ static int gdsc_disable(struct generic_pm_domain *domain) > if (sc->flags & CLAMP_IO) > gdsc_assert_clamp_io(sc); > > + icc_set_bw(sc->icc_path, 0, 0); Similar to above -- we should handle the error case and ideally move into gdsc_toggle_logic(). > + > return 0; > } > > @@ -574,6 +579,20 @@ int gdsc_register(struct gdsc_desc *desc, > if (!data->domains) > return -ENOMEM; > > + for (i = 0; i < num; i++) { > + if (!scs[i] || !scs[i]->needs_icc) > + continue; > + > + scs[i]->icc_path = devm_of_icc_get_by_index(dev, scs[i]->icc_path_index); I generally prefer using string-based DT lookups rather than index-based, i.e. using devm_of_icc_get(). I know our clock drivers have switched to primarily using index-based lookups, but I still generally prefer string lookups: 1. They're self-documenting within DT rather than relying on magic indices. 2. The property name in the driver being non-NULL can indicate whether a handle is expected rather than relying on things like "needs_icc". 3. Would remove the need of adding the new devm_of_icc_get_by_index() API, in this case. There's nothing fundamentally wrong with this and I won't argue hard against it especially considering that it's consistent with how our clock handles are being looked up on more recent targets, but I often find the string lookups to be cleaner and more robust. > + if (IS_ERR(scs[i]->icc_path)) { > + ret = PTR_ERR(scs[i]->icc_path); > + if (ret != -ENODEV) > + return ret; > + > + scs[i]->icc_path = NULL; > + } > + } > + > for (i = 0; i < num; i++) { > if (!scs[i] || !scs[i]->supply) > continue; > diff --git a/drivers/clk/qcom/gdsc.h b/drivers/clk/qcom/gdsc.h > index dd843e86c05b..92ff6bcce7b1 100644 > --- a/drivers/clk/qcom/gdsc.h > +++ b/drivers/clk/qcom/gdsc.h > @@ -9,6 +9,7 @@ > #include > #include > > +struct icc_path; > struct regmap; > struct regulator; > struct reset_controller_dev; > @@ -74,6 +75,10 @@ struct gdsc { > > const char *supply; > struct regulator *rsupply; > + > + bool needs_icc; > + unsigned int icc_path_index; > + struct icc_path *icc_path; > }; > > struct gdsc_desc { > > -- > 2.52.0 > >