From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3BB3D3385A1 for ; Thu, 18 Jun 2026 21:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781817169; cv=none; b=X1RK7Kcga1qQcY2dySLcCYh3RGetbNUzFZ+lkv8P2RTDZTIWlUcERzkmkXbAWnzxzSUNCTd05q8jDnBcrvXKEv0SKi6SI8il3R6+Tka/oWiNELI3vKN8v6Rin5ntYjZzcI8fgQHedTkcGB0gtKHJb093iLocRlPDEffm+Br4CbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781817169; c=relaxed/simple; bh=BPJXynNAo8Jcooz8/RyQzKJBfUECCST9+2kUSac33zg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cztBmWmcHsE5+vUepuaJlGm2aN1oS3zypE87f3EjA0uN8rdm/2FkYpbcDoVZjaC8y316YdcUlG/h9zrSXFcwEe0NU70tDxX+vdMzlX3vDkWqpj/qXaG9W7dZajzvsATHl8oaSnjYYI+QGBStujjOhL7VOweQTL0jRUzwUSGVH+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XesuMcAB; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=s+Yzq9TF; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XesuMcAB"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="s+Yzq9TF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781817167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=avP9ibHNPh0uZocZWfTS/uf3Zirh7iSsxekjlin/Vn8=; b=XesuMcABWgf0CvQ+Xuvlcc2kOEa17wMj5slqp+Qn8OgH8phEJDx8PcMeXexSwPl6AIY+sl b5prZRYX3zvbVANF4GxZ5tw7ATaQ8rE27eDG37RfwKULcct2ucOMQ4cAGBPPbKi1NmOBTe BRASgZNJ5CCOAIaxNwg17dgSywuMZQk= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-75-VCmqkdjOPgS-XB8zUHepLg-1; Thu, 18 Jun 2026 17:12:45 -0400 X-MC-Unique: VCmqkdjOPgS-XB8zUHepLg-1 X-Mimecast-MFC-AGG-ID: VCmqkdjOPgS-XB8zUHepLg_1781817165 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-91e59716176so275291485a.1 for ; Thu, 18 Jun 2026 14:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1781817165; x=1782421965; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=avP9ibHNPh0uZocZWfTS/uf3Zirh7iSsxekjlin/Vn8=; b=s+Yzq9TFSIuzKFBZ/vi1TPnuGPSqHAxQVN0gO2CN3DnYKWqY834dtOlCH7udxrhGf+ zkCFlsZNtuFsKYeA60k9v8aXOfFVQHz0Fy5BK5hYFR3pbAANon8nvcPyhUNOSC9/Il60 RfmcKAKQOz2+Zwu6gAP0poWpWLZsrcVyTZMCM482X9Iu3I8Ykzm3EhwPR0iWUr92eYyq CpexjaZHlemKdAB1Y6m6Hh/2QL11dhxuhj4Nu/U8usydkTjm4xNEipN6TeQvgycjmKA2 6vrz6YyPv1SgHqpqvvKFrVUPZKsX433c63JklHhzX4J7JolTipw/Fh9G3qINuHDrmgwA 4wIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781817165; x=1782421965; h=user-agent:in-reply-to:content-transfer-encoding :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=avP9ibHNPh0uZocZWfTS/uf3Zirh7iSsxekjlin/Vn8=; b=l6l1rHUEfFOmgRw1LQuvYov28I5m7kq0zgBUhQTxu4L6dQtBMP27cZktKFnsBZf4hq pVu/F4twniXNBBIkRV4xWCm9CVi0KFoOebuT+86J24yG38MXNfiO9A4VFI/C95scgZ68 MDg5SZpewFkf29DFW5NtuyPzSjnEaMSYhXrpd3PZzJsit1vw9gpFkbRQ+bJ1my+d9rHl PFP8UFPjoCJTi0VrNO+UgQGc7X3qMFuV5KbPIXO/gqU1kbkLI1TEhMcmEKrbWnyOXdcD ksOqPB2mWJ8Lgl6Kukytsv69qPsH1ELrdGY0dZuwdP5CfKD0Hm9/IJNRZK4Im7ZmFT0H Z9Tg== X-Forwarded-Encrypted: i=1; AFNElJ/BV3NOA+a2ZabFs1TC+JbEtBvrQvCbg3hCFMo5xIUMNGSWcKyOYgIkc2B6p0uOWWp0A9IYqWhy9bUA6wM=@vger.kernel.org X-Gm-Message-State: AOJu0YxZ6Y90p8/p5sSr5mXJBSEDtCSjdbwFO+aqBkDxWj9OMtEnTzdJ gy+X6fDr6APetTyvNbDlJPXRwgHiFyDM7IXW8Y1WVHhiYdDJg35gJtxdwFidFf4yeAcPB6jivYP 3Tak/KNfRqJCp1+EM6wbaWBGhaKRf/DHL95XCXAIwOmCV10WdABucFoBXI8ZcpexNYQ== X-Gm-Gg: AfdE7cnhwDV7xIxzZKufUA3KkNII9n+KHJ/BxZqtMkA9Lv0BhV5xlKlMfMKuxyKsbr8 A4iK+1WwhCPlO5ub1nkCu2r2WQf7kIChHhfbartdmMdNgEgabUA2UpPrscn8d7Gt2UnrX2IzBbj 29FcO0EOl32Ylr8ZSku5ireZz/OVFm87q3G/BN2k2OPNOuQMblZlFhQ8q9iXIH5clpo4M51OYw0 Ngatb65651X2lpqDC/Md4eZVDwa3tqV1PqBXx2a7kQP/cRf4eA8XtCflEDllPxvlOMbo+Nnbb/W yliOWXzfCNs/k0ryQAHLp9vQ2tUguZNTDQZEL0HH17CyvHzLlTvp553ZbGU4ZH+QFNG4U/60bN/ q5qQCFIgU7cxd1XVEuUlEaiT5FP6U+InYyU5umLTb3ZINrQ== X-Received: by 2002:a05:620a:27d2:b0:915:9de3:226b with SMTP id af79cd13be357-9208f256e5cmr124278785a.18.1781817165241; Thu, 18 Jun 2026 14:12:45 -0700 (PDT) X-Received: by 2002:a05:620a:27d2:b0:915:9de3:226b with SMTP id af79cd13be357-9208f256e5cmr124271785a.18.1781817164653; Thu, 18 Jun 2026 14:12:44 -0700 (PDT) Received: from redhat.com (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-920a1819fa5sm28625685a.20.2026.06.18.14.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 14:12:43 -0700 (PDT) Date: Thu, 18 Jun 2026 17:12:41 -0400 From: Brian Masney To: Ulf Hansson Cc: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede , Konrad Dybcio , Dmitry Baryshkov , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jens Glathe Subject: Re: [PATCH v2 5/5] clk: implement sync_state support Message-ID: References: <20260616-clk-sync-state-v2-0-15f82c64d95c@redhat.com> <20260616-clk-sync-state-v2-5-15f82c64d95c@redhat.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.3.2 (2026-04-26) 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. Brian