Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Santosh Shilimkar <ssantosh@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH] clk: keystone: sci-clk: Remove firmware based clock ID detection
Date: Thu, 3 Dec 2026 16:49:10 -0600	[thread overview]
Message-ID: <20261203224910.861331-1-afd@ti.com> (raw)

For all drives using this driver clocks are probed from DT. The older
method of getting clock IDs from firmware was left in case it would
be useful for debugging purposes. The old code has bitrotted and most
likely doesn't work with new firmware. As AI is now finding bugs in it
and causing churn, easier to just delete this old function.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/clk/keystone/Kconfig   | 11 -----
 drivers/clk/keystone/sci-clk.c | 85 ----------------------------------
 2 files changed, 96 deletions(-)

diff --git a/drivers/clk/keystone/Kconfig b/drivers/clk/keystone/Kconfig
index e64d6726048f6..9d019fc32fd64 100644
--- a/drivers/clk/keystone/Kconfig
+++ b/drivers/clk/keystone/Kconfig
@@ -16,17 +16,6 @@ config TI_SCI_CLK
 	  If you wish to use clock resources from the PMMC firmware, say Y.
 	  Otherwise, say N.
 
-config TI_SCI_CLK_PROBE_FROM_FW
-	bool "Probe available clocks from firmware"
-	depends on TI_SCI_CLK
-	default n
-	help
-	  Forces the TI SCI clock driver to probe available clocks from the
-	  firmware. By default, only the used clocks are probed from DT.
-	  This is mostly only useful for debugging purposes, and will
-	  increase the boot time of the device. If you want the clocks probed
-	  from firmware, say Y. Otherwise, say N.
-
 config TI_SYSCON_CLK
 	tristate "Syscon based clock driver for K2/K3 SoCs"
 	depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sci-clk.c
index 967f779003587..193b503ad29e1 100644
--- a/drivers/clk/keystone/sci-clk.c
+++ b/drivers/clk/keystone/sci-clk.c
@@ -453,82 +453,6 @@ static const struct of_device_id ti_sci_clk_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ti_sci_clk_of_match);
 
-#ifdef CONFIG_TI_SCI_CLK_PROBE_FROM_FW
-static int ti_sci_scan_clocks_from_fw(struct sci_clk_provider *provider)
-{
-	int ret;
-	int num_clks = 0;
-	struct sci_clk **clks = NULL;
-	struct sci_clk **tmp_clks;
-	struct sci_clk *sci_clk;
-	int max_clks = 0;
-	int clk_id = 0;
-	int dev_id = 0;
-	u32 num_parents = 0;
-	int gap_size = 0;
-	struct device *dev = provider->dev;
-
-	while (1) {
-		ret = provider->ops->get_num_parents(provider->sci, dev_id,
-						     clk_id,
-						     (void *)&num_parents);
-		if (ret) {
-			gap_size++;
-			if (!clk_id) {
-				if (gap_size >= 5)
-					break;
-				dev_id++;
-			} else {
-				if (gap_size >= 2) {
-					dev_id++;
-					clk_id = 0;
-					gap_size = 0;
-				} else {
-					clk_id++;
-				}
-			}
-			continue;
-		}
-
-		gap_size = 0;
-
-		if (num_clks == max_clks) {
-			tmp_clks = devm_kmalloc_objs(dev, sci_clk,
-						     max_clks + 64);
-			memcpy(tmp_clks, clks, max_clks * sizeof(sci_clk));
-			if (max_clks)
-				devm_kfree(dev, clks);
-			max_clks += 64;
-			clks = tmp_clks;
-		}
-
-		sci_clk = devm_kzalloc_obj(dev, *sci_clk);
-		if (!sci_clk)
-			return -ENOMEM;
-		sci_clk->dev_id = dev_id;
-		sci_clk->clk_id = clk_id;
-		sci_clk->provider = provider;
-		sci_clk->num_parents = num_parents;
-
-		clks[num_clks] = sci_clk;
-
-		clk_id++;
-		num_clks++;
-	}
-
-	provider->clocks = devm_kmemdup_array(dev, clks, num_clks, sizeof(sci_clk), GFP_KERNEL);
-	if (!provider->clocks)
-		return -ENOMEM;
-
-	provider->num_clocks = num_clks;
-
-	devm_kfree(dev, clks);
-
-	return 0;
-}
-
-#else
-
 static int _cmp_sci_clk_list(void *priv, const struct list_head *a,
 			     const struct list_head *b)
 {
@@ -667,7 +591,6 @@ static int ti_sci_scan_clocks_from_dt(struct sci_clk_provider *provider)
 
 	return 0;
 }
-#endif
 
 /**
  * ti_sci_clk_probe - Probe function for the TI SCI clock driver
@@ -699,19 +622,11 @@ static int ti_sci_clk_probe(struct platform_device *pdev)
 	provider->ops = &handle->ops.clk_ops;
 	provider->dev = dev;
 
-#ifdef CONFIG_TI_SCI_CLK_PROBE_FROM_FW
-	ret = ti_sci_scan_clocks_from_fw(provider);
-	if (ret) {
-		dev_err(dev, "scan clocks from FW failed: %d\n", ret);
-		return ret;
-	}
-#else
 	ret = ti_sci_scan_clocks_from_dt(provider);
 	if (ret) {
 		dev_err(dev, "scan clocks from DT failed: %d\n", ret);
 		return ret;
 	}
-#endif
 
 	ret = ti_sci_init_clocks(provider);
 	if (ret) {
-- 
2.43.0



                 reply	other threads:[~2026-12-03 22:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203224910.861331-1-afd@ti.com \
    --to=afd@ti.com \
    --cc=bmasney+clk@redhat.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=kristo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox