From: Colin Foster <colin.foster@in-advantage.com>
To: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>,
Michal Simek <michal.simek@amd.com>,
Brian Masney <bmasney@redhat.com>,
Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>
Subject: [PATCH_v2 2/3] clk: clocking-wizard: optimize clock search
Date: Mon, 29 Jun 2026 15:53:45 -0500 [thread overview]
Message-ID: <20260629205346.3228886-3-colin.foster@in-advantage.com> (raw)
In-Reply-To: <20260629205346.3228886-1-colin.foster@in-advantage.com>
When an exact clock match is found, there is no need to continue
searching. This process was optimized for versal as part of
'commit e0a94c6bb5b4 ("clk: xilinx: Optimize divisor search in
clk_wzrd_get_divisors_ver()")' but that logic wasn't applied to
the non-versal driver.
Apply this fast-exit logic to the non-versal driver.
Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
---
drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
index 77c9d025ca8cf..c7e8010afae52 100644
--- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
+++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
@@ -414,6 +414,9 @@ static int clk_wzrd_get_divisors(struct clk_hw *hw, unsigned long rate,
divider->d = d;
divider->o = o >> 3;
divider->o_frac = (o - (divider->o << 3)) * 125;
+
+ if (!diff)
+ return 0;
}
}
}
--
2.43.0
next prev parent reply other threads:[~2026-06-29 20:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 20:53 [PATCH_v2 0/3] clock-wizard fixups Colin Foster
2026-06-29 20:53 ` [PATCH_v2 1/3] clk: clocking-wizard: fix clock difference detection Colin Foster
2026-06-29 20:53 ` Colin Foster [this message]
2026-06-29 20:53 ` [PATCH_v2 3/3] clk: clocking-wizard: remove 20kHz restriction Colin Foster
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=20260629205346.3228886-3-colin.foster@in-advantage.com \
--to=colin.foster@in-advantage.com \
--cc=bmasney@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=shubhrajyoti.datta@amd.com \
/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