From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 713A1270EC3 for ; Mon, 22 Jun 2026 10:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782124541; cv=none; b=nAagDtZc7t7ZU/XfOHRWWxYLt+lQOC/kq1NYByuwroKP8Ri/1+AePTtVtTkaPAgKxBzZZ2ucuiGPikmQs86jpEjJLFldLvyGg8H0hgW+92Lf4eanwsgJA1rax49puYMm9yhrA4p+VadOlf9K8gyiVS5dKMsN7+5Pj2Wt/8y9L+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782124541; c=relaxed/simple; bh=ybDbDgEQCbGWYNmT77Qma+WdCRNJi0V6KPZ3tEaEJbA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BAnVgIyCJ2ivv9yzbX7zc91QsGwsWfPWtDwCLv54XUkGMeyuF++CTYrlhIlM8IT3WKYH+TSOkO0TgME1qF9Vp9gCgIc+y+KRiwfSS5Ld0565zHMXPIWvmxKdzvicQHYPLsj/VH9i9/HKu9lcpQogoY6FTNOt8UgD5bibDSH83SY= 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=oLd6LJM3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=b0e0v+fD; arc=none smtp.client-ip=205.220.168.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="oLd6LJM3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="b0e0v+fD" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65MAQXwh329139 for ; Mon, 22 Jun 2026 10:35:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wz5cN6jsiGUIDg9U9pmEbpCmOQJeHcDs24G2sv2VOWQ=; b=oLd6LJM3VldlGuv6 d8+AcPSPM05BCJCXWdUSrOj4HMxM+PDx6LLKmsjBygdd+zbKpFLaoQpgQSCfBRfr GTUTKvY7leVtifj4Jb9pSetTqXqPaaaWC1eWcJIFd2u+5aKMUBU5gXRst5COtamj ARTC8zvolVkLqi+lrdxJtdk3dsjnwfIlJYHTxA6yQlITkxbCxIXo43d4Whtopj3G Y3BwNh+in/bDdrS1dYBMg1NScYHIzKxkWfDVC8v/0sAaiDzX11iSq8hCdLpBh0Kb MkahxDYlNdMWS2846ZYezemeBdP95AIX112BZIQwROHwLxJxf7skoHQ7Xo3hkKKN z+oexQ== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ey3a0r13j-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 22 Jun 2026 10:35:38 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8ddecbc403eso9056706d6.3 for ; Mon, 22 Jun 2026 03:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782124537; x=1782729337; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wz5cN6jsiGUIDg9U9pmEbpCmOQJeHcDs24G2sv2VOWQ=; b=b0e0v+fDBDSx5xA5QwLf63Jr2d/QVdyb1JWIxoJZkP8a71CH/rvTHwCKLZmiYOHFwN 7omQElRfG5nF3KO7GpkYjXGqfSpIvhWlH/d+HFdPSdVtPWpynSWqot3MpvOnbdxYHHqU sax/+vGcZgv/eAJAz9Pm0FVaOBTETZfsUxrRKa7FeUsjD2ir5doFoTQuGOnYVRWVFWhq XVz+apkQ+CEe0MoH2RtaoGWmnTtmSIbr4AGPFRMpSuKFsMtFBQf8DkYlF7RK4UMRdJE+ FisnBd7E1NzFVRJRtJEo7wQaiOB4CATOLBDRoWHXr/jeU/h/0Fw4mzGPYk/HRqXcRVKc GOtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782124537; x=1782729337; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wz5cN6jsiGUIDg9U9pmEbpCmOQJeHcDs24G2sv2VOWQ=; b=CEs/bHwOPAc0mys05PFFTOeiNihR4dQUHfgVEajyIE68c7bbs76eooJAIxdUOAAKtC 1rT1kvC1tIKzj9aw9J2WRnRZEdeBx3KPH2DDe8m+BjaLSXhnlPv89S9mL34C3enuPJPW 5/QLJ3z+puAnqItwXoQg2fq8OJI7ssyrddVgJGHADq5WwnEugBc/Y41Mq4QqwBcf5R6C bCuE5tcMP4P8sgi4ybgiCpUPMBKnLrzaWMQpJW8l9I6PoJNw84SO0nFqeE8r2xixypM/ ShnWijvbIaViYKNMMqgUv/f1pUpu1BhpPUOgl7pMmvP4Y2Ch0byAGbWO1wdIsFEKSeA2 dTJA== X-Forwarded-Encrypted: i=1; AHgh+RqgBLlrZesc1rbZdCknTKgablnvPOLpr9+OKiL4QUI9zsWIyj6p5ShQztSVLFuZb8vtVTIufrfhbvJMcR0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7zycsHZrPnzvx3/4ZTWvopfb6JSXyFVTgGQkQGBtB2OKZYXNI QyeDj+R2hH3FoudTCs0FO6Bif0eNHMBzHXGaL2S12C2vgw0bKrEARZ3btUBzMsHAv5KA6tKED5J pirSeNR8f5wqJW3RY3LU3shyiVQndChklKdEsX2O1VWwa40Xb0gu8LTyPoOmApHrWyY8= X-Gm-Gg: AfdE7clXqQK+L4EVUvItZsWQJcv0f3o+yPdaSxBNHytiolPBweTzRdJB7Zu/SOKLNey JjmCe1Pzv7HxYdVbNU1gOy0tJi6HG7iN+CZH+UJ6BBDG/jOdpVHGINr3/+aF4P08H3xhHfGASqP PMHtBKP2UJv6+YiH/mLViV3h9bJ2wDk0wmeyDXCOfbIx0R5W3I8f1G9wcp9VesqKIFCNCDatOur PVhoZ+AG7e3+HYIQsCeSHq0ihyD+SI6xnzXWTLuDh4ZP+zlLUddFzbcMbcRpgLKrYd/HQrtsMBw io+3EaYDVAm6kTDCFXSoJDrUqYFC61BnEZFxTwisBQfcP283q3zZy6CuqGkpH4GAZpQkB/LZmyC WuaSpPjqUC/EzCZN25wY7Fsd0+nd7Lc7TL9M= X-Received: by 2002:a05:6214:6004:b0:8e0:c7de:1a38 with SMTP id 6a1803df08f44-8e0c7ed60eamr62570696d6.4.1782124537641; Mon, 22 Jun 2026 03:35:37 -0700 (PDT) X-Received: by 2002:a05:6214:6004:b0:8e0:c7de:1a38 with SMTP id 6a1803df08f44-8e0c7ed60eamr62570296d6.4.1782124537229; Mon, 22 Jun 2026 03:35:37 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6977be49b7asm2835424a12.21.2026.06.22.03.35.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jun 2026 03:35:35 -0700 (PDT) Message-ID: <4d25f656-1372-4ddb-9e52-8f381700abed@oss.qualcomm.com> Date: Mon, 22 Jun 2026 12:35:32 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] clk: implement sync_state support To: Brian Masney , Ulf Hansson Cc: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede , Dmitry Baryshkov , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jens Glathe References: <20260616-clk-sync-state-v2-0-15f82c64d95c@redhat.com> <20260616-clk-sync-state-v2-5-15f82c64d95c@redhat.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNjIyMDEwNCBTYWx0ZWRfXzQ+cofN9Wo15 txJvQncYGe14n6I08K2n5s64y7d14oxis8UtjkQVXS0vu0qaYImQVD8YMXz4fAHi/x0TGfjMeCf AiPXk5zYXV23AXDYYdNbi7tR7bdhgP8= X-Proofpoint-GUID: A5UHwIw7BEneRkGtip9WsZ3DUEpdyWR4 X-Authority-Analysis: v=2.4 cv=UJ7t2ify c=1 sm=1 tr=0 ts=6a390ffa cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=KKAkSRfTAAAA:8 a=20KFwNOVAAAA:8 a=ndTenVKbHRbPZtASR5oA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIyMDEwNCBTYWx0ZWRfX1ZY+b+hCS1Eo QyngmyvWcx/jIwG51Qrn2FluxEWml9+KEAywEaJoP1SXpdO0pt82iqOguwGMm4dLC18lY/mGsQ1 t0J+uwhHNYbhtTfzhvgeLix8B6ntN/tjTz57KvsYApMSVu+oWyfT5BoR3cEqGJd4a/w7gbFVDvK nxAMa/YPSu0H2G7s9/K+3ETkByeVDSN9+aTWYllQqjcrAgQBJ4Ai5ncS3xxmCGzScyjSC1Zjhmz arVVV4FjLeE9Qh063gCj4gp8v4Z7XE2qTEcyRp5TpJvttPPXOO9n1vDvsoKJq2HP//wS5Fk5Np8 SpJLrDGS7pyitDcOux09lHxnaZCJV7/bQ9T7BC0o4Xl2mWfzmfxgUcoejekoFe5CI6F2e68cE9X nlT40ekjRFTwMxEanv9Brguj59uqE6Tp8u4MNyT0ipAAVt2D342omOu6HFYe2Q0c1qVUWJ3SJxR hhUTVbDXvWo2AC4/G0Q== X-Proofpoint-ORIG-GUID: A5UHwIw7BEneRkGtip9WsZ3DUEpdyWR4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-22_01,2026-06-18_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606220104 On 6/18/26 11:12 PM, Brian Masney wrote: > Hi Ulf, > > On Wed, Jun 17, 2026 at 05:29:51PM +0200, Ulf Hansson wrote: >> On Wed, Jun 17, 2026 at 5:02 PM Brian Masney wrote: >>> On Wed, Jun 17, 2026 at 04:24:05PM +0200, Ulf Hansson wrote: >>>> On Tue, Jun 16, 2026 at 11:09 PM Brian Masney wrote: >>>>> @@ -4345,8 +4382,17 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) >>>>> core->dev = dev; >>>>> clk_pm_runtime_init(core); >>>>> core->of_node = np; >>>>> - if (dev && dev->driver) >>>>> + if (dev && dev->driver) { >>>>> core->owner = dev->driver->owner; >>>>> + >>>>> + /* >>>>> + * If a clk provider sets their own sync_state, then it needs to >>>>> + * also call clk_sync_state(). dev_set_drv_sync_state() won't >>>>> + * overwrite the sync_state callback, and this call will fail >>>>> + * with -EBUSY. >>>>> + */ >>>>> + dev_set_drv_sync_state(dev, clk_sync_state); >>>> >>>> We have cases where a device node represents a provider for multiple >>>> types of resources, like clocks, power-domains (genpds), resets, etc, >>>> as in the qcom case, for example. >>>> >>>> For power-domain provider drivers (genpd) we also try to assign the >>>> ->sync_state() callback, see of_genpd_add_provider_simple() and >>>> of_genpd_add_provider_simple(). This means the above doesn't play well >>>> with how genpd behaves, so we need to figure out a way to manage these >>>> cases. >>>> >>>> In this regard, we also have of_genpd_sync_state(), which allows a >>>> genpd provider driver to explicitly call genpd's sync state function, >>>> if/when needed. >>>> >>>> Unfortunately I am not able to suggest a detailed solution for how to >>>> move this forward at this point, as it requires some more thinking and >>>> I am heading for some vacation very soon. >>> >>> One approach I initially considered was to make it so that we can have a >>> list of sync_state callbacks that can be added to. I already did some >>> work on this, but I didn't think it was worth it for just the QC clk >>> drivers in isolation, but it would address the concern here. >> >> Right, maybe that would work. >> >> One more thing to somewhat consider, is the problem I have been trying >> to address for power-domains providers [1]. At least for genpd >> providers, we need a more fine grained sync state solution, which also >> must be able to co-exists with other subsystems sync state support. I >> am not sure if something like this is needed for clocks too? >> >> [1] >> https://lore.kernel.org/all/20260508123910.114273-1-ulf.hansson@linaro.org/ > > I am not aware of any clks setup that way but that's not to say they don't > exist. Stephen, and/or some of the folks from QC would know better. I'm not sure I'm following, but we do have this bit qcom_cc_probe() -> qcom_cc_really_probe() -> gdsc_register() -> of_genpd_add_provider_onecell() -> dev_set_drv_sync_state() and this patch calls dev_set_drv_sync_state() again in __clk_register() Konrad