Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp62934rwd; Wed, 14 Jun 2023 12:14:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5i4XdOpwZKujgOMkGm02DN7rmeJMNHYJyMCPLxa+IUfVBEiRja9zD/UxDVFxinpCsZfK6F X-Received: by 2002:a05:651c:1033:b0:2b1:a8b9:4543 with SMTP id w19-20020a05651c103300b002b1a8b94543mr6851698ljm.53.1686770057928; Wed, 14 Jun 2023 12:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686770057; cv=none; d=google.com; s=arc-20160816; b=qJS1Mv9MJXIik7uZ3KsyN0QnKSf5aJ6jMi3Std8RNLLPTxIyka9ibscR4XUPbFgaP9 iZTYINEgN9SLfHXowmHidZgWdXLPONQr6mdsqe335WrQxdGdF3QzJpgbaq2vptwPhurM tpq7AZyLNzf74sicyjg5HmpFJNVQoih67tTzVkFri7BzTr2/oNEF8HBcVe8nQ+IUN32b JbNz0BpLuSvvBLumxPwAf4lbK+9P1KGyjdD5QS0gUnBQps9GoysTwhp0XhvB/dA9ePhC /Giq/E0EPr32JbUuFbtXPLCBajP2UVgSgTzr/bQGBoI1HKCn70JWhqW+voZIJODF5MES dPBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=z3zE80Axoqx9I3Z6OPP9RKn3Hf32SECyjRv60EIg2KE=; b=Kd0mrqRawh5SSvWtVeFHfuWG8xNB1tym0tM7X4gZUS1Y+AjnFt/4JRyyiu3oe0r7uj oCaYGUDPiUrX3ZjIRDVvRqXQJMMe8o7JA9is769C2y8+QxRKUuyGNm29kOC79+jl0t1u irksUAAwHy8yP38VXbaC7nYLIx35li2rFkHJXiA746loVUYqS62kpLsp7Tbnd28YbaSK uaviSKa0Ixm8MiwfolRPuENZpOlAR36TxG05myTQ7mZiFtoeFYs6rguOvd6Q0mokd1HP ARzz3eUAVK7vDoKV6BCrpvnwPh5W27FAMXL3RjMeNnGunTtDffMjxZdvOIhBuasUmTIw Do6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oltmanns.dev header.s=MBO0001 header.b=nW8+zhnI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oltmanns.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a056402185200b0051492c2a588si9484225edy.112.2023.06.14.12.13.52; Wed, 14 Jun 2023 12:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oltmanns.dev header.s=MBO0001 header.b=nW8+zhnI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oltmanns.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235291AbjFNSzm (ORCPT + 99 others); Wed, 14 Jun 2023 14:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233826AbjFNSzl (ORCPT ); Wed, 14 Jun 2023 14:55:41 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 495701A2; Wed, 14 Jun 2023 11:55:39 -0700 (PDT) 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-201.mailbox.org (Postfix) with ESMTPS id 4QhF450lFYz9sSN; Wed, 14 Jun 2023 20:55:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1686768933; 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=z3zE80Axoqx9I3Z6OPP9RKn3Hf32SECyjRv60EIg2KE=; b=nW8+zhnIcN/WNBFCHMU1xRQdRR0uUyx+IqnE+6q3HUBtkiAIePwbFrwX1/97rs9J6Rh/At rtiO0F5HhXcKA9kNGo/wxBJ0xg0DgOIJUFJ3Ru91j9zLCfiqOv/QKsiNKKSPAItedxdR7r V5r17URgikI7v63ZbocdM9nHj6DzHqDOU89yJZwdKliM3S9dd6oLudMCsSyhvq3i6Zr9E8 yq50x0saXn6v633zoDVvsBABGtmWLdaL4NHA7Inmn5aKg/1pkwWb+xQYNflbcFPtKBTWE7 jEX/ZVzTbyW0Bgc9daav/7O08cFS2OgPaJNfOOtSwxAT1NDXSdYuuE5UE0lXUQ== 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 Subject: [PATCH v3 0/2] clk: fractional-divider: Improve approximation when zero based Date: Wed, 14 Jun 2023 20:55:19 +0200 Message-ID: <20230614185521.477924-1-frank@oltmanns.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QhF450lFYz9sSN X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I stumpled upon this, when familiarizing myself with clk drivers. Unfortunately, I have no boards to test this patch. 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. 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 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 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. Thank you for considering this contribution, Frank Frank Oltmanns (2): clk: fractional-divider: Improve approximation when zero based 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 | 26 ++- drivers/clk/clk-fractional-divider_test.c | 196 ++++++++++++++++++++++ 5 files changed, 224 insertions(+), 7 deletions(-) create mode 100644 drivers/clk/clk-fractional-divider_test.c -- 2.41.0