Skip to content

clk: fractional-divider: Improve approximation when zero based and export

Frank Oltmanns linux-arm-kernel linux-clk lkml 5 versions – Applied

Status from this message: Applied to clk-next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 4 repliesApplied
  2. v42 patches 1 replySuperseded
  3. v32 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches9 repliesSuperseded
v11 patch2 repliesSuperseded

Changes in v5 from the cover letter

- Fix compiler warnings on clang by removing superfluous variable max_m in the test cases for the maximum denominator (n) and max_n in the test cases for max numerator (m).
Thank you, Intel, for your kernel test robot!

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2clk: fractional-divider: Improve approximation when zero based and exportdrivers/clk/clk-fractional-divider.c+20 -71 reply
2/2clk: fractional-divider: tests: Add test suite for edge casesdrivers/clk/.kunitconfig drivers/clk/Kconfig drivers/clk/Makefile +1 more+166 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/2] clk: fractional-divider: Improve approximation when zero based and export

The fractional divider approximation does not utilize the full available range for clocks that are flagged CLK_FRAC_DIVIDER_ZERO_BASED. This patchset aims to fix that.

It also adds test cases for the edge cases of fractional divider clocks with and without the CLK_FRAC_DIVIDER_ZERO_BASED flag to highlight the changes.

Finally, it also exports clk_fractional_divider_general_approximation so that the test cases (but also other users like rockchip clk driver) can be compiled as a module.

Unfortunately, I have no boards to test this patch. So all we have are the unit tests. It seems the only user of this flag in mainline is drivers/clk/imx/clk-composite-7ulp.c, therefore I'm cc-ing get_maintainers.pl --git-blame -f drivers/clk/imx/clk-composite-7ulp.c in the hopes of a wider audience.

Thank you for considering this contribution,
Frank

P.S.: V4 was short-lived, because it triggered a compiler warning on clang. I'm sorry for the noise. -- Frank

V4: https://lore.kernel.org/all/[email protected]/
V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/lkml/[email protected]/
V1: https://lore.kernel.org/lkml/[email protected]/

Changes in V5 (since V4):
- Fix compiler warnings on clang by removing superfluous variable max_m in the test cases for the maximum denominator (n) and max_n in the test cases for max numerator (m).
Thank you, Intel, for your kernel test robot!

Changes in V4 (since V3):
- Export clk_fractional_divider_general_approximation so that users (e.g., the testcases) can be compiled as modules.
- Change test cases so that they test clk_fractional_divider_general_approximation again (like in V2) instead of clk_fd_round_rate (like in V3), but keeping the structure of V3 with separate file and individual test cases for each edge case.

Changes in V3 (since V2):
- Completely reworked the test cases
- Moved tests to separate file as per Stephen's request
- Move each edge case into their individual test case as per Stephen's request
- Test clk_fd_round_rate instead of clk_fractional_divider_general_approximation as testing the latter broke builds

Changes in V2 (since V1):
- Added test case as requested by Stephen Boyd
- Fixed commit message as the Cc: was missing a closing bracket, so that the original mail unfortunately did not go out to A. s. Dong.

Frank Oltmanns (2):
clk: fractional-divider: Improve approximation when zero based and
export
clk: fractional-divider: tests: Add test suite for edge cases

 drivers/clk/.kunitconfig                  |   1 +
 drivers/clk/Kconfig                       |   7 +
 drivers/clk/Makefile                      |   1 +
 drivers/clk/clk-fractional-divider.c      |  27 +++-
 drivers/clk/clk-fractional-divider_test.c | 157 ++++++++++++++++++++++
 5 files changed, 186 insertions(+), 7 deletions(-)
 create mode 100644 drivers/clk/clk-fractional-divider_test.c
Signature · 1 line
2.41.0