From nobody Mon Jun 8 08:29:03 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 C2B9848125C for ; Wed, 3 Jun 2026 14:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496545; cv=none; b=aaPggaO4iG2HdBTroUTqsLu8ixOQr0bVgL/6M/rO//Enn1kCZp3IULfDkzsOez9CO97Ov6XlbCg5YtESKI9mFkMBF6mxdVLb+pfuf5FYPPrwfME6kyqPNjSsoGH0zslR5kxcJVavcW2uLHRJH1adSfhxMo0AQE+Cy+72Y8ZR3MY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496545; c=relaxed/simple; bh=KhCbpgV6AqhdwmwMlKi4yi2ia3rmtjcamegp0BrEsrg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kc6wHF2QfD5oUBcSP3c1Xg9N/rfSXixUSqcvpDBprRLqqsvR6Gusv6lqhXQjRua9yaPeuFgtjwR82yuU4MQrvgFQW7CXhmPszmif/2yt6Li1MUlYF2E/jG72u7qmOSaPEerm6ZvFWWGbSrJ9RFDZzhNuyXaV5YUQI0o5CwFdcso= 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=gNABRc1i; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=ikghDgM/; arc=none smtp.client-ip=170.10.133.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="gNABRc1i"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="ikghDgM/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780496542; 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=391N46PAZ2bnWpBAooB+cdPDZzJ5sfwLhKuZHitisjA=; b=gNABRc1izLwADxlVq+NaPfjRAvdTkH2svyQkI427WZBchBvGHCbJl8v06WIwB56QwWzq+a F45xHRhzHqMEKFd/vl1df2J9AZS4YQPtH4Ya45yn69Vdn5AD9ni4SVL4S9HAfPLXawVSE9 0tznDarHagm3dFL0/HOi5K1e7xwydJI= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-306-BCFPf1r_PiSIpjjy71WcfA-1; Wed, 03 Jun 2026 10:22:21 -0400 X-MC-Unique: BCFPf1r_PiSIpjjy71WcfA-1 X-Mimecast-MFC-AGG-ID: BCFPf1r_PiSIpjjy71WcfA_1780496541 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-5175a1e32e3so18202421cf.0 for ; Wed, 03 Jun 2026 07:22:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780496541; x=1781101341; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=391N46PAZ2bnWpBAooB+cdPDZzJ5sfwLhKuZHitisjA=; b=ikghDgM/jDJyNVfummPp4tEtuF7ypOI+4O9XprVKiLqL7uOV8l6aHtvKhIbtsM3X4C heXDxm/1Kl93b5mNyvssYr2RtEkuYUkuC4yq08IKRU3Qo6zDZVIWFt4iz2NEfgAImGbN puEVgJIEtJg503GYtLBO3yYKdr/HCdpj6qOoJTzqAIYvpkEFJBQGVLeqT/wjg1hyvID/ FuFI9PO/QcWnxIuC/bHP7GB+7BH512k1ig8EXiGEQxEYjN+HEE2KNaOu8a+CAcb8DFNF V7boHEqorOkaPOVoPTnlqcgFkziHrdNbVWjNklY4SJQnhXvCICDA/7adW+bepr4c+WmP ujgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496541; x=1781101341; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=391N46PAZ2bnWpBAooB+cdPDZzJ5sfwLhKuZHitisjA=; b=YgtJ1Cyd2cHsa/2INpM1kQuyTkXJCKticN/uYKFcm7dHB2xHy47BObiFvU/l1iCMCI ax8htlMjug3ic19kkgpEkJU10E4JnwsKL0Y1CCTnT4RUn7obHqgr0fwN/MPHsDPTbZkU mI577B3LzlWOyd9tUfN1EDhn97bjzk25Ifz4L3YPIqVG6JJ5jxwUMzBbkGlYWUY+Eu7s LJ0AFH3+sY/ZKTCAQEIJZrWp51uZD1zkFjit7u8lMA3TMLXUFKc1tIRetaxVfkV6iXjs j5DhsM6opLfAOVqpiXSNgqzJpyv6MHHuJtVmpg2RVL8B6RerIqLLo8pfKrXX76pCa7l/ gppg== X-Forwarded-Encrypted: i=1; AFNElJ/CzFXeXsueNMks+TWBXNVIGGcx3SpXLC9ZaRCYOU2cRniM/mJhcfOgod5PYiVNcABFkRtmPsM2k9QrSQg=@vger.kernel.org X-Gm-Message-State: AOJu0YxfhAKMPzBnLLcs8QCHx7XNQ4HZDdQWGpKPCUeb1IjXRWxsOOGG fEuNyLbgQTd+p+NAmEYyA0PLyk/4LQx0aCy2dISZiem/Q4wcFBN2C9fzyghHsuS5HvIgfrAJNIc Qnb/rV5ObkDwRR+W2YznPoVKeoJyeq3ujQi7D/UKmGeoF9+RC9b7kfeqbrHfovPFbvg== X-Gm-Gg: Acq92OH/Rhkj0jvYD5h2n82pld0B7+2phlPKJ23LzGcS8tB7cGL5EccjWKJjoUHWGYx T1k1+oy73VUkQ/Wp1Z/h6Lv8ictfVVETeilHcfLDLxxpmk69+ENvvKpmou2gZQB5K1GzCRrHNmj E1JhaIjlBaHz30sQ5t9ELdn0NrypjwWAWz8E+A623CgTXfZd6PxJmxLT2QBKsFuFVUul1NNwbEm mOUzoaDXPGscJEIVlhFT6DBp1O25KsSvlbsfgcx7Xkx49O8+zE+ZGzf7i8h+OBkv5MmVYjOvNzO aC10famR/vg4KbIOfTDJ1HDPvj5IqNqTU/dE18NTp6mGd0MslSDTU6vlO/MZMk7X88WamYeV/ks /KZFTAKqnFgAWchmpq2iHf9nRCJ5plGvc0PXurH3NCHcOtApb4ym2ax3EIcv6E2Zwn51iC60= X-Received: by 2002:a05:620a:6403:b0:914:c226:ecbb with SMTP id af79cd13be357-9158a70ae5amr640308385a.23.1780496540899; Wed, 03 Jun 2026 07:22:20 -0700 (PDT) X-Received: by 2002:a05:620a:6403:b0:914:c226:ecbb with SMTP id af79cd13be357-9158a70ae5amr640304185a.23.1780496540504; Wed, 03 Jun 2026 07:22:20 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a238f8esm255611585a.15.2026.06.03.07.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:22:19 -0700 (PDT) From: Brian Masney Date: Wed, 03 Jun 2026 10:21:46 -0400 Subject: [PATCH 1/4] clk: introduce stub clk_sync_state() 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-Transfer-Encoding: quoted-printable Message-Id: <20260603-clk-sync-state-v1-1-457120eed200@redhat.com> References: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> In-Reply-To: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> To: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Brian Masney X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1987; i=bmasney@redhat.com; s=20250903; h=from:subject:message-id; bh=KhCbpgV6AqhdwmwMlKi4yi2ia3rmtjcamegp0BrEsrg=; b=owGbwMvMwCW2/dJd9di6A+2Mp9WSGLIULKbMV7q2I9Wyj6Nk7o6tCoV/u9azlzxQKt2ekH0rw Ev4j0N4RykLgxgXg6yYIsuSXKOCiNRVtvfuaLLAzGFlAhnCwMUpABOpWcfI8E9nld7atKsKNV+D 72neYlBaam3ccfieKrf3Kkv17SxcoowMMx8+vnx/h/X8A5z78k0a65Y5fIo21f14f/rRWzzyMpZ tzAA= X-Developer-Key: i=bmasney@redhat.com; a=openpgp; fpr=A46D32705865AA3DDEDC2904B7D2DD275D7EC087 Add a stub clk_sync_state() since this will be needed for some clk drivers that already have a sync_state callback. This allows introducing all of the necessary changes into the drivers before actually adding the real clk_sync_state() implementation. Doing it this way ensures that the tree stays bisectable, and the individual changes are small patches. Signed-off-by: Brian Masney --- drivers/clk/clk.c | 6 ++++++ include/linux/clk.h | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 048adfa86a5d..9cb2b42d1be4 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1557,6 +1557,12 @@ static int __init clk_disable_unused(void) } late_initcall_sync(clk_disable_unused); =20 +void clk_sync_state(struct device *dev) +{ + /* Will fill in */ +} +EXPORT_SYMBOL_GPL(clk_sync_state); + static int clk_core_determine_round_nolock(struct clk_core *core, struct clk_rate_request *req) { diff --git a/include/linux/clk.h b/include/linux/clk.h index 998ba3f261da..31a0c9224c46 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -846,6 +846,20 @@ void devm_clk_put(struct device *dev, struct clk *clk); */ =20 =20 +/* + * clk_sync_state - sync_state callback to disable unused clocks + * @dev: the clock provider device whose unused clocks should be disabled + * + * It is called by the driver core once all consumers of @dev have probed, + * and disables any clocks belonging to @dev that are unused at that point. + * + * If a clock provider doesn't have a sync_state callback, then the framew= ork + * will set up clk_sync_state() on your drivers behalf. If your driver nee= ds + * a sync_state callback, then that callback also needs to call + * clk_sync_state(). + */ +void clk_sync_state(struct device *dev); + /** * clk_round_rate - adjust a rate to the exact rate a clock can provide * @clk: clock source --=20 2.54.0 From nobody Mon Jun 8 08:29:03 2026 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 CD1B148164D for ; Wed, 3 Jun 2026 14:22:25 +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=1780496547; cv=none; b=f5QWcMB3j/9YYDpJPmXq1rIAT5nDxxniRJyPDZJVHsnx5nb7X3KHvXZQUiT70rT6uI0nAelk1L/Rv5uu8IfVRDbDdA/SAwlHm0OUmSbTpIqfp4MMrbMDA5Zy2myKWtDZC6ZN39t7nc6AHpeAujo9Denhu9wFoEnZuA+U24JfNXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496547; c=relaxed/simple; bh=JZF/Cu1Lu/+vvFbUxKQUvMxkNiBd2sXQABNziPpbgqA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oNfYOdsTQKGjQDLC7zGEC9YnqFjta05gcsYEnTWwLkUMNsq4KwUMEtqCL62RO87Cz8OyG9laKjKFHjPP1a0nMEt3bLtkkU5Ngekvv1c9Flz841fcRQRxitMx3KC+Pd7BPijretpr3kTNlMBrRNSN/nMzPw4MVvpI6YpP/eeq/mg= 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=ZI+ETNtb; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Wo1hKtSs; 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="ZI+ETNtb"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Wo1hKtSs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780496545; 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=sc+5V9Ml7sv1NeeOOXUch3H7RjzHTXyFc4umZk6JURs=; b=ZI+ETNtbSglErg9loTrJ2in/++xOEkIvOJUOMRfSOQG2AQZFOGg9OrPgAzDRFcy7VEurWO IpXFlyRX5NF4BgFZhv/ZYRdsgMOUcktBHVgABj46Ilw8hUyRjwiWLRnue2uqyqmzvAIPYs pTYgFgERmvdXB//NVulmyJmh+S5kCGc= 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-387-gajifvtkMQ-BuE29dhBy1Q-1; Wed, 03 Jun 2026 10:22:23 -0400 X-MC-Unique: gajifvtkMQ-BuE29dhBy1Q-1 X-Mimecast-MFC-AGG-ID: gajifvtkMQ-BuE29dhBy1Q_1780496543 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-9157db42dd8so392141785a.2 for ; Wed, 03 Jun 2026 07:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780496543; x=1781101343; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sc+5V9Ml7sv1NeeOOXUch3H7RjzHTXyFc4umZk6JURs=; b=Wo1hKtSsnjkP451JPmkIlYhAPLfppMP+t+Xl5fO9P31cUtYYKRIN7Cr10rumoXD8ur LV635NiuSA3/ll+Qn5NqXNlp6KHcYXcC9KqyWTOvGSHnCWjQ6Y7SGrwLgS9sn2rv/4AW EL0WxtZoTdxOV4YjzUC7daAkio+bwdZk4W5CCMPoyBVN36ZnVdIaOcGSTRy7sJVCywLt cW4wFd9XTaVNfqzjiPJ39YYrGK2HFHKfU6rEdPgNHY1ZQSNtQw9aey2XO8DvrCfD1IGm VprdRarJIqOTgbgmAtE+/jQ+VIHBlyR189qkTpiPkNk3O88/JiTVbKGIRqUgtYwo6sSi 18Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496543; x=1781101343; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sc+5V9Ml7sv1NeeOOXUch3H7RjzHTXyFc4umZk6JURs=; b=WRylKJsR1u6u9a3iS+yS1rSRrA+YCfaGVP+lE5sU/shVpZHnm4tnvuKFvppOC6hGjp VUnKY5obJXrWo5u1SrAR3Svvau3ptPYcADAgdaZT71CrmIUurkzpy5aNrfll8B3CkBiY C5rP8WbPXLtCgbQpyePfb+iGxU02kf2ySqVsGsjkZtn6rm3Trn9xJpm/jQAtqlt5xBgV rW1QchjUQ/cQOwlw60yH3ScLS5ZgzikYERHckX+PtmQM85MKpdWtjD2PDg84S31LtSVR 7y+6UYTVmM/uaaROiOywjUW7/emK026baEiZWjEopHieqGDpCCkk1RWAX1idOvEGZ1T2 GXKQ== X-Forwarded-Encrypted: i=1; AFNElJ+IUbTnumo5Risw949b3QIvE2l1r/ljmGfMwC1lozWKwZU2+VuJEuXDzc0FV0BmiWtOdJiZSSpNl7eoAp0=@vger.kernel.org X-Gm-Message-State: AOJu0YxABpjPuOx2RwC7i7KChO5F/Q066HRFDcSIeGDn4raAE7VHJqzK 9CbFX5g2ZFmghh07CgCRZh8ejQpVF5vvSy2CLEV7hXchqeFSX9yGFCi2MK6qdgEcJ7fCh1t34IQ 0y23t2V+DUwG9ZGCaVStgKGWBPbS03K7oxvbwcFrQGBRmNe/xuhy6o6cxAHqkAKVvww== X-Gm-Gg: Acq92OEI1ark0jEXxyc4GVeC/izxOPv5yvi8sSXWjp2vBH/FtXWPzAKWMA47IijWXD9 uBPeBFPeOiSO9hxM5nmZ0krsfw4FKlTDGh+iKrlgJkNXP2Zj1GA8u3NyXyYRFfcZq4RaXfsINav Z/W3R3szcsC1bnn8fVFfS0KMElie+AcVT4iKzoMZECPE5oboT0q0X4SMYl1HZMFU4jZQ85wbTvh CCF3wR2MiauOqfVRbmqSXEFHQ3GzKHD8ryiqwvSpyMDs1M/MibxaE4lzGkylZ+uHX0hDbtba2/Z 5ng9VTKDNGj19qHBE6xNQ6EEoa72HpAabZDvmtxJ35qolNYLzVh/BrWfZ+DOvwMnC8Qayjk3X7s DtlgvlhY5uQ6ynbwpGFt2mqq9b4hSDB+NelGqRIKUFBOM4eESnSJWW6bKAUDR2PCrWrK6nTM= X-Received: by 2002:a05:620a:2890:b0:913:7bc8:79ac with SMTP id af79cd13be357-9158a71f5bcmr642621185a.26.1780496542942; Wed, 03 Jun 2026 07:22:22 -0700 (PDT) X-Received: by 2002:a05:620a:2890:b0:913:7bc8:79ac with SMTP id af79cd13be357-9158a71f5bcmr642614485a.26.1780496542503; Wed, 03 Jun 2026 07:22:22 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a238f8esm255611585a.15.2026.06.03.07.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:22:21 -0700 (PDT) From: Brian Masney Date: Wed, 03 Jun 2026 10:21:47 -0400 Subject: [PATCH 2/4] clk: qcom: common: introduce qcom_cc_sync_state() 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-Transfer-Encoding: quoted-printable Message-Id: <20260603-clk-sync-state-v1-2-457120eed200@redhat.com> References: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> In-Reply-To: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> To: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Brian Masney X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2106; i=bmasney@redhat.com; s=20250903; h=from:subject:message-id; bh=JZF/Cu1Lu/+vvFbUxKQUvMxkNiBd2sXQABNziPpbgqA=; b=owGbwMvMwCW2/dJd9di6A+2Mp9WSGLIULKalT707RceH93adVeuLyYv23bi062PBTInLgZwM0 0xrrwoe6ShlYRDjYpAVU2RZkmtUEJG6yvbeHU0WmDmsTCBDGLg4BWAiv7UYGfq2mZ9xLxKamhfy aFrd3F2fBU6+2lBtM6nhUOtfmT7bX9cYGfZlxVkH5eiJ3Unz47m8RT8/McTyu9eMs01ZB897cl2 OYQcA X-Developer-Key: i=bmasney@redhat.com; a=openpgp; fpr=A46D32705865AA3DDEDC2904B7D2DD275D7EC087 Several qcom clk providers currently have a sync_state helper set to icc_sync_state(). With an upcoming change to the clk framework, if sync_state is not defined for the device, then the clk framework sets it to clk_sync_state(). Clk providers that require their own sync_state will need to call the framework level clk_sync_state(). Let's introduce a new common helper qcom_cc_sync_state() that calls icc_sync_state() and clk_sync_state(). Signed-off-by: Brian Masney --- drivers/clk/qcom/common.c | 9 +++++++++ drivers/clk/qcom/common.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index eec369d2173b..31382c49c948 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -3,12 +3,14 @@ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. */ =20 +#include #include #include #include #include #include #include +#include #include #include #include @@ -464,5 +466,12 @@ int qcom_cc_probe_by_index(struct platform_device *pde= v, int index, } EXPORT_SYMBOL_GPL(qcom_cc_probe_by_index); =20 +void qcom_cc_sync_state(struct device *dev) +{ + icc_sync_state(dev); + clk_sync_state(dev); +} +EXPORT_SYMBOL_GPL(qcom_cc_sync_state); + MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("QTI Common Clock module"); diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h index 6f2406f8839e..ee448163b1fc 100644 --- a/drivers/clk/qcom/common.h +++ b/drivers/clk/qcom/common.h @@ -88,5 +88,6 @@ extern int qcom_cc_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc); extern int qcom_cc_probe_by_index(struct platform_device *pdev, int index, const struct qcom_cc_desc *desc); +extern void qcom_cc_sync_state(struct device *dev); =20 #endif --=20 2.54.0 From nobody Mon Jun 8 08:29:03 2026 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 6631848A2C0 for ; Wed, 3 Jun 2026 14:22:27 +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=1780496548; cv=none; b=oN+T9GCyvYOBPMH8Eml3mgWauRgHG1MmRoRt6uNrvUVFEuzEPM8XCvTfZmegSqZFGA9f3eRwsvNe4hX3ZTsjTtbTz9N1MSDQVbRCCDwkY+BFyg2tlfDNiRPFGksaK5qaw7+mHpxS67BW8Ag5o0okcH7hhn9e15Daa/e9Lx9rckM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496548; c=relaxed/simple; bh=bjN8RAuY/lp1bR9xKcsMa2zNTPYa8eGr1YlYX+mBtHE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hf7MEziCrDR8P26XLi+nl7QhijVwCUUKyrpBZdwZKqRDLL95Q7cr3QIfzTmH2by1d5IHQJPc2RYaQ1Z74gxJ/PkU0L0alwrY737beCKstw7ezIAv+HhaFsraT3qFEQj5ARkbiXElyHWTXj3C3vb2H7fgdoQaxKWIb+CspJsKXvM= 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=Cdg+C2tH; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=EbEDugy0; 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="Cdg+C2tH"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="EbEDugy0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780496546; 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=IgQ3umXcpR3Cc34wKA2umMzxxU1QdCZVKqXka7AU700=; b=Cdg+C2tHuiKxW+SadPD11jhRTE6tbFeVfLDJ7uRRkg8CxCOWQtMoM7fE9KXMvjrHdmU9W7 FhbBEYrlVfhqwhA9CwwQeLNnAedNWxk8LpNC6JxuI8SRaoGan5GwQgTOg1HM0LyK+TVkCo 6TBsOYWxdI+HBVe1BCEk5ddZClc82wM= 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-605-ntiyYY6zOcuBmU9iEFGuuA-1; Wed, 03 Jun 2026 10:22:25 -0400 X-MC-Unique: ntiyYY6zOcuBmU9iEFGuuA-1 X-Mimecast-MFC-AGG-ID: ntiyYY6zOcuBmU9iEFGuuA_1780496545 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-9158f07f5eeso137110485a.0 for ; Wed, 03 Jun 2026 07:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780496545; x=1781101345; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IgQ3umXcpR3Cc34wKA2umMzxxU1QdCZVKqXka7AU700=; b=EbEDugy0Havq/N1XOUTRhywwmRNgB17qLyzVmAbGeQ2mYIpM9nCf7nGnHdxrHuX2Eh TjqzOnUQ32pxAgwUf5wrg4aozEW3I9CcFzU/yjtqLq3plzzUVVzR0QvZXKMKwVJmx+Up UiLmj1fRPdg1FbawYURn0kCLV8nTSuUg/jRUNMPfzuhrgIjg8C6vqQlZvNsWNLk4N/po 2CuVbaWdfktjrtJSuIKzhrkOmVEG1B8wB6HtQrfCkb5HoutYPRK8tCvbBhNZUw++Vmeg uyxK4Ibd7zMeQ6FSYUgvC1T6fj0prLUBqfKXuka0Yu9hYojLIMCaCcR17p/n61IRG3cI XGew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496545; x=1781101345; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IgQ3umXcpR3Cc34wKA2umMzxxU1QdCZVKqXka7AU700=; b=GL6f1NKxl1Rr09ql3V0EVP79jWUNKIh82O9rZiz3U+2FBk6pgbxsonk+InmI8Bc3M6 dHyH4RMnla5w972I9tFI1lbJsz953XXW0fDLrpP9a/+8ieBOjECsKyn7Y1A4tl9MjFJg IShTIZ8L+LNZ65iSKreNOZn7cOALi40G1yvCuQwFiKH+Ai9s+PeEYcRyT/KzrqNuH+dd I7O7/wyD23p+ntSTM05Vzq8U52mTgzIcINhv3bpe9c0gZjxqKHwk56D+RKpgjpVKLG1J q9xuIwIhqHHj/UuH9PcXu3iuB0T+pVghDVl/bCP2Haz5lyvt9uqiEplrsN6zSSg00hha Q3DA== X-Forwarded-Encrypted: i=1; AFNElJ8vvxCE3xOFJzAZ8MIIfi1vOus9OyaQyoWDHOBNpm1mgmalkvrZp/Sb3qeakC9kQ91g0MiZfNjYAtN4ck4=@vger.kernel.org X-Gm-Message-State: AOJu0YyFrtuzRLVAFzWuy9B/Ns/3k+rek8kf5Ix8iWcxhnbZp2mSFuuB +llnF64j/vZp/KB9asxJWVkSJyun3eWxGgesbZrEmReCPXhFVsRAU4eZ0/aLWJWxolNLMmrahu9 l3ea8aizQWmvrP33Ck2/Fj+RQ25XIoht4vzy3mzdfzJZCtBrB9aG3XUOrzRFEOjYmtQ== X-Gm-Gg: Acq92OGyiaynIZ9MkBTv1jHUNJ6+IrJUBVLNBDTWQ2nt6JwwGZ2SI1jk/4c2CvonvqK Nc4D0Va4ECXI3Xm5Wx8i897lbGK2k+d4UcR0sAx+c91VuYeDWnlibtffbwJOJ2UucS6F3d7dsT+ 0Ahac8dkJ13ODh97eOA3id1GQGnOcYLS+w1RjBKe3VpA91UOspCD31oDFH2Xo7GAkuLEe0Sl8Ia GUAzs+Q0XbQfWR6VXjlIEtAhvl+8/spPwghLUsHiTBmRom28IWDBvyKXTHejFDIdpKcwXAkY6Nw s5J1MVbPR3Px2KoW4XBcG9BxbNdHrP/6dCAqiNjY/boYQEe0YQ6mGGYzrV22vNZ+AQW60hyhZXT UQsF5jUZq4EPSlHWV1MFP/kiIW0wxmGs4vnUj+jOTiY/06SWXwaeGUoUsXEM8jHuRg3R+bio= X-Received: by 2002:a05:620a:4804:b0:910:4e35:cf02 with SMTP id af79cd13be357-9158a7a997dmr614025485a.37.1780496544716; Wed, 03 Jun 2026 07:22:24 -0700 (PDT) X-Received: by 2002:a05:620a:4804:b0:910:4e35:cf02 with SMTP id af79cd13be357-9158a7a997dmr614018785a.37.1780496544099; Wed, 03 Jun 2026 07:22:24 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a238f8esm255611585a.15.2026.06.03.07.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:22:23 -0700 (PDT) From: Brian Masney Date: Wed, 03 Jun 2026 10:21:48 -0400 Subject: [PATCH 3/4] clk: qcom: convert from icc_sync_state() to qcom_cc_sync_state() 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-Transfer-Encoding: quoted-printable Message-Id: <20260603-clk-sync-state-v1-3-457120eed200@redhat.com> References: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> In-Reply-To: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> To: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Brian Masney X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5781; i=bmasney@redhat.com; s=20250903; h=from:subject:message-id; bh=bjN8RAuY/lp1bR9xKcsMa2zNTPYa8eGr1YlYX+mBtHE=; b=owGbwMvMwCW2/dJd9di6A+2Mp9WSGLIULKYf2hrw9Dzjwwa11fdDGLhUTqmL6r76Y8Y1p/zDS tf+xpTyjlIWBjEuBlkxRZYluUYFEamrbO/d0WSBmcPKBDKEgYtTACYydTfDP7vcKSyxOmazvs1/ lnpMpiNjlk+0bIjszBUz1OUWblISesDIcHTqs2U1fYZCVRF3X181n9DTIiBYKq5/s/bcxYs58/Y uZwEA X-Developer-Key: i=bmasney@redhat.com; a=openpgp; fpr=A46D32705865AA3DDEDC2904B7D2DD275D7EC087 Convert all of the qcom clk drivers from icc_sync_state() to qcom_cc_sync_state(). Signed-off-by: Brian Masney Tested-by: Jens Glathe --- drivers/clk/qcom/apss-ipq5424.c | 3 +-- drivers/clk/qcom/clk-cbf-8996.c | 5 ++--- drivers/clk/qcom/gcc-ipq5332.c | 3 +-- drivers/clk/qcom/gcc-ipq5424.c | 3 +-- drivers/clk/qcom/gcc-ipq9574.c | 3 +-- drivers/clk/qcom/nsscc-ipq5424.c | 3 +-- drivers/clk/qcom/nsscc-ipq9574.c | 3 +-- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/clk/qcom/apss-ipq5424.c b/drivers/clk/qcom/apss-ipq542= 4.c index 1662c83058bc..70991c3a9a58 100644 --- a/drivers/clk/qcom/apss-ipq5424.c +++ b/drivers/clk/qcom/apss-ipq5424.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -248,7 +247,7 @@ static struct platform_driver apss_ipq5424_driver =3D { .driver =3D { .name =3D "apss-ipq5424-clk", .of_match_table =3D apss_ipq5424_match_table, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; =20 diff --git a/drivers/clk/qcom/clk-cbf-8996.c b/drivers/clk/qcom/clk-cbf-899= 6.c index 0b40ed601f9a..0d920bd5a992 100644 --- a/drivers/clk/qcom/clk-cbf-8996.c +++ b/drivers/clk/qcom/clk-cbf-8996.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -249,7 +248,7 @@ static void qcom_msm8996_cbf_icc_remove(struct platform= _device *pdev) =20 icc_clk_unregister(provider); } -#define qcom_msm8996_cbf_icc_sync_state icc_sync_state +#define qcom_msm8996_cbf_icc_sync_state qcom_cc_sync_state #else static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, st= ruct clk_hw *cbf_hw) { @@ -258,7 +257,7 @@ static int qcom_msm8996_cbf_icc_register(struct platfor= m_device *pdev, struct c return 0; } #define qcom_msm8996_cbf_icc_remove(pdev) { } -#define qcom_msm8996_cbf_icc_sync_state NULL +#define qcom_msm8996_cbf_icc_sync_state clk_sync_state #endif =20 static int qcom_msm8996_cbf_probe(struct platform_device *pdev) diff --git a/drivers/clk/qcom/gcc-ipq5332.c b/drivers/clk/qcom/gcc-ipq5332.c index 9246e97d785a..adec25aa9c27 100644 --- a/drivers/clk/qcom/gcc-ipq5332.c +++ b/drivers/clk/qcom/gcc-ipq5332.c @@ -4,7 +4,6 @@ */ =20 #include -#include #include #include #include @@ -3307,7 +3306,7 @@ static struct platform_driver gcc_ipq5332_driver =3D { .driver =3D { .name =3D "gcc-ipq5332", .of_match_table =3D gcc_ipq5332_match_table, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; =20 diff --git a/drivers/clk/qcom/gcc-ipq5424.c b/drivers/clk/qcom/gcc-ipq5424.c index 35af6ffeeb85..9bf3bb6f8904 100644 --- a/drivers/clk/qcom/gcc-ipq5424.c +++ b/drivers/clk/qcom/gcc-ipq5424.c @@ -5,7 +5,6 @@ */ =20 #include -#include #include #include #include @@ -3322,7 +3321,7 @@ static struct platform_driver gcc_ipq5424_driver =3D { .driver =3D { .name =3D "qcom,gcc-ipq5424", .of_match_table =3D gcc_ipq5424_match_table, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; =20 diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c index 6dc86e686de4..9edcfd8afb77 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -5,7 +5,6 @@ =20 #include #include -#include #include #include #include @@ -4134,7 +4133,7 @@ static struct platform_driver gcc_ipq9574_driver =3D { .driver =3D { .name =3D "qcom,gcc-ipq9574", .of_match_table =3D gcc_ipq9574_match_table, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; =20 diff --git a/drivers/clk/qcom/nsscc-ipq5424.c b/drivers/clk/qcom/nsscc-ipq5= 424.c index 5893c7146180..253d625ebf35 100644 --- a/drivers/clk/qcom/nsscc-ipq5424.c +++ b/drivers/clk/qcom/nsscc-ipq5424.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -1331,7 +1330,7 @@ static struct platform_driver nss_cc_ipq5424_driver = =3D { .name =3D "qcom,ipq5424-nsscc", .of_match_table =3D nss_cc_ipq5424_match_table, .pm =3D &nss_cc_ipq5424_pm_ops, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; module_platform_driver(nss_cc_ipq5424_driver); diff --git a/drivers/clk/qcom/nsscc-ipq9574.c b/drivers/clk/qcom/nsscc-ipq9= 574.c index c8b11b04a7c2..be8fbf5edda4 100644 --- a/drivers/clk/qcom/nsscc-ipq9574.c +++ b/drivers/clk/qcom/nsscc-ipq9574.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -3100,7 +3099,7 @@ static struct platform_driver nss_cc_ipq9574_driver = =3D { .name =3D "qcom,nsscc-ipq9574", .of_match_table =3D nss_cc_ipq9574_match_table, .pm =3D &nss_cc_ipq9574_pm_ops, - .sync_state =3D icc_sync_state, + .sync_state =3D qcom_cc_sync_state, }, }; =20 --=20 2.54.0 From nobody Mon Jun 8 08:29:03 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 37F7A48AE14 for ; Wed, 3 Jun 2026 14:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496550; cv=none; b=c6QweOI5DRWC50g2ePzSVTh0biAccKA196qMpXWtyiI3qSopGLhiEq6TQIQSH7W6IFCTbsfbdOq+ixjOOck7BxOM5NDDf/OZPPL/C8/UnF8EFhGhi6kPeSbj5Zo4JQkrbOZ1M84u40MwfGf1eeROxxi78XoPP+ifPk9upeAcDQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496550; c=relaxed/simple; bh=zy9SqZgZxUx6odgCUdJ3l3chdPu76ryK/kRXQOy9IZ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BUJSc9broRC2WNGynRR6+C9yO5ldsgVFpxf7pOZJ8ksl1uLhOHXnezkOGg9FkyE8Rb+Qbci2iEralYlEOkXUTXCn20taofV8VAsucVGZXzTFsqJfesfeQxvXdYM2xgq8WBi1G4cExDEoGBJkMUBrNf0llxJbDyPL/sIasen7mwQ= 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=DTYMYdk9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=uKWcsd7F; arc=none smtp.client-ip=170.10.133.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="DTYMYdk9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="uKWcsd7F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780496548; 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=+64RL1MUhJVflWQ0/Hrf9COdjHtondF6tiwJq41sfAg=; b=DTYMYdk9BalkLgOcuVVY4dQoaiUBvZsnHx/cO4kXyQGYp157/yRCBG/OcK56P2Z5a947xV hG1VqDFD9hO6XWe0cogBdyWeuvD0DXipENKIjAeD6uatR+FFpmiVSF9BVEWwu3D4qm1wT0 RuzRxzubJRp85fsO927nujBrvEGkXig= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-7crnqMxnM_OjRcYZOt3UbA-1; Wed, 03 Jun 2026 10:22:27 -0400 X-MC-Unique: 7crnqMxnM_OjRcYZOt3UbA-1 X-Mimecast-MFC-AGG-ID: 7crnqMxnM_OjRcYZOt3UbA_1780496546 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-91579011fd1so460139885a.1 for ; Wed, 03 Jun 2026 07:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1780496546; x=1781101346; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+64RL1MUhJVflWQ0/Hrf9COdjHtondF6tiwJq41sfAg=; b=uKWcsd7Fgwtg9+yzPsQHPbui06xGX/cC9irnx3cZK+Rsv2ddJZWs/gvirzvkA9351N VEzgmVnmCcLq333amKI4fEPcBRfZXQm7g5WDSyxse0xUPqAtt7lnhFZkeXm5CZrb6j3w MsffaJqwRIloC0Bn643wuUj5OdBqvUkJgozw3zU56SoShGRS7/uRGF9WyiBiiGw+qzli gcylpgRiBrlQOrohB0AoRJpJ/Y1LjNVgH0TnzZa07oxQ7bCcicaRFPrWDeUN7xQDqM7h QvSY3Q1ykfZgl6TXZ9GIgzh6H58nxWHTIzNOgpX91F4Nne0l0Jv+8Rc7yg0t4KNM6i+W KyAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496546; x=1781101346; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=+64RL1MUhJVflWQ0/Hrf9COdjHtondF6tiwJq41sfAg=; b=Zxion87yg9WxxB8nz5C3H7kvPYvjTX3hQh+0O7x63aSyB5auzVLL+UvQF8KoiCtNYf 3EiTV3R+d2UcpaKE3gcKuaNBIaxeWImHKafZz0Sup//DcK3QEdCqgev5qLGHqpIKGMsI Qy4Qu9RI1+Y+lWOUc2g/acAoDqMRJTISKfZQ5r3HZQ+fOMoXqRkXEF6+GshrS5V7TGib tnq373sseOD255kNiZahcNJa2ohLHduu+g8AHzuMoG3EgpaTLopIYLq4JePB39radLz7 VXqcfeby8C6I+Q7wrEH8IipT57Qndoj6yP+251FX2pDTQT1nN4joNZWnKQUM3V3XOtKY rufw== X-Forwarded-Encrypted: i=1; AFNElJ8LNZK4wQ+3q99RTWBSoliQljQBYXo6ygMjNtqpMYR4XaRxeRFX7s4Z8+7fqqHn83FyZIro6tNNltBK3FU=@vger.kernel.org X-Gm-Message-State: AOJu0YyryRExogTZs65s4gWNJDaoC1j5vb3GbWf735cta8Y7ut4Y+JeY 0QHI6IiIisy5jEutA9b6e6LAv9O5NHFy+vxPMAiut6V0ICr2kzPKB5q6INpb/XOKhehXJ9wx1kc VDuWaY/YIbbe7s1vRA8UVnslveRf5E61ORMVbl4pG+53E4cnRhwIPUssKNpsWxAmYjg== X-Gm-Gg: Acq92OHfnbUy/SRf9ymxhsbDesHKjLGOvspuIYzkDmJ4mEM5IhYmhsmNDbQGV7ZMwaF hjULJxjC9ddswrcwm6CBgHZqND80C1PG4chlgdFbv0qjgbTZSzIo0hAHOqf76z8piEBL2yHgke0 00iF+xFfHRNAOUhxdziyzC8esEEWoED+pp+b/5+6cAySadyuq2nOfF5DVABnd3otGiu5hPB1kFo PxjFhXhIy6c+pUFNcWvFQBAykt09LguhtnlEseAoFas82zXihwwYHac3c8gchX0VmXbix4Dv05v thOgVPKMBmQ0g4v6Wr0aOBGXobTBF+HjyUbmhcPzq+jopaNWFFUwYmWj2NsN/PeTirilLLJZcIK zPaEa4fqFFEF2DeGJYIOUFxnWvr3jOB9YjUvoh2hlC1iXmg8lxVPXSuUU47/H3UzOhKmL1ao= X-Received: by 2002:a05:620a:4096:b0:915:8f08:5f9d with SMTP id af79cd13be357-9158f086545mr424084685a.56.1780496546320; Wed, 03 Jun 2026 07:22:26 -0700 (PDT) X-Received: by 2002:a05:620a:4096:b0:915:8f08:5f9d with SMTP id af79cd13be357-9158f086545mr424078585a.56.1780496545742; Wed, 03 Jun 2026 07:22:25 -0700 (PDT) Received: from [192.168.1.3] (c-73-183-52-120.hsd1.pa.comcast.net. [73.183.52.120]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a238f8esm255611585a.15.2026.06.03.07.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:22:25 -0700 (PDT) From: Brian Masney Date: Wed, 03 Jun 2026 10:21:49 -0400 Subject: [PATCH 4/4] clk: implement sync_state support 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-Transfer-Encoding: quoted-printable Message-Id: <20260603-clk-sync-state-v1-4-457120eed200@redhat.com> References: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> In-Reply-To: <20260603-clk-sync-state-v1-0-457120eed200@redhat.com> To: Saravana Kannan , Abel Vesa , Maxime Ripard , Michael Turquette , Stephen Boyd , Russell King , Bjorn Andersson , Hans de Goede Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Brian Masney X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8197; i=bmasney@redhat.com; s=20250903; h=from:subject:message-id; bh=zy9SqZgZxUx6odgCUdJ3l3chdPu76ryK/kRXQOy9IZ8=; b=owGbwMvMwCW2/dJd9di6A+2Mp9WSGLIULGaIv3q08v28UiOhF9xnOK1ME46ulmFgsbzGllhyk OPz69h7HaUsDGJcDLJiiixLco0KIlJX2d67o8kCM4eVCWQIAxenAEwk+TIjw5uvxyYeDeKVLDEw NIgI+tqzbMPZpNiAt990l6ZVT6/7fI7hF9OyhgfP0juy/bnjzx8+mXbZRMpF/0tQ1Ix0o/qHKkt /cwMA X-Developer-Key: i=bmasney@redhat.com; a=openpgp; fpr=A46D32705865AA3DDEDC2904B7D2DD275D7EC087 The existing support for disabling unused clks runs in the late initcall stage, and it has been known for a long time that this is broken since it runs too early in the boot up process. It doesn't work for kernel modules, and it also doesn't work if all of the consumers haven't fully probed yet. Folks have long recommended to boot certain platforms with clk_ignore_unused to work around issues with disabling unused clks. Let's go ahead and add a framework-level sync_state callback for the clk subsystem. If a driver doesn't have a sync_state callback configured, which is the 99+% use case today, then let's set it up to use the clk_sync_state() introduced in this commit so that no driver changes are needed. At the time of this writing, there are currently only 7 clk drivers that implement sync_state, and all are Qualcomm SoCs where they interact with the interconnect framework via icc_sync_state(). A shared helper has been created for this platform that calls clk_sync_state(). It is expected that any new clk drivers that want to implement their own sync_state will also need to call clk_sync_state() at the end of their custom sync_state callback. There will be several stages of disabling unused clks: - The first phase will be executed at late_initcall and it will only disable unused clks that do not have a struct dev. - The sync_state callback will be invoked for each clk driver once all consumers have probed. This is based on previous attempts by Saravana Kannan and Abel Vesa that are linked below. This change was tested on a Thinkpad x13s laptop. [ 0.308051] clk: Disabling unused clocks not associated with a device [ 6.541069] qcom_aoss_qmp c300000.power-management: clk: Disabling u= nused clocks [ 6.843310] qcom-qmp-pcie-phy 1c24000.phy: clk: Disabling unused clo= cks [ 7.604556] qcom-qmp-pcie-phy 1c14000.phy: clk: Disabling unused clo= cks [ 8.446161] qcom-qmp-usb-phy 88f1000.phy: clk: Disabling unused cloc= ks [ 8.446293] qcom-qmp-usb-phy 88ef000.phy: clk: Disabling unused cloc= ks [ 8.546067] qcom-qmp-combo-phy 88eb000.phy: clk: Disabling unused cl= ocks [ 8.546203] qcom-qmp-combo-phy 8903000.phy: clk: Disabling unused cl= ocks [ 8.546254] qcom-edp-phy aec5a00.phy: clk: Disabling unused clocks [ 15.436834] qcom-cpufreq-hw 18591000.cpufreq: clk: Disabling unused = clocks [ 15.436953] clk-rpmh 18200000.rsc:clock-controller: clk: Disabling u= nused clocks [ 15.723348] qcom-qmp-pcie-phy 1c06000.phy: clk: Disabling unused clo= cks [ 21.063241] q6prm-lpass-clock 3000000.remoteproc:glink-edge:gpr:serv= ice@2:clock-controller: clk: Disabling unused clocks [ 21.081996] va_macro 3370000.codec: clk: Disabling unused clocks [ 21.092740] rx_macro 3200000.rxmacro: clk: Disabling unused clocks [ 21.118261] wsa_macro 3240000.codec: clk: Disabling unused clocks [ 21.128758] tx_macro 3220000.txmacro: clk: Disabling unused clocks Signed-off-by: Brian Masney Link: https://www.youtube.com/watch?v=3DtXYzM8yLIQA Link: https://lore.kernel.org/all/20210407034456.516204-1-saravanak@google.= com/ Link: https://lore.kernel.org/all/20221227204528.1899863-1-abel.vesa@linaro= .org/ --- drivers/clk/clk.c | 71 +++++++++++++++++++++++++++++++++++++++++++++------= ---- 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 9cb2b42d1be4..ab3f8becda0c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1442,14 +1442,39 @@ static void clk_core_disable_unprepare(struct clk_c= ore *core) clk_core_unprepare_lock(core); } =20 -static void __init clk_unprepare_unused_subtree(struct clk_core *core) +/* + * Returns true if @core should be skipped during an unused-clock sweep for + * @dev. When @dev is NULL the sweep is the global late_initcall pass; wh= en + * @dev is non-NULL the sweep is a per-device sync_state pass. + */ +static bool clk_core_skip_unused(struct clk_core *core, struct device *dev) +{ + /* + * At late_initcall, skip clocks that belong to a device =E2=80=94 they w= ill be + * handled at sync_state time. + */ + if (!dev && core->dev) + return true; + + /* When called from sync_state, only process clocks for this device. */ + if (dev && core->dev !=3D dev) + return true; + + return false; +} + +static void clk_unprepare_unused_subtree(struct clk_core *core, + struct device *dev) { struct clk_core *child; =20 lockdep_assert_held(&prepare_lock); =20 hlist_for_each_entry(child, &core->children, child_node) - clk_unprepare_unused_subtree(child); + clk_unprepare_unused_subtree(child, dev); + + if (clk_core_skip_unused(core, dev)) + return; =20 if (core->prepare_count) return; @@ -1467,7 +1492,8 @@ static void __init clk_unprepare_unused_subtree(struc= t clk_core *core) } } =20 -static void __init clk_disable_unused_subtree(struct clk_core *core) +static void clk_disable_unused_subtree(struct clk_core *core, + struct device *dev) { struct clk_core *child; unsigned long flags; @@ -1475,7 +1501,10 @@ static void __init clk_disable_unused_subtree(struct= clk_core *core) lockdep_assert_held(&prepare_lock); =20 hlist_for_each_entry(child, &core->children, child_node) - clk_disable_unused_subtree(child); + clk_disable_unused_subtree(child, dev); + + if (clk_core_skip_unused(core, dev)) + return; =20 if (core->flags & CLK_OPS_PARENT_ENABLE) clk_core_prepare_enable(core->parent); @@ -1508,7 +1537,7 @@ static void __init clk_disable_unused_subtree(struct = clk_core *core) clk_core_disable_unprepare(core->parent); } =20 -static bool clk_ignore_unused __initdata; +static bool clk_ignore_unused; static int __init clk_ignore_unused_setup(char *__unused) { clk_ignore_unused =3D true; @@ -1516,7 +1545,7 @@ static int __init clk_ignore_unused_setup(char *__unu= sed) } __setup("clk_ignore_unused", clk_ignore_unused_setup); =20 -static int __init clk_disable_unused(void) +static int __clk_disable_unused(struct device *dev) { struct clk_core *core; int ret; @@ -1526,7 +1555,10 @@ static int __init clk_disable_unused(void) return 0; } =20 - pr_info("clk: Disabling unused clocks\n"); + if (dev) + dev_info(dev, "clk: Disabling unused clocks\n"); + else + pr_info("clk: Disabling unused clocks not associated with a device\n"); =20 ret =3D clk_pm_runtime_get_all(); if (ret) @@ -1538,16 +1570,16 @@ static int __init clk_disable_unused(void) clk_prepare_lock(); =20 hlist_for_each_entry(core, &clk_root_list, child_node) - clk_disable_unused_subtree(core); + clk_disable_unused_subtree(core, dev); =20 hlist_for_each_entry(core, &clk_orphan_list, child_node) - clk_disable_unused_subtree(core); + clk_disable_unused_subtree(core, dev); =20 hlist_for_each_entry(core, &clk_root_list, child_node) - clk_unprepare_unused_subtree(core); + clk_unprepare_unused_subtree(core, dev); =20 hlist_for_each_entry(core, &clk_orphan_list, child_node) - clk_unprepare_unused_subtree(core); + clk_unprepare_unused_subtree(core, dev); =20 clk_prepare_unlock(); =20 @@ -1555,11 +1587,16 @@ static int __init clk_disable_unused(void) =20 return 0; } + +static int __init clk_disable_unused(void) +{ + return __clk_disable_unused(NULL); +} late_initcall_sync(clk_disable_unused); =20 void clk_sync_state(struct device *dev) { - /* Will fill in */ + __clk_disable_unused(dev); } EXPORT_SYMBOL_GPL(clk_sync_state); =20 @@ -4345,8 +4382,16 @@ __clk_register(struct device *dev, struct device_nod= e *np, struct clk_hw *hw) core->dev =3D dev; clk_pm_runtime_init(core); core->of_node =3D np; - if (dev && dev->driver) + if (dev && dev->driver) { core->owner =3D 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. + */ + dev_set_drv_sync_state(dev, clk_sync_state); + } core->hw =3D hw; core->flags =3D init->flags; core->num_parents =3D init->num_parents; --=20 2.54.0