From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 874AAEB64DA for ; Sat, 17 Jun 2023 10:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qWlbdbg99Q2UHWZ8Rk1uZX/Z7fcrWI8gEbJi61XrwjI=; b=vETZWhD7LmE2sX HtNUXw46syXbUfVozmLBXFWXxtl9on+prssUIhWk7DMG9mt7I625quPFbbcgRdAkIPpBTjNl1a3OI r+KM77ZHPUfaYEVr3GnFTlzSeyk765aeCInmCLYGuzlPzu055ApgxF8TGGb7dn07LyyeMg/cbP9qc 2rHx0BHhj8WR+DAnqSgOnuok0U0sZw9fF/CEepnIc/mAGWqmtMOGUtHT0QiDwyyy7M+PuV0BmKgxg 0qLaEyc3TxZ6VNLX+p9zFMpedoSJfhwFnDvsAiJec2b1Vk+hH7tBHJQ+DTbo2NU07Sz6hakNh0wuh Gfr8MG4HqTmJbM6e9McQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qATBl-003Gbd-1a; Sat, 17 Jun 2023 10:29:49 +0000 Received: from mout-p-101.mailbox.org ([80.241.56.151]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qATBi-003GYX-0U for linux-arm-kernel@lists.infradead.org; Sat, 17 Jun 2023 10:29:47 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Qjshw1bbRz9skk; Sat, 17 Jun 2023 12:29:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1686997776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=K5wyhgjHKxMK2UvxF9fHePQ3wWFGU8riLfzYADKKQ7w=; b=jVNb4i6S+RfjnA2Ucr3rrz1VKTNbDFjsM2au3KKHy6p1vZyQGFUCDdr0hVxUF5BJGu1/fj FjxseDFXiX1CCx8snkYz3t20VD3RYuit4UnTeiq92Q4RkzXEPh95gku2uWRW0J1Y+s+cm7 wbRnCXqrymdIzPGU/AyM6cXi/YITQWhDVmwJwKzbSlhs2f7ALPIp9Wryl3rFDiBDeDnonh yoRNcBFRCGu3bJ2SGp0Bv9nxGUCRRRNPgfJwGRepABfJVYZC0ThxNwcB6zRNLUjnyXeleC S2twfTK902N9R2ok8O8/77wsuyPcP9c3i8HtLwTxkU2MakLAtBjDBgPjle/8og== From: Frank Oltmanns To: Michael Turquette , Stephen Boyd Cc: Frank Oltmanns , "A.s. Dong" , Abel Vesa , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, NXP Linux Team , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Elaine Zhang Subject: [PATCH v4 0/2] clk: fractional-divider: Improve approximation when zero based and export Date: Sat, 17 Jun 2023 12:29:17 +0200 Message-ID: <20230617102919.27564-1-frank@oltmanns.dev> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Qjshw1bbRz9skk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230617_032946_382802_884CCB9D X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 V3: https://lore.kernel.org/all/20230614185521.477924-1-frank@oltmanns.dev/ V2: https://lore.kernel.org/lkml/20230613083626.227476-1-frank@oltmanns.dev/ V1: https://lore.kernel.org/lkml/20230529133433.56215-1-frank@oltmanns.dev/ 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 | 161 ++++++++++++++++++++++ 5 files changed, 190 insertions(+), 7 deletions(-) create mode 100644 drivers/clk/clk-fractional-divider_test.c -- 2.41.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel